code:
//=============================================================================
// MN_ShowPictureExtend - 画像の表示拡張
// ---------------------------------------------------------------------------
// author: minazuki
// ---------------------------------------------------------------------------
// ver:
//      1.0 (2020-05-15) 初版
// ---------------------------------------------------------------------------
// Copyright (c) 2020 minazuki
// Released under the MIT license
// https://opensource.org/licenses/mit-license.php
//=============================================================================

/*:
 * @plugindesc 画像表示を拡張 picturesのサブフォルダや別フォルダの画像が表示可能に
 * @author minazuki
 * @help
 *
 * --- 概要 --------------------------------------------------------------
 * $gameScreen.showPicture() では、pictureフォルダ直下の画像しか
 * 表示できませんでした。このプラグインを導入すると、ファイル名に
 * フォルダパスを入れた場合にはpictureフォルダ内のフォルダを参照して
 * 画像を表示することができます。また、ファイル名の先頭に'/'を入力すると
 * プロジェクトフォルダからのパスとなり、プロジェクト内のどの画像も
 * 表示することができます。
 *
 *
 * --- 導入方法 ----------------------------------------------------------
 * プラグインマネージャで読み込むだけで動作します。
 * 設定項目はありません。
 *
 *
 * --- 使い方 ------------------------------------------------------------
 * $gameScreen.showPicture()のファイル名にファイルパス指定ができます。
 * それだけです。詳しい使い方は以下の例をどうぞ。
 * ※「./」「../」は使用できません。
 *
 *
 * --- 例 ----------------------------------------------------------------
 * exp.1) picturesフォルダ内のサブフォルダにある画像を表示する
 *
 *   img / pictures / サブフォルダ / image.png
 *   の「image.png」を表示したい
 *     -> $gameScreen.showPicture()のファイル名部分に
 *        'サブフォルダ/image'    と指定する。
 *
 *
 * exp.2) exp.1 より更に下層のフォルダにある画像を表示する
 *
 *   img / pictures / サブフォルダ / サブフォルダ2 / image.png
 *   の「image.png」を表示したい
 *     -> $gameScreen.showPicture()のファイル名部分に
 *        'サブフォルダ/サブフォルダ2/image'    と指定する。
 *
 *
 * exp.3) enemiesフォルダ内の画像を表示する
 *
 *   img / enemies / enemyImage.png
 *   の「enemyImage.png」を表示したい
 *     -> $gameScreen.showPicture()のファイル名部分に
 *        '/img/enemies/enemyImage'    と指定する。
 *
 *   ※先頭の'/'に注意!!
 *
 *
 * exp.4) enemiesフォルダ内のサブフォルダにある画像を表示する
 *
 *   img / enemies / サブフォルダ / enemyImage.png
 *   の「enemyImage.png」を表示したい
 *     -> $gameScreen.showPicture()のファイル名部分に
 *        '/img/enemies/サブフォルダ/enemyImage'    と指定する。
 *
 *   ※先頭の'/'に注意!!
 *
 *
 * exp.5) プロジェクトフォルダ直下の画像を表示する
 *
 *   (projectフォルダ) / projectImage.png
 *   の「projectImage.png」を表示したい
 *     -> $gameScreen.showPicture()のファイル名部分に
 *        '/projectImage'    と指定する。
 *
 *   ※先頭の'/'に注意!!
 *
 *
 */

(function () {
  "use strict";

  const defaultFilePath = "img/pictures/";
  const separator = "/";
  const sepReg = new RegExp(separator);

  var ImageManager_loadPicture = ImageManager.loadPicture;
  ImageManager.loadPicture = function (filename, hue) {
    if (filename.match(sepReg)) {
      var fn = filename.split(separator);
      var path =
        filename.slice(0, 1) == separator ? fn.shift() : defaultFilePath;
      for (var i = 0; i < fn.length - 1; i++) {
        path += fn[i] + separator;
      }
      return this.loadBitmap(path, fn[fn.length - 1], hue, true);
    }
    return ImageManager_loadPicture.call(this, filename, hue);
  };
})();

repo_name: dazed/translations

license: unknown


code:
//=============================================================================
// MOG_BattlerMotion.js
//=============================================================================

/*:
 * @plugindesc (v1.8) Adiciona efeitos animados nos battlers.
 * @author Moghunter
 *
 * @param Shake Effect Actor
 * @desc Ativar o efeito tremer no aliado.
 * @default true
 *
 * @param Shake Effect Enemy
 * @desc Ativar o efeito tremer no aliado.
 * @default true
 *
 * @param Disable Blink Damage
 * @desc Desativar o efeito de piscar o battler no dano.
 * @default false
 *
 * @help
 * =============================================================================
 * +++ MOG - Battler Motion (v1.8) +++
 * By Moghunter
 * https://atelierrgss.wordpress.com/
 * =============================================================================
 * Adiciona efeitos animados nos battlers.
 *
 * =============================================================================
 * Para definir a animação de ação use a Tag abaixo na caixa de notas da skill.
 *
 * Motion Action: X
 *
 * 1 - Efeito Zoom.
 * 2 - Efeito giro para direita.
 * 3 - Efeito giro para esquerda.
 * 4 - Efeito pular.
 * 5 - Efeito ataque frontal.
 * 6 - Efeito rotação.
 * 7 - Efeito mover para direita.
 *
 * =============================================================================
 * Para ativar os esfeitos de animações em posição de espera use as Tags abaixo.
 *
 * Breath Effect
 * Float Effect
 * Swing Effect
 *
 * =============================================================================
 * Histórico.
 * =============================================================================
 * (1.8) - Compatibilidade com o MOG Consecutive Battles.
 *       - Melhoria na compatibilidade com MOG Emerge Motion.
 * (1.7) - Compatibilidade com o MOG Emerge Motion.
 * (1.6) - Compatibilidade com o MOG Flash Damage.
 * (1.5) - Correção do glitch gráfico aleatório no modo flutuar.
 * (1.4) - Correção da animação de ação em ações forçadas.
 * (1.3) - Correção do Crash relativo as Notetags.
 * (1.2) - Correção de não atualizar o efeito ao transformar o inimigo.
 *       - Correção do efeito tremer ao reviver o aliado.
 * (1.1) - Melhoria na animação de ação.
 *
 */

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

Moghunter.parameters = PluginManager.parameters("MOG_BattlerMotion");
Moghunter.b_motion_shake_effect_actor = String(
  Moghunter.parameters["Shake Effect Actor"] || "true"
);
Moghunter.b_motion_shake_effect_enemy = String(
  Moghunter.parameters["Shake Effect Enemy"] || "true"
);
Moghunter.b_motion_disable_blink_damage = String(
  Moghunter.parameters["Disable Blink Damage"] || "false"
);

//=============================================================================
// ** Game System
//=============================================================================

//==============================
// * Initialize
//==============================
var _alias_mog_bmotion_sys_initialize = Game_System.prototype.initialize;
Game_System.prototype.initialize = function () {
  _alias_mog_bmotion_sys_initialize.call(this);
  this._bmotion = [false, false, false];
  if (String(Moghunter.b_motion_shake_effect_actor) === "true") {
    this._bmotion[0] = true;
  }
  if (String(Moghunter.b_motion_shake_effect_enemy) === "true") {
    this._bmotion[1] = true;
  }
  if (String(Moghunter.b_motion_disable_blink_damage) === "true") {
    this._bmotion[2] = true;
  }
};

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

//==============================
// * Prepare
//==============================
var _alias_mog_bmotion_gaction_prepare = Game_Action.prototype.prepare;
Game_Action.prototype.prepare = function () {
  _alias_mog_bmotion_gaction_prepare.call(this);
  if (this.subject().isEnemy()) {
    this.subject().set_bmotion_action(this._item);
  }
};

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

//==============================
// ** iniMembers
//==============================
var _alias_mog_bmotion_gbattler_initMembers =
  Game_Battler.prototype.initMembers;
Game_Battler.prototype.initMembers = function () {
  _alias_mog_bmotion_gbattler_initMembers.call(this);
  this.set_motion_data();
};

//==============================
// * 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]+/);
  }
};

//==============================
// ** Set Motion Data
//==============================
Game_Battler.prototype.set_motion_data = function () {
  this.clear_action_data();
  this._motion_damage_duration = 0;
  this._motion_damage_xy = [0, 0];
  this._motion_idle_xy = [0, 0];
  this._motion_idle_scale = [1.0, 1.0];
  this._motion_idle_rotation = 0;
  this._motion_collapse_scale = [0, 0];
  this._motion_collapse_rotation = 0;
  this._motion_breath = [0, 0, 0, 1.03, 0, false];
  this._motion_fly = [0, 0, 0, 60, 0.35, false];
  this._motion_swing = [0, 0.003, 0.1, 60, 0.35, false];
};

//==============================
// ** Clear Action Data
//==============================
Game_Battler.prototype.clear_action_data = function () {
  this._motion_action_data = [0, 0, 0, 0];
  this._motion_action_xy = [0, 0];
  this._motion_action_scale = [0, 0];
  this._motion_action_rotation = 0;
  if (Imported.MOG_EnemyPoses && this._batPoses) {
    this._batPoses[2] = 1;
  }
};

//==============================
// ** Is MotionActing
//==============================
Game_Battler.prototype.is_motionActing = function () {
  return this._motion_action_data[0] != 0;
};

//==============================
// ** Set Battler Motion Data
//==============================
Game_Battler.prototype.set_battler_motion_data = function () {
  for (var i = 0; i < this.notetags().length; i++) {
    if (this.notetags()[i] == "Breath Effect") {
      this._motion_breath[5] = true;
    }
    if (this.notetags()[i] == "Float Effect") {
      this._motion_fly[5] = true;
    }
    if (this.notetags()[i] == "Swing Effect") {
      this._motion_swing[5] = true;
    }
  }
};

//==============================
// ** OnBattleStart
//==============================
var _alias_mog_bmotion_gbattler_onBattleStart =
  Game_Battler.prototype.onBattleStart;
Game_Battler.prototype.onBattleStart = function () {
  _alias_mog_bmotion_gbattler_onBattleStart.call(this);
  this.set_motion_data();
};

//==============================
// ** Motion Xaxis
//==============================
Game_Battler.prototype.motion_Xaxis = function () {
  return (
    this._motion_idle_xy[0] +
    this._motion_action_xy[0] +
    this._motion_damage_xy[0]
  );
};

//==============================
// ** Motion Yaxis
//==============================
Game_Battler.prototype.motion_Yaxis = function () {
  return (
    this._motion_idle_xy[1] +
    this._motion_action_xy[1] +
    this._motion_damage_xy[1]
  );
};

//==============================
// ** Motion ScaleX
//==============================
Game_Battler.prototype.motion_ScaleX = function () {
  return (
    this._motion_idle_scale[0] +
    this._motion_action_scale[0] +
    this._motion_collapse_scale[0]
  );
};

//==============================
// ** Motion ScaleY
//==============================
Game_Battler.prototype.motion_ScaleY = function () {
  return (
    this._motion_idle_scale[1] +
    this._motion_action_scale[1] +
    this._motion_collapse_scale[1]
  );
};

//==============================
// ** Motion Rotation
//==============================
Game_Battler.prototype.motion_rotation = function () {
  return (
    this._motion_idle_rotation +
    this._motion_action_rotation +
    this._motion_collapse_rotation
  );
};

//==============================
// ** is Breath Mode
//==============================
Game_Battler.prototype.is_breath_mode = function () {
  return this._motion_breath[5];
};

//==============================
// ** is Flying Mode
//==============================
Game_Battler.prototype.is_fly_mode = function () {
  return this._motion_fly[5] == true;
};

//==============================
// ** is Swing Mode
//==============================
Game_Battler.prototype.is_swing_mode = function () {
  return this._motion_swing[5];
};

//==============================
// ** Motion Shake
//==============================
Game_Battler.prototype.motion_shake = function () {
  this._motion_damage_duration = 30;
};

//==============================
// * Force Action
//==============================
var _mog_batmotion_forceAction = Game_Battler.prototype.forceAction;
Game_Battler.prototype.forceAction = function (skillId, targetIndex) {
  _mog_batmotion_forceAction.call(this, skillId, targetIndex);
  if (this._actions[0]) {
    this.set_bmotion_action(this._actions[0]._item);
  }
};

//==============================
// * Set Bmotion Action
//==============================
Game_Battler.prototype.set_bmotion_action = function (item) {
  if (!item || !item.object()) {
    return;
  }
  var item_notes = item.object().note.split(/[\r\n]+/);
  item_notes.forEach(function (note) {
    var note_data = note.split(": ");
    if (note_data[0].toLowerCase() == "motion action") {
      var par = note_data[1].split(":");
      this.clear_action_data();
      this._motion_action_data[0] = Number(par[0]);
    }
  }, this);
};

//=============================================================================
// ** Game Enemy
//=============================================================================

//==============================
// * Setup
//==============================
var _alias_mog_bmotion_genmy_setup = Game_Enemy.prototype.setup;
Game_Enemy.prototype.setup = function (enemyId, x, y) {
  _alias_mog_bmotion_genmy_setup.call(this, enemyId, x, y);
  this.set_motion_data();
};

//==============================
// * Transform
//==============================
var _alias_mog_bmotion_transform = Game_Enemy.prototype.transform;
Game_Enemy.prototype.transform = function (enemyId) {
  _alias_mog_bmotion_transform.call(this, enemyId);
  this.set_motion_data();
};

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

//==============================
// * Apply
//==============================
var _alias_mog_bmotion_gact_apply = Game_Action.prototype.apply;
Game_Action.prototype.apply = function (target) {
  var old_hp = target.hp;
  _alias_mog_bmotion_gact_apply.call(this, target);
  if (target.hp < old_hp) {
    if (target.isActor() && $gameSystem._bmotion[0]) {
      target.motion_shake();
    }
    if (target.isEnemy() && $gameSystem._bmotion[1]) {
      target.motion_shake();
    }
  }
  if (target.isDead()) {
    this._motion_damage_duration = 0;
  }
  if (this.item() && this.item().damage.type != 1) {
    target._motion_damage_duration = 0;
  }
};

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

//==============================
// * create BMotion Shadow
//==============================
Spriteset_Battle.prototype.createBMotionShadow = function () {
  this._sprite_shadow = [];
  for (var i = 0; i < $gameTroop.members().length; i++) {
    this._sprite_shadow[i] = new SpriteBattlerShadow();
    this._sprite_shadow[i].z = 0;
    this._battleField.addChild(this._sprite_shadow[i]);
  }
};

//==============================
// * remove BMotion Shadow
//==============================
Spriteset_Battle.prototype.removeBMotionShadow = function () {
  for (var i = 0; i < this._sprite_shadow.length; i++) {
    this._battleField.removeChild(this._sprite_shadow[i]);
  }
};

//==============================
// * add BMotion Shadow
//==============================
Spriteset_Battle.prototype.addBMotionShadow = function () {
  for (var i = 0; i < this._enemySprites.length; i++) {
    this._enemySprites[i].add_shadow(this._sprite_shadow[i]);
  }
};

//==============================
// * create Enemies
//==============================
var _alias_mog_bmotion_spriteseBattle_createEnemies =
  Spriteset_Battle.prototype.createEnemies;
Spriteset_Battle.prototype.createEnemies = function () {
  this.createBMotionShadow();
  _alias_mog_bmotion_spriteseBattle_createEnemies.call(this);
  this.addBMotionShadow();
};

//=============================================================================
// ** Sprite Enemy
//=============================================================================

//==============================
// * Add Shadow
//==============================
Sprite_Enemy.prototype.add_shadow = function (sprite_shadow) {
  this._spriteShadow = sprite_shadow;
};

//==============================
// * iniVisibility
//==============================
var _alias_mog_bmotion_spenemy_initVisibility =
  Sprite_Enemy.prototype.initVisibility;
Sprite_Enemy.prototype.initVisibility = function () {
  _alias_mog_bmotion_spenemy_initVisibility.call(this);
  this._check_initsetup = true;
};

//==============================
// * updateBitmap
//==============================
var _alias_mog_bmotion_senmy_updateBitmap = Sprite_Enemy.prototype.updateBitmap;
Sprite_Enemy.prototype.updateBitmap = function () {
  _alias_mog_bmotion_senmy_updateBitmap.call(this);
  if (this._check_duration < 10) {
    this._check_duration += 1;
  }
  if (this._check_duration > 1) {
    if (this._check_initsetup && this.bitmap.isReady()) {
      this.set_bmotion_setup();
    }
  }
};

//==============================
// * startBlink
//==============================
var _alias_mog_bmotion_srtenemy_startBlink = Sprite_Enemy.prototype.startBlink;
Sprite_Enemy.prototype.startBlink = function () {
  if ($gameSystem._bmotion[2]) {
    this._effectDuration = 1;
    return;
  }
  _alias_mog_bmotion_srtenemy_startBlink.call(this);
};

//=============================================================================
// ** Sprite_Battler
//=============================================================================
var _alias_mog_bmotion_sprtb_initialize = Sprite_Battler.prototype.initialize;
Sprite_Battler.prototype.initialize = function (battler) {
  _alias_mog_bmotion_sprtb_initialize.call(this, battler);
  this._check_initsetup = true;
  this._check_duration = 0;
};

//==============================
// * initMembers
//==============================
var _alias_mog_bmotion_sprtb_initMembers = Sprite_Battler.prototype.initMembers;
Sprite_Battler.prototype.initMembers = function () {
  _alias_mog_bmotion_sprtb_initMembers.call(this);
  this._check_initsetup = true;
};

//==============================
// * Set Motion Setup
//==============================
Sprite_Battler.prototype.set_bmotion_setup = function () {
  this._check_initsetup = false;
  this._battler.set_battler_motion_data();
  if (this._battler.is_breath_mode()) {
    this.set_breath_mode();
  }
  if (this._battler.is_fly_mode()) {
    this.set_fly_mode();
  }
  if (this._battler.is_swing_mode()) {
    this.set_swing_mode();
  }
};

//==============================
// * Set Breath Mode
//==============================
Sprite_Battler.prototype.set_breath_mode = function () {
  this._battler._motion_breath = [0, 0, 0, 1.03, 2, true];
  if (this.bitmap.height <= 100) {
    this._battler._motion_breath[4] = 1;
  }
  if (this.bitmap.height >= 300) {
    this._battler._motion_breath[4] = 3;
  }
  var rz = (Math.random() * 0.06).toFixed(3);
  this.scale.y = 1.0 + Number(rz);
  var rz = Math.floor(Math.random() * 2);
  this._battler._motion_breath[0] = rz;
  var rz = Math.floor(Math.random() * 5);
  var rz = (rz * 0.0001).toFixed(4);
  this._battler._motion_breath[1] = 0.0025 + Number(rz);
  if (Imported.MOG_EmergeMotion) {
    this.scale.y = 1.0;
  }
};

//==============================
// * Set Fly Mode
//==============================
Sprite_Battler.prototype.set_fly_mode = function () {
  this._battler._motion_fly = [this.x, this.y, 0, 40, 0.35, true];
  this._battler._motion_fly[2] = Math.floor(Math.random() * 2);
  this._battler._motion_fly[3] += Math.floor(Math.random() * 5);
  var rz = (Math.random() * 0.1).toFixed(2);
  this._battler._motion_fly[4] = 0;
  if (!Imported.MOG_EmergeMotion) {
    this._battler._motion_idle_xy[1] = -Math.floor(
      Math.random() * this._battler._motion_fly[3]
    );
  }
};

//==============================
// * Set Swing Mode
//==============================
Sprite_Battler.prototype.set_swing_mode = function () {
  this._battler._motion_swing = [0, 0.003, 0.1, 0, 0.35, true];
  var rz = (Math.random() * 0.1).toFixed(2);
  this.rotation = Number(rz);
  this._battler._motion_swing[0] += Math.floor(Math.random() * 2);
  if (Imported.MOG_EmergeMotion) {
    this.rotation = 0;
  }
};

//==============================
// * Update Position
//==============================
var _alias_mog_battlerMotion_sprbtr_updatePosition =
  Sprite_Battler.prototype.updatePosition;
Sprite_Battler.prototype.updatePosition = function () {
  _alias_mog_battlerMotion_sprbtr_updatePosition.call(this);
  this.update_bmotion_position();
};

//==============================
// * Update Main
//==============================
var _alias_mog_bmotion_updateMain = Sprite_Battler.prototype.updateMain;
Sprite_Battler.prototype.updateMain = function () {
  _alias_mog_bmotion_updateMain.call(this);
  this.update_bmotion();
};

//==============================
// * Update Bmotion Position
//==============================
Sprite_Battler.prototype.update_bmotion_position = function () {
  this.x += this._battler.motion_Xaxis();
  this.y += this._battler.motion_Yaxis();
  this.scale.x = this._battler.motion_ScaleX();
  this.scale.y = this._battler.motion_ScaleY();
  this.rotation = this._battler.motion_rotation();
};

//==============================
// * Update Bmotion Position
//==============================
Sprite_Battler.prototype.update_bmotion = function () {
  if (this._spriteShadow != null) {
    this._spriteShadow.update_shadow(this);
  }
  if (this._battler.isDead()) {
    return;
  }
  if (this._battler._motion_damage_duration > 0) {
    this.update_motion_damage();
  }
  if (this._battler.is_motionActing()) {
    this.update_motion_action();
  } else {
    this.update_motion_idle();
  }
};

//==============================
// * Update Motion_Standy
//==============================
Sprite_Battler.prototype.update_motion_idle = function () {
  if (Imported.MOG_EmergeMotion) {
    if (this._battler && this._battler._emerge[0]) {
      return;
    }
  }
  if (this._battler.isActor()) {
    return;
  }
  if (this._battler.is_breath_mode()) {
    this.update_idle_breath_mode();
  }
  if (this._battler.is_fly_mode()) {
    this.update_idle_fly_mode();
  }
  if (this._battler.is_swing_mode()) {
    this.update_idle_swing_mode();
  }
};

//==============================
// * Update Idle Breath Mode
//==============================
Sprite_Battler.prototype.update_idle_breath_mode = function () {
  this._battler._motion_breath[2] += 1;
  if (this._battler._motion_breath[2] < this._battler._motion_breath[4]) {
    return;
  }
  this._battler._motion_breath[2] = 0;
  if (this._battler._motion_breath[0] == 0) {
    this._battler._motion_idle_scale[1] += this._battler._motion_breath[1];
    if (this._battler._motion_idle_scale[1] > this._battler._motion_breath[3]) {
      this._battler._motion_idle_scale[1] = this._battler._motion_breath[3];
      this._battler._motion_breath[0] = 1;
    }
  } else {
    this._battler._motion_idle_scale[1] -= this._battler._motion_breath[1];
    if (this._battler._motion_idle_scale[1] < 1.0) {
      this._battler._motion_idle_scale[1] = 1.0;
      this._battler._motion_breath[0] = 0;
    }
  }
};

//==============================
// * Update Idle Fly Mode
//==============================
Sprite_Battler.prototype.update_idle_fly_mode = function () {
  this._battler._motion_fly[4]++;
  if (this._battler._motion_fly[4] < 3) {
    return;
  }
  this._battler._motion_fly[4] = 0;
  if (this._battler._motion_fly[2] === 0) {
    this._battler._motion_idle_xy[1] -= 1;
    if (this._battler._motion_idle_xy[1] <= -this._battler._motion_fly[3]) {
      this._battler._motion_idle_xy[1] = -this._battler._motion_fly[3];
      this._battler._motion_fly[2] = 1;
    }
  } else {
    this._battler._motion_idle_xy[1] += 1;
    if (this._battler._motion_idle_xy[1] >= -20) {
      this._battler._motion_idle_xy[1] = -20;
      this._battler._motion_fly[2] = 0;
    }
  }
};

//==============================
// * Update Swing Mode
//==============================
Sprite_Battler.prototype.update_idle_swing_mode = function () {
  if (this._battler._motion_swing[0] === 0) {
    this._battler._motion_idle_rotation += this._battler._motion_swing[1];
    if (this._battler._motion_idle_rotation >= this._battler._motion_swing[2]) {
      this._battler._motion_idle_rotation = this._battler._motion_swing[2];
      this._battler._motion_swing[0] = 1;
    }
  } else {
    this._battler._motion_idle_rotation -= this._battler._motion_swing[1];
    if (
      this._battler._motion_idle_rotation <= -this._battler._motion_swing[2]
    ) {
      this._battler._motion_idle_rotation = -this._battler._motion_swing[2];
      this._battler._motion_swing[0] = 0;
    }
  }
};

//==============================
// * Update Motion Damage
//==============================
Sprite_Battler.prototype.update_motion_damage = function () {
  if (Imported.MOG_FlashDamage && this._battler._flashDamage) {
    return;
  }
  this._battler._motion_damage_xy[0] = Math.random() * 12 - 6;
  this._battler._motion_damage_duration -= 1;
  if (this._battler._motion_damage_duration <= 0) {
    this._battler._motion_damage_xy = [0, 0];
  }
};

//==============================
// * Update Motion Action
//==============================
Sprite_Battler.prototype.update_motion_action = function () {
  if (this._battler.isActor()) {
    return;
  }
  switch (this._battler._motion_action_data[0]) {
    case 1:
      this.update_action_zoom();
      break;
    case 2:
      this.update_action_swing_right();
      break;
    case 3:
      this.update_action_swing_left();
      break;
    case 4:
      this.update_action_jump();
      break;
    case 5:
      this.update_action_frontal_attack();
      break;
    case 6:
      this.update_action_rotation();
      break;
    case 7:
      this.update_action_move_right();
      break;
    default:
      this._battler.clear_action_data();
      break;
  }
};

//==============================
// * Update Action Zoom
//==============================
Sprite_Battler.prototype.update_action_zoom = function () {
  this._battler._motion_action_data[1] += 1;
  if (this._battler._motion_action_data[1] < 20) {
    this._battler._motion_action_scale[0] += 0.005;
  } else if (this._battler._motion_action_data[1] < 40) {
    this._battler._motion_action_scale[0] -= 0.005;
  } else {
    this._battler.clear_action_data();
  }
  this._battler._motion_action_scale[1] = this._battler._motion_action_scale[0];
};

//==============================
// * Update Action Swing Right
//==============================
Sprite_Battler.prototype.update_action_swing_right = function () {
  this._battler._motion_action_data[1] += 1;
  if (this._battler._motion_action_data[1] < 10) {
    this._battler._motion_action_scale[0] = 0;
    this._battler._motion_action_xy[0] += 6;
    this._battler._motion_action_xy[1] += 6;
  } else if (this._battler._motion_action_data[1] < 30) {
    this._battler._motion_action_scale[0] = -2.0;
    this._battler._motion_action_xy[0] -= 6;
  } else if (this._battler._motion_action_data[1] < 40) {
    this._battler._motion_action_scale[0] = 0;
    this._battler._motion_action_xy[0] += 6;
    this._battler._motion_action_xy[1] -= 6;
  } else {
    this._battler.clear_action_data();
  }
};

//==============================
// * Update Action Swing Left
//==============================
Sprite_Battler.prototype.update_action_swing_left = function () {
  this._battler._motion_action_data[1] += 1;
  if (this._battler._motion_action_data[1] < 10) {
    this._battler._motion_action_scale[0] = -2.0;
    this._battler._motion_action_xy[0] -= 6;
    this._battler._motion_action_xy[1] += 6;
  } else if (this._battler._motion_action_data[1] < 30) {
    this._battler._motion_action_scale[0] = 0;
    this._battler._motion_action_xy[0] += 6;
  } else if (this._battler._motion_action_data[1] < 40) {
    this._battler._motion_action_scale[0] = -2.0;
    this._battler._motion_action_xy[0] -= 6;
    this._battler._motion_action_xy[1] -= 6;
  } else {
    this._battler.clear_action_data();
  }
};

//==============================
// * Update Action Jump
//==============================
Sprite_Battler.prototype.update_action_jump = function () {
  this._battler._motion_action_data[1] += 1;
  if (this._battler._motion_action_data[1] < 15) {
    this._battler._motion_action_xy[1] -= 6;
  } else if (this._battler._motion_action_data[1] < 30) {
    this._battler._motion_action_xy[1] += 6;
  } else {
    this._battler.clear_action_data();
  }
};

//==============================
// * Update Action Frontal
//==============================
Sprite_Battler.prototype.update_action_frontal_attack = function () {
  this._battler._motion_action_data[1] += 1;
  if (this._battler._motion_action_data[1] < 10) {
    this._battler._motion_action_rotation -= 0.03;
  } else if (this._battler._motion_action_data[1] < 30) {
    this._battler._motion_action_rotation += 0.04;
  } else if (this._battler._motion_action_data[1] < 40) {
    this._battler._motion_action_rotation -= 0.06;
  } else {
    this._battler.clear_action_data();
  }
};

//==============================
// * Update Action Rotation
//==============================
Sprite_Battler.prototype.update_action_rotation = function () {
  this._battler._motion_action_data[1] += 1;
  if (this._battler._motion_action_data[1] < 30) {
    this._battler._motion_action_rotation += 0.2;
  } else {
    this._battler.clear_action_data();
  }
};

//==============================
// * Update Move Right
//==============================
Sprite_Battler.prototype.update_action_move_right = function () {
  this._battler._motion_action_data[1] += 1;
  if (this._battler._motion_action_data[1] < 15) {
    this._battler._motion_action_xy[0] += 6;
  } else if (this._battler._motion_action_data[1] < 30) {
    this._battler._motion_action_xy[0] -= 6;
  } else {
    this._battler.clear_action_data();
  }
};

//=============================================================================
// * SpriteBattlerShadow
//=============================================================================
function SpriteBattlerShadow() {
  this.initialize.apply(this, arguments);
}

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

//==============================
// * Initialize
//==============================
SpriteBattlerShadow.prototype.initialize = function () {
  Sprite.prototype.initialize.call(this);
  this.opacity = 0;
  this.visible = false;
  this._data = [false, false];
};

//==============================
// * Load File
//==============================
SpriteBattlerShadow.prototype.loadFiles = function (sprite) {
  if (!sprite._battler.is_fly_mode()) {
    return;
  }
  this._data = [true, false];
  this.bitmap = sprite.bitmap;
};

//==============================
// * Set Data
//==============================
SpriteBattlerShadow.prototype.set_data = function (sprite) {
  this._data = [true, true];
  this.setBlendColor([0, 0, 0, 255]);
  this.anchor.x = 0.5;
  this.anchor.y = 0.5;
  this.z = 1;
};

//==============================
// * Update Shadow
//==============================
SpriteBattlerShadow.prototype.update_shadow = function (sprite) {
  if (!this._data[0]) {
    this.loadFiles(sprite);
    return;
  }
  if (!this.bitmap.isReady()) {
    return;
  }
  if (!this._data[1]) {
    this.set_data(sprite);
  }
  if (!sprite._battler.is_fly_mode()) {
    this.visible = false;
    return;
  }
  this.x = sprite.x;
  ny = 0;
  if (this.need_set_ny_action(sprite._battler)) {
    ny = sprite._battler._motion_action_xy[1];
  }
  this.y = sprite.y - sprite._battler._motion_idle_xy[1] - ny;
  nz = Number((sprite._battler._motion_idle_xy[1] / 3) * 0.004);
  this.scale.x = 1.4 + nz;
  this.scale.y = 0.3 + nz;
  this.opacity = sprite.opacity - 90;
  this.visible = sprite.visible;
};

//==============================
// * Need set ny Action
//==============================
SpriteBattlerShadow.prototype.need_set_ny_action = function (battler) {
  if (battler._motion_action_data[0] == 4) {
    return true;
  }
  return false;
};


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

/*:
 * @plugindesc (v1.3) 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.3) +++
 * 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
 *
 * =============================================================================
 * HISTÓRICO
 * =============================================================================
 * (v1.3) - Compatibilidade com MOG Consecutive Battles.
 * (v1.2) - Correção de apresentar o HP dos aliados no modo batalha frontal.
 *        - Melhoria na codificação e na compatibilidade de plugins.
 */

//=============================================================================
// ** 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 (typeof this._ehpgauge === "undefined")
      this._ehpgauge = [false, 0, 0, false, false];
    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.loadPicture("HPGaugeActor_A");
    this._meterImg = ImageManager.loadPicture("HPGaugeActor_B");
    this._numberImg = ImageManager.loadPicture("HPGaugeActor_C");
  } else {
    this._layImg = ImageManager.loadPicture("HPGaugeEnemy_A");
    this._meterImg = ImageManager.loadPicture("HPGaugeEnemy_B");
    this._numberImg = ImageManager.loadPicture("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;
  }
  if (typeof $gameSystem._hpGaugeEDef === "undefined")
    $gameSystem._hpGaugeEDef = [];
  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 (typeof this.battler()._ehpgauge === "undefined")
    this.battler()._ehpgauge = [false, 0, 0, false, 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 () {
  var xs = this.forceVisible() ? 0 : this._slideX;
  return this._sprite.x + xs + this.battler()._ehpgauge[1];
};

//==============================
// * pos Y
//==============================
HPGaugeSprite.prototype.posY = function () {
  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();
};

//==============================
// * 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.0) Adiciona partículas na tela de título.
 * @author Moghunter
 *
 * @param P1 Visible
 * @desc Ativar partícula.
 * @default true
 *
 * @param P1 File Name
 * @desc Nome do arquivo.
 * @default Particles
 *
 * @param P1 Amount
 * @desc Quantidade de partículas.
 * @default 25
 *
 * @param P1 Z Index
 * @desc Prioridade Z do sprite.
 * @default 20
 *
 * @param P1 X Speed
 * @desc Velocidade X-Axis.
 * @default -10
 *
 * @param P1 Y Speed
 * @desc Velocidade Y-Axis.
 * @default -1
 *
 * @param P1 Rotation Speed
 * @desc Velocidade de rotação.
 * @default 0.02
 *
 * @param P1 Blend Mode
 * @desc Definição de blend.
 * @default 1
 *
 * @param P1 Anchor
 * @desc Definição do anchor.
 * @default 0
 *
 * @param P1 Leaf Mode
 * @desc Ativar animação de folha.
 * @default false
 *
 * @param P1 Transition Time
 * @desc Tempo para apresentar a imagem.
 * @default 0
 *
 * @param ---------------------------------------------------------------------
 *
 * @param P2 Visible
 * @desc Ativar partícula.
 * @default true
 *
 * @param P2 File Name
 * @desc Nome do arquivo.
 * @default Particles2
 *
 * @param P2 Amount
 * @desc Quantidade de partículas.
 * @default 5
 *
 * @param P2 Z Index
 * @desc Prioridade Z do sprite.
 * @default 21
 *
 * @param P2 X Speed
 * @desc Velocidade X-Axis.
 * @default 2
 *
 * @param P2 Y Speed
 * @desc Velocidade Y-Axis.
 * @default 2
 *
 * @param P2 Rotation Speed
 * @desc Velocidade de rotação.
 * @default 0.01
 *
 * @param P2 Blend Mode
 * @desc Definição de blend.
 * @default 0
 *
 * @param P2 Anchor
 * @desc Definição do anchor.
 * @default 0
 *
 * @param P2 Leaf Mode
 * @desc Ativar animação de folha.
 * @default false
 *
 * @param P2 Transition Time
 * @desc Tempo para apresentar a imagem.
 * @default 0
 *
 * @param ---------------------------------------------------------------------
 *
 * @param P3 Visible
 * @desc Ativar partícula.
 * @default true
 *
 * @param P3 File Name
 * @desc Nome do arquivo.
 * @default Particles3
 *
 * @param P3 Amount
 * @desc Quantidade de partículas.
 * @default 5
 *
 * @param P3 Z Index
 * @desc Prioridade Z do sprite.
 * @default 22
 *
 * @param P3 X Speed
 * @desc Velocidade X-Axis.
 * @default 0.5
 *
 * @param P3 Y Speed
 * @desc Velocidade Y-Axis.
 * @default 0.5
 *
 * @param P3 Rotation Speed
 * @desc Velocidade de rotação.
 * @default 0.006
 *
 * @param P3 Blend Mode
 * @desc Definição de blend.
 * @default 0
 *
 * @param P3 Anchor
 * @desc Definição do anchor.
 * @default 0
 *
 * @param P3 Leaf Mode
 * @desc Ativar animação de folha.
 * @default true
 *
 * @param P3 Transition Time
 * @desc Tempo para apresentar a imagem.
 * @default 0
 *
 * @param ---------------------------------------------------------------------
 *
 * @param P4 Visible
 * @desc Ativar partícula.
 * @default false
 *
 * @param P4 File Name
 * @desc Nome do arquivo.
 * @default Particles4
 *
 * @param P4 Amount
 * @desc Quantidade de partículas.
 * @default 25
 *
 * @param P4 Z Index
 * @desc Prioridade Z do sprite.
 * @default 23
 *
 * @param P4 X Speed
 * @desc Velocidade X-Axis.
 * @default 2
 *
 * @param P4 Y Speed
 * @desc Velocidade Y-Axis.
 * @default 0.3
 *
 * @param P4 Rotation Speed
 * @desc Velocidade de rotação.
 * @default 0.3
 *
 * @param P4 Blend Mode
 * @desc Definição de blend.
 * @default 1
 *
 * @param P4 Anchor
 * @desc Definição do anchor.
 * @default 0
 *
 * @param P4 Leaf Mode
 * @desc Ativar animação de folha.
 * @default true
 *
 * @param P4 Transition Time
 * @desc Tempo para apresentar a imagem.
 * @default 0
 *
 * @param ---------------------------------------------------------------------
 *
 * @param P5 Visible
 * @desc Ativar partícula.
 * @default false
 *
 * @param P5 File Name
 * @desc Nome do arquivo.
 * @default Particles5
 *
 * @param P5 Amount
 * @desc Quantidade de partículas.
 * @default 25
 *
 * @param P5 Z Index
 * @desc Prioridade Z do sprite.
 * @default 24
 *
 * @param P5 X Speed
 * @desc Velocidade X-Axis.
 * @default 4
 *
 * @param P5 Y Speed
 * @desc Velocidade Y-Axis.
 * @default 0
 *
 * @param P5 Rotation Speed
 * @desc Velocidade de rotação.
 * @default 0
 *
 * @param P5 Blend Mode
 * @desc Definição de blend.
 * @default 1
 *
 * @param P5 Anchor
 * @desc Definição do anchor.
 * @default 0
 *
 * @param P5 Leaf Mode
 * @desc Ativar animação de folha.
 * @default false
 *
 * @param P5 Transition Time
 * @desc Tempo para apresentar a imagem.
 * @default 0
 *
 * @param ---------------------------------------------------------------------
 *
 * @param P6 Visible
 * @desc Ativar partícula.
 * @default false
 *
 * @param P6 File Name
 * @desc Nome do arquivo.
 * @default Particles6
 *
 * @param P6 Amount
 * @desc Quantidade de partículas.
 * @default 25
 *
 * @param P6 Z Index
 * @desc Prioridade Z do sprite.
 * @default 25
 *
 * @param P6 X Speed
 * @desc Velocidade X-Axis.
 * @default 4
 *
 * @param P6 Y Speed
 * @desc Velocidade Y-Axis.
 * @default 0
 *
 * @param P6 Rotation Speed
 * @desc Velocidade de rotação.
 * @default 0
 *
 * @param P6 Blend Mode
 * @desc Definição de blend.
 * @default 1
 *
 * @param P6 Anchor
 * @desc Definição do anchor.
 * @default 0
 *
 * @param P6 Leaf Mode
 * @desc Ativar animação de folha.
 * @default false
 *
 * @param P6 Transition Time
 * @desc Tempo para apresentar a imagem.
 * @default 0
 *
 * @help
 * =============================================================================
 * +++ MOG - Title Particles (v2.0) +++
 * By Moghunter
 * https://atelierrgss.wordpress.com/
 * =============================================================================
 * Adiciona partículas na tela de título.
 *
 * Grave as imagens na pasta.
 *
 * img/titles2/
 *
 * =============================================================================
 * ** Histórico **
 * =============================================================================
 * v2.0 - Multiplas partículas.
 *      - Novas animações.
 *
 */

//=============================================================================
// ** 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.loadPicture(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.0,
      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();
  }
};