code:
/*
 * ==============================================================================
 * ** Victor Engine MV - Fog And Overlay
 * ------------------------------------------------------------------------------
 * VE_FogAndOverlay.js
 * ==============================================================================
 */

var Imported = Imported || {};
Imported['VE - Fog And Overlay'] = '1.07';

var VictorEngine = VictorEngine || {};
VictorEngine.FogAndOverlay = VictorEngine.FogAndOverlay || {};

(function () {

    VictorEngine.FogAndOverlay.loadDatabase = DataManager.loadDatabase;
    DataManager.loadDatabase = function () {
        VictorEngine.FogAndOverlay.loadDatabase.call(this);
        PluginManager.requiredPlugin.call(PluginManager, 'VE - Fog And Overlay', 'VE - Basic Module', '1.21');
        PluginManager.requiredPlugin.call(PluginManager, 'VE - Fog And Overlay', 'VE - Tile Priority');
    };

    VictorEngine.FogAndOverlay.requiredPlugin = PluginManager.requiredPlugin;
    PluginManager.requiredPlugin = function (name, required, version) {
        if (!VictorEngine.BasicModule) {
            var msg = 'The plugin ' + name + ' requires the plugin ' + required;
            msg += ' v' + version + ' or higher installed to work properly.';
            msg += ' Go to http://victorenginescripts.wordpress.com/ to download the plugin.';
            throw new Error(msg);
        } else {
            VictorEngine.FogAndOverlay.requiredPlugin.call(this, name, required, version)
        };
    };

})();

/*:
 * @plugindesc v1.07 - Display fogs and overlay on maps and battles.
 * @author Victor Sant
 *
 * @param Max Fogs
 * @desc Max number of simultaneous fogs and overlay effects
 * Default: 5.
 * @default 5
 *
 * @help
 * ==============================================================================
 *  Notetags:
 * ==============================================================================
 *
 * ==============================================================================
 *  Fog Effect (notetag for Maps)
 * ------------------------------------------------------------------------------
 *  <fog effect>
 *   settings
 *  </fog effect>
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *  Create a fog effect on the map, add the following values to the info
 *  the ID and name must be added, other values are optional.
 *    id: n      : fog ID
 *    name: 's'  : fog graphic filename ('filename' in quotations)
 *    opacity: n : fog opacity (0-255)
 *    zoom: n%   : fog zoom (100% = default size)
 *    hue: n     : fog hue (0-360)
 *    blend: n   : fog blend mode (0: normal, 1: addition, 2: subtraction)
 *    move x: n  : fog horizontal movement (Numeric value, can be negative)
 *    move y: n  : fog vertical movement   (Numeric value, can be negative)
 *    pan x: n   : fog horizontal panning  (Numeric value)
 *    pan y: n   : fog vertical panning    (Numeric value)
 *    depth: n   : fog depth (1-7, see details bellow)
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *  Ex.:  <fog effect>
 *         id: 1
 *         name: 'Sky'
 *         opacity: 160
 *         hue: 100
 *         move x: 3
 *         move y: 2
 *        </fog effect>
 *
 *        <fog effect>
 *         id: 3
 *         name: '$Fog'
 *         opacity: 92
 *         zoom: 150%
 *         pan x: -5
 *         blend: 2
 *        </fog effect>
 * ==============================================================================
 *
 * ==============================================================================
 *  Plugin Commands
 * ------------------------------------------------------------------------------
 *
 * ------------------------------------------------------------------------------
 *  FogEffect id name opacity hue blend depth
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *  Show the fog effect on map.
 *    id      : fog effect id. (Number)
 *    name    : fog filename. (filename can't contain white space)
 *    opacity : fog opacity. (0-255)
 *    hue     : fog hue. (0-360)
 *    blend   : fog blend mode (0: normal, 1: addition, 2: subtraction)
 *    depth   : fog depth (1-7, see details bellow)
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *  Ex.: FogEffect 1 Sky 160 100 0 0
 *       FogEffect 2 $Fog 92 0 1 3
 * ------------------------------------------------------------------------------
 *
 * ------------------------------------------------------------------------------
 *  FogOpacity id opacity duration
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *  Changes the fog effect opacity.
 *    id       : fog effect id. (Number)
 *    opacity  : opacity. (0-255)
 *    duration : opacity change duration. (in frames, 0 if not set).
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *  Ex.: FogOpacity 1 92 60
 *       FogOpacity 2 0 120
 * ------------------------------------------------------------------------------
 *
 * ------------------------------------------------------------------------------
 *  FogMove id x y
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *    Adds continuous movement to the fog effect.
 *      id : fog effect id. (Number)
 *      x  : fog move X. (Number, can be negative)
 *      y  : fog move Y. (Number, can be negative)
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *  Ex.: FogMove 1 5 -5
 *       FogMove 2 0 4
 * ------------------------------------------------------------------------------
 *
 * ------------------------------------------------------------------------------
 *  FogPan id x y
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *    Change fog effect panning.
 *      id : fog effect id. (Number)
 *      x  : fog pan X. (Number, can be negative)
 *      y  : fog pan Y. (Number, can be negative)
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *  Ex.: FogPan 1 4 4
 *       FogPan 2 0 -5
 * ==============================================================================
 *
 * ==============================================================================
 * Additional Information:
 * ------------------------------------------------------------------------------
 *
 *  - Fogs Depths:
 *  The fog depth represents wich objects will be displayed above or bellow the
 *  overlay effect. There are 8 depths available from 0 to 7.
 *
 *  On map:
 *   1: above animations
 *   2: above airship/upper characters
 *   3: above upper tiles
 *   4: above normal characters
 *   5: above lower characters
 *   6: above lower tilesets
 *   7: above parallax
 *
 *  On battle:
 *   0, 1, 2, 3, 4: above battlers
 *   5: above battleback2
 *   6: above battleback1
 *   7: above background (blured map image)
 *
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *
 *  - Fogs in Battle:
 *  By default, fogs are shown only on Map. You can make some fogs to display
 *  during battle by adding a prefix to it's filename.
 *  Add '$' on the fog filename, for the fog to be shown in the map and battle.
 *  Add '%' on the fog filename, for the fog to be shown only in battle.
 *  For example, a fog named '%Clouds' will be shown only in battle.
 *
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *
 *  - Creating Fogs
 *  The fog images must be placed on the folder img/fogs/ (you must create this
 *  new folder).
 *  The fogs can be created either adding a notetag on the map note box or using
 *  plugin commands. Fogs created with plugin commands will disappear when you
 *  leave the map. You can also control fogs created with notetags using plugin
 *  commands with their Ids, but any change will reset when you leave the map.
 *  Fogs on the same depht are sorted based on their IDs. The ones with higher
 *  IDs will be shown above the ones with lower IDs.
 *
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *
 *  If you want to create a fixed overlay (that follows the map movement),
 *  add '!' on the start of the overlay filename. For example, an overlay
 *  named "Over" should be renamed "!Over". You can combine this prefix with
 *  the battle and battle only prefixes.
 *
 * ==============================================================================
 *
 * ==============================================================================
 *  Compatibility:
 * ------------------------------------------------------------------------------
 * - To be used together with this plugin, the following plugins must be placed
 *   bellow this plugin:
 *     VE - Tile Priority
 * ==============================================================================
 *
 * ==============================================================================
 *  Version History:
 * ------------------------------------------------------------------------------
 *  v 1.00 - 2015.12.07 > First release.
 *  v 1.01 - 2015.12.25 > Revised code for better performance.
 *                      > Added more depth options.
 *  v 1.02 - 2016.01.06 > Fixed issue with fogs not clearing.
 *  v 1.03 - 2016.01.27 > Fixed issue with loading games with fogs on the map.
 *  v 1.04 - 2016.03.12 > Fixed issue with stack call and battle fogs.
 *  v 1.05 - 2016.03.23 > Compatibility with Basic Module 1.16.
 *  v 1.06 - 2016.06.04 > Fixed issue when calling new Fogs with Plugin Commands.
 *  v 1.07 - 2016.06.11 > Compatibility with Tile Priority.
 *                      > Fixed issue with crash at battle start.
 * ------------------------------------------------------------------------------
 */
/*:ja
 * @plugindesc v1.07 マップや戦闘にフォグやオーバーレイを表示できます
 * @author Victor Sant
 *
 * @param Max Fogs
 * @text フォグ最大数
 * @type number
 * @desc 同時フォグとオーバーレイ効果の最大数
 * デフォルト: 5
 * @default 5
 *
 * @help
 * 翻訳:ムノクラ
 * https://fungamemake.com/
 * https://twitter.com/munokura/
 *
 * 元プラグイン:
 * https://victorenginescripts.wordpress.com/rpg-maker-mv/fog-and-overlay/
 *
 *
 * ===========================================================================
 * 必要プラグイン
 * ===========================================================================
 *
 * このプラグインを使用するには、下記のプラグインが必要です。
 * - VE_BasicModule
 *
 *
 * ===========================================================================
 *  メモタグ
 * ===========================================================================
 *
 * ===========================================================================
 *  フォグ効果 (マップのメモタグ)
 * ---------------------------------------------------------------------------
 *  <fog effect>
 *   settings
 *  </fog effect>
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 * マップ上にフォグ効果を作成し、以下の値を情報に追加します。
 * idとnameを指定する必要がありますが、その他の値は任意です。
 *    id: n      : フォグID (数値)
 *    name: 's'  : フォグの画像ファイル名 ('ファイル名'を引用符で囲む)
 *    opacity: n : フォグの不透明度 (0-255)
 *    zoom: n%   : フォグの拡縮率 (100% = デフォルトサイズ)
 *    hue: n     : フォグの色相 (0-360)
 *    blend: n   : フォグの合成方法(0:通常、1:加算、2:減算)
 *    move x: n  : フォグの水平移動(数値、負の値にすることができます)
 *    move y: n  : フォグの垂直移動(数値、負の値にすることができます)
 *    pan x: n   : フォグの水平パン(数値)
 *    pan y: n   : フォグの垂直パン(数値)
 *    depth: n   : フォグの深さ
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *  例:
 *    <fog effect>
 *     id: 1
 *     name: 'Sky'
 *     opacity: 160
 *     hue: 100
 *     move x: 3
 *     move y: 2
 *    </fog effect>
 *
 *    <fog effect>
 *     id: 3
 *     name: '$Fog'
 *     opacity: 92
 *     zoom: 150%
 *     pan x: -5
 *     blend: 2
 *    </fog effect>
 * ===========================================================================
 *
 * ===========================================================================
 *  プラグインコマンド
 * ---------------------------------------------------------------------------
 *
 * ---------------------------------------------------------------------------
 *  FogEffect id name opacity hue blend depth
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *  マップ上にフォグ効果を表示します。
 *    id      : フォグID (数値)
 *    name    : フォグの画像ファイル名 (ファイル名にスペースを含められません)
 *    opacity : フォグの不透明度 (0-255)
 *    hue     : フォグの色相 (0-360)
 *    blend   : フォグの合成方法(0:通常、1:加算、2:減算)
 *    depth   : フォグの深さ (1-7、詳細は下記参照)
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *  例 : FogEffect 1 Sky 160 100 0 0
 *       FogEffect 2 $Fog 92 0 1 3
 * ---------------------------------------------------------------------------
 *
 * ---------------------------------------------------------------------------
 *  FogOpacity id opacity duration
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *  フォグ効果の不透明度を変更します。
 *    id      : フォグID (数値)
 *    opacity : フォグの不透明度 (0-255)
 *    duration : 不透明度変化の速度。 (フレーム数、無指定は0)
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *  例 : FogOpacity 1 92 60
 *       FogOpacity 2 0 120
 * ---------------------------------------------------------------------------
 *
 * ---------------------------------------------------------------------------
 *  FogMove id x y
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *    フォグ効果に連続的な動きを加えます。
 *      id : フォグID (数値)
 *      x  : フォグの水平移動(数値、負の値にすることができます)
 *      y  : フォグの垂直移動(数値、負の値にすることができます)
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *  例 : FogMove 1 5 -5
 *       FogMove 2 0 4
 * ---------------------------------------------------------------------------
 *
 * ---------------------------------------------------------------------------
 *  FogPan id x y
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *    フォグ効果のパン動作を変更します。
 *      id : フォグ効果ID (数値)
 *      x  : フォグ効果のパン水平移動(数値、負の値にすることができます)
 *      y  : フォグ効果のパン垂直移動(数値、負の値にすることができます)
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *  例 : FogPan 1 4 4
 *       FogPan 2 0 -5
 * ===========================================================================
 *
 * ===========================================================================
 * 追加情報
 * ---------------------------------------------------------------------------
 *
 *  - フォグの深さ
 * フォグの深さは、
 * オーバーレイ効果の上/下に表示されるオブジェクトの種類を表します。
 * 0から7までの8つの深さがあります。
 *
 *  マップ中:
 *   1: アニメーションの上
 *   2：飛行船/上のキャラの上
 *   3: 上のタイルの上
 *   4: 通常キャラの上に
 *   5: 下のキャラの上に
 *   6：下のタイルセットの上
 *   7: 視差の上
 *
 *  戦闘中:
 *   0,1,2,3,4：バトラーの上
 *   5：戦闘背景2の上
 *   6：戦闘背景1の上
 *   7: 背景の上(ブラー化マップ画像)
 *
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *
 *  - 戦闘中のフォグ
 * デフォルトではフォグはマップ上にのみ表示されます。
 * フォグのファイル名に接頭辞を追加することで、
 * 一部のフォグを戦闘中に表示させることができます。
 * フォグのファイル名に'$'を追加すると、マップとバトルにフォグが表示されます。
 * フォグのファイル名に'%'を追加すると、フォグは戦闘時にのみ表示されます。
 * 例えば、'%Clouds'という名前のフォグは、戦闘でのみ表示されます。
 *
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *
 *  - フォグの作成
 * フォグ画像はimg/fogs/フォルダに配置する必要があります。
 * この新しいフォルダを作成する必要があります。
 * フォグは、マップメモ欄にメモタグを追加するか、
 * プラグインコマンドを使用して作成できます。
 * プラグインコマンドで作成したフォグは、マップを離れると消えます。
 * プラグインコマンドを使用してメモタグで作成されたフォグを
 * IDで制御することもできますが、変更はマップを離れるとリセットされます。
 * 同じ深さにあるフォグは、IDに基づいてソートされます。
 * 高いIDを持つフォグは低いIDを持つフォグの上に表示されます。
 *
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *
 * 固定オーバーレイ(マップの動きに沿った)を作成する場合、
 * オーバーレイファイル名の先頭に'!'を追加します。
 * 例えば、'Over'という名前のオーバーレイは、'!Over'と名前を変更します。
 * この接頭辞は、戦闘や戦闘のみの接頭辞と組み合わせることができます。
 *
 * ===========================================================================
 *
 * ===========================================================================
 *  互換性
 * ---------------------------------------------------------------------------
 * - このプラグインと一緒に使用する場合、
 * 以下のプラグインは、このプラグインの下に配置する必要があります。
 *     VE - Tile Priority
 * ===========================================================================
 *
 * ===========================================================================
 *  Version History:
 * ---------------------------------------------------------------------------
 *  v 1.00 - 2015.12.07 > First release.
 *  v 1.01 - 2015.12.25 > Revised code for better performance.
 *                      > Added more depth options.
 *  v 1.02 - 2016.01.06 > Fixed issue with fogs not clearing.
 *  v 1.03 - 2016.01.27 > Fixed issue with loading games with fogs on the map.
 *  v 1.04 - 2016.03.12 > Fixed issue with stack call and battle fogs.
 *  v 1.05 - 2016.03.23 > Compatibility with Basic Module 1.16.
 *  v 1.06 - 2016.06.04 > Fixed issue when calling new Fogs with Plugin
 *                        Commands.
 *  v 1.07 - 2016.06.11 > Compatibility with Tile Priority.
 *                      > Fixed issue with crash at battle start.
 * ---------------------------------------------------------------------------
 */

(function () {

    //=============================================================================
    // Parameters
    //=============================================================================

    if (Imported['VE - Basic Module']) {
        var parameters = VictorEngine.getPluginParameters();
        VictorEngine.Parameters = VictorEngine.Parameters || {};
        VictorEngine.Parameters.FogAndOverlay = {};
        VictorEngine.Parameters.FogAndOverlay.MaxFogs = Number(parameters["Max Fogs"]) || 1;
    };

    //=============================================================================
    // ImageManager
    //=============================================================================

    /* Overwritten fucntion */
    Tilemap.prototype._compareChildOrder = function (a, b) {
        if ((a.z || 0) !== (b.z || 0)) {
            return (a.z || 0) - (b.z || 0);
        } else if ((a.y || 0) !== (b.y || 0)) {
            return (a.y || 0) - (b.y || 0);
        } else {
            return a.spriteId - b.spriteId;
        }
    };

    //=============================================================================
    // ImageManager
    //=============================================================================

    ImageManager.loadFog = function (filename, hue) {
        return this.loadBitmap('img/fogs/', filename, hue, true);
    };

    ImageManager.isBattleOnlyFog = function (filename) {
        var sign = filename.match(/^[\!\%]+/);
        return sign && sign[0].contains('%');
    };

    ImageManager.isBattleFog = function (filename) {
        var sign = filename.match(/^[\!\$]+/);
        return sign && sign[0].contains('$');
    };

    ImageManager.isFixedFog = function (filename) {
        var sign = filename.match(/^[\!\$\%]+/);
        return sign && sign[0].contains('!');
    };

    //=============================================================================
    // Game_Screen
    //=============================================================================

    VictorEngine.FogAndOverlay.clear = Game_Screen.prototype.clear;
    Game_Screen.prototype.clear = function () {
        VictorEngine.FogAndOverlay.clear.call(this);
        this.clearFogs();
    };

    VictorEngine.FogAndOverlay.GameScreenUpdate = Game_Screen.prototype.update;
    Game_Screen.prototype.update = function () {
        VictorEngine.FogAndOverlay.GameScreenUpdate.call(this);
        this.updateFogs();
    };

    Game_Screen.prototype.fog = function (fogId) {
        return this._fogs[fogId];
    };

    Game_Screen.prototype.clearFogs = function () {
        this._fogs = [];
    };

    Game_Screen.prototype.updateFogs = function () {
        this._fogs.forEach(function (fog) {
            if (fog) fog.update();
        });
    };

    Game_Screen.prototype.showFog = function (fogId, name, opacity, hue, blend, depth) {
        var fog = new Game_Fog();
        fog.show(name, opacity, hue, blend, depth);
        this._fogs[fogId] = fog;
    };

    Game_Screen.prototype.moveFog = function (fogId, x, y) {
        var fog = this.fog(fogId);
        if (fog) {
            fog.move(x, y);
        }
    };

    Game_Screen.prototype.panFog = function (fogId, x, y) {
        var fog = this.fog(fogId);
        if (fog) {
            fog.pan(x, y);
        }
    };

    Game_Screen.prototype.changeFogZoom = function (fogId, zoom, duration) {
        var fog = this.fog(fogId);
        if (fog) {
            fog.changeZoom(zoom, duration);
        }
    };

    Game_Screen.prototype.changeFogOpacity = function (fogId, opacity, duration) {
        var fog = this.fog(fogId);
        if (fog) {
            fog.changeOpacity(opacity, duration);
        }
    };

    Game_Screen.prototype.eraseFog = function (fogId) {
        this._fogs[fogId] = null;
    };

    Game_Screen.prototype.mapFog = function () {
        this._fogScene = 'map';
    };

    Game_Screen.prototype.battleFog = function () {
        this._fogScene = 'battle';
    };

    Game_Screen.prototype.fogScene = function () {
        return this._fogScene
    };

    //=============================================================================
    // Game_Map
    //=============================================================================

    VictorEngine.FogAndOverlay.setup = Game_Map.prototype.setup;
    Game_Map.prototype.setup = function (mapId) {
        VictorEngine.FogAndOverlay.setup.call(this, mapId);
        this.setupFogs();
    };

    VictorEngine.FogAndOverlay.setDisplayPos = Game_Map.prototype.setDisplayPos;
    Game_Map.prototype.setDisplayPos = function (x, y) {
        VictorEngine.FogAndOverlay.setDisplayPos.call(this, x, y);
        this._fogX = this.isLoopHorizontal() ? x : this._displayX;
        this._fogY = this.isLoopVertical() ? y : this._displayY;
    };

    VictorEngine.FogAndOverlay.scrollDown = Game_Map.prototype.scrollDown;
    Game_Map.prototype.scrollDown = function (distance) {
        var lastY = this._displayY;
        VictorEngine.FogAndOverlay.scrollDown.call(this, distance);
        this._fogY += this.isLoopVertical() ? distance : this._displayY - lastY;
    };

    VictorEngine.FogAndOverlay.scrollLeft = Game_Map.prototype.scrollLeft;
    Game_Map.prototype.scrollLeft = function (distance) {
        var lastX = this._displayX;
        VictorEngine.FogAndOverlay.scrollLeft.call(this, distance);
        this._fogX += this.isLoopHorizontal() ? -distance : this._displayX - lastX;
    };

    VictorEngine.FogAndOverlay.scrollRight = Game_Map.prototype.scrollRight;
    Game_Map.prototype.scrollRight = function (distance) {
        var lastX = this._displayX;
        VictorEngine.FogAndOverlay.scrollRight.call(this, distance);
        this._fogX += this.isLoopHorizontal() ? distance : this._displayX - lastX;
    };

    VictorEngine.FogAndOverlay.scrollUp = Game_Map.prototype.scrollUp;
    Game_Map.prototype.scrollUp = function (distance) {
        var lastY = this._displayY;
        VictorEngine.FogAndOverlay.scrollUp.call(this, distance);
        this._fogY += this.isLoopVertical() ? -distance : this._displayY - lastY;
    };

    Game_Map.prototype.fogX = function () {
        return this._fogX;
    };

    Game_Map.prototype.fogY = function () {
        return this._fogY;
    };

    Game_Map.prototype.setupFogs = function () {
        $gameScreen.clearFogs();
        var note = $dataMap.note;
        this._fogX = 0
        this._fogY = 0
        this.createFog(note);
    };

    Game_Map.prototype.createFog = function (note) {
        var regex = VictorEngine.getNotesValues('fog effect');
        var match;
        while (match = regex.exec(note)) {
            this.setupFog(match[1]);
        };
    };

    Game_Map.prototype.setupFog = function (note) {
        var name = String(this.fogName(note, new RegExp("name:[ ]*('[^\']+'|\"[^\"]+\")", 'gi'), ''));
        var id = Number(this.fogValue(note, new RegExp('id:[ ]*(\\d+)', 'gi'), 0));
        var op = Number(this.fogValue(note, new RegExp('opacity:[ ]*(\\d+)', 'gi'), 192));
        var zoom = Number(this.fogValue(note, new RegExp('zoom:[ ]*(\\d+)%?', 'gi'), 100));
        var hue = Number(this.fogValue(note, new RegExp('hue:[ ]*(\\d+)', 'gi'), 0));
        var blend = Number(this.fogValue(note, new RegExp('blend:[ ]*(\\d+)', 'gi'), 0));
        var moveX = Number(this.fogValue(note, new RegExp('move x:[ ]*([+-]?\\d+)', 'gi'), 0));
        var moveY = Number(this.fogValue(note, new RegExp('move y:[ ]*([+-]?\\d+)', 'gi'), 0));
        var panX = Number(this.fogValue(note, new RegExp('pan x:[ ]*(\\d+)', 'gi'), 0));
        var panY = Number(this.fogValue(note, new RegExp('pan y:[ ]*(\\d+)', 'gi'), 0));
        var depth = Number(this.fogValue(note, new RegExp('depth:[ ]*(\\d+)', 'gi'), 1));
        $gameScreen.showFog(id, name, op, hue, blend, depth);
        $gameScreen.moveFog(id, moveX, moveY);
        $gameScreen.panFog(id, panX, panY);
        $gameScreen.changeFogZoom(id, zoom, 0);
    };

    Game_Map.prototype.fogValue = function (note, regex, value) {
        var result = regex.exec(note);
        return result ? result[1] : value;
    };

    Game_Map.prototype.fogName = function (note, regex, value) {
        var result = regex.exec(note);
        return result ? result[1].slice(1, -1) : value;
    };

    //=============================================================================
    // Game_Interpreter
    //=============================================================================

    VictorEngine.FogAndOverlay.pluginCommand = Game_Interpreter.prototype.pluginCommand;
    Game_Interpreter.prototype.pluginCommand = function (command, args) {
        VictorEngine.FogAndOverlay.pluginCommand.call(this, command, args);
        if (command.toLowerCase() === 'fogeffect') {
            var id = Number(args[0]);
            var name = String(args[1]);
            var op = Number(args[2]);
            var hue = Number(args[3]) || 0;
            var blend = Number(args[4]) || 0;
            var depth = Number(args[5]) || 1;
            $gameScreen.showFog(id, name, op, hue, blend, depth)
        }
        if (command.toLowerCase() === 'fogmove') {
            var id = Number(args[0]);
            var x = Number(args[1]);
            var y = Number(args[2]);
            $gameScreen.moveFog(id, x, y)
        }
        if (command.toLowerCase() === 'fogpan') {
            var id = Number(args[0]);
            var x = Number(args[1]);
            var y = Number(args[2]);
            $gameScreen.panFog(id, x, y)
        }
        if (command.toLowerCase() === 'fogopacity') {
            var id = Number(args[0]);
            var op = Number(args[1]);
            var d = Number(args[2]) || 0;
            $gameScreen.changeFogOpacity(id, op, d)
        }
        if (command.toLowerCase() === 'fogzoom') {
            var id = Number(args[0]);
            var z = Number(args[1]);
            var d = Number(args[2]) || 0;
            $gameScreen.changeFogZoom(id, z, d)
        }
    };

    //=============================================================================
    // Spriteset_Base
    //=============================================================================

    VictorEngine.FogAndOverlay.createLowerLayer = Spriteset_Base.prototype.createLowerLayer;
    Spriteset_Base.prototype.createLowerLayer = function () {
        VictorEngine.FogAndOverlay.createLowerLayer.call(this);
        this._fogEffects = [];
    };

    VictorEngine.FogAndOverlay.SpritesetBaseUpdate = Spriteset_Base.prototype.update;
    Spriteset_Base.prototype.update = function () {
        VictorEngine.FogAndOverlay.SpritesetBaseUpdate.call(this);
        for (var i = 1; i < VictorEngine.Parameters.FogAndOverlay.MaxFogs; i++) {
            this.updateFogs(i);
        };
    };

    Spriteset_Base.prototype.updateFogs = function (fogId) {
        if (!this._fogEffects[fogId] && this.validFog(fogId)) {
            this.createFog(fogId);
            this.updateFog(fogId);
        } else if (this._fogEffects[fogId] && !this.validFog(fogId)) {
            this.deleteFog(fogId);
        } else if (this._fogEffects[fogId] && this.validFog(fogId)) {
            this.updateFog(fogId);
        }
    };

    Spriteset_Base.prototype.updateFog = function (fogId) {
        var sprite = this._fogEffects[fogId];
        var fog = $gameScreen.fog(fogId);
        if (sprite.fogName !== fog.name || sprite.fogHue !== fog.hue ||
            sprite.blendMode !== fog.blend || sprite.z !== fog.z) {
            this.deleteFog(fogId)
            this.createFog(fogId)
        }
        sprite.origin.x = Math.floor(fog.x);
        sprite.origin.y = Math.floor(fog.y);
        sprite.scale.x = fog.zoom;
        sprite.scale.y = fog.zoom;
        sprite.opacity = fog.opacity;
    };

    Spriteset_Base.prototype.setFogSpriteBitmap = function (sprite, bitmap) {
        sprite.bitmap = bitmap;
    };

    //=============================================================================
    // Spriteset_Map
    //=============================================================================

    Spriteset_Map.prototype.createFog = function (fogId) {
        var sprite = new TilingSprite();
        var fog = $gameScreen.fog(fogId);
        var bitmap = ImageManager.loadFog(fog.name, fog.hue);
        sprite.spriteId = sprite.spriteId || Sprite._counter++;
        sprite.bitmap = new Bitmap();
        sprite.fogName = fog.name;
        sprite.fogHue = fog.hue;
        sprite.blendMode = fog.blend;
        sprite.z = fog.z;
        sprite.move(0, 0, Graphics.width, Graphics.height);
        bitmap.addLoadListener(this.setFogSpriteBitmap.bind(this, sprite, bitmap));
        this._fogEffects[fogId] = sprite;
        if (fog.blend === 2 && fog.z > 3) {
            this.addChild(this._fogEffects[fogId]);
        } else {
            this._tilemap.addChild(this._fogEffects[fogId]);
        }
    };

    Spriteset_Map.prototype.deleteFog = function (fogId) {
        this._tilemap.removeChild(this._fogEffects[fogId]);
        this.removeChild(this._fogEffects[fogId]);
        this._fogEffects[fogId] = null;
    };

    Spriteset_Map.prototype.validFog = function (fogId) {
        var fog = $gameScreen.fog(fogId);
        if (!fog || fog.isBattleOnlyFog()) {
            return false;
        }
        return true;
    };

    //=============================================================================
    // Spriteset_Battle
    //=============================================================================

    VictorEngine.FogAndOverlay.createBattleback = Spriteset_Battle.prototype.createBattleback;
    Spriteset_Battle.prototype.createBattleback = function () {
        VictorEngine.FogAndOverlay.createBattleback.call(this)
        this._back1Sprite.z = 0
        this._back2Sprite.z = 1
    };

    VictorEngine.FogAndOverlay.updateSpritesetBattle = Spriteset_Battle.prototype.update;
    Spriteset_Battle.prototype.update = function () {
        VictorEngine.FogAndOverlay.updateSpritesetBattle.call(this);
        this.sortBattleSprites();
    };

    Spriteset_Battle.prototype.createFog = function (fogId) {
        var sprite = new TilingSprite();
        var fog = $gameScreen.fog(fogId);
        var bitmap = ImageManager.loadFog(fog.name, fog.hue);
        sprite.spriteId = sprite.spriteId || Sprite._counter++;
        sprite.bitmap = new Bitmap();
        sprite.bitmap = ImageManager.loadFog(fog.name, fog.hue);
        sprite.fogName = fog.name;
        sprite.fogHue = fog.hue;
        sprite.blendMode = fog.blend;
        sprite.z = fog.z;
        sprite.move(0, 0, Graphics.width, Graphics.height);
        bitmap.addLoadListener(this.setFogSpriteBitmap.bind(this, sprite, bitmap));
        this._fogEffects[fogId] = sprite;
        if (fog.blend === 2 && fog.z > 3) {
            this.addChild(this._fogEffects[fogId]);
        } else {
            this._battleField.addChild(this._fogEffects[fogId]);
        }
    };

    Spriteset_Battle.prototype.deleteFog = function (fogId) {
        this._battleField.removeChild(this._fogEffects[fogId]);
        this.removeChild(this._fogEffects[fogId]);
        this._fogEffects[fogId] = null;
    };

    Spriteset_Battle.prototype.validFog = function (fogId) {
        var fog = $gameScreen.fog(fogId);
        if (!fog || !fog.isBattleFog()) {
            return false;
        }
        return true;
    };

})();

//=============================================================================
// Game_Fog
//=============================================================================

function Game_Fog() {
    this.initialize.apply(this, arguments);
}

Game_Fog.prototype.constructor = Game_Fog;

(function () {

    Object.defineProperties(Game_Fog.prototype, {
        x: {
            get: function () {
                return this._x;
            },
            configurable: true
        },
        y: {
            get: function () {
                return this._y;
            },
            configurable: true
        },
        hue: {
            get: function () {
                return this._hue;
            },
            configurable: true
        },
        name: {
            get: function () {
                return this._name;
            },
            configurable: true
        },
        zoom: {
            get: function () {
                return this._zoom;
            },
            configurable: true
        },
        blend: {
            get: function () {
                return this._blend;
            },
            configurable: true
        },
        opacity: {
            get: function () {
                return this._opacity;
            },
            configurable: true
        },
        z: {
            get: function () {
                var values = [9, 9, 6, 4, 3.5, 2, 1, -1];
                return values[this._depth] || 9;
            },
            configurable: true
        }
    });

    Game_Fog.prototype.initialize = function () {
        this.initBasic();
    };

    Game_Fog.prototype.isBattleFog = function () {
        return this._battleFog || this._battleOnly;
    };

    Game_Fog.prototype.isBattleOnlyFog = function () {
        return this._battleOnly;
    };

    Game_Fog.prototype.initBasic = function () {
        this.erase();
        this._x = 0;
        this._y = 0;
        this._sX = 0;
        this._sY = 0;
        this._zoomTarget = 192;
        this._zoomDuration = 0;
        this._opacityTarget = 192;
        this._opacityDuration = 0;
    };

    Game_Fog.prototype.show = function (name, opacity, hue, blend, depth) {
        this._name = name;
        this._hue = hue;
        this._blend = blend;
        this._depth = depth;
        this._opacity = opacity;
        this._fixed = ImageManager.isFixedFog(name);
        this._battleFog = ImageManager.isBattleFog(name);
        this._battleOnly = ImageManager.isBattleOnlyFog(name);
        this.update();
    };

    Game_Fog.prototype.erase = function () {
        this._name = '';
        this._hue = 0;
        this._blend = 0;
        this._moveX = 0;
        this._moveY = 0;
        this._depth = 1;
        this._panX = 1;
        this._panY = 1;
        this._zoom = 1;
        this._fixed = false;
        this._opacity = 192;
        this._battleFog = false;
        this._battleOnly = false;
    };

    Game_Fog.prototype.update = function () {
        this.updateMove();
        this.updateZoom();
        this.updateOpacity();
    };

    Game_Fog.prototype.pan = function (x, y) {
        this._panX = Math.max((10 + x) / 10, 1);
        this._panY = Math.max((10 + y) / 10, 1);
    };

    Game_Fog.prototype.move = function (x, y) {
        this._moveX = x;
        this._moveY = y;
    };

    Game_Fog.prototype.changeOpacity = function (opacity, duration) {
        this._opacityTarget = opacity;
        this._opacityDuration = duration;
        if (duration === 0) this._opacity = this._opacityTarget;
    };

    Game_Fog.prototype.changeZoom = function (zoom, duration) {
        this._zoomTarget = zoom / 100;
        this._zoomDuration = duration;
        if (duration === 0) {
            this._zoom = this._zoomTarget;
        }
    };

    Game_Fog.prototype.updateMove = function () {
        this._sX += this._moveX / $gameMap.tileWidth() / 2;
        this._sY += this._moveY / $gameMap.tileHeight() / 2;
        var mapX = $gameMap.fogX();
        var mapY = $gameMap.fogY();
        var tileW = $gameMap.tileWidth();
        var tileH = $gameMap.tileHeight();
        if (this._fixed) {
            this._x = (mapX + this._sX) * tileW;
            this._y = (mapY + this._sY) * tileH;
        } else {
            this._x = (mapX * this._panX + this._sX) * tileW / 2;
            this._y = (mapY * this._panY + this._sY) * tileH / 2;
        }
    };

    Game_Fog.prototype.updateOpacity = function () {
        if (this._opacityDuration > 0) {
            var d = this._opacityDuration;
            this._opacity = (this._opacity * (d - 1) + this._opacityTarget) / d;
            this._opacityDuration--;
        }
    };

    Game_Fog.prototype.updateZoom = function () {
        if (this._zoomDuration > 0) {
            var d = this._zoomDuration;
            this._zoom = (this._zoom * (d - 1) + this._zoomTarget) / d;
            this._zoomDuration--;
        }
    };

})();

repo_name: dazed/translations

license: unknown


code:
/*
 * ==============================================================================
 * ** Victor Engine MV - Skip Battle Log
 * ------------------------------------------------------------------------------
 * VE_SkipBattleLog.js
 * ==============================================================================
 */

var Imported = Imported || {};
Imported['VE - Skip Battle Log'] = '1.04';

var VictorEngine = VictorEngine || {};
VictorEngine.SkipBattleLog = VictorEngine.SkipBattleLog || {};

(function () {

    VictorEngine.SkipBattleLog.loadDatabase = DataManager.loadDatabase;
    DataManager.loadDatabase = function () {
        VictorEngine.SkipBattleLog.loadDatabase.call(this);
        PluginManager.requiredPlugin.call(PluginManager, 'VE - Skip Battle Log', 'VE - Basic Module', '1.21');
        PluginManager.requiredPlugin.call(PluginManager, 'VE - Skip Battle Log', 'VE - Charge Actions');
    };

    VictorEngine.SkipBattleLog.requiredPlugin = PluginManager.requiredPlugin;
    PluginManager.requiredPlugin = function (name, required, version) {
        if (!VictorEngine.BasicModule) {
            var msg = 'The plugin ' + name + ' requires the plugin ' + required;
            msg += ' v' + version + ' or higher installed to work properly.';
            msg += ' Go to http://victorenginescripts.wordpress.com/ to download the plugin.';
            throw new Error(msg);
        } else {
            VictorEngine.SkipBattleLog.requiredPlugin.call(this, name, required, version)
        };
    };

})();

/*:
 * @plugindesc v1.04 - Skip Battle Log Window messages.
 * @author Victor Sant
 *
 * @param Skip All Text
 * @desc Skip any battle log text.
 * true - ON	false - OFF
 * @default true
 *
 * @param Action Text
 * @desc Display skill icon and name.
 * true - ON	false - OFF
 * @default true
 *
 * @help
 * ==============================================================================
 *  Notetags:
 * ==============================================================================
 *
 * ==============================================================================
 *  Throw Image (for Skills and Items)
 * ------------------------------------------------------------------------------
 *  <hide name display>
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *  Usable only if the plugin parameter 'Action Text' is turned ON. This
 *  tag will make the action name to not be displayed when it is used.
 * ==============================================================================
 *
 * ==============================================================================
 * Additional Information:
 * ------------------------------------------------------------------------------
 *
 *  If the plugin parameter "Skip All Text" is turned on, every battle log text
 *  will be skiped. If false, you can define wich texts will be skiped.
 *
 *  To skip a text if the plugin parameter is off, just leave the text empty on
 *  the database.
 *  For skills (wich include the basic attack and guard) and states message,
 *  just go to the the skill or state and remove the messages.
 *
 *  For other texts, go to the database 'Terms' tab and remove the texts related
 *  to the battle log. The texts that are displayed on the battlelog are:
 *  - Use Item
 *  - Critical to Enemy
 *  - Critical to Actor
 *  - Actor Damage
 *  - Actor Recovery
 *  - Actor Gain
 *  - Actor Loss
 *  - Actir Drain
 *  - Actor No Damage
 *  - Actor No Hit
 *  - Enemy Damage
 *  - Enemy Recovery
 *  - Enemy Gain
 *  - Enemy Loss
 *  - Enemy Drain
 *  - Enemy No Damage
 *  - Enemy No Hit
 *  - Evasion
 *  - Magic Evasion
 *  - Magic Reflection
 *  - Counter Attack
 *  - Substitute
 *  - Buff Add
 *  - Debuff Add
 *  - Buff Remove
 *  - Action Failure
 *  Other texts are show in other parts besides the Battle Log, so they shoudn't
 *  be removed.
 *
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *
 *  If the plugin paramenter 'Action Text' is turned on, when using a skill or
 *  item, the item/skill name will be displayed, along with it's icon, insted
 *  of the default skill text set on the database. This text will be displayed
 *  even if the
 *
 * ==============================================================================
 *  Compatibility:
 * ------------------------------------------------------------------------------
 *  To be used together with this plugin, the following plugin must be placed
 *  bellow this plugin:
 *     VE - Charge Actions
 * ==============================================================================
 *
 * ==============================================================================
 *  Version History:
 * ------------------------------------------------------------------------------
 *  v 1.00 - 2016.01.17 > First release.
 *  v 1.01 - 2016.03.04 > Improved collapse effect timing.
 *  v 1.02 - 2016.03.23 > Compatibility with Throwable Objects.
 *  v 1.03 - 2016.04.21 > Compatibility with Damage Popup.
 *  v 1.04 - 2016.05.31 > Compatibility with Battle Motions.
 * ==============================================================================
 */
/*:ja
 * @plugindesc v1.04 - バトルログウィンドウのメッセージを非表示にします
 * @author Victor Sant
 *
 * @param Skip All Text
 * @text 全テキストを非表示
 * @type boolean
 * @on 非表示
 * @off 表示
 * @desc バトルログのテキストを非表示
 * 非表示:true / 表示:false
 * @default true
 *
 * @param Action Text
 * @text アクションテキスト表示
 * @type boolean
 * @on 表示
 * @off 非表示
 * @desc スキルアイコンと名前を表示
 * 表示:true / 非表示:false
 * @default true
 *
 * @help
 * 翻訳:ムノクラ
 * https://fungamemake.com/
 * https://twitter.com/munokura/
 *
 * 元プラグイン:
 * https://victorenginescripts.wordpress.com/rpg-maker-mv/skip-battle-log/
 *
 * ===========================================================================
 * 必要プラグイン
 * ===========================================================================
 *
 * このプラグインを使用するには、下記のプラグインが必要です。
 * - VE_BasicModule
 *
 *
 * ===========================================================================
 *  メモタグ
 * ===========================================================================
 *
 * ===========================================================================
 *  非表示(スキル・アイテム用)
 * ---------------------------------------------------------------------------
 *  <hide name display>
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 * プラグインのパラメータ'Action Text'がONになっている場合のみ使用可能です。
 * このタグを使用すると、アクション名を表示しないようにします。
 * ===========================================================================
 *
 * ===========================================================================
 * 追加情報
 * ---------------------------------------------------------------------------
 *
 * プラグインパラメータ'Skip All Text'がオンになっている場合、
 * 全てのバトルログテキストが非表示になります。
 * falseの場合、どのテキストを非表示にするか設定できます。
 *
 * プラグインのパラメータがオフの場合、テキストを非表示にするには、
 * データベース上にテキストを空のままにしておきます。
 * スキル(通常攻撃と防御を含む)とステートのメッセージについては、
 * そのスキルかステートでメッセージを削除してください。
 *
 * その他のテキストについては、データベースの'用語'タブに移動し、
 * バトルログに関連するメッセージを削除してください。
 * バトルログに表示されるメッセージ項目は以下の通りです。
 *  - アイテム使用
 *  - 敵に会心
 *  - 味方に会心
 *  - 味方ダメージ
 *  - 味方回復
 *  - 味方ポイント増加
 *  - 味方ポイント減少
 *  - 味方ポイント吸収
 *  - 味方ノーダメージ
 *  - 味方に命中せず
 *  - 敵ダメージ
 *  - 敵回復
 *  - 敵ポイント増加
 *  - 敵ポイント減少
 *  - 敵ポイント吸収
 *  - 敵ノーダメージ
 *  - 敵に命中せず
 *  - 回避
 *  - 魔法回避
 *  - 魔法反射
 *  - 反撃
 *  - 身代わり
 *  - 強化
 *  - 弱体
 *  - 強化・弱体の解除
 *  - 行動失敗
 * 他のテキストはバトルログ以外の部分にも表示されているので、
 * 削除してはいけません。
 *
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *
 * プラグインのパラメータ'Action Text'を有効にすると、
 * スキルやアイテムを使用する際に、
 * データベース上のデフォルトのスキルテキストの他に、
 * アイテム/スキル名とそのアイコンが表示されます。
 *
 * ===========================================================================
 *  互換性
 * ---------------------------------------------------------------------------
 * 本プラグインと併用するためには、
 * 以下のプラグインを本プラグインの下に配置する必要があります。
 *     VE - Charge Actions
 * ===========================================================================
 *
 * ===========================================================================
 *  Version History:
 * ---------------------------------------------------------------------------
 *  v 1.00 - 2016.01.17 > First release.
 *  v 1.01 - 2016.03.04 > Improved collapse effect timing.
 *  v 1.02 - 2016.03.23 > Compatibility with Throwable Objects.
 *  v 1.03 - 2016.04.21 > Compatibility with Damage Popup.
 *  v 1.04 - 2016.05.31 > Compatibility with Battle Motions.
 * ===========================================================================
 */

(function () {

    //=============================================================================
    // Parameters
    //=============================================================================

    if (Imported['VE - Basic Module']) {
        var parameters = VictorEngine.getPluginParameters();
        VictorEngine.Parameters = VictorEngine.Parameters || {};
        VictorEngine.Parameters.SkipBattleLog = {};
        VictorEngine.Parameters.SkipBattleLog.SkipAllText = eval(parameters["Skip All Text"]);
        VictorEngine.Parameters.SkipBattleLog.ActionText = eval(parameters["Action Text"]);
    };

    //=============================================================================
    // VictorEngine
    //=============================================================================

    VictorEngine.SkipBattleLog.loadNotetagsValues = VictorEngine.loadNotetagsValues;
    VictorEngine.loadNotetagsValues = function (data, index) {
        VictorEngine.SkipBattleLog.loadNotetagsValues.call(this, data, index);
        if (this.objectSelection(index, ['skill', 'item'])) {
            VictorEngine.SkipBattleLog.loadNotes(data);
        }
    };

    VictorEngine.SkipBattleLog.loadNotes = function (data) {
        var match;
        var regex = new RegExp('<hide name display>', 'gi');
        while (match = regex.exec(data.note)) {
            data.hideNameDisplay = true;
        };
    };

    //=============================================================================
    // Game_Action
    //=============================================================================

    VictorEngine.SkipBattleLog.apply = Game_Action.prototype.apply;
    Game_Action.prototype.apply = function (target) {
        this.subject()._skipClearResult = true;
        VictorEngine.SkipBattleLog.apply.call(this, target);
        this.subject()._skipClearResult = false;
    };

    //=============================================================================
    // Game_Battler
    //=============================================================================

    VictorEngine.SkipBattleLog.clearResult = Game_Battler.prototype.clearResult;
    Game_Battler.prototype.clearResult = function () {
        if (!this._skipClearResult) {
            VictorEngine.SkipBattleLog.clearResult.call(this);
        }
    };

    //=============================================================================
    // Window_BattleLog
    //=============================================================================

    /* Overwritten function */
    Window_BattleLog.prototype.isFastForward = function () {
        return false;
    };

    /* Overwritten function */
    Window_BattleLog.prototype.animationBaseDelay = function () {
        return 0;
    };

    /* Overwritten function */
    Window_BattleLog.prototype.animationNextDelay = function () {
        return 0;
    };

    VictorEngine.SkipBattleLog.initialize = Window_BattleLog.prototype.initialize;
    Window_BattleLog.prototype.initialize = function () {
        this.initializeMethodsStack()
        VictorEngine.SkipBattleLog.initialize.call(this);
    };

    VictorEngine.SkipBattleLog.updateWaitMode = Window_BattleLog.prototype.updateWaitMode;
    Window_BattleLog.prototype.updateWaitMode = function () {
        if (this._waitMode === 'effect' && !$gameTroop.isAllDead()) {
            this._waitMode = '';
        }
        return VictorEngine.SkipBattleLog.updateWaitMode.call(this);
    };

    VictorEngine.SkipBattleLog.addText = Window_BattleLog.prototype.addText;
    Window_BattleLog.prototype.addText = function (text) {
        if (text !== "" && !VictorEngine.Parameters.SkipBattleLog.SkipAllText) {
            VictorEngine.SkipBattleLog.addText.call(this, text);
        }
    };

    VictorEngine.SkipBattleLog.drawLineText = Window_BattleLog.prototype.drawLineText;
    Window_BattleLog.prototype.drawLineText = function (index) {
        var item = this._lines[index];
        if (DataManager.isItem(item) || DataManager.isSkill(item)) {
            var rect = this.itemRectForText(index);
            var width = this.textWidth(item.name + Window_Base._iconWidth + 4);
            this.drawItemName(item, rect.width / 2 - width / 2, rect.y);
        } else {
            VictorEngine.SkipBattleLog.drawLineText.call(this, index);
        }
    };

    VictorEngine.SkipBattleLog.displayAction = Window_BattleLog.prototype.displayAction;
    Window_BattleLog.prototype.displayAction = function (subject, item) {
        if (VictorEngine.Parameters.SkipBattleLog.ActionText) {
            if (!item.hideNameDisplay) {
                this.push('pushBaseLine');
                this.push('addItemText', item);
                this.push('popBaseLine');
            } else {
                this.push('wait');
            }
        } else {
            VictorEngine.SkipBattleLog.displayAction.call(this, subject, item);
        }
    };

    VictorEngine.SkipBattleLog.startAction = Window_BattleLog.prototype.startAction;
    Window_BattleLog.prototype.startAction = function (subject, action, targets) {
        VictorEngine.SkipBattleLog.startAction.call(this, subject, action, targets);
        this.setupStartAction(subject, action, targets);
    };

    VictorEngine.SkipBattleLog.push = Window_BattleLog.prototype.push;
    Window_BattleLog.prototype.push = function (methodName) {
        if (this._stackIndex || this.methodStackActive()) {
            this.pushMethodsStack.apply(this, arguments);
        } else {
            VictorEngine.SkipBattleLog.push.apply(this, arguments);
        }
    };

    VictorEngine.SkipBattleLog.update = Window_BattleLog.prototype.update;
    Window_BattleLog.prototype.update = function () {
        if (this.methodStackActive() && !Imported['VE - Battle Motions']) {
            this.updateMethodsStack();
        } else {
            VictorEngine.SkipBattleLog.update.call(this);
        }
    };

    VictorEngine.SkipBattleLog.isBusy = Window_BattleLog.prototype.isBusy;
    Window_BattleLog.prototype.isBusy = function () {
        return VictorEngine.SkipBattleLog.isBusy.call(this) || this.methodStackActive();
    };

    VictorEngine.SkipBattleLog.updateWait = Window_BattleLog.prototype.updateWait;
    Window_BattleLog.prototype.updateWait = function () {
        return VictorEngine.SkipBattleLog.updateWait.call(this) || this.methodStackActive();
    };

    VictorEngine.SkipBattleLog.updateStackWaitMode = Window_BattleLog.prototype.updateStackWaitMode;
    Window_BattleLog.prototype.updateStackWaitMode = function (index) {
        var waitMode = this._stackWaitMode[index];
        if (waitMode && waitMode.contains('effect') && !$gameTroop.isAllDead()) {
            this.removeWaitMode(index, 'effect');
        }
        return VictorEngine.SkipBattleLog.updateStackWaitMode.call(this, index);
    };

    Window_BattleLog.prototype.addItemText = function (item) {
        this._lines.push(item);
        this.refresh();
        this.wait();
    };

})();


code:
//=============================================================================
// VariableControlItem.js
// ----------------------------------------------------------------------------
// (C)2016 Triacontane
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
// ----------------------------------------------------------------------------
// Version
// 1.2.0 2020/11/23 変数操作の実行条件に実行者を指定できる機能を追加
// 1.1.1 2017/04/19 範囲が「なし」の場合も操作できるよう修正
// 1.1.0 2016/10/21 加算と代入を別々のメモ欄で設定できるよう変更
// 1.0.0 2016/10/21 初版
// ----------------------------------------------------------------------------
// [Blog]   : https://triacontane.blogspot.jp/
// [Twitter]: https://twitter.com/triacontane/
// [GitHub] : https://github.com/triacontane/
//=============================================================================

/*:
 * @plugindesc VariableControlItemPlugin
 * @author triacontane
 *
 * @help アイテムもしくはスキルを使用し、かつ
 * 行動が成功した場合に、変数を操作できます。
 *
 * アイテムもしくはスキルのメモ欄に以下の通り指定してください。
 *
 * <VCI変数番号:3>  # 変数番号[3]に値を設定します。
 * <VCIVarNumber:3> # 同上
 * <VCI代入値:5>    # 指定した変数に値[5]を代入します。
 * <VCISetValue:5>  # 同上
 * <VCI加算値:5>    # 指定した変数に値[5]を加算します。
 * <VCIAddValue:5>  # 同上
 * <VCI実行者:actor>   # 実行者がアクターの場合のみ変数操作します。
 * <VCISubject:actor> # 同上
 * <VCI実行者:enemy>   # 実行者が敵キャラの場合のみ変数操作します。
 * <VCISubject:enemy> # 同上
 * ※加算値に負の値を指定すると減算になります。
 *
 * 設定値は、制御文字を適用した上でJavaScript計算式として評価されます。
 * たとえば、アイテムの使用で変数[1]に[5]を乗算したい場合は以下の通り設定します。
 * <VCI変数番号:1>
 * <VCI代入値:\v[1] * 5> # 変数[1]の値に[5]を乗算した結果を変数[1]に設定
 *
 * このプラグインにはプラグインコマンドはありません。
 */
/*:ja
 * @plugindesc 変数操作アイテムプラグイン
 * @author トリアコンタン
 *
 * @help アイテムもしくはスキルを使用し、かつ
 * 行動が成功した場合に、変数を操作できます。
 *
 * アイテムもしくはスキルのメモ欄に以下の通り指定してください。
 *
 * <VCI変数番号:3>  # 変数番号[3]に値を設定します。
 * <VCIVarNumber:3> # 同上
 * <VCI代入値:5>    # 指定した変数に値[5]を代入します。
 * <VCISetValue:5>  # 同上
 * <VCI加算値:5>    # 指定した変数に値[5]を加算します。
 * <VCIAddValue:5>  # 同上
 * <VCI実行者:actor>   # 実行者がアクターの場合のみ変数操作します。
 * <VCISubject:actor> # 同上
 * <VCI実行者:enemy>   # 実行者が敵キャラの場合のみ変数操作します。
 * <VCISubject:enemy> # 同上
 * ※加算値に負の値を指定すると減算になります。
 *
 * 設定値は、制御文字を適用した上でJavaScript計算式として評価されます。
 * たとえば、アイテムの使用で変数[1]に[5]を乗算したい場合は以下の通り設定します。
 * <VCI変数番号:1>
 * <VCI代入値:\v[1] * 5> # 変数[1]の値に[5]を乗算した結果を変数[1]に設定
 *
 * このプラグインにはプラグインコマンドはありません。
 *
 * 利用規約：
 *  作者に無断で改変、再配布が可能で、利用形態（商用、18禁利用等）
 *  についても制限はありません。
 *  このプラグインはもうあなたのものです。
 */

(function() {
    'use strict';
    var metaTagPrefix = 'VCI';

    var getArgNumber = function(arg, min, max) {
        if (arguments.length < 2) min = -Infinity;
        if (arguments.length < 3) max = Infinity;
        return (parseInt(convertEscapeCharacters(arg), 10) || 0).clamp(min, max);
    };

    var getArgEval = function(arg, min, max) {
        if (arguments.length < 2) min = -Infinity;
        if (arguments.length < 3) max = Infinity;
        return (eval(convertEscapeCharacters(arg)) || 0).clamp(min, max);
    };

    var getMetaValue = function(object, name) {
        var metaTagName = metaTagPrefix + (name ? name : '');
        return object.meta.hasOwnProperty(metaTagName) ? object.meta[metaTagName] : undefined;
    };

    var getMetaValues = function(object, names) {
        if (!Array.isArray(names)) return getMetaValue(object, names);
        for (var i = 0, n = names.length; i < n; i++) {
            var value = getMetaValue(object, names[i]);
            if (value !== undefined) return value;
        }
        return undefined;
    };

    var convertEscapeCharacters = function(text) {
        if (text == null) text = '';
        var windowLayer = SceneManager._scene._windowLayer;
        return windowLayer ? windowLayer.children[0].convertEscapeCharacters(text) : text;
    };

    //=============================================================================
    // Game_Action
    //  行動が成功した場合、変数の操作を実行します。
    //=============================================================================
    var _Game_Action_applyItemUserEffect      = Game_Action.prototype.applyItemUserEffect;
    Game_Action.prototype.applyItemUserEffect = function(target) {
        _Game_Action_applyItemUserEffect.apply(this, arguments);
        if (!this.isForNone()) {
            this.applyVariableControl();
        }
    };

    var _Game_Action_applyGlobal      = Game_Action.prototype.applyGlobal;
    Game_Action.prototype.applyGlobal = function(target) {
        _Game_Action_applyGlobal.apply(this, arguments);
        if (this.isForNone()) {
            this.applyVariableControl();
        }
    };

    Game_Action.prototype.isForNone = function() {
        return this.checkItemScope([0]);
    };

    Game_Action.prototype.applyVariableControl = function() {
        if (!this.isVariableControlSubject()) {
            return;
        }
        var varNumberStr = getMetaValues(this.item(), ['VarNumber', '変数番号']);
        if (varNumberStr) {
            var varNumber = getArgNumber(varNumberStr, 0);
            var setValue   = getMetaValues(this.item(), ['SetValue', '代入値']);
            if (setValue) {
                $gameVariables.setValue(varNumber, getArgEval(setValue));
                return;
            }
            var addValue   = getMetaValues(this.item(), ['AddValue', '加算値']);
            if (addValue) {
                var originalValue = $gameVariables.value(varNumber);
                $gameVariables.setValue(varNumber, originalValue + getArgEval(addValue));
            }
        }
    };

    Game_Action.prototype.isVariableControlSubject = function() {
        var subject = getMetaValues(this.item(), ['Subject', '実行者']);
        if (!subject || subject === true) {
            return true;
        }
        subject = subject.toLowerCase();
        if (subject === 'actor' && this._subjectEnemyIndex >= 0) {
            return false;
        }
        if (subject === 'enemy' && this._subjectActorId > 0) {
            return false;
        }
        return true;
    };
})();


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();
  };

})();