code:
/*---------------------------------------------------------------------------*
 * Torigoya_QuickSkill.js
 *---------------------------------------------------------------------------*
 * 2019/08/24 ru_shalm
 * http://torigoya.hatenadiary.jp/
 *---------------------------------------------------------------------------*/

/*:
 * @plugindesc usable Quick skill (select and action!)
 * @author ru_shalm
 *
 * @param ■ Advanced Settings
 *
 * @param Recalc Action Time Mode
 * @type select
 * @option None
 * @option Only Actor
 * @option Party
 * @default None
 *
 * @help
 *
 * Skill Note:
 *   <QuickSkill>           # set quick skill
 */

/*:ja
 * @plugindesc 選択するとターンを消費せずに即発動するスキルを追加します。
 * @author ru_shalm
 *
 * @param ■ 上級者向け設定
 *
 * @param Recalc Action Time Mode
 * @type select
 * @option なし
 * @option 使用者のみ
 * @option 味方全員
 * @desc ターン消費なしスキル後に行動回数の再計算を行う対象。確率で行動回数が変わるキャラがいる場合おかしな挙動になります。
 * @default None
 *
 * @help
 * ターン消費なしスキルを作れるようになります。
 *
 * ------------------------------------------------------------
 * ■ 設定方法
 * ------------------------------------------------------------
 * スキルのメモ欄に以下のように記述してください。
 *
 * <QuickSkill>
 */

(function (global) {
    'use strict';

    var QuickSkill = {
        name: 'Torigoya_QuickSkill',
        currentActionActor: null,
        originalSubject: null,
        actorIndexForForcedAction: null,
        backupActions: null,

        // 競合回避用フラグ
        conflictData: {
            // 連携発動スキル / yanaさま
            // https://www6.atwiki.jp/pokotan/pages/3.html
            currentChainAction: null
        }
    };
    QuickSkill.settings = (function () {
        var parameters = PluginManager.parameters(QuickSkill.name);
        return {
            recalcActionTimeMode: String(parameters['Recalc Action Time Mode'])
        };
    })();

    // -------------------------------------------------------------------------
    // Utils

    QuickSkill.reset = function () {
        this.currentActionActor = null;
        this.originalSubject = null;
        this.actorIndexForForcedAction = null;
        this.backupActions = null;

        this.conflictData.currentChainAction = null;
    };

    QuickSkill.isBattleEnd = function () {
        return $gameParty.isEmpty() || $gameParty.isAllDead() || $gameTroop.isAllDead();
    };

    QuickSkill.recalcMode = function () {
        switch (QuickSkill.settings.recalcActionTimeMode) {
            case 'Party':
            case '味方全員':
                return 'party';
            case 'Only Actor':
            case '使用者のみ':
                return 'actor';
            case 'None':
            case 'なし':
            default:
                return 'none';
        }
    };

    // -------------------------------------------------------------------------
    // Game_Battler

    // ターン消費なしスキル中はActionを減らさないようにしないと死ぬ
    Game_Battler.prototype.removeCurrentAction = function () {
        if (QuickSkill.conflictData.currentChainAction) {
            this._actions.shift();
        } else if (QuickSkill.currentActionActor) {
            this._actions[0] = new Game_Action(this);
            this._actions.sort(function (a, _) {
                return a._item.isNull() ? 1 : 0;
            });
        } else if (QuickSkill.actorIndexForForcedAction !== null) {
            this._actions = QuickSkill.backupActions;
        } else {
            this._actions.shift();
        }
    };

    // ターン消費なし戦闘行動の強制の場合は行動を保存してあげる
    var upstream_Game_Battler_forceAction = Game_Battler.prototype.forceAction;
    Game_Battler.prototype.forceAction = function (skillId, targetIndex) {
        if (BattleManager._phase === 'torigoya_quickSkill') {
            QuickSkill.backupActions = this._actions;
        }
        upstream_Game_Battler_forceAction.apply(this, arguments);
    };

    // 行動回数が増えていたらActionを増やす
    // ※RPGツクールの仕様上、確率で増える行動回数が設定できるが、
    //   このメソッドを呼び出すと行動計算が再計算されてしまうため、
    //   「さっき1回だったのに急に2回になった！」のようなことが起きることがあります。
    //   ただし、減ることはないようにしています。
    Game_Battler.prototype.torigoya_quickSkill_recalcActionTime = function () {
        var actionTimes = this.makeActionTimes();
        for (var i = this._actions.length; i < actionTimes; i++) {
            this._actions.push(new Game_Action(this));
        }
    };

    // 行動選択後のバックを防止する
    var upstream_Game_Battler_performActionEnd = Game_Battler.prototype.performActionEnd;
    Game_Battler.prototype.performActionEnd = function () {
        var isInputting = this._actionState === 'inputting';
        upstream_Game_Battler_performActionEnd.apply(this);
        if (isInputting) this.setActionState('inputting');
    };

    // -------------------------------------------------------------------------
    // Scene_Battle

    // Actionが決定されたら、Actionの中にターン消費なしスキルがないか調べる
    var upstream_Scene_Battle_selectNextCommand = Scene_Battle.prototype.selectNextCommand;
    Scene_Battle.prototype.selectNextCommand = function () {
        QuickSkill.currentActionActor = BattleManager.actor();
        if (QuickSkill.currentActionActor) {
            var actions = QuickSkill.currentActionActor._actions;
            for (var i = 0; i < actions.length; ++i) {
                if (actions[i]._item.isNull()) continue;
                if (actions[i]._item.object().meta['QuickSkill']) {
                    actions.unshift(actions.splice(i, 1)[0]);
                    QuickSkill.originalSubject = BattleManager._subject;
                    BattleManager._subject = BattleManager.actor();
                    BattleManager.processTurn();
                    $gameTroop._interpreter.setupReservedCommonEvent();
                    return;
                }
            }
            QuickSkill.currentActionActor = null;
        }
        upstream_Scene_Battle_selectNextCommand.apply(this);
    };

    // -------------------------------------------------------------------------
    // BattleManager

    // 戦闘開始前に初期化処理を行う
    var upstream_BattleManager_setup = BattleManager.setup;
    BattleManager.setup = function (troopId, canEscape, canLose) {
        QuickSkill.reset();
        upstream_BattleManager_setup.apply(this, arguments);
    };

    // ターン消費なしスキル中なら後片付け
    var upstream_BattleManager_endAction = BattleManager.endAction;
    BattleManager.endAction = function () {
        QuickSkill.conflictData.currentChainAction = this._subject.currentChainAction && this._subject.currentChainAction();

        upstream_BattleManager_endAction.apply(this);

        // 後始末
        if (QuickSkill.currentActionActor) {
            if (QuickSkill.conflictData.currentChainAction) {
                QuickSkill.conflictData.currentChainAction = null;
            } else {
                this._phase = 'torigoya_quickSkill';
                this._subject = QuickSkill.originalSubject;
                if (this.actor() && this.actor().canInput()) {
                    this.changeActor(this._actorIndex, 'inputting');
                } else {
                    this.selectNextCommand();
                }
                QuickSkill.currentActionActor = null;
            }
        }
    };

    // ターン消費なしスキル中にイベントが積まれたら実行する
    var upstream_BattleManager_updateEvent = BattleManager.updateEvent;
    BattleManager.updateEvent = function () {
        switch (this._phase) {
            case 'turn':
                if (QuickSkill.actorIndexForForcedAction !== null) {
                    this._phase = 'torigoya_quickSkill';
                    this._actorIndex = QuickSkill.actorIndexForForcedAction;
                    QuickSkill.actorIndexForForcedAction = null;
                    QuickSkill.backupActions = null;
                }
                break;
            case 'torigoya_quickSkill':
                if (this.isActionForced()) {
                    QuickSkill.actorIndexForForcedAction = this._actorIndex;
                    this.processForcedAction();
                    return true;
                } else if (this.updateEventMain()) {
                    return true;
                }
                if (this._phase === 'torigoya_quickSkill') {
                    this._phase = QuickSkill.isBattleEnd() ? 'turn' : 'input';

                    // 行動回数の再計算
                    switch (QuickSkill.recalcMode()) {
                        case 'party':
                            $gameParty.members().forEach(function (member) {
                                member.torigoya_quickSkill_recalcActionTime();
                            });
                            break;
                        case 'actor':
                            $gameParty.members()[this._actorIndex].torigoya_quickSkill_recalcActionTime();
                            break;
                    }
                }
                this.refreshStatus();
                break;
        }
        return upstream_BattleManager_updateEvent.apply(this);
    };

    // -------------------------------------------------------------------------
    // 競合対策

    // NumbState.js
    // ターン消費なしスキルによる行動時には行動不能判定をしないようにする
    if (Game_BattlerBase.prototype.numb_occur) {
        var upstream_Game_BattlerBase_numb_occur = Game_BattlerBase.prototype.numb_occur;
        Game_BattlerBase.prototype.numb_occur = function () {
            if (QuickSkill.currentActionActor) return false;
            return upstream_Game_BattlerBase_numb_occur.apply(this);
        };
    }

    // -------------------------------------------------------------------------
    global.Torigoya = (global.Torigoya || {});
    global.Torigoya.QuickSkill = QuickSkill;
})(this);


code:
//=============================================================================
// UTA_CommonSave.js
//=============================================================================
// Version    : 1.20
// LastUpdate : 2016.05.11
// Author     : T.Akatsuki
// Website    : http://utakata-no-yume.net/
// License    : MIT License(http://opensource.org/licenses/mit-license.php)
//=============================================================================

//=============================================================================
/*:
 * @plugindesc Create a share save data. Share state of game switch and variables between each save data.
 * @author T.Akatsuki
 *
 * @param Target Switches
 * @desc Set target switch index number.
 * If you want to set multiple, put comma between indexes.
 * Using "-", the range can be specified.
 * (ex) 1-3,11,12,13,20,21
 * @default
 *
 * @param Target Variables
 * @desc Set target variable index number.
 * If you want to set multiple, put comma between indexes.
 * Using "-", the range can be specified.
 * (ex) 1-5,11,12,13,23,24
 * @default
 *
 * @param Is Auto
 * @desc Automatically to set save / load common save data on save / load timing.
 * true  : Automatically common save data is saved/loaded on save / load timing.
 * false : Save and load of common save data you do manually.
 * @default true
 *
 * @param Auto on Gameover
 * @desc If auto saving common save data is enabled , it automatically saves common save data on gameover.
 * true  : It save common save data on game over.
 * false : It do nothing on game over.
 * @default false
 *
 * @param Show Trace
 * @desc Set state traces display.
 * true  : Show trace., false : Don't show trace.
 * @default false
 *
 * @help # Overview
 * Create a share save data. Share state of game switch and variables between each save data.
 * If you use plugin command, you can operate common save data at any time.
 *
 * Common save data will be saved with a name "common.rpgsave" below save directory.
 *
 * # Parameters
 *   Target Switches [Switch No, ...]
 *     Set target switch index number.
 *     If you want to set multiple, put comma between indexes.
 *     Using "-", the range can be specified.
 *     (Ex) 1-3,11,12,13,20,21
 *            => number 1,2,3,11,12,13,20,21 switches are target.
 *
 *   Target Variables [Valiable No, ...]
 *     Set target variable index number.
 *     If you want to set multiple, put comma between indexes.
 *     Using "-", the range can be specified.
 *     (Ex) 1-3,11,12,13,14,15
 *            => number 1,2,3,11,12,13,14,15 variables are target.
 *
 *   Is Auto [true|false]
 *     Automatically to set save / load common save data on save / load timing.
 *
 *   Auto on Gameover [true|false]
 *     If auto saving common save data is enabled , it automatically saves common save data on gameover.
 *
 *   Show Trace [true|false]
 *     Set whether the issue a trace for debugging.
 *
 * # Plugin Command
 *   CommonSave load                  # Read GameSwitches and GameVariables from common save data and apply game data.
 *                                    # This command is used when you want to load common save data at any time.
 *   CommonSave save                  # Save target GameSwitches and GameVariables common save data.
 *                                    # This command is used when you want to save in common save data at any time.
 *   CommonSave remove                # Remove common save data file.
 *
 *   CommonSave setTrace [true|false] # Setting to enabled trace on console.
 *
 *   CommonSave check                 # Show sharing target switches and variables to console.
 *
 * # Change Log
 *   ver 1.20 (2016.05.11)
 *     Using "-", the range can be specified.
 *     Add setTrace plugin command.
 *     Add check plugin command.
 *
 *   ver 1.10 (Fed 17, 2016)
 *     Rename to UTA_CommonSave.js.
 *     To be able to set trace in the parameter.
 *
 *   ver1.01 (Jan 14, 2016)
 *     Fixed bug where could not share variables.
 *
 *   ver1.00 (Dec 31, 2015)
 *     To ver1.00 according to the Japanese version of RPG Maker MV.
 *
 *   ver0.01 (Nov 05, 2015)
 *     Initial release.
 */

/*:ja
 * @plugindesc 共有のセーブデータを作成し、指定したスイッチ・変数の状態をセーブデータ間で共有します。
 * @author 赤月 智平
 *
 * @param Target Switches
 * @desc 対象となるスイッチの番号を指定します。
 * カンマ区切りで複数指定、ハイフンで範囲指定が可能です。
 * (例) 1-3,11,12,13,20,21
 * @default
 *
 * @param Target Variables
 * @desc 対象となる変数の番号を指定します。
 * カンマ区切りで複数指定、ハイフンで範囲指定が可能です。
 * (例) 1-5,11,12,13,23,24
 * @default
 *
 * @param Is Auto
 * @desc セーブ・ロード時に自動的に共通セーブデータのセーブ・ロードを行うかを設定します。
 *       true  : セーブ・ロード時に自動的に共有セーブデータにデータのセーブ・ロードを行う。
 *       false : 共通セーブデータのセーブ・ロードは手動で行う。
 * @default true
 *
 * @param Auto on Gameover
 * @desc 自動セーブ設定がONの時にゲームオーバー時に共有セーブデータの自動セーブを行うかを設定します。
 *       true  : ゲームオーバー時に自動共有セーブを行う。
 *       false : ゲームオーバー時は自動共有セーブを行わない。
 * @default false
 *
 * @param Show Trace
 * @desc デバッグ用のトレースを出すかを設定します。
 * true: トレースを表示, false: トレースを表示しない
 * @default false
 *
 * @help ■概要
 * CommonSaveプラグインは共有セーブデータを作成し、指定したスイッチ・変数の状態をセーブデータ間で共有する事ができます。
 * 基本的にはセーブ・ロード時に設定に応じて自動的に処理してくれます。
 * プラグインコマンドを利用すると、任意のタイミングで共有セーブデータの操作を行う事ができます。
 *
 * 共有セーブデータはsaveディレクトリ以下に「common.rpgsave」という名前で保存されます。
 *
 * ■パラメータの説明
 *   Target Switches [スイッチ番号, ...]
 *     共有したいスイッチの番号を指定します。「,」で区切り複数の値を指定する事ができます。
 *     「-」で数値の範囲を指定する事も可能です。
 *     (例) 1-3,11,12,13,20,21
 *            => 1,2,3,11,12,13,20,21番のスイッチが対象になる。
 *
 *   Target Variables [変数番号, ...]
 *     共有したい変数の番号を指定します。「,」で区切り複数の値を指定する事ができます。
 *     「-」で数値の範囲を指定する事も可能です。
 *     (例) 1-3,11,12,13,14,15
 *            => 1,2,3,11,12,13,14,15番の変数が対象になる。
 *
 *   Is Auto [true|false]
 *     セーブ・ロード時に自動的に共通セーブデータのセーブ・ロードを行うかを設定します。
 *     デフォルトではtrue(セーブ・ロード時に自動的に共有セーブ・ロードを行う)になっています。
 *
 *   Auto on Gameover [true|false]
 *     自動セーブ設定がONの時にゲームオーバー時に共有セーブデータの自動セーブを行うかを設定します。
 *     デフォルトではfalse(ゲームオーバー時に自動共有セーブを行わない)になっています。
 *
 *   Show Trace [true|false]
 *     デバッグ用のトレースを出すかを設定します。
 *
 * ■プラグインコマンド
 *   CommonSave load                  # 共有セーブデータからスイッチ・変数を読み込み反映させます。
 *                                    # 任意のタイミングで共有セーブデータのロードを行いたい場合に使用します。
 *   CommonSave save                  # 共有セーブデータにスイッチ・変数の状態を記録します。
 *                                    # 任意のタイミングで共有セーブデータのセーブを行いたい場合に使用します。
 *   CommonSave remove                # 共有セーブデータを削除します。
 *                                    # 共有セーブデータをリセットしたい場合に使用します。
 *   CommonSave setTrace [true|false] # コンソールにトレースを出力するかを設定します。
 *                                    # ゲーム実行中にトレース状態を切り替えたい場合に使用します。
 *   CommonSave check                 # 共有状態になっているスイッチ・変数番号をコンソールに表示し確認します。
 *
 * ■更新履歴
 *   ver 1.20 (2016.05.11)
 *     スイッチ・変数の指定の際に「-」を使う事で範囲指定を可能に。
 *     トレース状態を動的に変えられるように setTrace プラグインコマンドを追加。
 *     共有対象になっているスイッチ・変数を確認できる check プラグインコマンドを追加。
 *
 *   ver 1.10 (2016.02.17)
 *     ファイル名をUTA_CommonSave.jsに変更。
 *     トレース出力の有無をパラメータで設定できるように。
 *
 *   ver 1.01 (2016.01.14)
 *     変数の共有が上手くできていないバグの修正。
 *
 *   ver 1.00 (2015.12.31)
 *     日本語版RPGツクールMVの発売に合わせver1.00に。
 *
 *   ver 0.01 (2015.11.05)
 *     初版。
 */
//=============================================================================

//name space
var utakata = utakata || (utakata = {});

//-----------------------------------------------------------------------------
// class CommonSaveManager
//-----------------------------------------------------------------------------
(function (utakata) {
    var CommonSaveManager = (function () {
        //constructor
        function CommonSaveManager() {
            //member variables
            this._targetSwitchList = [];
            this._targetVariableList = [];

            this._showTrace = false;
            this._tr = null;

            this.initialize();
        }

        //private methods
        CommonSaveManager.prototype.initialize = function () {
            this.parameters = PluginManager.parameters('UTA_CommonSave');

            this._showTrace = (String(this.parameters['Show Trace']) === "true");

            this._tr = function (s) {
                if (!this._showTrace) { return; }
                var str = "CommonSaveManager: " + s; console.log(str);
            };

            var targetSwitchStr = String(this.parameters['Target Switches']);
            var targetVariableStr = String(this.parameters['Target Variables']);

            this._targetSwitchList = this._parseTargetNumber(targetSwitchStr);
            this._targetVariableList = this._parseTargetNumber(targetVariableStr);
        };

        CommonSaveManager.prototype._parseTargetNumber = function (str) {
            if (typeof str === "undefined" || str === "undefined") { return []; }

            str = str.replace(/\s+/g, "");

            var split_str = ',';
            var rgn_split_str = '-';

            var indexes = str.split(split_str, -1);
            var ret = [];

            var parseTargetNumbersFromRegion = function (rgn_target) {
                var ret = [];
                var target_number = rgn_target.split(rgn_split_str, -1);
                if (typeof target_number[0] === "undefined" || typeof target_number[1] === "undefined") { return []; }

                var s_number = parseInt(target_number[0]);
                if (s_number !== s_number) {
                    this._tr("_parseTargetNumber getTargetNumbersFromRegion: Setting parameter is invalid.");
                    return [];
                }

                var e_number = parseInt(target_number[1]);
                if (e_number !== e_number) {
                    this._tr("_parseTargetNumber getTargetNumbersFromRegion: Setting parameter is invalid.");
                    return [];
                }

                for (var i = s_number; i <= e_number; i++) {
                    ret.push(i);
                }

                return ret;
            };

            for (var i = 0; i < indexes.length; i++) {
                var rgn_target = indexes[i].match(/\d+-\d+/g);
                if (!!rgn_target) {
                    var parseIndexes = parseTargetNumbersFromRegion(rgn_target[0]);
                    if (parseIndexes.length <= 0) { continue; }

                    ret = ret.concat(parseIndexes);
                } else {
                    var parseIndex = parseInt(indexes[i]);
                    if (parseIndex !== parseIndex) {
                        this._tr("_parseTargetNumber: Setting parameter is invalid.");
                        continue;
                    }
                    ret.push(parseIndex);
                }
            }
            return ret;
        };

        CommonSaveManager.prototype._getTargetSwitchJson = function () {
            var json = {};

            for (var i = 0; i < this._targetSwitchList.length; i++) {
                var idx = this._targetSwitchList[i].toString();
                var value = $gameSwitches.value(idx);
                json[idx] = value;
            }

            return json;
        };

        CommonSaveManager.prototype._getTargetVariableJson = function () {
            var json = {};

            for (var i = 0; i < this._targetVariableList.length; i++) {
                var idx = this._targetVariableList[i].toString();
                var value = $gameVariables.value(idx);
                json[idx] = value;
            }

            return json;
        };

        CommonSaveManager.prototype.setLoadSwitches = function (switches) {
            for (var key in switches) {
                var idx = parseInt(key);
                var value = switches[key];
                $gameSwitches.setValue(idx, value);
            }
        };

        CommonSaveManager.prototype.setLoadVariables = function (variables) {
            for (var key in variables) {
                var idx = parseInt(key);
                var value = variables[key];
                $gameVariables.setValue(idx, value);
            }
        };

        //public methods
        CommonSaveManager.prototype.load = function () {
            this._tr("load common save data.");

            if (!this.exists()) { return false; }

            var loadData = DataManager.loadCommonSave();

            if ("gameSwitches" in loadData) {
                this.setLoadSwitches(loadData["gameSwitches"]);
            }
            if ("gameVariables" in loadData) {
                this.setLoadVariables(loadData["gameVariables"]);
            }
        };

        CommonSaveManager.prototype.save = function () {
            this._tr("save common save data.");

            var switchesJson = this._getTargetSwitchJson();
            var variablesJson = this._getTargetVariableJson();

            var json = {
                "gameSwitches": switchesJson,
                "gameVariables": variablesJson
            };

            DataManager.saveCommonSave(json);
        };

        CommonSaveManager.prototype.exists = function () {
            this._tr("check exists common save data.");
            return StorageManager.existsCommonSave();
        };

        CommonSaveManager.prototype.remove = function () {
            this._tr("remove common save data.");
            StorageManager.removeCommonSave();
        };

        CommonSaveManager.prototype.setShowTrace = function (args) {
            if (!args) { return; }
            var enabled = String(args[1]) === "true" ? true : false;
            this._tr("setShowTrace: " + this._showTrace);
            this._showTrace = enabled;
        };

        CommonSaveManager.prototype.check = function () {
            var str = "CommonSaveManager: \n";
            str += " # Share switch targets : \n";
            str += JSON.stringify(this._targetSwitchList);

            str += "\n # Share variable targets : \n";
            str += JSON.stringify(this._targetVariableList);

            console.log(str);
        };

        CommonSaveManager.prototype.isAuto = function () {
            return String(this.parameters['Is Auto']) === "true";
        };

        CommonSaveManager.prototype.isAutoOnGameOver = function () {
            return String(this.parameters['Auto on Gameover']) === "true";
        };

        return CommonSaveManager;
    })();
    utakata.CommonSaveManager = new CommonSaveManager();

})(utakata || (utakata = {}));

(function () {
    //parse and dispatch plugin command
    var _Game_Interpreter_pluginCommand =
        Game_Interpreter.prototype.pluginCommand;
    Game_Interpreter.prototype.pluginCommand = function (command, args) {
        _Game_Interpreter_pluginCommand.call(this, command, args);
        if (command === 'CommonSave') {
            switch (args[0]) {
                case 'load':
                    utakata.CommonSaveManager.load();
                    break;
                case 'save':
                    utakata.CommonSaveManager.save();
                    break;
                case 'exists':
                    utakata.CommonSaveManager.exists();
                    break;
                case 'remove':
                    utakata.CommonSaveManager.remove();
                    break;
                case 'setTrace':
                    utakata.CommonSaveManager.setShowTrace(args);
                    break;
                case 'check':
                    utakata.CommonSaveManager.check();
                    break;
                default:
                    break;
            }
        }
    };

    //-----------------------------------------------------------------------------
    // DataManager
    //-----------------------------------------------------------------------------
    // # extension
    var _Data_Manager_loadGame = DataManager.loadGame;
    DataManager.loadGame = function (savefileId) {
        var ret = _Data_Manager_loadGame.call(this, savefileId);

        if (utakata.CommonSaveManager.isAuto()) { utakata.CommonSaveManager.load(); }
        return ret;
    };

    var _Data_Manager_saveGame = DataManager.saveGame;
    DataManager.saveGame = function (savefileId) {
        var ret = _Data_Manager_saveGame.call(this, savefileId);

        if (utakata.CommonSaveManager.isAuto()) { utakata.CommonSaveManager.save(); }
        return ret;
    };

    var _Data_Manager_setupNewGame = DataManager.setupNewGame;
    DataManager.setupNewGame = function () {
        _Data_Manager_setupNewGame.call(this);
        if (utakata.CommonSaveManager.isAuto()) { utakata.CommonSaveManager.load(); }
    };

    // # add methods
    DataManager.loadCommonSave = function () {
        var json;
        try {
            json = StorageManager.loadCommonSave();
        } catch (e) {
            console.error(e);
            return [];
        }
        if (json) {
            var commonInfo = JSON.parse(json);
            return commonInfo;
        } else {
            return [];
        }
    };

    DataManager.saveCommonSave = function (json) {
        var jsonStr = JsonEx.stringify(json);
        if (jsonStr.length >= 200000) {
            console.warn('Common Save too big!');
        }
        StorageManager.saveCommonSave(jsonStr);
        return true;
    };

    //-----------------------------------------------------------------------------
    // StorageManager
    //-----------------------------------------------------------------------------
    //load methods ----------------------------------------------------------------
    StorageManager.loadCommonSave = function () {
        if (this.isLocalMode()) {
            return this.loadFromLocalFileCommonSave();
        } else {
            return this.loadFromWebStorageCommonSave();
        }
    };

    StorageManager.loadFromLocalFileCommonSave = function () {
        var data = null;
        var fs = require('fs');
        var filePath = this.localFilePathCommonSave();
        if (fs.existsSync(filePath)) {
            data = fs.readFileSync(filePath, { encoding: 'utf8' });
        }
        return LZString.decompressFromBase64(data);
    };

    StorageManager.loadFromWebStorageCommonSave = function () {
        var key = this.webStorageKeyCommonSave();
        var data = localStorage.getItem(key);
        return LZString.decompressFromBase64(data);
    };

    // save methods ---------------------------------------------------------------
    StorageManager.saveCommonSave = function (json) {
        if (this.isLocalMode()) {
            this.saveToLocalFileCommonSave(json);
        } else {
            this.saveToWebStorageCommonSave(json);
        }
    };

    StorageManager.saveToLocalFileCommonSave = function (json) {
        var data = LZString.compressToBase64(json);
        var fs = require('fs');
        var dirPath = this.localFileDirectoryPath();
        var filePath = this.localFilePathCommonSave();
        if (!fs.existsSync(dirPath)) {
            fs.mkdirSync(dirPath);
        }
        fs.writeFileSync(filePath, data);
    };

    StorageManager.saveToWebStorageCommonSave = function (json) {
        var key = this.webStorageKeyCommonSave();
        var data = LZString.compressToBase64(json);
        localStorage.setItem(key, data);
    };

    //check exists ----------------------------------------------------------------
    StorageManager.existsCommonSave = function () {
        if (this.isLocalMode()) {
            return this.localFileExistsCommonSave();
        } else {
            return this.webStorageExistsCommonSave();
        }
    };

    StorageManager.localFileExistsCommonSave = function () {
        var fs = require('fs');
        return fs.existsSync(this.localFilePathCommonSave());
    };

    StorageManager.webStorageExistsCommonSave = function () {
        var key = this.webStorageKeyCommonSave();
        return !!localStorage.getItem(key);
    };

    //remove ----------------------------------------------------------------------
    StorageManager.removeCommonSave = function () {
        if (this.isLocalMode()) {
            this.removeLocalFileCommonSave();
        } else {
            this.removeWebStorageCommonSave();
        }
    };

    StorageManager.removeLocalFileCommonSave = function () {
        var fs = require('fs');
        var filePath = this.localFilePathCommonSave();
        if (fs.existsSync(filePath)) {
            fs.unlinkSync(filePath);
        }
    };

    StorageManager.removeWebStorageCommonSave = function () {
        var key = this.webStorageKeyCommonSave();
        localStorage.removeItem(key);
    };

    StorageManager.localFilePathCommonSave = function () { return this.localFileDirectoryPath() + 'common.rpgsave'; };
    StorageManager.webStorageKeyCommonSave = function () { return 'RPG Common'; };

    //-----------------------------------------------------------------------------
    // Scene_Gameover
    //-----------------------------------------------------------------------------
    var _Scene_Gameover_Start = Scene_Gameover.prototype.start;
    Scene_Gameover.prototype.start = function () {
        if (utakata.CommonSaveManager.isAutoOnGameOver()) {
            utakata.CommonSaveManager.save();
        }
        _Scene_Gameover_Start.call(this);
    };

})();

repo_name: dazed/translations

license: unknown


code:
//=============================================================================
// VeryFastBattle.js
//=============================================================================

/*:
 * @plugindesc battle exceeds very fast when specified keys down
 * @author Sasuke KANNAZUKI (Thx to 星潟)
 *
 * @help This plugin does not provide plugin commands.
 *
 * When 'pageup' key(=PageUp or Q) or 'control' key (=Ctrl or Alt) is down
 * at battle turn, it exceeds very fast.
 *
 * There is no operation for mouse and touch panel.
 *
 * Copyright:
 * This plugin's specification is based on、星潟's RGSS3 material.
 * Artificial Providence http://artificialprovidence.web.fc2.com/
 * Thanks to 星潟.
 *
 * This plugin is released under MIT license.
 * http://opensource.org/licenses/mit-license.php
 */
/*:ja
 * @plugindesc 特定のキーが押された時、超高速に戦闘シーンが進みます
 * @author 神無月サスケ (原案:星潟)
 *
 * @help このプラグインには、プラグインコマンドはありません
 *
 * 'pageup' キー か 'control' キーが押されている間、超高速になります。
 * - 'pageup' とは、キーボードの PgUp か Q, またはパッドの Lボタンです。
 * - 'control' とは、キーボードの Ctrl か Alt です。
 *
 * タッチパネルやマウスでは、該当する動作はありません。
 *
 * 謝辞:
 * このプラグインの仕様は、星潟様の RGSS3 素材を参考にしました。
 * Artificial Providence http://artificialprovidence.web.fc2.com/
 * 星潟様に謝意を示します。
 *
 * このプラグインは MIT ライセンスで配布されます。
 * ご自由にお使いください。
 * http://opensource.org/licenses/mit-license.php
 */

(function () {

  //
  // Check Very Fast
  //
  Game_System.prototype.isVeryFastForward = function () {
    return Input.isPressed('pageup') || Input.isPressed('control');
  };

  //
  // skip all wait
  //
  var _Window_BattleLog_updateWaitCount =
    Window_BattleLog.prototype.updateWaitCount;
  Window_BattleLog.prototype.updateWaitCount = function () {
    if (this._waitCount > 0 && $gameSystem.isVeryFastForward()) {
      this._waitCount = 1;
    }
    return _Window_BattleLog_updateWaitCount.call(this);
  };

  var _Window_BattleLog_updateWaitMode =
    Window_BattleLog.prototype.updateWaitMode;
  Window_BattleLog.prototype.updateWaitMode = function () {
    if ($gameSystem.isVeryFastForward() && this._waitMode === 'effect') {
      this._waitMode = '';
      return false;
    }
    return _Window_BattleLog_updateWaitMode.call(this);
  };

  var _Sprite_Battler_updateMove = Sprite_Battler.prototype.updateMove;
  Sprite_Battler.prototype.updateMove = function () {
    if (this._movementDuration > 0 && $gameSystem.isVeryFastForward()) {
      this._movementDuration = 1;
    }
    return _Sprite_Battler_updateMove.call(this);
  };

  var _Spriteset_Battle_isBusy = Spriteset_Battle.prototype.isBusy;
  Spriteset_Battle.prototype.isBusy = function () {
    if ($gameSystem.isVeryFastForward()) {
      return false;
    } else {
      return _Spriteset_Battle_isBusy.call(this);
    }
  };
})();


code:
//=============================================================================
// WeaponSkill.js
//=============================================================================

/*:
 * @plugindesc Change skill id of attack for each weapon.
 * @author Sasuke KANNAZUKI
 *
 * @help This plugin does not provide plugin commands.
 *
 * When <skill_id:3> is written in a weapon's note field,
 * skill id # 3 is used for the weapon's attack.
 * If nothing is written, default id(=1) is used.
 *
 * Check Points:
 * - When multiple weapons are equipped, the skill id of the weapon
 *  held in the dominant hand (previously defined) is used.
 * - It is most favorable for "skill type" to be "none"(=0),
 *  otherwise you cannot attack when your skill is blocked.
 *
 * Usage examples of this plugin:
 * - to create all-range weapons
 * - to create dual-attack or triple-attack weapons
 * - If healing skill is set when actor attacks, you can choose a friend to heal.
 * - It is possible to make a weapon that functions similar to a guard command.
 */

/*:ja
 * @plugindesc 武器ごとに通常攻撃のスキルIDを変更します。
 * @author 神無月サスケ
 *
 * @help このプラグインにはプラグインコマンドはありません。
 *
 *  武器の「メモ」欄に、<skill_id:3> と書いた場合、
 * 通常攻撃の際、3番のスキルが発動します。
 * ※特に記述がなければ、通常通り1番のスキルが採用されます。
 *
 * チェックポイント:
 * - 二刀流の場合、利き腕(先に定義された方)に持っているスキルIDが採用されます。
 * - スキルタイプは「なし」にするのが望ましいです。
 * さもなくば、技などを封じられたとき、攻撃が出来なくなります。
 *
 * 想定される用途:
 * - 全体攻撃可能な武器
 * - 2回攻撃、3回攻撃する武器
 * - 回復魔法をスキルに指定した場合、
 * 「攻撃」を選んだ際、味方の選択が出来、その仲間を回復します
 * - 防御コマンドなどと同等になる武器も実現可能です。
 */

(function () {

  //
  // set skill id for attack.
  //
  Game_Actor.prototype.attackSkillId = function () {
    var normalId = Game_BattlerBase.prototype.attackSkillId.call(this);
    if (this.hasNoWeapons()) {
      return normalId;
    }
    var weapon = this.weapons()[0];  // at plural weapon, one's first skill.
    var id = weapon.meta.skill_id;
    return id ? Number(id) : normalId;
  };

  //
  // for command at battle
  //
  var _Scene_Battle_commandAttack = Scene_Battle.prototype.commandAttack;
  Scene_Battle.prototype.commandAttack = function () {
    BattleManager.inputtingAction().setAttack();
    // normal attack weapon (or other single attack weapon)
    var action = BattleManager.inputtingAction();
    if (action.needsSelection() && action.isForOpponent()) {
      _Scene_Battle_commandAttack.call(this);
      return;
    }
    // special skill weapon
    this.onSelectAction();
  };

})();


code:
/*:
 * Yami Engine Delta - Retain States On Death
 *
 * @plugindesc Makes some kinds of state to be retained on actors
 * even when they die.
 * @author Yami Engine Delta [Dr.Yami]
 *
 * @help
 * There is no Configuration and Plugin Command.
 *
 * ============================================================================
 *
 * States
 * To make a state to be retained on death, use the following notetag:
 *   <retain on death>
 *
 * ============================================================================
 */
/*:ja
 * Yami Engine Delta - Retain States On Death
 *
 * @plugindesc キャラクターの死後も、アクターのステートを維持させます
 * @author Yami Engine Delta [Dr.Yami]
 *
 * @help
 * このプラグインには、コンフィグやプラグインコマンドはありません。
 *
 * ============================================================================
 *
 * States
 * キャラクターの死後もステートの維持を行いたい場合は、
 * 下記のNotetagを使用してください。
 *   <retain on death>
 *
 * ============================================================================
 */

/**
 * @namespace RetainStateOnDeath
 * @memberof YED
 */

var YED = YED || {};

// init RetainStateOnDeath module
YED.RetainStateOnDeath = {};

/* globals YED: false */

(function () {
    /**
     * Enum for RegExp, used to notetags
     *
     * @readonly
     * @enum {RegExp}
     * @memberof YED.RetainStateOnDeath
     */
    var Regexp = {
        /**
         * Retain on death notetag for state
         */
        RETAIN: /<(?:retain on death)>/i
    };

    YED.RetainStateOnDeath.Regexp = Regexp;
}());

/* globals YED: false */

(function () {
    /**
     * Shorten Dependencies
     */
    var Regexp = YED.RetainStateOnDeath.Regexp;

    /**
     * Contains utility tools for module.
     *
     * @namespace Utils
     * @memberof YED.RetainStateOnDeath
     */
    var Utils = {};

    /**
     * Process notetag function.
     * Should be called with DataManager as current object.
     *
     * @function processNotetag
     * @memberof YED.RetainStateOnDeath.Utils
     */
    Utils.processNotetags = function () {
        var group = $dataStates,    // shorten group name
            obj,
            notedata,
            line;

        for (var i = 1; i < group.length; i++) {
            obj = group[i];
            notedata = obj.note.split(/[\r\n]+/);

            Utils._processMethods.call(this, obj);

            for (var n = 0; n < notedata.length; n++) {
                line = notedata[n];
                Utils._processNotetag.call(this, obj, line);
            }
        }
    };

    /**
     * Add new methods into object.
     *
     * @function _processMethods
     * @memberof YED.RetainStateOnDeath.Utils
     * @param  {Object} obj Data object
     * @private
     */
    Utils._processMethods = function (obj) {
        obj.isRetainStateOnDeath = Utils.isRetainStateOnDeath;
    };

    /**
     * Process notetag for object.
     *
     * @function _processNotetag
     * @memberof YED.RetainStateOnDeath.Utils
     * @param  {Object} obj Data object
     * @param  {String} notetag Notetag
     * @private
     */
    Utils._processNotetag = function (obj, notetag) {
        if (notetag.match(Regexp.RETAIN)) {
            obj._retainStateOnDeath = true;
        }
    };

    /**
     * Check if the state is retained on death.
     * Should be attached to state object.
     *
     * @function isRetainStateOnDeath
     * @memberof YED.RetainStateOnDeath.Utils
     * @return {Boolean} Retain flag
     */
    Utils.isRetainStateOnDeath = function () {
        return !!this._retainStateOnDeath;
    };

    YED.RetainStateOnDeath.Utils = Utils;
}());

/* globals YED: false */

/**
 * Pre-processes and notetag parsing
 */
(function () {
    /**
     * Shorten Dependencies
     */
    var Utils = YED.RetainStateOnDeath.Utils;
    /**
     * Aliasing methods
     */
    var _Scene_Boot_start = Scene_Boot.prototype.start;

    /**
     * Extending: Scene_Boot.prototype.start
     *
     * Add notetags processing for module.
     */
    Scene_Boot.prototype.start = function () {
        _Scene_Boot_start.call(this);

        Utils.processNotetags.call(DataManager);
    };
}());

(function () {
    /**
     * Aliasing methods
     */
    var _Game_Actor_initialize = Game_Actor.prototype.initialize;
    var _Game_Actor_die = Game_Actor.prototype.die;

    /**
     * Extending: Game_Actor.prototype.initialize
     *
     * Add setup retain state on death for Game_Actor.
     */
    Game_Actor.prototype.initialize = function (actorId) {
        // actual initialize
        _Game_Actor_initialize.call(this, actorId);

        // setup retain states on death
        this.setupRetainStateOnDeath();
    };

    /**
     * Setup retain state on death for Game Actor
     *
     * @function external:Game_Actor#setupRetainStateOnDeath
     */
    Game_Actor.prototype.setupRetainStateOnDeath = function () {
        this._retainStateOnDeath = [];
    };

    /**
     * Extending: Game_Actor.prototype.die
     *
     * Add store and restore states methods.
     */
    Game_Actor.prototype.die = function () {
        // store states
        this.storeRetainStateOnDeath();

        // actual die
        _Game_Actor_die.call(this);

        // restore states
        this.restoreRetainStateOnDeath();
    };

    /**
     * Store current states that need to be retained on death.
     *
     * @function external:Game_Actor#storeRetainStateOnDeath
     */
    Game_Actor.prototype.storeRetainStateOnDeath = function () {
        var state,      // for iterator
            storeData,  // data hash
            states = this.states();

        for (var i = 0; i < states.length; i++) {
            state = states[i];

            if (state.isRetainStateOnDeath()) {
                storeData = {};
                storeData.id = state.id;
                storeData.turn = this._stateTurns[state.id];
                storeData.step = this._stateSteps[state.id];

                this._retainStateOnDeath.push(storeData);
            }
        }
    };

    /**
     * Restore the retained on death states.
     *
     * @function external:Game_Actor#restoreRetainStateOnDeath
     */
    Game_Actor.prototype.restoreRetainStateOnDeath = function () {
        var storeData; // data hash

        for (var i = 0; i < this._retainStateOnDeath.length; i++) {
            storeData = this._retainStateOnDeath[i];

            this.addNewState(storeData.id);
            this._stateTurns[storeData.id] = storeData.turn;
            this._stateSteps[storeData.id] = storeData.step;
        }

        this._retainStateOnDeath = [];
    };
}());