code:
//=============================================================================
// KNH_CharacterShadow.js
//=============================================================================

/*:
 * @plugindesc キャラクターに影をつけるプラグイン
 * @author こんにちは
 *
 * @version 1.0.0 2017/10/28 公開
 * 1.0.1 2017/10/29 パーティが0人の時などにエラーが発生する不具合を修正
 * 1.0.2 2018/10/23 隊列非表示時またはパーティからメンバーを外した際にも隊列の影が表示される不具合を修正
 *
 * @param 影画像
 * @desc 影画像を指定。img/systemに保存する。
 * @default
 * @type file
 * @require 1
 * @dir img/system
 *
 * @help キャラクターの下に影をつけます。
 * 影画像が必要です。img/system に保存し、プラグインパラメータで指定してください。
 *
 * ●プレイヤーや隊列メンバーに影を設定する方法
 *
 * データベース → アクター の「メモ」に下のいずれかを記入します。
 * 【】内を記入してください。「\v[1]」等使用できます。
 *
 * 【<KNHShadow>】            アクターに影を表示する
 * 【<KNHShadow:5,-10,150>】  影のX座標を 5 、Y座標を -10 ずらし
 *                            大きさを 1.5 倍にして表示する
 *
 * ●イベントに影を設定する方法
 *
 * イベントの「メモ」、またはイベントコマンド「注釈」内に上記と同じ方法で
 * 記入します。メモ欄の場合は全てのページで、注釈の場合は
 * そのイベントページでのみ適用されます。
 *
 * ※注意
 * キャラクターが透明化 ON の場合表示されません。
 * キャラクターの不透明度を変更した場合、影も同じ不透明度となります。
 * キャラクター画像をなしに設定しても、影だけ表示することができます。
 *
 * ●影の表示切り替えや位置・大きさの変更
 *
 * 変更したいイベント(またはプレイヤー)の「移動ルートの設定」内の「スクリプト」に
 * 記入します。【】内を記入してください。
 *
 * 【this.setShadow(true)】           影を表示する
 * 【this.setShadow(false)】          影を表示しない
 * 【this.setShadowPosition(-5, 8)】  影の表示位置のX座標を -5、Y座標を 8 ずらす
 * 【this.setShadowPosition(0, 0)】   影の表示位置のずれを無くす
 * 【this.setShadowScale(80)】        影の大きさを 0.8 倍にする
 * 【this.setShadowScale(100)】       影の大きさを通常に戻す
 *
 * ●プラグインコマンド    なし
 *
 * ●利用規約
 *   特に無いです。
 */

(function() {
    'use strict';
    var pluginName = 'KNH_CharacterShadow';

    var getNumber = function(text, max, min) {
        text = applyCharacters(text);
        if (isNaN(text)) return NaN;
        return Math.max(Math.min(Number(text), max || Infinity), min || -Infinity);
    };

    var getArrayString = function(text) {
        var values = applyCharacters(text).split(',');
        for (var i = 0; i < values.length; i++) {
            values[i] = values[i].trim();
            if (!isNaN(values[i])) values[i] = Number(values[i]);
        }
        return values;
    };

    var applyCharacters = function(text) {
        if (text === null) text = '';
        text = '' + text;
        text = text.replace(/\\/g, '\x1b');
        text = text.replace(/\x1b\x1b/g, '\\');
        text = text.replace(/\x1bV\[(\d+)\]/gi, function() {
            return $gameVariables.value(parseInt(arguments[1], 10));
        }.bind(this));
        text = text.replace(/\x1bV\[(\d+)\]/gi, function() {
            return $gameVariables.value(parseInt(arguments[1], 10));
        }.bind(this));
        text = text.replace(/\x1bN\[(\d+)\]/gi, function() {
            var actor = parseInt(arguments[1], 10) >= 1 ? $gameActors.actor(parseInt(arguments[1], 10)) : null;
            return actor ? actor.name() : '';
        }.bind(this));
        text = text.replace(/\x1bP\[(\d+)\]/gi, function() {
            var actor = parseInt(arguments[1], 10) >= 1 ? $gameParty.members()[parseInt(arguments[1], 10) - 1] : null;
            return actor ? actor.name() : '';
        }.bind(this));
        if ($dataSystem) text = text.replace(/\x1bG/gi, TextManager.currencyUnit);
        return text;
    };

    var getMeta = function(text, str) {
        var re = /<([^<>:]+)(:?)([^>]*)>/g;
        var meta = {};
        for (;;) {
            var match = re.exec(text);
            if (match) {
                if (match[2] === ':') {
                    meta[match[1]] = match[3];
                } else {
                    meta[match[1]] = true;
                }
            } else {
                break;
            }
        }
        return meta['' + str];
    }

     var getShadowInfo = function(text) {
        if (text.contains('<KNHShadow>')) {
            return [true];
        } else if (getMeta(text, 'KNHShadow')) {
            return [true].concat(getArrayString(getMeta(text, 'KNHShadow')));
        } else {
            return false;
        }
    };

    //-----------------------------------------------------------------------------
    // プラグインパラメータの取得
    //-----------------------------------------------------------------------------

    var KNH_shadowImage = PluginManager.parameters(pluginName)['影画像'];

    //-----------------------------------------------------------------------------
    //  Game_CharacterBase
    //-----------------------------------------------------------------------------

    var _Game_CharacterBase_initMembers = Game_CharacterBase.prototype.initMembers;
    Game_CharacterBase.prototype.initMembers = function() {
        _Game_CharacterBase_initMembers.apply(this, arguments);
        this._shadow = false;
        this._shadowAddX = 0;
        this._shadowAddY = 0;
        this._shadowScale = 100;
    };

    Game_CharacterBase.prototype.setShadow = function(shadow) {
        this._shadow = !!shadow;
    };

    Game_CharacterBase.prototype.setShadowPosition = function(addX, addY) {
        this._shadowAddX = addX || 0;
        this._shadowAddY = addY || 0;
    };

    Game_CharacterBase.prototype.setShadowScale = function(scale) {
        this._shadowScale = scale || 100;
    };

    Game_CharacterBase.prototype.setShadowInfo = function(info) {
        if (!info) info = [false];
        this.setShadow(!!info[0] || false);
        this.setShadowPosition(info[1] || 0, info[2] || 0);
        this.setShadowScale(info[3] || 100);
    };

    //-----------------------------------------------------------------------------
    // Game_Event
    //-----------------------------------------------------------------------------

    var _Game_Event_setupPageSettings = Game_Event.prototype.setupPageSettings;
    Game_Event.prototype.setupPageSettings = function() {
        _Game_Event_setupPageSettings.call(this);
        this.setupShadow();
    };

    Game_Event.prototype.setupShadow = function() {
        var info = [false], page = this.page(), shadow = false;
        if (page) {
            for (var i = 0; i < page.list.length; i++) {
                if (page.list[i].code == 108 && getShadowInfo(page.list[i].parameters[0])) {
                    info = getShadowInfo(page.list[i].parameters[0]);
                    shadow = true;
                }
            }
        }
        if (!shadow) info = getShadowInfo(this.event().note);
        this.setShadowInfo(info);
    };

    //-----------------------------------------------------------------------------
    // Game_Player
    //-----------------------------------------------------------------------------

    var _Game_Player_refresh = Game_Player.prototype.refresh;
    Game_Player.prototype.refresh = function() {
        _Game_Player_refresh.apply(this, arguments);
        if ($gameParty.leader()) this.setShadowInfo(getShadowInfo($gameParty.leader().actor().note));
    };

    //-----------------------------------------------------------------------------
    // Game_Follower
    //-----------------------------------------------------------------------------

    var _Game_Follower_refresh = Game_Follower.prototype.refresh;
    Game_Follower.prototype.refresh = function() {
        _Game_Follower_refresh.apply(this, arguments);
        if (this.actor()) this.setShadowInfo(getShadowInfo(this.actor().actor().note));
        if (!this.isVisible()) this.setShadow(false);
    };

    //-----------------------------------------------------------------------------
    // Sprite_Character
    //-----------------------------------------------------------------------------

    var _Sprite_Character_update = Sprite_Character.prototype.update;
    Sprite_Character.prototype.update = function() {
        _Sprite_Character_update.call(this);
        this.updateShadow();
    };

    Sprite_Character.prototype.updateShadow = function() {
        if (this._character._shadow) {
            if (!this._shadowSprite) {
                this._shadowSprite = new Sprite_CharacterShadow(this._character);
                this.parent.addChild(this._shadowSprite);
            }
        } else if (this._shadowSprite) {
            this.parent.removeChild(this._shadowSprite);
            this._shadowSprite = null;
        }
    };

    //-----------------------------------------------------------------------------
    // Sprite_CharacterShadow
    //-----------------------------------------------------------------------------

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

    Sprite_CharacterShadow.prototype = Object.create(Sprite_Base.prototype);
    Sprite_CharacterShadow.prototype.constructor = Sprite_CharacterShadow;

    Sprite_CharacterShadow.prototype.initialize = function(character) {
        Sprite_Base.prototype.initialize.call(this);
        this._character = character;
        this.bitmap = ImageManager.loadSystem(KNH_shadowImage);
        this.anchor.x = this.anchor.y = 0.5;
    };

    Sprite_CharacterShadow.prototype.update = function() {
        var ch = this._character;
        this.x = ch.screenX() + ch._shadowAddX;
        this.y = ch.screenY() + ch.jumpHeight() - 2 + ch._shadowAddY;
        this.z = ch.screenZ() - 1;
        this.scale.x = this.scale.y = ch._shadowScale / 100;
        this.opacity = (ch._transparent || ch._opacity === 0) ? 0 : ch._opacity;
    };

})();

repo_name: onms/melphias

license: unknown


code:
//
/*:
@plugindesc レベルアップの時に回復するプラグインです。
@author 霧島万
*/

(function(_global) {
	var CPOlevelUp = Game_Actor.prototype.levelUp;

	Game_Actor.prototype.levelUp = function() {
		//元の定義
		var defaultLevelUp = CPOlevelUp.call(this);
		//追記
		this._hp = this.mhp;
		this._mp = this.mmp;

	};

})();


code:
//=============================================================================
// LoadComSim.js
//=============================================================================

/*:ja
 * @plugindesc ver1.00 メニューコマンドにロードを追加します。
 * @author まっつＵＰ
 *
 * @param loadtext
 * @desc コマンド「ロード」のコマンド名です。
 * @default ロード
 *
 * @help
 *
 * RPGで笑顔を・・・
 *
 * このヘルプとパラメータの説明をよくお読みになってからお使いください。
 *
 * コマンド「ロード」はイベントテスト中またはセーブデータがないときは選択不能になります。
 *
 * このプラグインを利用する場合は
 * readmeなどに「まっつＵＰ」の名を入れてください。
 * また、素材のみの販売はダメです。
 * 上記以外の規約等はございません。
 * もちろんツクールMVで使用する前提です。
 * 何か不具合ありましたら気軽にどうぞ。
 *
 * 免責事項：
 * このプラグインを利用したことによるいかなる損害も制作者は一切の責任を負いません。
 *
 */

(function() {

    var parameters = PluginManager.parameters('LoadComSim');
    var LCSloadtext = String(parameters['loadtext'] || 'ロード');

    var _Scene_Menu_createCommandWindow = Scene_Menu.prototype.createCommandWindow;
    Scene_Menu.prototype.createCommandWindow = function() {
    _Scene_Menu_createCommandWindow.call(this);
    this._commandWindow.setHandler('load', this.commandLoad.bind(this));
    };

    Scene_Menu.prototype.commandLoad = function() { //新規
    SceneManager.push(Scene_Load);
    };

    var _Window_MenuCommand_addSaveCommand = Window_MenuCommand.prototype.addSaveCommand;
    Window_MenuCommand.prototype.addSaveCommand = function() {
    _Window_MenuCommand_addSaveCommand.call(this);
     var enabled = this.isLoadEnabled();
     this.addCommand(LCSloadtext, 'load', enabled);
    };

    Window_MenuCommand.prototype.isLoadEnabled = function() { //新規
    if(DataManager.isEventTest()) return false; //この行はイベントテスト中かどうか判定しています。
    return DataManager.isAnySavefileExists();
    };

})();


code:
//=============================================================================
// Looping Animations
// by Shaz
// Last Updated: 2015.09.21
//=============================================================================

/*:
 * @plugindesc Allows animations on the map to loop
 * @author Shaz
 *
 * @help
 *
 * Plugin Command:
 *   LoopAnim start event animid   # Start a looping animation on an event
 *   LoopAnim stop event           # Stop animation loop
 *
 *   event = number for specific event
 *   event = 0 for "this" event
 *   event = -1 for player
 *   event = $gameVariables.value(x) to get the event id from variable x
 */

/*:ja
 * @plugindesc マップ上のアニメーションループを可能にします。
 * @author Shaz
 *
 * @help
 *
 * Plugin Command:
 *   LoopAnim start event animid   #
 * 	イベント上でのアニメーションループを開始します。
 *   LoopAnim stop event           #
 * 	アニメーションループを停止します。
 *
 *   event = 0 →このイベント
 *   event = -1 →プレイヤー
 *   event = $gameVariables.value(x) →xからイベントIDを取得
 */

(function() {
  var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  Game_Interpreter.prototype.pluginCommand = function(command, args) {
    _Game_Interpreter_pluginCommand.call(this, command, args);

    if (command.toUpperCase() === 'LOOPANIM') {
      var character = this.character(eval(args[1]));
      if (character) {
        switch (args[0].toUpperCase()) {
          case 'START':
            character.loopAnimStart(args[2]);
            break;
          case 'STOP':
            character.loopAnimStop();
        }
      }
    }
  }

  var _Game_CharacterBase_initMembers = Game_CharacterBase.prototype.initMembers;
  Game_CharacterBase.prototype.initMembers = function() {
    _Game_CharacterBase_initMembers.call(this);
    this._loopAnimId = 0;
  };

  Game_CharacterBase.prototype.loopAnimStart = function(animId) {
    this._loopAnimId = animId;
    this.requestAnimation(animId);
  };

  Game_CharacterBase.prototype.loopAnimStop = function() {
    this._loopAnimId = 0;
  };

  Sprite_Character.prototype.isAnimationPlaying = function() {
    if (this._animationSprites.length > 0) {
      result = true;
    } else if (this._character._loopAnimId > 0) {
      this._character.requestAnimation(this._character._loopAnimId);
      this.setupAnimation();
      result = true;
    } else {
      result = false;
    };
    return result;
  };
})();


code:
//=============================================================================
// MKR_MapScrollFix.js
//=============================================================================
// Copyright (c) 2016 マンカインド
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
// ----------------------------------------------------------------------------
// Version
// 1.1.0 2019/07/28 DP_MapZoomプラグインとの競合を修正
//
// 1.0.4 2019/07/15 画面固定時、画面のスクロールを
//                  タイル単位で行わないようにできる設定を追加
//
// 1.0.3 2017/10/24 画面固定時、ジャンプ移動で画面外へ移動できていた
//                  問題を修正。
//
// 1.0.2 2017/10/20 一部プラグインとの競合に対応。
//
// 1.0.1 2017/10/04 スクロール固定時、画面外への離脱と画面内への侵入を
//                  制限できるようにした。
//
// 1.0.0 2016/10/24 初版公開。
// ----------------------------------------------------------------------------
// [Twitter] https://twitter.com/mankind_games/
//  [GitHub] https://github.com/mankindGames/
//    [Blog] http://mankind-games.blogspot.jp/
//=============================================================================

/*:
 *
 * @plugindesc (v1.1.0) マップスクロール固定プラグイン
 * @author マンカインド
 *
 * @help = MKR_MapScrollFix.js =
 * 指定されたスイッチがオンの間、
 * プレイヤーの移動によるマップスクロールを固定します。
 *
 * プラグインパラメータ(以下、パラメータ)でスクロールを禁止するための
 * スイッチ番号を指定します。
 * ゲーム中にそのスイッチがオンになると画面スクロールが固定されます。
 *
 *
 * パラメータ[画面外への離脱/画面内への侵入]により、
 * イベントが固定された画面から外への離脱、画面内への侵入が可能か設定できます。
 * (プレイヤー/イベントがすり抜けONの場合、この設定は無視されます)
 *
 *
 * スクロール固定はタイル(48px四方)単位で行われます。
 * そのため、解像度変更などでマップ画面の更新がタイル単位で行われなくなった場合、
 * 画面表示がタイル単位になるようスクロールされてから固定が行われます。
 *
 * パラメータ[画面固定方法]で「緩和する」を設定することで、
 * タイル単位ではなくその場で画面が固定されます。
 * ただし、キャラクター移動はタイル単位となっているため、
 * 画面固定の結果、画面内に収まっていないタイルは画面外と判定されます。
 *
 *
 * プラグイン:DP_MapZoom.js(以下、MapZoomプラグイン)併用時、
 * プラグイン管理画面で本プラグインをMapZoomプラグインより下に登録し
 * 本プラグインのプラグインパラメータ[MapZoom併用]を「有効にする」と
 * 設定してください。
 *
 *
 * プラグインコマンド:
 *   ありません。
 *
 *
 * スクリプトコマンド:
 *   ありません。
 *
 *
 * 補足：
 *   ・このプラグインに関するメモ欄の設定、プラグインコマンド/パラメーター、
 *     制御文字は大文字/小文字を区別していません。
 *
 *
 * 利用規約:
 *   ・作者に無断で本プラグインの改変、再配布が可能です。
 *     (ただしヘッダーの著作権表示部分は残してください。)
 *
 *   ・利用形態(フリーゲーム、商用ゲーム、R-18作品等)に制限はありません。
 *     ご自由にお使いください。
 *
 *   ・本プラグインを使用したことにより発生した問題について作者は一切の責任を
 *     負いません。
 *
 *   ・要望などがある場合、本プラグインのバージョンアップを行う
 *     可能性がありますが、
 *     バージョンアップにより本プラグインの仕様が変更される可能性があります。
 *     ご了承ください。
 *
 *
 * @param Default_Scroll_Fix_Sw
 * @text スクロール固定スイッチ
 * @desc 画面スクロールを固定するスイッチの番号を指定します。
 * @type switch
 * @default 10
 *
 * @param Is_Display_Out
 * @text 画面外への離脱
 * @desc 画面スクロール固定時、イベントが画面外へと移動可能か選択します。
 * @type boolean
 * @on 移動可能
 * @off 移動不可
 * @default true
 *
 * @param Is_Display_In
 * @text 画面内への侵入
 * @desc 画面スクロール固定時、画面外にいるイベントが画面内へと移動可能か選択します。
 * @type boolean
 * @on 移動可能
 * @off 移動不可
 * @default true
 *
 * @param Scroll_Fix_Type
 * @text 画面固定方法
 * @type select
 * @option 厳格に行う
 * @value 1
 * @option 緩和する
 * @value 0
 * @default 1
 * @desc ゲーム画面内にマップタイルが収まる(=画面解像度がタイル1マスのサイズ、48の倍数である)場合は[厳格に行う]を選択します。
 *
 * @param Enable_MapZoom
 * @text MapZoom併用
 * @desc DP_MapZoom.jsプラグイン併用時、「有効する」に設定してください
 * @type boolean
 * @on 有効にする
 * @off 無効にする
 * @default false
 *
*/

var Imported = Imported || {};
Imported.MKR_MapScrollFix = true;

(function () {
    'use strict';

    const PN = "MKR_MapScrollFix";

    const CheckParam = function(type, name, value, def, min, max, options) {
        if(min == undefined || min == null) {
            min = -Infinity;
        }
        if(max == undefined || max == null) {
            max = Infinity;
        }

        if(value == null) {
            value = "";
        } else {
            value = String(value);
        }

        switch(type) {
            case "bool":
                if(value == "") {
                    value = (def)? true : false;
                }
                value = value.toUpperCase() === "ON" || value.toUpperCase() === "TRUE" || value.toUpperCase() === "1";
                break;
            case "num":
                value = (isFinite(value))? parseInt(value, 10) : (isFinite(def))? parseInt(def, 10) : 0;
                value = value.clamp(min, max);
                break;
            default:
                throw new Error("[CheckParam] " + name + "のタイプが不正です: " + type);
                break;
        }

        return [value, type, def, min, max];
    };

    const paramParse = function(obj) {
        return JSON.parse(JSON.stringify(obj, paramReplace));
    }

    const paramReplace = function(key, value) {
        try {
            return JSON.parse(value || null);
        } catch (e) {
            return value;
        }
    };

    const Parameters = paramParse(PluginManager.parameters(PN));
    let Params = {};

    Params = {
        "ScrollFixSw" : CheckParam("num", "Default_Scroll_Fix_Sw", Parameters["Default_Scroll_Fix_Sw"], 10, 0),
        "ScrollFixType" : CheckParam("num", "Scroll_Fix_Type", Parameters["Scroll_Fix_Type"], 1),
        "IsDisplayOut" : CheckParam("bool", "Is_Display_Out", Parameters["Is_Display_Out"], true),
        "IsDisplayIn" : CheckParam("bool", "Is_Display_In", Parameters["Is_Display_In"], true),
        "EnableMapZoom" : CheckParam("bool", "Enable_MapZoom", Parameters["Enable_MapZoom"], false),
    };

    //=========================================================================
    // Game_Player
    //  ・プレイヤー移動による画面のスクロールを再定義します。
    //
    //=========================================================================
    var _Game_Player_updateScroll = Game_Player.prototype.updateScroll;
    Game_Player.prototype.updateScroll = function(lastScrolledX, lastScrolledY) {
        if(!$gameSwitches.value(Params.ScrollFixSw[0])) {
            _Game_Player_updateScroll.apply(this, arguments);
            return;
        }

        if(Params.ScrollFixType[0] != 1) {
            return;
        }

        if($gameMap.displayX() != Math.round($gameMap.displayX())) {
            $gameMap._displayX = Math.round($gameMap.displayX());
        }
        if($gameMap.displayY() != Math.round($gameMap.displayY())) {
            $gameMap._displayY = Math.round($gameMap.displayY());
        }
    };

    //=========================================================================
    // Game_Map
    //  ・マップスクロール処理を再定義します。
    //
    //=========================================================================
    const _Game_Map_scrollDown = Game_Map.prototype.scrollDown;
    Game_Map.prototype.scrollDown = function(distance) {
        if(Params.EnableMapZoom[0] && $gameSwitches.value(Params.ScrollFixSw[0])) {
            return;
        }
        _Game_Map_scrollDown.call(this, distance);
    };

    const _Game_Map_scrollLeft = Game_Map.prototype.scrollLeft;
    Game_Map.prototype.scrollLeft = function(distance) {
        if(Params.EnableMapZoom[0] && $gameSwitches.value(Params.ScrollFixSw[0])) {
            return;
        }
        _Game_Map_scrollLeft.call(this, distance);
    };

    const _Game_Map_scrollRight = Game_Map.prototype.scrollRight;
    Game_Map.prototype.scrollRight = function(distance) {
        if(Params.EnableMapZoom[0] && $gameSwitches.value(Params.ScrollFixSw[0])) {
            return;
        }
        _Game_Map_scrollRight.call(this, distance);
    };

    const _Game_Map_scrollUp = Game_Map.prototype.scrollUp;
    Game_Map.prototype.scrollUp = function(distance) {
        if(Params.EnableMapZoom[0] && $gameSwitches.value(Params.ScrollFixSw[0])) {
            return;
        }
        _Game_Map_scrollUp.call(this, distance);
    };

    //=========================================================================
    // Game_CharacterBase
    //  ・画面外への移動可能判定を定義します
    //
    //=========================================================================
    var _Game_CharacterBase_isMapPassable = Game_CharacterBase.prototype.isMapPassable;
    Game_CharacterBase.prototype.isMapPassable = function(x, y, d) {
        let isPass, x2, y2;
        isPass = _Game_CharacterBase_isMapPassable.apply(this, arguments);

        if(!this.isThrough() && $gameSwitches.value(Params.ScrollFixSw[0])) {
            if(isPass && !Params.IsDisplayOut[0]) {
                isPass = this.isDisplayOutPassible(x, y, d);
            }
            if(isPass && !Params.IsDisplayIn[0]) {
                isPass = this.isDisplayInPassible(x, y, d);
            }
        }
        return isPass;
    };

    Game_CharacterBase.prototype.isDisplayOutPassible = function(x, y, d) {
        let x2, y2, dx, rdx, dy, rdy, realX, realY;
        dx = $gameMap.displayX();
        rdx = dx + $gameMap.screenTileX() - 1;
        dy = $gameMap.displayY();
        rdy = dy + $gameMap.screenTileY() - 1;
        x2 = $gameMap.roundXWithDirection(x, d);
        y2 = $gameMap.roundYWithDirection(y, d);
        realX = this._realX;
        realY = this._realY;

        // switch(true) {
        //     case x == dx && x2 < dx:
        //     case x == rdx && x2 > rdx:
        //     case y == dy && y2 < dy:
        //     case y == rdy && y2 > rdy:
        //     case realX == dx && x2 < dx:
        //     case realX == rdx && x2 > rdx:
        //     case realY == dy && y2 < dy:
        //     case realY == rdy && y2 > rdy:
        //         return false;
        // }

        if(d == 8 || d == 2) {
            switch(true) {
                case y == Math.floor(dy) && y2 < dy:
                case y == Math.ceil(dy) && y2 < dy:
                case y == Math.floor(rdy) && y2 > rdy:
                case y == Math.ceil(rdy) && y2 > rdy:
                case realY == Math.floor(dy) && y2 < dy:
                case realY == Math.ceil(dy) && y2 < dy:
                case realY == Math.floor(rdy) && y2 > rdy:
                case realY == Math.ceil(rdy) && y2 > rdy:
                    return false;
            }
        } else if(d == 6 || d == 4) {
            switch(true) {
                case x == Math.floor(dx) && x2 < dx:
                case x == Math.ceil(dx) && x2 < dx:
                case x == Math.floor(rdx) && x2 > rdx:
                case x == Math.ceil(rdx) && x2 > rdx:
                case realX == Math.floor(dx) && x2 < dx:
                case realX == Math.ceil(dx) && x2 < dx:
                case realX == Math.floor(rdx) && x2 > rdx:
                case realX == Math.ceil(rdx) && x2 > rdx:
                    return false;
            }
        }

        return true;
    };

    Game_CharacterBase.prototype.isDisplayInPassible = function(x, y, d) {
        let x2, y2, dx, rdx, dy, rdy, realX, realY;
        dx = $gameMap.displayX();
        rdx = dx + $gameMap.screenTileX();
        dx--;
        dy = $gameMap.displayY();
        rdy = dy + $gameMap.screenTileY();
        dy--;
        x2 = $gameMap.roundXWithDirection(x, d);
        y2 = $gameMap.roundYWithDirection(y, d);
        realX = this._realX;
        realY = this._realY;

        // switch(true) {
        //     case x == dx && x2 > dx:
        //     case x == rdx && x2 < rdx:
        //     case y == dy && y2 > dy:
        //     case y == rdy && y2 < rdy:
        //     case realX == dx && x2 > dx:
        //     case realX == rdx && x2 < rdx:
        //     case realY == dy && y2 > dy:
        //     case realY == rdy && y2 < rdy:
        //         return false;
        // }

        if(d == 8 || d == 2) {
            switch(true) {
                case y == Math.floor(dy) && y2 > dy:
                case y == Math.ceil(dy) && y2 > dy:
                case y == Math.floor(rdy) && y2 < rdy:
                case y == Math.ceil(rdy) && y2 < rdy:
                case realY == Math.floor(dy) && y2 > dy:
                case realY == Math.ceil(dy) && y2 > dy:
                case realY == Math.floor(rdy) && y2 < rdy:
                case realY == Math.ceil(rdy) && y2 < rdy:
                    return false;
            }
        } else if(d == 6 || d == 4) {
            switch(true) {
                case x == Math.floor(dx) && x2 < dx:
                case x == Math.ceil(dx) && x2 < dx:
                case x == Math.floor(rdx) && x2 > rdx:
                case x == Math.ceil(rdx) && x2 > rdx:
                case realX == Math.floor(dx) && x2 > dx:
                case realX == Math.ceil(dx) && x2 > dx:
                case realX == Math.floor(rdx) && x2 < rdx:
                case realX == Math.ceil(rdx) && x2 < rdx:
                    return false;
            }
        }

        return true;
    };

    const _Game_CharacterBase_updateJump = Game_CharacterBase.prototype.updateJump;
    Game_CharacterBase.prototype.updateJump = function() {
        _Game_CharacterBase_updateJump.call(this);

        let maxDisplayX, maxDisplayY;
        maxDisplayX = $gameMap.displayX() + $gameMap.screenTileX() - 1;
        maxDisplayY = $gameMap.displayY() + $gameMap.screenTileY() - 1;

        if(!this.isThrough() && $gameSwitches.value(Params.ScrollFixSw[0])) {
            if(this._realX > maxDisplayX) {
                this._realX = maxDisplayX;
                this._x = maxDisplayX;
            } else if(this._realX <= $gameMap.displayX()) {
                this._realX = $gameMap.displayX();
                this._x = $gameMap.displayX();
            }
            if(this._realY >= maxDisplayY) {
                this._realY = maxDisplayY;
                this._y = maxDisplayY;
            } else if(this._realY <= $gameMap.displayY()) {
                this._realY = $gameMap.displayY();
                this._y = $gameMap.displayY();
            }
        }
    };

})();


code:
/*
 * --------------------------------------------------
 * MNKR_TimerEX.js
 *   Ver.1.1.0
 * Copyright (c) 2020 Munokura
 * This software is released under the MIT license.
 * http://opensource.org/licenses/mit-license.php
 * --------------------------------------------------
 */

/*:
 * @target MZ MV
 * @url https://raw.githubusercontent.com/munokura/MNKR-MZ-plugins/master/MNKR_TimerEX.js
 * @plugindesc タイマーをカウントアップ・ダウン、表示・非表示を切り替えできるようにします。
 * @author munokura
 *
 * @help
 * タイマーをカウントアップ・ダウンできるようにします。
 * タイマーをスイッチで表示・非表示を切り替えられます。
 *
 * カウントアップ・ダウンに関わらず、タイマー停止時の値を変数に保存します。
 * 保存される値はフレーム値(1フレーム:1/60秒)です。
 * 分や秒に換算する場合、計算して使用してください。
 *
 * プラグインコマンドはありません。
 *
 *
 * 利用規約:
 *   MITライセンスです。
 *   https://licenses.opensource.jp/MIT/MIT.html
 *   作者に無断で改変、再配布が可能で、
 *   利用形態（商用、18禁利用等）についても制限はありません。
 *
 *
 * @param countUpSwitch
 * @text カウントアップ発動スイッチ
 * @type switch
 * @desc 指定スイッチがON時カウントアップ。OFF時カウントダウン。
 * 無指定の場合、常にカウントアップになります。
 * @default 0
 *
 * @param hideSwitch
 * @text タイマー非表示スイッチ
 * @type switch
 * @desc 指定スイッチがON時タイマーを非表示。OFF時に表示。
 * 無指定の場合、常に表示になります。
 * @default 0
 *
 * @param countStopValue
 * @text 保存変数ID
 * @type variable
 * @desc タイマーを停止した時の値を保存する変数ID。取得値はフレーム値(1フレーム:1/60秒)
 * @default 0
 */

(() => {
    "use strict";

    const pluginName = document.currentScript.src.split("/").pop().replace(/\.js$/, "");
    const parameters = PluginManager.parameters(pluginName);
    const countUpSwitch = Number(parameters['countUpSwitch'] || 0);
    const hideSwitch = Number(parameters['hideSwitch'] || 0);
    const countStopValue = Number(parameters['countStopValue'] || 0);

    const _Game_Timer_update = Game_Timer.prototype.update;
    Game_Timer.prototype.update = function (sceneActive) {
        if (($gameSwitches.value(countUpSwitch) || countUpSwitch === 0) && sceneActive && this._working) {
            this._frames++;
        } else {
            _Game_Timer_update.apply(this, arguments);
        }
    };

    const _Game_Timer_stop = Game_Timer.prototype.stop;
    Game_Timer.prototype.stop = function () {
        _Game_Timer_stop.call(this);
        if (countStopValue) {
            $gameVariables.setValue(countStopValue, this._frames);
        }
    };

    const _Sprite_Timer_redraw = Sprite_Timer.prototype.redraw;
    Sprite_Timer.prototype.redraw = function () {
        if ((!$gameSwitches.value(hideSwitch) || hideSwitch === 0)) {
            _Sprite_Timer_redraw.call(this);
        } else {
            this.bitmap.clear();
        }
    };

})();


code:
//=============================================================================
// MOG_HPGauge.js
//=============================================================================

/*:
 * @plugindesc (v1.4 *) Apresenta um medidor de HP do alvo.
 * @author Moghunter
 *
 * @param Gauge For Actors
 * @desc Apresentar o HP nos aliados .
 * @default true
 *
 * @param Gauge For Enemies
 * @desc Apresentar o HP nos inimigos.
 * @default true
 *
 * @param Show HP On Selection
 * @desc Apresentar o HP na seleção do alvo.
 * @default true
 *
 * @param Fade Duration
 * @desc Definição do tempo para ativar o fade.
 * @default 90
 *
 * @param Slide Animation
 * @desc Ativar animação de deslize.
 * @default true
 *
 * @param Show HP Number Actor
 * @desc Apresentar o número de HP para o ator.
 * @default false
 *
 * @param Show HP Number Enemy
 * @desc Apresentar o número de HP para o inimigo.
 * @default true
 *
 * @param Required to Kill
 * @desc Requer derrotar o inimigo para mostrar o HP.
 * @default false
 *
 * @param Actor Layout X-Axis
 * @desc Posição X-Axis do layout.
 * @default 0
 *
 * @param Actor Layout Y-Axis
 * @desc Posição Y-Axis do layout.
 * @default 0
 *
 * @param Actor Meter X-Axis
 * @desc Posição X-Axis do medidor.
 * @default 0
 *
 * @param Actor Meter Y-Axis
 * @desc Posição Y-Axis do medidor.
 * @default 3
 *
 * @param Actor HP Number X-Axis
 * @desc Posição X-Axis do numero de HP.
 * @default -25
 *
 * @param Actor HP Number Y-Axis
 * @desc Posição Y-Axis do numero de HP.
 * @default -22
 *
 * @param Enemy Layout X-Axis
 * @desc Posição X-Axis do layout.
 * @default 0
 *
 * @param Enemy Layout Y-Axis
 * @desc Posição Y-Axis do layout.
 * @default 0
 *
 * @param Enemy Meter X-Axis
 * @desc Posição X-Axis do medidor.
 * @default 8
 *
 * @param Enemy Meter Y-Axis
 * @desc Posição Y-Axis do medidor.
 * @default 10
 *
 * @param Enemy HP Number X-Axis
 * @desc Posição X-Axis do numero de HP.
 * @default -25
 *
 * @param Enemy HP Number Y-Axis
 * @desc Posição Y-Axis do numero de HP.
 * @default -19
 *
 * @help
 * =============================================================================
 * +++ MOG - HP Gauge (v1.4) +++
 * By Moghunter
 * https://atelierrgss.wordpress.com/
 * =============================================================================
 * Apresenta um medidor de HP do alvo.
 * Serão necessários os arquivos. (img/system/)
 *
 * HPGaugeActor_A.png
 * HPGaugeActor_B.png
 * HPGaugeActor_C.png
 * HPGaugeEnemy_A.png
 * HPGaugeEnemy_B.png
 * HPGaugeEnemy_C.png
 *
 * =============================================================================
 * NOTETAGS
 * =============================================================================
 * Para ocultar o HP do inimigo use a seguinte Tag na caixa de notas
 *
 * Hide HP
 *
 * -----------------------------------------------------------------------------
 * Para ajustar a posição do medidor use a Tag abaixo.
 *
 * Hp Gauge Offset: X:Y
 *
 * Exemplo
 *
 * Hp Gauge Offset: 130:40
 *
 * ============================================================================
 * - WHAT'S  NEW (version 1.4)
 * ============================================================================
 * (NEW) - Reformulação dos plugins Parameters para a versão do RPG Maker MV 1.5+
 * (NEW) - Compatibilidade com Frontal Battle Camera plugin.
 *
 */

//=============================================================================
// ** PLUGIN PARAMETERS
//=============================================================================
　　var Imported = Imported || {};
　　Imported.MOG_HPGauge = true;
　　var Moghunter = Moghunter || {};

  　Moghunter.parameters = PluginManager.parameters('MOG_HPGauge');
    Moghunter.hpgauge_actors = String(Moghunter.parameters['Gauge For Actors'] || "true");
	Moghunter.hpgauge_enemies = String(Moghunter.parameters['Gauge For Enemies'] || "true");
	Moghunter.hpgauge_selection = String(Moghunter.parameters['Show HP On Selection'] || "true");
	Moghunter.hpgauge_slide = String(Moghunter.parameters['Slide Animation'] || "true");
	Moghunter.hpgauge_showNumberActor = String(Moghunter.parameters['Show HP Number Actor'] || "false");
	Moghunter.hpgauge_showNumberEnemy = String(Moghunter.parameters['Show HP Number Enemy'] || "true");
	Moghunter.hpgauge_NumberAfter = String(Moghunter.parameters['Required to Kill'] || "false");
    Moghunter.hpgauge_a_x = Number(Moghunter.parameters['Enemy Layout X-Axis'] || 0);
    Moghunter.hpgauge_a_y = Number(Moghunter.parameters['Enemy Layout Y-Axis'] || 0);
    Moghunter.hpgauge_b_x = Number(Moghunter.parameters['Enemy Meter X-Axis'] || 8);
    Moghunter.hpgauge_b_y = Number(Moghunter.parameters['Enemy Meter Y-Axis'] || 10);
    Moghunter.hpgauge_c_x = Number(Moghunter.parameters['Enemy HP Number X-Axis'] || -30);
    Moghunter.hpgauge_c_y = Number(Moghunter.parameters['Enemy HP Number Y-Axis'] || -19);
    Moghunter.hpgauge_a_xa = Number(Moghunter.parameters['Actor Layout X-Axis'] || 0);
    Moghunter.hpgauge_a_ya = Number(Moghunter.parameters['Actor Layout Y-Axis'] || 0);
    Moghunter.hpgauge_b_xa = Number(Moghunter.parameters['Actor Meter X-Axis'] || 0);
    Moghunter.hpgauge_b_ya = Number(Moghunter.parameters['Actor Meter Y-Axis'] || 3);
    Moghunter.hpgauge_c_xa = Number(Moghunter.parameters['Actor HP Number X-Axis'] || -25);
    Moghunter.hpgauge_c_ya = Number(Moghunter.parameters['Actor HP Number Y-Axis'] || -19);
	Moghunter.hpgauge_duration = Number(Moghunter.parameters['Fade Duration'] || 90);

//=============================================================================
// ** Game_Temp
//=============================================================================

//==============================
// * Initialize
//==============================
var _mog_hpgauge_temp_initialize = Game_Temp.prototype.initialize;
Game_Temp.prototype.initialize = function() {
	_mog_hpgauge_temp_initialize.call(this);
    this._hpGauge = [true,false];
};

//=============================================================================
// ** Game_System
//=============================================================================

//==============================
// * Initialize
//==============================
var _mog_hpgauge_sys_initialize = Game_System.prototype.initialize;
Game_System.prototype.initialize = function() {
	_mog_hpgauge_sys_initialize.call(this);
    this._hpGaugeEDef = [];
};

//=============================================================================
// ** BattleManager
//=============================================================================

//==============================
// * processVictory
//==============================
var _mog_hpGauge_processVictory = BattleManager.processVictory;
BattleManager.processVictory = function() {
	 $gameTemp._hpGauge[0] = false;
	 _mog_hpGauge_processVictory.call(this);
};

//==============================
// * processAbort
//==============================
var _mog_hpGauge_processAbort = BattleManager.processAbort;
BattleManager.processAbort = function() {
	 $gameTemp._hpGauge[0] = false;
	 _mog_hpGauge_processAbort.call(this);
};

//==============================
// * processDefeat
//==============================
var _mog_hpGauge_processDefeat = BattleManager.processDefeat;
BattleManager.processDefeat = function() {
	 $gameTemp._hpGauge[0] = false;
	 _mog_hpGauge_processDefeat.call(this);
};

//=============================================================================
// ** Game Battler
//=============================================================================

//==============================
// * init Members
//==============================
var _mog_hpgauge_gbat_initMembers = Game_Battler.prototype.initMembers;
Game_Battler.prototype.initMembers = function() {
    _mog_hpgauge_gbat_initMembers.call(this);
    this._ehpgauge = [false,0,0,false,false];
};

//==============================
// * check HP Gauge Notes
//==============================
Game_Battler.prototype.checkHPGaugeNotes = function() {
	this.notetags().forEach(function(note) {
		if (note == "Hide HP") {this._ehpgauge[0] = false};
         var note_data = note.split(': ')
		 if (note_data[0].toLowerCase() == "hp gauge offset"){
			 var par = note_data[1].split(':');
		     this._ehpgauge[1] = Number(par[0]);
			 this._ehpgauge[2] = Number(par[1]);
		 };
	},this);
};

//==============================
// * Notetags
//==============================
Game_Battler.prototype.notetags = function() {
	if (this.isEnemy()) {return this.enemy().note.split(/[\r\n]+/)};
	if (this.isActor()) {return this.actor().note.split(/[\r\n]+/)};
};

//=============================================================================
// ** Game_Actor
//=============================================================================

//==============================
// * Setup
//==============================
var _mog_hp_gauge_gactor_setup = Game_Actor.prototype.setup;
Game_Actor.prototype.setup = function(actorId) {
	_mog_hp_gauge_gactor_setup.call(this,actorId);
	if (String(Moghunter.hpgauge_actors) === "true") {this._ehpgauge[0] = true};
	this.checkHPGaugeNotes();
};

//=============================================================================
// ** Game_Enemy
//=============================================================================

//==============================
// * Setup
//==============================
var _mog_hpgauge_genemy_setup = Game_Enemy.prototype.setup;
Game_Enemy.prototype.setup = function(enemyId, x, y) {
	_mog_hpgauge_genemy_setup.call(this,enemyId, x, y);
	if (String(Moghunter.hpgauge_enemies) === "true") {this._ehpgauge[0] = true};
	this.checkHPGaugeNotes();
};

//==============================
// * Die
//==============================
var _mog_hpgauge_genemy_die = Game_Enemy.prototype.die;
Game_Enemy.prototype.die = function() {
	_mog_hpgauge_genemy_die.call(this);
	$gameSystem._hpGaugeEDef[this._enemyId] = true;
};

//=============================================================================
// ** Game Action
//=============================================================================

//==============================
// * Apply
//==============================
var _mog_hpgauge_gaction_apply = Game_Action.prototype.apply;
Game_Action.prototype.apply = function(target) {
	 _mog_hpgauge_gaction_apply.call(this,target);
     if (target) {
		 if (this.isHpRecover()) {
			 target._ehpgauge[4] = true;
		 } else if (this.item() && this.item().damage.type === 5) {
			 target._ehpgauge[4] = true;
			 var subj = this.subject();
			 if (subj) {subj._ehpgauge[4] = true};
		 };
	  };
};

//=============================================================================
// ** Spriteset_Battle
//=============================================================================

//==============================
// * Create Lower Layer
//==============================
var _mog_hpGauge_createLowerLayer = Spriteset_Battle.prototype.createLowerLayer;
Spriteset_Battle.prototype.createLowerLayer = function() {
	_mog_hpGauge_createLowerLayer.call(this);
	this.create_HPGauge();
};

//==============================
// * Create HP Gauge
//==============================
Spriteset_Battle.prototype.create_HPGauge = function() {
    this.createHPField();
	this.createHPSprites()
};

//==============================
// * Create EHP Field
//==============================
Spriteset_Battle.prototype.createHPField = function() {
    this._hpField = new Sprite();
	this._hpField.z = 100;
	this.addChild(this._hpField);
};

//==============================
// * Create HP Sprites
//==============================
Spriteset_Battle.prototype.createHPSprites = function() {
	$gameTemp._hpGauge[0] = true;
	this._HPSprites = [];
    this.createHPSpritesActor();
	this.createHPSpritesEnemy();
};

//==============================
// * create H PSprites Actor
//==============================
Spriteset_Battle.prototype.createHPSpritesActor = function() {
	if (String(Moghunter.hpgauge_actors) != "true") {return};
	for (var i = 0; i < this._actorSprites.length; i++) {
		 this._HPSprites[i] = new HPGaugeSprite(this._actorSprites[i],0);
		 this._hpField.addChild(this._HPSprites[i]);
	};
};

//==============================
// * create H PSprites Enemy
//==============================
Spriteset_Battle.prototype.createHPSpritesEnemy = function() {
	if (String(Moghunter.hpgauge_enemies) != "true") {return};
	for (var i = 0; i < this._enemySprites.length; i++) {
		 this._HPSprites[i] = new HPGaugeSprite(this._enemySprites[i],1);
		 this._hpField.addChild(this._HPSprites[i]);
	};
};

//==============================
// * remove HP Sprites
//==============================
Spriteset_Battle.prototype.removeHPSprites = function() {
	if (!this._HPSprites) {return};
	for (var i = 0; i < this._HPSprites.length; i++) {
		 this._hpField.removeChild(this._HPSprites[i]);
	};
};

//==============================
// * Update
//==============================
var _mog_hpGauge_sprBat_update = Spriteset_Battle.prototype.update;
Spriteset_Battle.prototype.update = function() {
	_mog_hpGauge_sprBat_update.call(this);
	if (Imported.MOG_BattleCamera && this._hpField) {this.updateHPField()};
};

//==============================
// * Update
//==============================
Spriteset_Battle.prototype.updateHPField = function() {
    this._hpField.x = this._battleField.x
	this._hpField.y = this._battleField.y
};

//=============================================================================
// ** HP Gauge Sprite
//=============================================================================
function HPGaugeSprite() {
    this.initialize.apply(this, arguments);
};

HPGaugeSprite.prototype = Object.create(Sprite.prototype);
HPGaugeSprite.prototype.constructor = HPGaugeSprite;

//==============================
// * Initialize
//==============================
HPGaugeSprite.prototype.initialize = function(sprite,type) {
    Sprite.prototype.initialize.call(this);
    this._sprite = sprite;
	this._slideX = 0;
	this._duration = 0;
	this.opacity = 0;
	this.type = type;
	this.z = 100;
	this._slideA = String(Moghunter.hpgauge_slide) === "true" ? true : false;
	this._selectionHP = String(Moghunter.hpgauge_selection) === "true" ? true : false;
	if (type === 0) {
    	this._showHPNumber = String(Moghunter.hpgauge_showNumberActor) === "true" ? true : false;
	} else {
	    this._showHPNumber = String(Moghunter.hpgauge_showNumberEnemy) === "true" ? true : false;
	};
	this._IDA = type === 0 ? true : this.enemyIDA();
	if (type === 1 && String(Moghunter.hpgauge_NumberAfter) != "true") {this._IDA = true};
	this._data = [0,0,0,0,0];
	this.loadBitmaps();
};

//==============================
// * Battler
//==============================
HPGaugeSprite.prototype.battler = function() {
    return this._sprite._battler;
};

//==============================
// * Load Bitmaps
//==============================
HPGaugeSprite.prototype.loadBitmaps = function() {
	if (this.type === 0) {
        this._layImg = ImageManager.loadSystem("HPGaugeActor_A");
	    this._meterImg = ImageManager.loadSystem("HPGaugeActor_B");
		this._numberImg = ImageManager.loadSystem("HPGaugeActor_C");
	} else {
        this._layImg = ImageManager.loadSystem("HPGaugeEnemy_A");
	    this._meterImg = ImageManager.loadSystem("HPGaugeEnemy_B");
		this._numberImg = ImageManager.loadSystem("HPGaugeEnemy_C");
	};
};

//==============================
// * createSprites
//==============================
HPGaugeSprite.prototype.createSprites = function() {
	this.createLayout();
	this.createMeter();
	if (this._showHPNumber) {this.createNumber()};
};

//==============================
// * Create Layout
//==============================
HPGaugeSprite.prototype.createLayout = function() {
    this._layout = new Sprite(this._layImg);
	if (this.type === 0) {
	    this._layout.x = Moghunter.hpgauge_a_xa - this._layImg.width / 2;
	    this._layout.y = Moghunter.hpgauge_a_ya - this._layImg.height / 2;
	} else {
	    this._layout.x = Moghunter.hpgauge_a_x - this._layImg.width / 2;
	    this._layout.y = Moghunter.hpgauge_a_y - this._layImg.height / 2;
	};
	this.addChild(this._layout);
};

//==============================
// * Create Gauge
//==============================
HPGaugeSprite.prototype.createMeter = function() {
	this._meter = [];
	for (var i = 0; i < 2; i++) {
		this._meter[i] = new Sprite(this._meterImg);
		this._meter[i].value1 = this.battler().hp;
		this._meter[i].value2 = this.battler().mhp;
		this._meter[i].ds = 0;
		this._meter[i].w = this._meterImg.width;
		this._meter[i].h = this._meterImg.height / 2;
		if (this.type === 0) {
		    this._meter[i].x = Moghunter.hpgauge_a_xa + Moghunter.hpgauge_b_xa - this._meterImg.width / 2;
		    this._meter[i].y = Moghunter.hpgauge_a_ya + Moghunter.hpgauge_b_ya - this._meterImg.height / 2;
		} else {
		    this._meter[i].x = Moghunter.hpgauge_a_x + Moghunter.hpgauge_b_x - this._meterImg.width / 2;
		    this._meter[i].y = Moghunter.hpgauge_a_y + Moghunter.hpgauge_b_y - this._meterImg.height / 2;
	    };
		this.addChild(this._meter[i]);
	};
    this.refreshMeter(this._meter[0],this._meter[0].value1,this.battler().mhp,1);
	this.refreshMeter(this._meter[1],this.battler().hp,this.battler().mhp,0);
	this.updateMeter();
};

//==============================
// * Need Refresh Blue Meter
//==============================
HPGaugeSprite.prototype.needRefreshBlueMeter = function() {
	if (this.battler()._ehpgauge[4]) {return true};
    if (this._meter[1].value1 != this.battler().hp) {return true};
	if (this._meter[1].value2 != this.battler().mhp) {return true};
	return false
};

//==============================
// * refresh Blue Meter
//==============================
HPGaugeSprite.prototype.refreshBlueMeter = function() {
	 this.battler()._ehpgauge[4] = false;
     this._meter[1].value1 = this.battler().hp;
	 this._meter[1].value2 = this.battler().mhp;
	 if (!$gameTemp._hpGauge[0]) {return};
	 this.refreshMeter(this._meter[0],this._meter[0].value1,this.battler().mhp,1);
	 this.refreshMeter(this._meter[1],this.battler().hp,this.battler().mhp,0);
	 this.prepareSlide();
};

//==============================
// * prepare Slide
//==============================
HPGaugeSprite.prototype.prepareSlide = function() {
	if (this.opacity < 100 || this._slideX > 0) {
	    this._slideX = this._slideA ? -50 : -0.01;
	    this.opacity = 0;
	};
	this._duration = Math.min(Math.max(Moghunter.hpgauge_duration,1),999);
};

//==============================
// * Update Dif
//==============================
HPGaugeSprite.prototype.update_dif = function(value,real_value,speed,type) {
	if (value == real_value) {return value};
	var mr = type === 0 ? 1 : 0.1;
    var dnspeed = mr + (Math.abs(value - real_value) / speed);
	if (value > real_value) {value -= dnspeed;
	    if (value < real_value) {value = real_value};
	} else if (value < real_value) {value  += dnspeed;
    	if (value  > real_value) {value  = real_value};
    };
	if (type === 0) {
	    return Math.floor(value);
	} else {
		return value;
	};
};

//==============================
// * Need Refresh Red Meter
//==============================
HPGaugeSprite.prototype.needRefreshRedMeter = function() {
     if (this._meter[0].value1 != this.battler().hp) {return true};
	 return false;
};

//==============================
// * refresh Red Meter
//==============================
HPGaugeSprite.prototype.refreshRedMeter = function() {
  	 this._meter[0].value1 = this.update_dif(this._meter[0].value1,this.battler().hp, 60,1);
	 this.refreshMeter(this._meter[0],this._meter[0].value1,this.battler().mhp,1);
};

//==============================
// * Update Meter
//==============================
HPGaugeSprite.prototype.updateMeter = function() {
	 if (this.needRefreshRedMeter()) {this.refreshRedMeter()};
	 if (this.needRefreshBlueMeter()) {this.refreshBlueMeter()};
};

//==============================
// * Refresh Meter
//==============================
HPGaugeSprite.prototype.refreshMeter = function(sprite,value1,value2,h) {
     var wd = value1 * sprite.w / value2
	 sprite.setFrame(0,sprite.h * h,wd,sprite.h);
};

//==============================
// * create Number
//==============================
HPGaugeSprite.prototype.createNumber = function() {
	this._hp_number = [];
	this._numberData = [this.battler().hp - 1,this._numberImg.width / 11,this._numberImg.height]
	for (var i = 0; i < 6; i++) {
		 this._hp_number[i] = new Sprite(this._numberImg);
		 this._hp_number[i].visible = false;
		 if (this.type === 0) {
		     this._hp_number[i].x = Moghunter.hpgauge_a_xa + Moghunter.hpgauge_c_xa;
		     this._hp_number[i].y = Moghunter.hpgauge_a_ya + Moghunter.hpgauge_c_ya;
		 } else {
		     this._hp_number[i].x = Moghunter.hpgauge_a_x + Moghunter.hpgauge_c_x;
		     this._hp_number[i].y = Moghunter.hpgauge_a_y + Moghunter.hpgauge_c_y;
		 };
		 this._hp_number[i].org = [this._hp_number[i].x,this._hp_number[i].y];
		 this.addChild(this._hp_number[i]);
	};
};

//==============================
// * update Number
//==============================
HPGaugeSprite.prototype.updateNumber = function() {
	if (this._numberData[0] != this.battler().hp) {this.refreshNumber()};
};

//==============================
// * enemy IDA
//==============================
HPGaugeSprite.prototype.enemyIDA = function() {
	 if (this.battler().isActor()) {return true};
     return $gameSystem._hpGaugeEDef[this.battler()._enemyId];
};

//==============================
// * ID available
//==============================
HPGaugeSprite.prototype.idIsAvailable = function() {
	return this._IDA;
};

//==============================
// * refresh Number
//==============================
HPGaugeSprite.prototype.refreshNumber = function() {
	this._numberData[0] = this.update_dif(this._numberData[0],this.battler().hp, 40,0);
    var w = this._numberData[1];
	var h = this._numberData[2];
	var number = Math.abs(this._numberData[0]).toString().split("");
    for (var i = 0; i < this._hp_number.length; i++) {
	   this._hp_number[i].visible = false;
	   if (this.idIsAvailable()) {
		   if (i <  number.length) {
			   var n = Number(number[i]);
			   this._hp_number[i].setFrame(n * w, 0, w, h);
			   this._hp_number[i].visible = true;
			   this._hp_number[i].x = this._hp_number[i].org[0] + (w * i);
		   };
	   } else {
		   if (i === 0) {
			   this._hp_number[0].setFrame(10 * w, 0, w, h);
			   this._hp_number[0].visible = true;
			   this._hp_number[0].x = this._hp_number[0].org[0] + (w * 2);
		   };
	   };
    };
};

//==============================
// * Is Visible
//==============================
HPGaugeSprite.prototype.isVisible = function() {
	if (!this.battler()) {return false};
	if (this.battler().isHidden()) {return false};
    if (!this.battler()._ehpgauge[0]) {return false};
	if (this.type === 0 && !$gameSystem.isSideView()) {
		return false;
	};
	return true;
};

//==============================
// * force Visible
//==============================
HPGaugeSprite.prototype.forceVisible = function() {
     if (this.battler()._ehpgauge[3]) {return true};
	 if (this._selectionHP && this.battler().isSelected() && !this.battler().isDead()) {return true};
	 return false;
};

//==============================
// * pos X
//==============================
HPGaugeSprite.prototype.posX = function() {
	if (Imported.MOG_BattleCameraFrontal) {
	　 var perc = ((($gameTemp._bcam.scale  / 1.00) * 100) - 100);
	   var x = $gameTemp._bcam.x + this._sprite.x + (this._sprite.x * perc / 100);
	   return x;
	} else {
	  var xs = this.forceVisible() ? 0 : this._slideX;
      return this._sprite.x + xs + this.battler()._ehpgauge[1];
	};
};

//==============================
// * pos Y
//==============================
HPGaugeSprite.prototype.posY = function() {
	if (Imported.MOG_BattleCameraFrontal && this._sprite.bitmap) {
		var scale = $gameTemp._bcam.scale
		if (scale < 0.60) {
			var perc = (((scale  / 1.00) * 100) - 100);
			var perc2 = (scale - this.battler()._camera.scaleX2) * 100;
			var sph = this._sprite.bitmap.height / 1.2
			var y = this._sprite.y + (this._sprite.y * perc / 100)
			var h = sph + (sph * perc / 100)
			var h2 = sph * perc2 / 250;
			var y2 = $gameTemp._bcam.y + y;
		} else {
			var perc = (((scale  / 1.00) * 100) - 100);
			var perc2 = (scale - this.battler()._camera.scaleX2) * 100;
			var sph = this._sprite.bitmap.height / 1.2
			var y = this._sprite.y + (this._sprite.y * perc / 100)
			var h = sph + (sph * perc / 100)
			var h2 = sph * perc2 / 250;
			var y2 = $gameTemp._bcam.y + y - h + h2 - 80;
		};
	    return y2;
	} else {
        return this._sprite.y + this.battler()._ehpgauge[2];
	};
};

//==============================
// * Update Slide
//==============================
HPGaugeSprite.prototype.updateSlide = function() {
	this._slideX += 2;
	this.opacity += 10;
	if (this._slideX >= 0) {
		this._slideX = 0;
		this.opacity = 255;
	};
};

//==============================
// * Update Fade
//==============================
HPGaugeSprite.prototype.updateFade = function() {
	if (this._slideA) {this._slideX += 2};
	this.opacity -= 10;
};

//==============================
// * Update Slide
//==============================
HPGaugeSprite.prototype.updateAnimation = function() {
    if (this._slideX < 0) {this.updateSlide();return};
	if (this._duration > 0) {this._duration--;return};
	if (this.opacity > 0) {this.updateFade()};
};

//==============================
// * Update Force Visible
//==============================
HPGaugeSprite.prototype.updateForceVisible = function() {
    this.opacity = 255;
    this._duration = 0;
    this._slideX = 0;
};

//==============================
// * Update Position
//==============================
HPGaugeSprite.prototype.updatePosition = function() {
   if (this.forceVisible()) {
       this.updateForceVisible();
   } else {
	   this.updateAnimation();
   };
   this.x = this.posX();
   this.y = this.posY();
   if (Imported.MOG_BattlerMotion) {this.x -= Math.abs(this._sprite._battler._bmotion.damage.x)};
};

//==============================
// * Update
//==============================
HPGaugeSprite.prototype.update = function() {
    Sprite.prototype.update.call(this);
	this.visible = this.isVisible();
	if (!this.battler()) {return};
	if (!this._layout && this._meterImg.isReady()) {this.createSprites()};
	if (this._meter) {this.updateMeter()};
	if (this._hp_number) {this.updateNumber()};
    this.updatePosition();
};


code:
//=============================================================================
// MOG_TitleParticles.js
//=============================================================================

/*:
 * @plugindesc (v2.1 *) Adiciona partículas na tela de título.
 * @author Moghunter
 *
 * @param -> Particles 1 <<<<<<<<<<<<<<<<<<<<<<<
 * @desc
 *
 * @param P1 Visible
 * @desc Ativar partícula.
 * @default true
 * @type boolean
 * @parent -> Particles 1 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P1 File Name
 * @desc Nome do arquivo.
 * @default Particles
 * @parent -> Particles 1 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P1 Amount
 * @desc Quantidade de partículas.
 * @default 25
 * @parent -> Particles 1 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P1 Z Index
 * @desc Prioridade Z do sprite.
 * @default 20
 * @parent -> Particles 1 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P1 X Speed
 * @desc Velocidade X-Axis.
 * @default -10
 * @parent -> Particles 1 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P1 Y Speed
 * @desc Velocidade Y-Axis.
 * @default -1
 * @parent -> Particles 1 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P1 Rotation Speed
 * @desc Velocidade de rotação.
 * @default 0.02
 * @parent -> Particles 1 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P1 Blend Mode
 * @desc Definição de blend.
 * @default 1
 * @type select
 * @option Normal
 * @value 0
 * @option Add
 * @value 1
 * @option Substract
 * @value 2
 * @parent -> Particles 1 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P1 Anchor
 * @desc Definição do anchor.
 * @default 0
 * @parent -> Particles 1 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P1 Leaf Mode
 * @desc Ativar animação de folha.
 * @default false
 * @type boolean
 * @parent -> Particles 1 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P1 Transition Time
 * @desc Tempo para apresentar a imagem.
 * @default 0
 * @parent -> Particles 1 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param
 *
 * @param -> Particles 2 <<<<<<<<<<<<<<<<<<<<<<<
 * @desc
 *
 * @param P2 Visible
 * @desc Ativar partícula.
 * @default true
 * @type boolean
 * @parent -> Particles 2 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P2 File Name
 * @desc Nome do arquivo.
 * @default Particles2
 * @parent -> Particles 2 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P2 Amount
 * @desc Quantidade de partículas.
 * @default 5
 * @parent -> Particles 2 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P2 Z Index
 * @desc Prioridade Z do sprite.
 * @default 21
 * @parent -> Particles 2 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P2 X Speed
 * @desc Velocidade X-Axis.
 * @default 2
 * @parent -> Particles 2 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P2 Y Speed
 * @desc Velocidade Y-Axis.
 * @default 2
 * @parent -> Particles 2 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P2 Rotation Speed
 * @desc Velocidade de rotação.
 * @default 0.01
 * @parent -> Particles 2 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P2 Blend Mode
 * @desc Definição de blend.
 * @default 0
 * @type select
 * @option Normal
 * @value 0
 * @option Add
 * @value 1
 * @option Substract
 * @value 2
 * @parent -> Particles 2 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P2 Anchor
 * @desc Definição do anchor.
 * @default 0
 * @parent -> Particles 2 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P2 Leaf Mode
 * @desc Ativar animação de folha.
 * @default false
 * @type boolean
 * @parent -> Particles 2 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P2 Transition Time
 * @desc Tempo para apresentar a imagem.
 * @default 0
 * @parent -> Particles 2 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param
 *
 * @param -> Particles 3 <<<<<<<<<<<<<<<<<<<<<<<
 * @desc
 *
 * @param P3 Visible
 * @desc Ativar partícula.
 * @default true
 * @type boolean
 * @parent -> Particles 3 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P3 File Name
 * @desc Nome do arquivo.
 * @default Particles3
 * @parent -> Particles 3 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P3 Amount
 * @desc Quantidade de partículas.
 * @default 5
 * @parent -> Particles 3 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P3 Z Index
 * @desc Prioridade Z do sprite.
 * @default 22
 * @parent -> Particles 3 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P3 X Speed
 * @desc Velocidade X-Axis.
 * @default 0.5
 * @parent -> Particles 3 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P3 Y Speed
 * @desc Velocidade Y-Axis.
 * @default 0.5
 * @parent -> Particles 3 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P3 Rotation Speed
 * @desc Velocidade de rotação.
 * @default 0.006
 * @parent -> Particles 3 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P3 Blend Mode
 * @desc Definição de blend.
 * @default 0
 * @type select
 * @option Normal
 * @value 0
 * @option Add
 * @value 1
 * @option Substract
 * @value 2
 * @parent -> Particles 3 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P3 Anchor
 * @desc Definição do anchor.
 * @default 0
 * @parent -> Particles 3 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P3 Leaf Mode
 * @desc Ativar animação de folha.
 * @default true
 * @type boolean
 * @parent -> Particles 3 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P3 Transition Time
 * @desc Tempo para apresentar a imagem.
 * @default 0
 * @parent -> Particles 3 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param
 *
 * @param -> Particles 4 <<<<<<<<<<<<<<<<<<<<<<<
 * @desc
 *
 * @param P4 Visible
 * @desc Ativar partícula.
 * @default false
 * @type boolean
 * @parent -> Particles 4 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P4 File Name
 * @desc Nome do arquivo.
 * @default Particles4
 * @parent -> Particles 4 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P4 Amount
 * @desc Quantidade de partículas.
 * @default 25
 * @parent -> Particles 4 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P4 Z Index
 * @desc Prioridade Z do sprite.
 * @default 23
 * @parent -> Particles 4 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P4 X Speed
 * @desc Velocidade X-Axis.
 * @default 2
 * @parent -> Particles 4 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P4 Y Speed
 * @desc Velocidade Y-Axis.
 * @default 0.3
 * @parent -> Particles 4 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P4 Rotation Speed
 * @desc Velocidade de rotação.
 * @default 0.3
 * @parent -> Particles 4 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P4 Blend Mode
 * @desc Definição de blend.
 * @default 1
 * @type select
 * @option Normal
 * @value 0
 * @option Add
 * @value 1
 * @option Substract
 * @value 2
 * @parent -> Particles 4 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P4 Anchor
 * @desc Definição do anchor.
 * @default 0
 * @parent -> Particles 4 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P4 Leaf Mode
 * @desc Ativar animação de folha.
 * @default true
 * @type boolean
 * @parent -> Particles 4 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P4 Transition Time
 * @desc Tempo para apresentar a imagem.
 * @default 0
 * @parent -> Particles 4 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param
 *
 * @param -> Particles 5 <<<<<<<<<<<<<<<<<<<<<<<
 * @desc
 *
 * @param P5 Visible
 * @desc Ativar partícula.
 * @default false
 * @type boolean
 * @parent -> Particles 5 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P5 File Name
 * @desc Nome do arquivo.
 * @default Particles5
 * @parent -> Particles 5 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P5 Amount
 * @desc Quantidade de partículas.
 * @default 25
 * @parent -> Particles 5 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P5 Z Index
 * @desc Prioridade Z do sprite.
 * @default 24
 * @parent -> Particles 5 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P5 X Speed
 * @desc Velocidade X-Axis.
 * @default 4
 * @parent -> Particles 5 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P5 Y Speed
 * @desc Velocidade Y-Axis.
 * @default 0
 * @parent -> Particles 5 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P5 Rotation Speed
 * @desc Velocidade de rotação.
 * @default 0
 * @parent -> Particles 5 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P5 Blend Mode
 * @desc Definição de blend.
 * @default 1
 * @type select
 * @option Normal
 * @value 0
 * @option Add
 * @value 1
 * @option Substract
 * @value 2
 * @parent -> Particles 5 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P5 Anchor
 * @desc Definição do anchor.
 * @default 0
 * @parent -> Particles 5 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P5 Leaf Mode
 * @desc Ativar animação de folha.
 * @default false
 * @type boolean
 * @parent -> Particles 5 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P5 Transition Time
 * @desc Tempo para apresentar a imagem.
 * @default 0
 * @parent -> Particles 5 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param
 *
 * @param -> Particles 6 <<<<<<<<<<<<<<<<<<<<<<<
 * @desc
 *
 * @param P6 Visible
 * @desc Ativar partícula.
 * @default false
 * @type boolean
 * @parent -> Particles 6 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P6 File Name
 * @desc Nome do arquivo.
 * @default Particles6
 * @parent -> Particles 6 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P6 Amount
 * @desc Quantidade de partículas.
 * @default 25
 * @parent -> Particles 6 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P6 Z Index
 * @desc Prioridade Z do sprite.
 * @default 25
 * @parent -> Particles 6 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P6 X Speed
 * @desc Velocidade X-Axis.
 * @default 4
 * @parent -> Particles 6 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P6 Y Speed
 * @desc Velocidade Y-Axis.
 * @default 0
 * @parent -> Particles 6 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P6 Rotation Speed
 * @desc Velocidade de rotação.
 * @default 0
 * @parent -> Particles 6 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P6 Blend Mode
 * @desc Definição de blend.
 * @default 1
 * @type select
 * @option Normal
 * @value 0
 * @option Add
 * @value 1
 * @option Substract
 * @value 2
 * @parent -> Particles 6 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P6 Anchor
 * @desc Definição do anchor.
 * @default 0
 * @parent -> Particles 6 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P6 Leaf Mode
 * @desc Ativar animação de folha.
 * @default false
 * @type boolean
 * @parent -> Particles 6 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @param P6 Transition Time
 * @desc Tempo para apresentar a imagem.
 * @default 0
 * @parent -> Particles 6 <<<<<<<<<<<<<<<<<<<<<<<
 *
 * @help
 * =============================================================================
 * +++ MOG - Title Particles (v2.1) +++
 * By Moghunter
 * https://atelierrgss.wordpress.com/
 * =============================================================================
 * Adiciona partículas na tela de título.
 *
 * Grave as imagens na pasta.
 *
 * img/titles2/
 *
 * ============================================================================
 * - WHAT'S  NEW (version 2.1)
 * ============================================================================
 * - (NEW) - Plugins parameters compatíveis com RM1.5+
 */

//=============================================================================
// ** PLUGIN PARAMETERS
//=============================================================================
　　var Imported = Imported || {};
　　Imported.MOG_Title_Particles = true;
　　var Moghunter = Moghunter || {};

  　Moghunter.parameters = PluginManager.parameters('MOG_TitleParticles');
	Moghunter.tparticles_M = 6 ;
	Moghunter.tparticles_V = [];	Moghunter.tparticles_F = [];
	Moghunter.tparticles_N = [];	Moghunter.tparticles_X = [];
	Moghunter.tparticles_Y = [];	Moghunter.tparticles_R = [];
	Moghunter.tparticles_B = [];	Moghunter.tparticles_A = [];
	Moghunter.tparticles_L = [];
	Moghunter.tparticles_Z = [];
	Moghunter.tparticles_T = [];
	for (var i = 0; i < Moghunter.tparticles_M; i++) {
		Moghunter.tparticles_V[i]  = String(Moghunter.parameters['P' + String(i + 1) + " Visible"] || "true");
		Moghunter.tparticles_F[i]  = String(Moghunter.parameters['P' + String(i + 1) + " File Name"] || "Particles");
		Moghunter.tparticles_N[i]  = Number(Moghunter.parameters['P' + String(i + 1) + " Amount"] || 25);
		Moghunter.tparticles_X[i]  = Number(Moghunter.parameters['P' + String(i + 1) + " X Speed"] || 0);
		Moghunter.tparticles_Y[i]  = Number(Moghunter.parameters['P' + String(i + 1) + " Y Speed"] || -1);
		Moghunter.tparticles_Z[i]  = Number(Moghunter.parameters['P' + String(i + 1) + " Z Index"] || 20);
		Moghunter.tparticles_R[i]  = Number(Moghunter.parameters['P' + String(i + 1) + " Rotation Speed"] || 0.02);
		Moghunter.tparticles_B[i]  = Number(Moghunter.parameters['P' + String(i + 1) + " Blend Mode"] || 1);
		Moghunter.tparticles_A[i]  = Number(Moghunter.parameters['P' + String(i + 1) + " Anchor"] || 0);
		Moghunter.tparticles_L[i]  = String(Moghunter.parameters['P' + String(i + 1) + " Leaf Mode"] || "false");
		Moghunter.tparticles_T[i]  = Number(Moghunter.parameters['P' + String(i + 1) + " Transition Time"] || 60);
	};

//=============================================================================
// ** Scene Title
//=============================================================================

//==============================
// * Create
//==============================
var _mog_titleparticles_create = Scene_Title.prototype.create;
Scene_Title.prototype.create = function() {
	_mog_titleparticles_create.call(this);
	if (this._titleField) {this._titleField.children.sort(function(a, b){return a.zIndex-b.zIndex})}
};

//==============================
// * Create Background
//==============================
var _mog_title_particles_createBackground = Scene_Title.prototype.createBackground;
Scene_Title.prototype.createBackground = function() {
    _mog_title_particles_createBackground.call(this);
	if (!this._titleField) {this.createTitleField()};
};

//==============================
// * Create Title Field
//==============================
Scene_Title.prototype.createTitleField = function() {
    this._titleField = new Sprite();
	this.addChild(this._titleField);
};

//==============================
// * Create Background
//==============================
var _mog_titleparticles_createForeground = Scene_Title.prototype.createForeground;
Scene_Title.prototype.createForeground = function() {
	this.createParticles();
    _mog_titleparticles_createForeground.call(this);
};

//==============================
// * Create Particles
//==============================
Scene_Title.prototype.createParticles = function() {
    if (!this._titleField) {this.createTitleField()};
	this._tparticles = []
    for (var i = 0; i < Moghunter.tparticles_M; i++) {
      this._tparticles[i] = new TitleParticles(i);
	  this._tparticles[i].zIndex = Moghunter.tparticles_Z[i];
	  this._titleField.addChild(this._tparticles[i]);
    };
};

//=============================================================================
// ** Title Particles
//=============================================================================
function TitleParticles() {
    this.initialize.apply(this, arguments);
};

TitleParticles.prototype = Object.create(Sprite.prototype);
TitleParticles.prototype.constructor = TitleParticles;

//==============================
// * Initialize
//==============================
TitleParticles.prototype.initialize = function(index) {
    Sprite.prototype.initialize.call(this);
	this._index = index;
	this._enabled = String(Moghunter.tparticles_V[this._index]) === "true" ? true : false;
	this._t = Number(Moghunter.tparticles_T[this._index]);
    if (this._enabled) {
		this._img = ImageManager.loadTitle2(Moghunter.tparticles_F[this._index])
		this._start = false;
		this._img._cw = 0;
		this._img._ch = 0;
		this._img._cw2 = 0;
		this._img._ch2 = 0;
	};
};

//==============================
// * get Data
//==============================
TitleParticles.prototype.getData = function() {
	 this._img._cw = this._img.width;
	 this._img._cw2 = this._img._cw * 3;
	 this._img._ch = this._img.height;
	 this._img._ch2 = this._img._ch * 3;
	 this.createParticles();
};

//==============================
// * create Particles
//==============================
TitleParticles.prototype.createParticles = function() {
    this._spriteP = [];
	for (var i = 0;i < Moghunter.tparticles_N[this._index]; i++){
		 this._spriteP[i] = new Sprite(this._img);
		 this._spriteP[i].sx = [0,Number(Moghunter.tparticles_X[this._index])];
		 this._spriteP[i].sy = [0,Number(Moghunter.tparticles_Y[this._index])];
		 this._spriteP[i].rt = [0,Number(Moghunter.tparticles_R[this._index])];
		 this._spriteP[i].blendMode = Number(Moghunter.tparticles_B[this._index]);
		 this._spriteP[i].anchor.x = Number(Moghunter.tparticles_A[this._index]);
		 this._spriteP[i].anchor.y = Number(Moghunter.tparticles_A[this._index]);
		 this._spriteP[i].int = true;
		 this._spriteP[i].lef = [String(Moghunter.tparticles_L[this._index]) === "true" ? true : false,0,1.00,0];
		 this.addChild(this._spriteP[i]);
		 this.refreshParticles(this._spriteP[i]);
	};
	this._start = true;
};

//==============================
// * refresh Particles
//==============================
TitleParticles.prototype.refreshParticles = function(sprite) {
	 if (sprite.sx[1] != 0) {
	     var r = 0.7 + Math.abs(Math.random() * sprite.sx[1]);
		 sprite.sx[0] = sprite.sx[1] > 0 ? r : -r;
	 };
	 if (sprite.sy[1] != 0) {
	     var r = 0.7 + Math.abs(Math.random() * sprite.sy[1]);
		 sprite.sy[0] = sprite.sy[1] > 0 ? r : -r;
	 };
	 if (sprite.rt[1] != 0) {
	     var r = 0.03 + Math.abs(Math.random() * sprite.rt[1]);
		 sprite.rt[0] = sprite.rt[1] > 0 ? r : -r;
	 };
     var r = Math.randomInt(360) * 0.01;
     sprite.rotation = r;
	 var pz = ((Math.random() * 0.5) * 1);
	 sprite.scale = new PIXI.Point(0.5 + Number(pz), 0.5 + Number(pz));
	 sprite.lef[1] = 0;
	 sprite.lef[2] = sprite.scale.x;
	 sprite.lef[3] = 120 + Math.randomInt(180);
	 sprite.opacity = 0;
	 this.setPosition(sprite);
};

//==============================
// * set Position
//==============================
TitleParticles.prototype.setPosition = function(sprite) {
	if (sprite.int) {
        this.setStartPosition(sprite);
	} else {
        this.setPositionX(sprite);
        this.setPositionY(sprite);
	};
};

//==============================
// * set Start Position
//==============================
TitleParticles.prototype.setStartPosition = function(sprite) {
	var r = Math.randomInt(Graphics.boxWidth + this._img._cw2);
	sprite.x = -this._img._cw + r;
	var r = Math.randomInt(Graphics.boxHeight + this._img._ch2);
	sprite.y = -this._img._ch + r;
	sprite.int = false;
};

//==============================
// * set Position X
//==============================
TitleParticles.prototype.setPositionX = function(sprite) {
    if (sprite.sx[1] > 0) {
		var r = Math.randomInt(Graphics.boxWidth - this.lx1(sprite));
		sprite.x = this.lx1(sprite) + r;
	} else if (sprite.sx[1] < 0) {
		var r = Math.randomInt(Graphics.boxWidth - this.lx1(sprite));
		sprite.x = -this.lx1(sprite) + r;
	} else {
		var r = Math.randomInt(Graphics.boxWidth + this._img._cw * 2);
		sprite.x = -this._img._cw + r;
	};
};

//==============================
// * set Position Y
//==============================
TitleParticles.prototype.setPositionY = function(sprite) {
    if (sprite.sy[1] > 0) {
		 sprite.y = this.ly1();
	} else if (sprite.sy[1] < 0) {
		 sprite.y = this.ly2();
	} else {
		var r = Math.randomInt(Graphics.boxHeight + this._img._ch * 2);
		sprite.y = -this._img._ch + r;
	};
};

//==============================
// * lx1
//==============================
TitleParticles.prototype.lx1 = function(sprite) {
   if (sprite.sx[1] > 0) {return -Graphics.boxWidth / 2;
   } else {return -this._img._cw2};
};

//==============================
// * lx2
//==============================
TitleParticles.prototype.lx2 = function(sprite) {
    if (sprite.sx[1] > 0) {return Graphics.boxWidth + this._img._cw2;
	} else {return Graphics.boxWidth + Graphics.boxWidth / 2};
};

//==============================
// * ly1
//==============================
TitleParticles.prototype.ly1 = function(sprite) {
   return -this._img._ch2;
};

//==============================
// * ly2
//==============================
TitleParticles.prototype.ly2 = function(sprite) {
	return Graphics.boxHeight + this._img._ch2
};

//==============================
// * update Move
//==============================
TitleParticles.prototype.updateMove = function(sprite) {
     sprite.x += sprite.sx[0];
	 sprite.y += sprite.sy[0];
	 sprite.rotation += sprite.rt[0];
	 sprite.opacity += 15;
	 if (sprite.lef[0]) {this.updateLeaf(sprite)};
};

//==============================
// * update Leaf
//==============================
TitleParticles.prototype.updateLeaf = function(sprite) {
	sprite.lef[3]--;
	if (sprite.lef[3] > 0) {return};
	sprite.scale.x -= 0.01;
	if (sprite.scale.x < -sprite.lef[2]) {
		 sprite.lef[1] = 1;
		 sprite.scale.x = -sprite.lef[2];
	};
};

//==============================
// * Need Refresh
//==============================
TitleParticles.prototype.needRefresh = function(sprite) {
     if (sprite.x < this.lx1(sprite)) {return true};
	 if (sprite.x > this.lx2(sprite)) {return true};
	 if (sprite.y < this.ly1(sprite)) {return true};
	 if (sprite.y > this.ly2(sprite)) {return true};
	 return false
};

//==============================
// * update Particles
//==============================
TitleParticles.prototype.updateParticles = function() {
	 if (this._img.isReady() && !this._start) {this.getData()};
	 if (!this._start) {return};
	 if (!this._spriteP) {return};
	 if (this._t > 0) {this._t--; return};
	 for (var i = 0; i < this._spriteP.length; i++) {
		  this.updateMove(this._spriteP[i]);
		  if (this.needRefresh(this._spriteP[i])) {this.refreshParticles(this._spriteP[i])};
	 };
};

//==============================
// * Update
//==============================
TitleParticles.prototype.update = function() {
    Sprite.prototype.update.call(this);
    if (this._enabled) {this.updateParticles()};
};