设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2578|回复: 2
打印 上一主题 下一主题

[已经过期] 求请教怎么使用敌人动态战斗脚本

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1206
在线时间
561 小时
注册时间
2014-11-30
帖子
155
跳转到指定楼层
1
发表于 2015-11-3 13:24:02 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 余烬之中 于 2015-11-21 14:57 编辑

在网上找个一个敌人的动态战斗脚本,不会使用,不知道怎么把敌人的战斗素材放什么文件夹,不知道怎么对应数据库的敌人ID,不用担心素材的问题,谁能告诉我怎么使用这个脚本
JAVASCRIPT 代码复制
  1. //=============================================================================
  2. // AnimatedSVEnemies.js
  3. // Version: 1.1 - Live and Reloaded
  4. //=============================================================================
  5.  
  6. var Imported = Imported || {};
  7. Imported.AnimatedSVEnemies = true;
  8.  
  9. var Rexal = Rexal || {};
  10. Rexal.ASVE = Rexal.ASVE || {};
  11. /*:
  12.  * @plugindesc Version: 1.1 - Live and Reloaded
  13.  * - Lets enemies be animated!
  14.  * @author Rexal
  15.  *
  16.  * @param No Movement
  17.  * @desc Prevents enemies from moving whenever they perform an action.
  18.  * @default false
  19.  
  20.  * @param Enemies Celebrate
  21.  * @desc Enemies will celebrate over your demise.
  22.  * @default true
  23.  
  24.   * @param SV Enemies Collapse
  25.  * @desc All SV Enemies will collapse after death.
  26.  * @default false
  27.  
  28.  * @param Static Enemies Breathe
  29.  * @desc Static Enemies have a breathing effect
  30.  * @default true
  31.  
  32.  * @param AGI Effects Breathing
  33.  * @desc Static Enemies with a higher AGI stat will breathe faster.
  34.  * @default true
  35.  
  36.  * @param Scale Statics by Distance
  37.  * @desc Static Enemies will be smaller the further away they are in the background
  38.  * @default true
  39.  
  40.   * @help
  41.  --------------------------------------------------------------------------------
  42.  Notetags
  43.  ================================================================================
  44.  
  45.  
  46.  ---------------------------[Side View Battlers]---------------------------------
  47.  
  48.  [SV Animated]
  49.  - Sets the enemy to use the an SV battler.
  50.  [Collapse]
  51.  - Lets the SV Enemy use collapse animations regardless of parameter settings.
  52.  
  53.  [No Collapse]
  54.  - Prevents the SV Enemy from using collapse animations regardless of parameter settings.
  55.  
  56.  SV Motion: motion
  57.  - Sets the enemy to use this motion when attacking. If you don't know what motions
  58.  you can use, refer to the motion list at the bottom of the help section.
  59.  
  60.   SV Weapon: id
  61.  - "Equips" the enemy with this weapon.
  62.  Ex: SV Weapon: 1
  63.  
  64.  
  65.   ----------------------------[Static Battlers]---------------------------------
  66.  
  67.  [Breathless]
  68.  -This enemy doesn't breathe. Useful for golems and evil walls.
  69.  
  70.  [Float]
  71.  -Makes enemies have a floating effect similar to rm2k3's.
  72.  
  73.  Breath Control: speedScale,xScale,yScale
  74.  -Sets the speed of the sine wave and how many times the size of the sprite it's
  75.   allowed to go width-wise and height-wise.
  76.  
  77.   You'll have to play around with the values a bit until it looks right. The
  78.   example below is the default settings.
  79.  
  80.  Ex: Breath Control: 50,5,25
  81.  
  82.  -----------------------------------[Both]---------------------------------------
  83.  
  84.  Enemy Scale: amount
  85.  
  86.  multiplies the size of the enemy by this amount.
  87.  
  88.  
  89.  --------------------------------------------------------------------------------
  90.  Version Log
  91.  ================================================================================
  92.  
  93.  v1 - Initial Version
  94.  
  95.  v1.05 - Many fixes
  96.  - Fixed issue with enemies not playing the right animations when more than one
  97.  enemy is on the screen.
  98.  - Misc. Fixes that I've forgotten about.
  99.  - Added SV Weapon, which lets you play a weapon animation(currently backwards).
  100.  This is not yet compatible with my other script: Sprite Weapons Enhanced.
  101.  - Added a param that stops enemies from moving.
  102.  
  103.   v1.075 - Deep breaths
  104.  - Static enemies breathe now!
  105.  - Added a bunch of stuff to control the breathing. (notetags do not work!)
  106.  
  107.    v1.08 - Fixed Breathing
  108.  - The breathing notetags work now! Yay!
  109.  - Added [Float]
  110.  
  111.    v1.1 - Live and Reloaded
  112.    
  113.   -Breathing slows down the less hp an enemy has. (orignally they just breathed less)
  114.   - Added an option that lets enemies scale down the further into the background they are.
  115.   - Fixed the weapons!
  116.   - Enemies can celebrate your demise.
  117.   - Fixed the Flash Target bug.
  118.   - SV Enemies can collapse.
  119.   - SV Enemies will properly appear
  120.   - Enemies have a proper escape animation.
  121.   - Enemies are now properly positioned.
  122.   - You can now scale the enemies however you want.
  123.  
  124.  
  125.  --------------------------------------------------------------------------------
  126.  Motion List
  127.  ================================================================================
  128.  walk - Ready Animation
  129.  wait - The Idle Animation
  130.  chant - Magic Ready animation
  131.  guard - The Guard Animation
  132.  damage - Damage Animation
  133.  evade - Miss! Animation
  134.  thrust - Stabbing Animation
  135.  swing - Swinging Animation
  136.  missile - Shooting Animation
  137.  skill - Physical Skill Use Animation
  138.  spell - Magical Skill Use Animation
  139.  item - Item Use Animation
  140.  escape - Escape Animation
  141.  victory - Victory Animation
  142.  dying - The "Danger" Animation
  143.  abnormal - The State Affected Animation
  144.  sleep - The Sleeping Animation
  145.  dead - The Dead Animation
  146.  
  147.  
  148.  */
  149.  
  150. Rexal.ASVE.Parameters = PluginManager.parameters('animatedSVEnemies');
  151. Rexal.ASVE.NoMovement = eval(String(Rexal.ASVE.Parameters['No Movement']));
  152.   Rexal.ASVE.Breathe = eval(String(Rexal.ASVE.Parameters['Static Enemies Breathe']));
  153.   Rexal.ASVE.AGIB = eval(String(Rexal.ASVE.Parameters['AGI Effects Breathing']));
  154.   Rexal.ASVE.Celebration = eval(String(Rexal.ASVE.Parameters['Enemies Celebrate']));
  155.    Rexal.ASVE.DoCollapse = eval(String(Rexal.ASVE.Parameters['SV Enemies Collapse']));
  156.  
  157.   //-----------------------------------------------------------------------------
  158. // BattleManager
  159. //=============================================================================
  160.  
  161.   if(Rexal.ASVE.Celebration)
  162.   {  
  163.  
  164.   BattleManager.processDefeat = function() {
  165.     if(Rexal.ASVE.Celebration)$gameTroop.performVictory();
  166.         this.displayDefeatMessage();
  167.     this.playDefeatMe();
  168.     if (this._canLose) {
  169.         this.replayBgmAndBgs();
  170.     } else {
  171.         AudioManager.stopBgm();
  172.     }
  173.     this.endBattle(2);
  174. };
  175.   }
  176.  
  177.   //-----------------------------------------------------------------------------
  178. // Game_Enemy
  179. //=============================================================================
  180.  
  181.         Game_Enemy.prototype.performAttack = function() {
  182.  
  183.                 Rexal.ASVE.processEnemyNoteTag( $dataEnemies[this._enemyId] );
  184.  
  185.                         if(Rexal.ASVE._weaponID == 0){this.requestMotion(Rexal.ASVE._motion);
  186.                         return;
  187.                         }
  188.  
  189.      var weapon = $dataWeapons[Rexal.ASVE._weaponID];
  190.     var wtypeId = weapon.wtypeId;
  191.     var attackMotion = $dataSystem.attackMotions[wtypeId];
  192.     if (attackMotion) {
  193.         if (attackMotion.type === 0) {
  194.             this.requestMotion('thrust');
  195.         } else if (attackMotion.type === 1) {
  196.             this.requestMotion('swing');
  197.         } else if (attackMotion.type === 2) {
  198.             this.requestMotion('missile');
  199.         }
  200.                 this.startWeaponAnimation(attackMotion.weaponImageId);
  201.     }
  202. };
  203.  
  204.  
  205. Game_Enemy.prototype.performAction = function(action) {
  206.     Game_Battler.prototype.performAction.call(this, action);
  207.     if (action.isAttack()) {
  208.         this.performAttack();
  209.     } else if (action.isGuard()) {
  210.         this.requestMotion('guard');
  211.     } else if (action.isMagicSkill()) {
  212.         this.requestMotion('spell');
  213.     } else if (action.isSkill()) {
  214.         this.requestMotion('skill');
  215.     } else if (action.isItem()) {
  216.         this.requestMotion('item');
  217.     }
  218. };
  219.  
  220. Game_Enemy.prototype.performDamage = function() {
  221.     Game_Battler.prototype.performDamage.call(this);
  222.     if (this.isSpriteVisible()) {
  223.         this.requestMotion('damage');
  224.     } else {
  225.         $gameScreen.startShake(5, 5, 10);
  226.     }
  227.     SoundManager.playActorDamage();
  228. };
  229.  
  230. Game_Enemy.prototype.performEvasion = function() {
  231.     Game_Battler.prototype.performEvasion.call(this);
  232.     this.requestMotion('evade');
  233. };
  234.  
  235. Game_Enemy.prototype.performMagicEvasion = function() {
  236.     Game_Battler.prototype.performMagicEvasion.call(this);
  237.     this.requestMotion('evade');
  238. };
  239.  
  240. Game_Enemy.prototype.performCounter = function() {
  241.     Game_Battler.prototype.performCounter.call(this);
  242.     this.performAttack();
  243. };
  244.  
  245. Game_Enemy.prototype.performVictory = function() {
  246.     if (this.canMove()) {
  247.         this.requestMotion('victory');
  248.     }
  249. };
  250.  
  251.  
  252. Game_Enemy.prototype.makeActions = function() {
  253.     Game_Battler.prototype.makeActions.call(this);
  254.     if (this.numActions() > 0) {
  255.         var actionList = this.enemy().actions.filter(function(a) {
  256.             return this.isActionValid(a);
  257.         }, this);
  258.         if (actionList.length > 0) {
  259.             this.selectAllActions(actionList);
  260.         }
  261.     }
  262. this.setActionState('undecided');
  263. };
  264.  
  265.  
  266. Game_Enemy.prototype.performEscape = function() {
  267.     if (this.canMove()) {
  268.         this.requestMotion('escape');
  269.     }
  270. };
  271.  
  272.  
  273. Game_Enemy.prototype.attackAnimationId = function() {
  274.         Rexal.ASVE.processEnemyNoteTag($dataEnemies[this.enemyId()]);
  275.   if(Rexal.ASVE._weaponID!=0)  return $dataWeapons[Rexal.ASVE._weaponID].animationId;
  276.   else
  277.           return 1;
  278. };
  279.  
  280.   //-----------------------------------------------------------------------------
  281. // Game_Troop
  282. //=============================================================================
  283. Game_Troop.prototype.performVictory = function() {
  284.     this.members().forEach(function(enemy) {
  285.         enemy.performVictory();
  286.     });
  287. };
  288.   //-----------------------------------------------------------------------------
  289. // Sprite_Enemy
  290. //=============================================================================
  291.  
  292. Sprite_Enemy.prototype.setBattler = function(battler) {
  293.     Sprite_Battler.prototype.setBattler.call(this, battler);
  294.     this._enemy = battler;
  295.     this.setHome(battler.screenX(), battler.screenY());
  296.     this._stateIconSprite.setup(battler);
  297. };
  298.  
  299. if(Rexal.ASVE.Breathe)
  300. {
  301.  
  302.  
  303. Sprite_Enemy.prototype.updateBitmap = function() {
  304.  
  305.  
  306.         Rexal.ASVE.processEnemyNoteTag(this._enemy.enemy());
  307.  
  308.         if(!Rexal.ASVE._noBreath){
  309.                 var a = 1;
  310.                 if(Rexal.ASVE.AGIB) a = this._enemy.agi/100+1;
  311.         var breathS = Rexal.ASVE._breathScale/1000;
  312.         breathS *= (this._enemy.hp/this._enemy.mhp)+.1;
  313.         var breathY = Math.cos(Graphics.frameCount*breathS*a)*(Rexal.ASVE._breathY/1000);
  314.         var breathX = Math.cos(Graphics.frameCount*breathS)*(Rexal.ASVE._breathX/1000);
  315.  
  316.         breathY *= (this._enemy.hp/this._enemy.mhp);
  317.         var ss = Graphics.boxHeight/624+.5;
  318.         var s = ss*(this._homeY/Graphics.boxHeight)*Rexal.ASVE._enemyScale;
  319.  
  320.  
  321.         this.scale.y = s+breathY;
  322.         this.scale.x = s+breathX;
  323.  
  324.         }
  325.  
  326.         if(Rexal.ASVE._float && !this.isBusy)
  327.         {
  328.                 this.setHome(this._enemy.screenX(),this.y-Math.sin(Graphics.frameCount/50)/4);
  329.         }
  330.  
  331.             Sprite_Battler.prototype.updateBitmap.call(this);
  332.     var name = this._enemy.battlerName();
  333.     var hue = this._enemy.battlerHue();
  334.     if (this._battlerName !== name || this._battlerHue !== hue) {
  335.         this._battlerName = name;
  336.         this._battlerHue = hue;
  337.         this.loadBitmap(name, hue);
  338.         this.initVisibility();
  339.     }
  340. };
  341. }
  342. else{
  343.                 if(Rexal.ASVE._float && !this.isBusy)
  344.         {
  345.         Sprite_Enemy.prototype.updateBitmap = function() {
  346.  
  347.  
  348.                 this.setHome(this._enemy.screenX(),this.y-Math.sin(Graphics.frameCount/50)/4);
  349.  
  350.         var ss = Graphics.boxHeight/624+.5;
  351.         var s = ss*(this._homeY/Graphics.boxHeight)*Rexal.ASVE._enemyScale;
  352.  
  353.  
  354.         this.scale.y = s;
  355.         this.scale.x = s;
  356.  
  357.     Sprite_Battler.prototype.updateBitmap.call(this);
  358.     var name = this._enemy.battlerName();
  359.     var hue = this._enemy.battlerHue();
  360.     if (this._battlerName !== name || this._battlerHue !== hue) {
  361.         this._battlerName = name;
  362.         this._battlerHue = hue;
  363.         this.loadBitmap(name, hue);
  364.         this.initVisibility();
  365.     }
  366. };
  367.         }
  368.  
  369.  
  370. }
  371.  
  372.  
  373.  
  374. Sprite_Enemy.prototype.stepForward = function() {
  375.    if(!Rexal.ASVE.NoMovement) this.startMove(48, 0, 12);
  376. };
  377.  
  378.  
  379.  
  380.                 Sprite_Enemy.prototype.setHome = function(x,y) {
  381.  
  382.                         var dX = Graphics.boxWidth/816;
  383.                         var dY = Graphics.boxHeight/624;
  384.  
  385.                         x*= dX;
  386.                         if(!Rexal.ASVE._float)y*= dY;
  387.  
  388.                         this._homeX = x;
  389.                         this._homeY = y + (Graphics.boxHeight - 624);
  390.                         this.updatePosition();
  391.         };
  392.  
  393.   //-----------------------------------------------------------------------------
  394. // Sprite_EnemyRex
  395. //=============================================================================
  396.  
  397. function Sprite_EnemyRex() {
  398.     this.initialize.apply(this, arguments);
  399. }
  400.  
  401.  
  402. Sprite_EnemyRex.prototype = Object.create(Sprite_Actor.prototype);
  403. Sprite_EnemyRex.prototype.constructor = Sprite_EnemyRex;
  404.  
  405. Sprite_EnemyRex.prototype.createWeaponSprite = function() {
  406.  
  407.     this._weaponSprite = new Sprite_Weapon();
  408.  
  409.     this.addChild(this._weaponSprite);
  410. };
  411.  
  412.  
  413. Sprite_EnemyRex.prototype.updateSelectionEffect = function() {
  414.  
  415.             var target = this._effectTarget;
  416.     if (this._battler.isSelected()) {
  417.         this._selectionEffectCount++;
  418.         if (this._selectionEffectCount % 30 < 15) {
  419.             target.setBlendColor([255, 255, 255, 64]);
  420.         } else {
  421.             target.setBlendColor([0, 0, 0, 0]);
  422.         }
  423.     } else if (this._selectionEffectCount > 0) {
  424.         this._selectionEffectCount = 0;
  425.         target.setBlendColor([0, 0, 0, 0]);
  426.     }
  427.  
  428. }
  429.  
  430. Sprite_EnemyRex.prototype = Object.create(Sprite_Actor.prototype);
  431. Sprite_EnemyRex.prototype.constructor = Sprite_EnemyRex;
  432.  
  433. Sprite_EnemyRex.prototype.initialize = function(battler) {
  434.     Sprite_Battler.prototype.initialize.call(this, battler);
  435.  
  436. };
  437.  
  438. Sprite_EnemyRex.prototype.loadBitmap = function(name, hue) {
  439.     if ($gameSystem.isSideView()) {
  440.         this.bitmap = ImageManager.loadSvActor(name,hue);
  441.     } else {
  442.         this.bitmap = ImageManager.loadEnemy(name, hue);
  443.     }
  444. };
  445.  
  446. Sprite_EnemyRex.prototype.setBattler = function(battler) {
  447.     Sprite_Battler.prototype.setBattler.call(this, battler);
  448.     var changed = (battler !== this._actor);
  449.     if (changed) {
  450.         this._actor = battler;
  451.         if (battler) {
  452.             this.setActorHome(battler);
  453.         }
  454.         this.startEntryMotion();
  455.         this._stateSprite.setup(battler);
  456.     }
  457. };
  458.  
  459.  
  460. Sprite_EnemyRex.prototype.updateBitmap = function() {
  461.         this.updateEffect();
  462.     Sprite_Battler.prototype.updateBitmap.call(this);
  463.         var hue = this._actor.battlerHue();
  464.     var name = this._actor.battlerName();
  465.     if (this._battlerName !== name) {
  466.         this._battlerName = name;
  467.         this._mainSprite.bitmap = ImageManager.loadSvActor(name,hue);
  468.                 this._mainSprite.scale.x = -Rexal.ASVE._enemyScale;
  469.                 this._mainSprite.scale.y = Rexal.ASVE._enemyScale;
  470.     }
  471. };
  472.  
  473. Sprite_EnemyRex.prototype.setupWeaponAnimation = function() {
  474.         Rexal.ASVE.processEnemyNoteTag($dataEnemies[this._actor._enemyId]);
  475.     if (this._actor.isWeaponAnimationRequested()) {
  476.         this._weaponSprite.setup($dataWeapons[Rexal.ASVE._weaponID].wtypeId);
  477.                 this._weaponSprite.scale.x = -Rexal.ASVE._enemyScale;
  478.                 this._weaponSprite.scale.y = Rexal.ASVE._enemyScale;
  479.                 this._weaponSprite.x = 16;
  480.         this._actor.clearWeaponAnimation();
  481.     }
  482.  
  483. };
  484.  
  485. Sprite_EnemyRex.prototype.setActorHome = function(battler) {
  486.  
  487.                         var dX = Graphics.boxWidth/816;
  488.                         var dY = Graphics.boxHeight/624;
  489.  
  490.                         var x = battler.screenX();
  491.                         var y = battler.screenY();
  492.  
  493.                         this._homeX = x;
  494.                         this._homeY = y + (Graphics.boxHeight - 624);
  495.                         this.updatePosition();
  496.         };
  497.  
  498.  
  499. Sprite_EnemyRex.prototype.damageOffsetX = function() {
  500.     return 32;
  501. };
  502.  
  503. Sprite_EnemyRex.prototype.stepForward = function() {
  504.    if(!Rexal.ASVE.NoMovement) this.startMove(48, 0, 12);
  505. };
  506.  
  507. Sprite_EnemyRex.prototype.stepBack = function() {
  508.    if(!Rexal.ASVE.NoMovement) this.startMove(0, 0, 12);
  509. };
  510.  
  511. Sprite_EnemyRex.prototype.retreat = function() {
  512.     this.startMove(300, 0, 30);
  513. };
  514.  
  515. Sprite_EnemyRex.prototype.initVisibility = function() {
  516.     this._appeared = this._actor.isAlive();
  517.     if (!this._appeared) {
  518.         this.opacity = 0;
  519.     }
  520. };
  521.  
  522. Sprite_EnemyRex.prototype.setupEffect = function() {
  523.  
  524.         Rexal.ASVE.processEnemyNoteTag(this._actor.enemy());
  525.     if (this._appeared && this._actor.isEffectRequested()) {
  526.         this.startEffect(this._actor.effectType());
  527.         this._actor.clearEffect();
  528.     }
  529.     if (!this._appeared && this._actor.isAlive()) {
  530.         this.startEffect('appear');
  531.     } else if (this._appeared && this._actor.isHidden()) {
  532.         this.startEffect('disappear');
  533.     }
  534. };
  535.  
  536. Sprite_EnemyRex.prototype.startEffect = function(effectType) {
  537.  
  538.     this._effectType = effectType;
  539.     switch (this._effectType) {
  540.     case 'appear':
  541.         this.startAppear();
  542.         break;
  543.     case 'disappear':
  544.         this.startDisappear();
  545.         break;
  546.     case 'whiten':
  547.         this.startWhiten();
  548.         break;
  549.     case 'blink':
  550.         this.startBlink();
  551.         break;
  552.     case 'collapse':
  553.      if(Rexal.ASVE._collapse)   this.startCollapse();
  554.         break;
  555.     case 'bossCollapse':
  556.         this.startBossCollapse();
  557.         break;
  558.     case 'instantCollapse':
  559.         this.startInstantCollapse();
  560.         break;
  561.     }
  562.     this.revertToNormal();
  563. };
  564.  
  565. Sprite_EnemyRex.prototype.startAppear = function() {
  566.     this._effectDuration = 16;
  567.     this._appeared = true;
  568. };
  569.  
  570. Sprite_EnemyRex.prototype.startDisappear = function() {
  571.     this._effectDuration = 32;
  572.     this._appeared = false;
  573. };
  574.  
  575. Sprite_EnemyRex.prototype.startWhiten = function() {
  576.     this._effectDuration = 16;
  577. };
  578.  
  579. Sprite_EnemyRex.prototype.startBlink = function() {
  580.     this._effectDuration = 20;
  581. };
  582.  
  583. Sprite_EnemyRex.prototype.startCollapse = function() {
  584.     this._effectDuration = 32;
  585.     this._appeared = false;
  586. };
  587.  
  588. Sprite_EnemyRex.prototype.startBossCollapse = function() {
  589.     this._effectDuration = this._mainSprite.height;
  590.     this._appeared = false;
  591. };
  592.  
  593. Sprite_EnemyRex.prototype.startInstantCollapse = function() {
  594.     this._effectDuration = 16;
  595.     this._appeared = false;
  596. };
  597.  
  598. Sprite_EnemyRex.prototype.updateEffect = function() {
  599.  
  600.  
  601.     this.setupEffect();
  602.     if (this._effectDuration > 0) {
  603.         this._effectDuration--;
  604.         switch (this._effectType) {
  605.         case 'whiten':
  606.             this.updateWhiten();
  607.             break;
  608.         case 'blink':
  609.             this.updateBlink();
  610.             break;
  611.         case 'appear':
  612.             this.updateAppear();
  613.             break;
  614.         case 'disappear':
  615.             this.updateDisappear();
  616.             break;
  617.         case 'collapse':
  618.        if(Rexal.ASVE._collapse)     this.updateCollapse();
  619.             break;
  620.         case 'bossCollapse':
  621.        if(Rexal.ASVE._collapse)     this.updateBossCollapse();
  622.             break;
  623.         case 'instantCollapse':
  624.       if(Rexal.ASVE._collapse)      this.updateInstantCollapse();
  625.             break;
  626.         }
  627.         if (this._effectDuration === 0) {
  628.             this._effectType = null;
  629.         }
  630.     }
  631. };
  632.  
  633. if(Rexal.ASVE._collapse)
  634.  
  635. Sprite_EnemyRex.prototype.isEffecting = function() {
  636.     return this._effectType !== null;
  637. };
  638.  
  639.  
  640.  
  641. Sprite_EnemyRex.prototype.revertToNormal = function() {
  642.     this._shake = 0;
  643.     this.blendMode = 0;
  644.     this.opacity = 255;
  645.     this.setBlendColor([0, 0, 0, 0]);
  646. };
  647.  
  648. Sprite_EnemyRex.prototype.updateWhiten = function() {
  649.     var alpha = 128 - (16 - this._effectDuration) * 10;
  650.     this.setBlendColor([255, 255, 255, alpha]);
  651. };
  652.  
  653. Sprite_EnemyRex.prototype.updateBlink = function() {
  654.     this.opacity = (this._effectDuration % 10 < 5) ? 255 : 0;
  655. };
  656.  
  657. Sprite_EnemyRex.prototype.updateAppear = function() {
  658.             this.setHome(this._homeX,this._homeY);
  659.                     this.opacity = (16 - this._effectDuration) * 16;
  660. };
  661.  
  662. Sprite_EnemyRex.prototype.updateDisappear = function() {
  663.             this.setHome(this._homeX-10,this._homeY);
  664.     this.opacity = 256 - (32 - this._effectDuration) * 10;
  665. };
  666.  
  667. Sprite_Enemy.prototype.updateAppear = function() {
  668.             this.setHome(this._homeX,this._homeY);
  669.                                     this.opacity = (16 - this._effectDuration) * 16;
  670. };
  671.  
  672. Sprite_Enemy.prototype.updateDisappear = function() {
  673.             this.setHome(this._homeX-10,this._homeY);
  674.     this.opacity = 256 - (32 - this._effectDuration) * 10;
  675. };
  676.  
  677. Sprite_EnemyRex.prototype.updateCollapse = function() {
  678.     this.blendMode = Graphics.BLEND_ADD;
  679.     this.setBlendColor([255, 128, 128, 128]);
  680.     this.opacity *= this._effectDuration / (this._effectDuration + 1);
  681. };
  682.  
  683. Sprite_EnemyRex.prototype.updateBossCollapse = function() {
  684.     this._shake = this._effectDuration % 2 * 4 - 2;
  685.     this.blendMode = Graphics.BLEND_ADD;
  686.     this.opacity *= this._effectDuration / (this._effectDuration + 1);
  687.     this.setBlendColor([255, 255, 255, 255 - this.opacity]);
  688.     if (this._effectDuration % 20 === 19) {
  689.         SoundManager.playBossCollapse2();
  690.     }
  691. };
  692.  
  693. Sprite_EnemyRex.prototype.updateInstantCollapse = function() {
  694.     this.opacity = 0;
  695. };
  696.  
  697. Sprite_EnemyRex.prototype.damageOffsetX = function() {
  698.     return 0;
  699. };
  700.  
  701. Sprite_EnemyRex.prototype.damageOffsetY = function() {
  702.     return -8;
  703. };
  704.  
  705.   //-----------------------------------------------------------------------------
  706. // Spriteset_Battle
  707. //=============================================================================
  708.  
  709. Spriteset_Battle.prototype.createEnemies = function() {
  710.     var enemies = $gameTroop.members();
  711.     var sprites = [];
  712.     for (var i = 0; i < enemies.length; i++) {
  713.  
  714.         Rexal.ASVE.processEnemyNoteTag($dataEnemies[enemies[i]._enemyId]);
  715.  
  716.     if(Rexal.ASVE._animated)  
  717.         {
  718.                 sprites[i] = new Sprite_EnemyRex(enemies[i]);
  719.                 sprites[i].opacity = 0;
  720.         }
  721.         else
  722.                 sprites[i] = new Sprite_Enemy(enemies[i]);
  723.  
  724.     }
  725.  
  726.     sprites.sort(this.compareEnemySprite.bind(this));
  727.     for (var j = 0; j < sprites.length; j++) {
  728.         this._battleField.addChild(sprites[j]);
  729.     }
  730.     this._enemySprites = sprites;
  731. };
  732.  
  733.  
  734. // Spriteset_Battle.prototype.updateActors = function() {
  735.     // var members = $gameParty.battleMembers();
  736.             // var enemies = $gameTroop.members();
  737.  
  738.                     // for (var i = 0; i < this._enemySprites.length; i++) {
  739.         // this._enemySprites[i].setBattler(enemies[i]);
  740.     // }
  741.  
  742.     // for (var i = 0; i < this._actorSprites.length; i++) {
  743.         // this._actorSprites[i].setBattler(members[i]);
  744.     // }
  745. // };
  746.  
  747.  
  748.   //-----------------------------------------------------------------------------
  749. // Rex Functions
  750. //=============================================================================
  751.  
  752.  
  753. Rexal.ASVE.processEnemyNoteTag = function(obj) {
  754.  
  755. Rexal.ASVE._animated = false;
  756. Rexal.ASVE._motion = 'thrust';
  757. Rexal.ASVE._weaponID = 0;
  758. Rexal.ASVE._noBreath = false;
  759. Rexal.ASVE._float = false;
  760. Rexal.ASVE._collapse = Rexal.ASVE.DoCollapse;
  761. Rexal.ASVE._breathX = 5;
  762. Rexal.ASVE._breathY = 25;
  763. Rexal.ASVE._breathScale = 50;
  764. Rexal.ASVE._enemyScale = 1.0;
  765.  
  766. if(obj == null)return;
  767.  
  768.                 var notedata = obj.note.split(/[\r\n]+/);
  769.  
  770.                 for (var i = 0; i < notedata.length; i++) {
  771.                 var line = notedata[i];
  772.                 var lines = line.split(': ');
  773.  
  774.                 switch (lines[0]) {
  775.  
  776.                 case '[SV Animated]' :
  777.         Rexal.ASVE._animated = true;
  778.                 break;
  779.  
  780.                 case 'SV Motion' :
  781.         Rexal.ASVE._motion = lines[1].toLowerCase();
  782.                 break;
  783.  
  784.                 case 'SV Weapon' :
  785.         Rexal.ASVE._weaponID = parseInt(lines[1]);
  786.                 break;
  787.  
  788.                 case '[Breathless]' :
  789.                 Rexal.ASVE._noBreath = true;
  790.                 break;       
  791.  
  792.                 case '[Float]' :
  793.                 Rexal.ASVE._float = true;
  794.                 break;       
  795.  
  796.                 case '[Collapse]' :
  797.                 Rexal.ASVE._collapse = true;
  798.                 break;       
  799.  
  800.                 case '[No Collapse]' :
  801.                 Rexal.ASVE._collapse = true;
  802.                 break;
  803.  
  804.                 case 'Breath Control' :
  805.  
  806.                 var lines2 = lines[1].split(',');
  807.                 Rexal.ASVE._breathScale = parseInt(lines2[0]);
  808.                 Rexal.ASVE._breathX = parseInt(lines2[1]);
  809.                 Rexal.ASVE._breathY = parseInt(lines2[2]);
  810.                 break;
  811.  
  812.                 case 'Enemy Scale' :
  813.         Rexal.ASVE._enemyScale = parseFloat(lines[1]);
  814.  
  815.                 }
  816.  
  817.  
  818.                 }
  819. };



JAVASCRIPT 代码复制
  1. //=============================================================================
  2. // AnimatedEnemiesYanflyCompatability.js
  3. // Version: 1.015a
  4. //=============================================================================
  5.  
  6. var Imported = Imported || {};
  7. Imported.AnimatedSVEnemies.Yanfly = true;
  8.  
  9. var Rexal = Rexal || {};
  10. Rexal.ASVE = Rexal.ASVE || {};
  11. /*:
  12.  * @plugindesc Version: 1.015
  13.  * - Makes animatedSVEnemies compatible with Yanfly's plugins.
  14.  * @author Rexal
  15.  *
  16.  * @help
  17.  Version Log:
  18.  
  19.  v1 - Initial Version
  20.  v1.01 - got rid of an unnecessary function.
  21.  v1.011 - Forgot a bracket.
  22.  v1.012b - Should be compatible with the lastest Battle Engine Core.
  23.  v1.013 - fixed floating monsters
  24.  v1.014 - fixed mouse support...but you can't mix up the enemy types.
  25.  v1.015a - Did some cleaning.
  26.  */
  27. if(Imported.AnimatedSVEnemies){
  28.  
  29.  
  30.  
  31.   //-----------------------------------------------------------------------------
  32. // Battle Engine Core
  33. //=============================================================================
  34.  
  35. if(Imported.YEP_BattleEngineCore)
  36. {
  37.  
  38.  
  39.         Game_Enemy.prototype.spriteWidth = function() {
  40.  
  41.     if(!this.battler()) return 1;
  42.  
  43.         if (Rexal.ASVE._animated && this.battler()._mainSprite) {
  44.                         return this.battler()._mainSprite.width;
  45.                 } else {
  46.                         return this.battler().width;
  47.                 }
  48.  
  49. };
  50.  
  51. Game_Enemy.prototype.spriteHeight = function() {
  52.  
  53.             if(!this.battler()) return 1;
  54.  
  55.     if (Rexal.ASVE._animated && this.battler()._mainSprite) {
  56.                         return this.battler()._mainSprite.height;
  57.                 } else {
  58.                         return this.battler().height;
  59.                 }
  60.  
  61. };
  62.  
  63. Sprite_EnemyRex.prototype.stepFlinch = function() {
  64.                 var flinchX = this.x - this._homeX + Yanfly.Param.BECFlinchDist;
  65.                 this.startMove(flinchX, 0, 6);
  66. };
  67.  
  68.  
  69.         Sprite_EnemyRex.prototype.stepForward = function() {
  70.     this.startMove(Yanfly.Param.BECStepDist, 0, 12);
  71. };
  72.  
  73.  
  74.  
  75.  
  76. }
  77.  
  78.  
  79.  
  80. }

Lv3.寻梦者

梦石
0
星屑
1206
在线时间
561 小时
注册时间
2014-11-30
帖子
155
2
 楼主| 发表于 2015-11-4 18:28:25 | 只看该作者
有没有人帮我看一下,没人回复啊,我连贴了,但是我真的想用这个脚本,一边动态的角色,一边死板的怪物,真心难看

点评

不知道是不是同一个 这里有人在研究的 http://tieba.baidu.com/p/4134518941  发表于 2015-11-5 16:10
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3018
在线时间
116 小时
注册时间
2010-7-17
帖子
138
3
发表于 2016-1-16 10:16:23 | 只看该作者
本帖最后由 xiaolu0415 于 2016-1-16 10:19 编辑

这个脚本没有研究。 之前看过一个脚本,是先把动态图放到角色SV动态图里,然后再从怪物的说明里调用那个SV图就行了。我自己没试过,你可以试试看。
国外这个网上有相关操作视频。只是俺英文太烂,完全看不懂。
https://youtu.be/-aP7k9uUFL8

//=============================================================================
// Yanfly Engine Plugins - Battle Engine Extension - Animated Sideview Enemies
// YEP_X_AnimatedSVEnemies.js
//=============================================================================

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

var Yanfly = Yanfly || {};
Yanfly.SVE = Yanfly.SVE || {};

//=============================================================================
/*:
* @plugindesc v1.05 (Requires YEP_BattleEngineCore.js) This plugin lets
* you use Animated Sideview Actors for enemies!
* @author Yanfly Engine Plugins
*
* @param ---General---
* @default
*
* @param Anchor X
* @desc Sets the default anchor position of the sprite.
* Default: 0.5
* @default 0.5
*
* @param Anchor Y
* @desc Sets the default anchor position of the sprite.
* Default: 1
* @default 1
*
* @param Sprite Smoothing
* @desc Enable Sprite Smoothing? This is a global setting.
* NO - false     YES - true
* @default true
*
* @param Sprite Width
* @desc Sets the minimum width for sideview sprites.
* Use 'auto' for automatic detection. Default: 64
* @default auto
*
* @param Sprite Height
* @desc Sets the minimum height for sideview sprites.
* Use 'auto' for automatic detection. Default: 64
* @default auto
*
* @param Collapse
* @desc When a sprite dies, have it collapse and vanish?
* NO - false     YES - true
* @default false
*
* @param Frame Speed
* @desc The default frame speed used in between motions.
* Default: 12
* @default 12
*
* @param ---Shadows---
* @default
*
* @param Show Shadow
* @desc Show shadows on sideview enemies?
* NO - false     YES - true
* @default false
*
* @param Shadow Scale X
* @desc Sets the default horizontal shadow scale.
* Use 'auto' for automatic detection. Default: 1
* @default auto
*
* @param Shadow Scale Y
* @desc Sets the default vertical shadow scale.
* Use 'auto' for automatic detection. Default: 1
* @default auto
*
* @param ---Breathing---
* @default
*
* @param Enable Breathing
* @desc Breathing option for enemies.
* 0 - None, 1 - Static, 2 - Sideview, 3 - Both
* @default 1
*
* @param Breathing Speed
* @desc The default breathing rate for enemies.
* Lower - Faster     Larger - Slower
* @default 20
*
* @param Breathing X Rate
* @desc The default breathing X rate for enemies.
* Lower - Static     Larger - Dynamic
* @default 0.001
*
* @param Breathing Y Rate
* @desc The default breathing Y rate for enemies.
* Lower - Static     Larger - Dynamic
* @default 0.02
*
* @param HP Link Breathing
* @desc Link breathing rate to HP Rate?
* NO - false     YES - true
* @default false
*
* @param ---Floating---
* @default
*
* @param Floating Speed
* @desc The default floating speed for enemies.
* Lower - Faster     Larger - Slower
* @default 20
*
* @param Floating Rate
* @desc The default floating rate for enemies.
* Lower - Faster     Larger - Slower
* @default 0.3
*
* @param Floating Height
* @desc The default minimum floating height for enemies.
* Lower - Closer to Ground     Larger - Higher Up
* @default 50
*
* @param ---Motions---
* @default
*
* @param Attack Motion
* @desc Sets the default attack motion for no weapons.
* Attack Motion Types: swing     thrust     missile
* @default thrust
*
* @param Weapon Image Index
* @desc Sets the default weapon image index for the sprite.
* Use 0 for no image.
* @default 0
*
* @param Idle Motion
* @desc Sets the sprite's idle motion.
* Default: walk
* @default walk
*
* @param Damage Motion
* @desc Sets the sprite's taking damage motion.
* Default: damage
* @default damage
*
* @param Evade Motion
* @desc Sets the sprite's evasion motion.
* Default: evade
* @default evade
*
* @param Escape Motion
* @desc Sets the sprite's escape motion.
* Default: escape
* @default escape
*
* @param Guard Motion
* @desc Sets the sprite's guard motion.
* Default: guard
* @default guard
*
* @param Abnormal Motion
* @desc Sets the sprite's abnormal (status afflicted) motion.
* Default: abnormal
* @default abnormal
*
* @param Sleep Motion
* @desc Sets the sprite's sleeping motion.
* Default: sleep
* @default sleep
*
* @param Dying Motion
* @desc Sets the sprite's dying (crisis) motion.
* Default: dying
* @default dying
*
* @param Dead Motion
* @desc Sets the sprite's dead motion.
* Default: dead
* @default dead
*
* @param ---Weapons---
* @default
*
* @param Weapon Image Index
* @desc Sets the default weapon image index for the sprite.
* Use 0 for no image.
* @default 0
*
* @param Weapon 1 Motion
* @desc Motion used by default for this weapon image.
* Weapon 1: Dagger     Motion: swing
* @default swing
*
* @param Weapon 1 Animation
* @desc Battle animation used by default for this weapon image.
* @default 6
*
* @param Weapon 2 Motion
* @desc Motion used by default for this weapon image.
* Weapon 2: Sword     Motion: swing
* @default swing
*
* @param Weapon 2 Animation
* @desc Battle animation used by default for this weapon image.
* @default 6
*
* @param Weapon 3 Motion
* @desc Motion used by default for this weapon image.
* Weapon 3: Flail     Motion: swing
* @default swing
*
* @param Weapon 3 Animation
* @desc Battle animation used by default for this weapon image.
* @default 1
*
* @param Weapon 4 Motion
* @desc Motion used by default for this weapon image.
* Weapon 4: Axe     Motion: swing
* @default swing
*
* @param Weapon 4 Animation
* @desc Battle animation used by default for this weapon image.
* @default 6
*
* @param Weapon 5 Motion
* @desc Motion used by default for this weapon image.
* Weapon 5: Whip     Motion: swing
* @default swing
*
* @param Weapon 5 Animation
* @desc Battle animation used by default for this weapon image.
* @default 6
*
* @param Weapon 6 Motion
* @desc Motion used by default for this weapon image.
* Weapon 6: Staff     Motion: swing
* @default swing
*
* @param Weapon 6 Animation
* @desc Battle animation used by default for this weapon image.
* @default 1
*
* @param Weapon 7 Motion
* @desc Motion used by default for this weapon image.
* Weapon 7: Long Bow     Motion: missile
* @default missile
*
* @param Weapon 7 Animation
* @desc Battle animation used by default for this weapon image.
* @default 11
*
* @param Weapon 8 Motion
* @desc Motion used by default for this weapon image.
* Weapon 8: Crossbow     Motion: missile
* @default missile
*
* @param Weapon 8 Animation
* @desc Battle animation used by default for this weapon image.
* @default 11
*
* @param Weapon 9 Motion
* @desc Motion used by default for this weapon image.
* Weapon 9: Gun     Motion: missile
* @default missile
*
* @param Weapon 9 Animation
* @desc Battle animation used by default for this weapon image.
* @default 111
*
* @param Weapon 10 Motion
* @desc Motion used by default for this weapon image.
* Weapon 10: Claw     Motion: thrust
* @default thrust
*
* @param Weapon 10 Animation
* @desc Battle animation used by default for this weapon image.
* @default 16
*
* @param Weapon 11 Motion
* @desc Motion used by default for this weapon image.
* Weapon 11: Glove     Motion: thrust
* @default thrust
*
* @param Weapon 11 Animation
* @desc Battle animation used by default for this weapon image.
* @default 1
*
* @param Weapon 12 Motion
* @desc Motion used by default for this weapon image.
* Weapon 12: Spear     Motion: thrust
* @default thrust
*
* @param Weapon 12 Animation
* @desc Battle animation used by default for this weapon image.
* @default 11
*
* @param Weapon 13 Motion
* @desc Motion used by default for this weapon image.
* Weapon 13: Mace     Motion: swing
* @default swing
*
* @param Weapon 13 Animation
* @desc Battle animation used by default for this weapon image.
* @default 1
*
* @param Weapon 14 Motion
* @desc Motion used by default for this weapon image.
* Weapon 14: Rod     Motion: swing
* @default swing
*
* @param Weapon 14 Animation
* @desc Battle animation used by default for this weapon image.
* @default 1
*
* @param Weapon 15 Motion
* @desc Motion used by default for this weapon image.
* Weapon 15: Club     Motion: swing
* @default swing
*
* @param Weapon 15 Animation
* @desc Battle animation used by default for this weapon image.
* @default 1
*
* @param Weapon 16 Motion
* @desc Motion used by default for this weapon image.
* Weapon 16: Chain     Motion: swing
* @default swing
*
* @param Weapon 16 Animation
* @desc Battle animation used by default for this weapon image.
* @default 6
*
* @param Weapon 17 Motion
* @desc Motion used by default for this weapon image.
* Weapon 17: Sword#2     Motion: swing
* @default swing
*
* @param Weapon 17 Animation
* @desc Battle animation used by default for this weapon image.
* @default 7
*
* @param Weapon 18 Motion
* @desc Motion used by default for this weapon image.
* Weapon 18: Iron Pipe     Motion: swing
* @default swing
*
* @param Weapon 18 Animation
* @desc Battle animation used by default for this weapon image.
* @default 1
*
* @param Weapon 19 Motion
* @desc Motion used by default for this weapon image.
* Weapon 19: Sling Shot     Motion: missile
* @default missile
*
* @param Weapon 19 Animation
* @desc Battle animation used by default for this weapon image.
* @default 11
*
* @param Weapon 20 Motion
* @desc Motion used by default for this weapon image.
* Weapon 20: Shotgun     Motion: missile
* @default missile
*
* @param Weapon 20 Animation
* @desc Battle animation used by default for this weapon image.
* @default 111
*
* @param Weapon 21 Motion
* @desc Motion used by default for this weapon image.
* Weapon 21: Rifle     Motion: missile
* @default missile
*
* @param Weapon 21 Animation
* @desc Battle animation used by default for this weapon image.
* @default 111
*
* @param Weapon 22 Motion
* @desc Motion used by default for this weapon image.
* Weapon 22: Chainsaw     Motion: thrust
* @default thrust
*
* @param Weapon 22 Animation
* @desc Battle animation used by default for this weapon image.
* @default 7
*
* @param Weapon 23 Motion
* @desc Motion used by default for this weapon image.
* Weapon 23: Railgun     Motion: missile
* @default missile
*
* @param Weapon 23 Animation
* @desc Battle animation used by default for this weapon image.
* @default 15
*
* @param Weapon 24 Motion
* @desc Motion used by default for this weapon image.
* Weapon 24: Stun Rod     Motion: thrust
* @default thrust
*
* @param Weapon 24 Animation
* @desc Battle animation used by default for this weapon image.
* @default 15
*
* @param Weapon 25 Motion
* @desc Motion used by default for this weapon image.
* Weapon 25: Spell Book   Motion: swing
* @default swing
*
* @param Weapon 25 Animation
* @desc Battle animation used by default for this weapon image.
* @default 1
*
* @param Weapon 26 Motion
* @desc Motion used by default for this weapon image.
* Weapon 26: custom     Motion: thrust
* @default thrust
*
* @param Weapon 26 Animation
* @desc Battle animation used by default for this weapon image.
* @default 1
*
* @param Weapon 27 Motion
* @desc Motion used by default for this weapon image.
* Weapon 27: custom     Motion: thrust
* @default thrust
*
* @param Weapon 27 Animation
* @desc Battle animation used by default for this weapon image.
* @default 1
*
* @param Weapon 28 Motion
* @desc Motion used by default for this weapon image.
* Weapon 28: custom     Motion: thrust
* @default thrust
*
* @param Weapon 28 Animation
* @desc Battle animation used by default for this weapon image.
* @default 1
*
* @param Weapon 29 Motion
* @desc Motion used by default for this weapon image.
* Weapon 29: custom     Motion: thrust
* @default thrust
*
* @param Weapon 29 Animation
* @desc Battle animation used by default for this weapon image.
* @default 1
*
* @param Weapon 30 Motion
* @desc Motion used by default for this weapon image.
* Weapon 30: custom     Motion: thrust
* @default thrust
*
* @param Weapon 30 Animation
* @desc Battle animation used by default for this weapon image.
* @default 1
*
* @help
* ============================================================================
* Introduction
* ============================================================================
*
* This plugin requires YEP_BattleEngineCore.
* Make sure this plugin is located under YEP_BattleEngineCore in the
* plugin list.
*
* This extension plugin allows you to animate enemies in a number of ways,
* from giving static enemies breathing, floating, and scaled attributes to
* utilizing animated sideview actors as potential battlers for your enemies
* instead of static graphics to help make your enemies appear more lively!
*
* If you are using YEP_X_ActSeqPack2, and would like the ability to add in
* floating enemies, place this plugin under YEP_X_ActSeqPack2 as well.
*
* To use this plugin, insert within the enemy's notebox the notetags you see
* in the section below:
*
* ============================================================================
* Notetags
* ============================================================================
*
* Insert these notetags into the enemy noteboxes below to change their
* sidewview battler aspects.
*
* Enemy Notetags:
*
*   --- General ---
*
*   <Breathing>
*   <No Breathing>
*   Enables or disables a 'breathing' effect for the enemy sprite.
*
*   <Breathing Speed: x>
*   How many frames does it take to make a full breathing cycle? The lower the
*   x value, the faster the enemy breathes. The higher the x value, the slower
*   the enemy breathes.
*
*   <Breathing Rate X: x.y>
*   <Breathing Rate Y: x.y>
*   Sets the horizontal and vertical breathing rate to x.y. 1.0 is a 100%
*   variance change while 0.0 is a 0% variance.
*
*   <Enable HP Link Breathing>
*   <Disable HP Link Breathing>
*   Will enable/disable HP Link Breathing. The lower the HP on the enemy, the
*   slower the enemy will breathe.
*
*   <Floating>
*   Sets the enemy to be animated as if it was floating.
*
*   <Floating Speed: x>
*   How many frames does it take to do a full floating cycle? The lower the x
*   value, the faster the enemy floats. The higher the x value, the slower the
*   enemy floats.
*
*   <Floating Rate: x.y>
*   Sets the floating rate for the enemy to x.y. 1.0 is a 100% variance change
*   while 0.0 is a 0% variance change.
*
*   <Floating Height: x>
*   Sets the minimum float height for the enemy to x.
*
*   <Scale Sprite: x%>
*   This allows you to scale the sprite larger or smaller by x% of the
*   original sprite size. If you wish to only scale either the width or the
*   height, use the notetags below:
*
*   <Scale Sprite Width: x%>
*   <Scale Sprite Height: x%>
*   This will scale the sprite's width or height by x% amount specifically
*   rather than the whole sprite itself by the same ratio.
*
*   --- Sideview ---
*
*   <Sideview Battler: filename>
*   This is the filename used for the sideview battler found within your
*   project's img/sv_actors/ folder. Doing this will enable the following
*   notetags to be applied to the battler. This is case-sensitive and used
*   without the image's file extension.
*
*   *Example: SF_Actor3_8.png would be <Sideview Battler: SF_Actor3_8>
*
*   *Note: If more than one of these tags is used, the sideview battler
*   selected will be picked from a random pool. Their settings, however, will
*   match all of the other sideview settings set in the notetags for the sake
*   of simplicity.
*
*   --- Sideview Specific ---
*
*   <Sideview Anchor X: y.z>
*   <Sideview Anchor Y: y.z>
*   This sets the anchor location for the enemy's sideview battler at y.z.
*   This is used for the event you have an odd-proportioned sideview battler.
*
*   <Sideview Width: x>
*   <Sideview Height: x>
*   Sets the width/height of the sideview battler. This is for the event
*   you're using a battler image that may have different proportions than
*   normal sideview battlers.
*
*   <Sideview Collapse>
*   Sets it so that the enemy when it dies will collapse and vanish.
*
*   <Sideview No Collapse>
*   Sets it so that the enemy when it dies will leave behind a corpse and
*   will not vanish.
*
*   <Sideview Frame Speed: x>
*   Sets the frame speed of this sideview battler to x. The lower the x value,
*   the faster the sideview battler animates. The higher it is, the slower the
*   battler animates.
*
*   --- Motions ---
*
*   <Sideview Attack Motion: swing>
*   <Sideview Attack Motion: thrust>
*   <Sideview Attack Motion: missile>
*   Sets the basic attack motion for your sideview enemy if the sideview
*   enemy is not using any weapons. You can use any of the following motions:
*   walk     wait     chant     guard     damage     evade
*   thrust   swing    missile   skill     spell      item
*   escape   victory  dying     abnormal  sleep      dead
*
*   <Sideview Weapon: x>
*   This sets the sprite's weapon image to x. If you haven't modified your
*   system images of the weapons, they would be as follows:
*
*   0 - Nothing
*   1 - Dagger   7 - Long Bow  13 - Mace       19 - Slingshot  25 - Book
*   2 - Sword    8 - Crossbow  14 - Rod        20 - Shotgun    26 - Custom
*   3 - Flail    9 - Gun       15 - Club       21 - Rifle      27 - Custom
*   4 - Axe     10 - Claw      16 - Chain      22 - Chainsaw   28 - Custom
*   5 - Whip    11 - Glove     17 - Sword#2    23 - Railgun    29 - Custom
*   6 - Staff   12 - Spear     18 - Iron Pipe  24 - Stun Rod   30 - Custom
*
*   * Note: Inserting multiple of these notetags will put them inside a random
*   pool of weapons to use. Keep in mind if you use this notetag, it will use
*   all the default settings found in the plugin's parameters. If you wish to
*   use more unique settings, use the notetag below:
*
*   <Sideview Weapon: x, y, z>
*   This sets the sprite's weapon image to x, motion to y, and attack
*   animation to z. An example of how this notetag would be used would be
*   as such:
*   
*      <Sideview Weapon: 2, swing, 6>
*
*   This will give the battler a sword with the swing motion and playing
*   battle animation 6 when attacking.
*
*   <Sideview Idle Motion: x>
*   Sets the idling motion for your sideview enemy. You can use any of the
*   following motions:
*   walk     wait     chant     guard     damage     evade
*   thrust   swing    missile   skill     spell      item
*   escape   victory  dying     abnormal  sleep      dead
*   * Note: Inserting multiple of these notetags will put them inside a random
*   pool of motions to use.
*
*   <Sideview Damage Motion: x>
*   Sets the damaged motion for your sideview enemy. You can use any of the
*   following motions:
*   walk     wait     chant     guard     damage     evade
*   thrust   swing    missile   skill     spell      item
*   escape   victory  dying     abnormal  sleep      dead
*
*   <Sideview Evade Motion: x>
*   Sets the evasion motion for your sideview enemy. You can use any of the
*   following motions:
*   walk     wait     chant     guard     damage     evade
*   thrust   swing    missile   skill     spell      item
*   escape   victory  dying     abnormal  sleep      dead
*
*   <Sideview Escape Motion: x>
*   Sets the escaping motion for your sideview enemy. You can use any of the
*   following motions:
*   walk     wait     chant     guard     damage     evade
*   thrust   swing    missile   skill     spell      item
*   escape   victory  dying     abnormal  sleep      dead
*
*   <Sideview Guard Motion: x>
*   Sets the guard motion for your sideview enemy. You can use any of the
*   following motions:
*   walk     wait     chant     guard     damage     evade
*   thrust   swing    missile   skill     spell      item
*   escape   victory  dying     abnormal  sleep      dead
*
*   <Sideview Abnormal Motion: x>
*   Sets the abnormal motion for your sideview enemy. You can use any of the
*   following motions:
*   walk     wait     chant     guard     damage     evade
*   thrust   swing    missile   skill     spell      item
*   escape   victory  dying     abnormal  sleep      dead
*
*   <Sideview Sleep Motion: x>
*   Sets the sleep motion for your sideview enemy. You can use any of the
*   following motions:
*   walk     wait     chant     guard     damage     evade
*   thrust   swing    missile   skill     spell      item
*   escape   victory  dying     abnormal  sleep      dead
*
*   <Sideview Dying Motion: x>
*   Sets the dying (crisis) motion for your sideview enemy. You can use any
*   of the following motions:
*   walk     wait     chant     guard     damage     evade
*   thrust   swing    missile   skill     spell      item
*   escape   victory  dying     abnormal  sleep      dead
*
*   <Sideview Dead Motion: x>
*   Sets the dead motion for your sideview enemy. You can use any of the
*   following motions:
*   walk     wait     chant     guard     damage     evade
*   thrust   swing    missile   skill     spell      item
*   escape   victory  dying     abnormal  sleep      dead
*
*   --- Shadows ---
*
*   <Sideview Show Shadow>
*   Sets it so the enemy will show its shadow for its sideview sprite. The
*   default setting of this is tied to Battle Engine Core's 'Show Shadows'.
*
*   <Sideview Hide Shadow>
*   Sets it so the enemy will hide its shadow for its sideview sprite. The
*   default setting of this is tied to Battle Engine Core's 'Show Shadows'.
*
*   <Sideview Shadow Width: x%>
*   Sets the shadow width to x% larger/smaller than the default shadow size
*   found within the img/system folder.
*
*   <Sideview Shadow Height: x%>
*   Sets the shadow height to x% larger/smaller than the default shadow size
*   found within the img/system folder.
*
* State Notetags:
*
*   <Hide Sideview Weapon>
*   This will cause the animated sideview enemy battler to hide its sideview
*   weapon effect. The attack motion will revert back to the barehanded attack
*   motion set for the enemy and the attack animation will be the enemy's
*   default attack animation.
*
* ============================================================================
* Changelog
* ============================================================================
*
* Version 1.05:
* - Made adjustments to the <Sprite Height: x> notetag to also affect the
* location of the state icons and effects.
*
* Version 1.04:
* - Fixed a bug with Sprite Smoothing disabled on Shadows.
* - Fixed a bug with the anchor Y positions being overwritten.
*
* Version 1.03:
* - Fixed a bug that would cause <Sideview Width: x> & <Sideview Height: x>
* notetags to crash the game.
*
* Version 1.02:
* - Synchronized state icons and overlays with floating enemies.
*
* Version 1.01:
* - Added 'HP Link Breathing' plugin parameter. If enabled, the lower the HP,
* the slower the enemy breathes.
* - Added <Enable HP Link Breathing> and <Disable HP Link Breathing> notetags.
*
* Version 1.00:
* - Finished plugin! Hooray!
*/
//=============================================================================

if (Imported.YEP_BattleEngineCore) {

//=============================================================================
// Parameter Variables
//=============================================================================

Yanfly.Parameters = PluginManager.parameters('YEP_X_AnimatedSVEnemies');
Yanfly.Param = Yanfly.Param || {};

Yanfly.Param.SVEAnchorX = Number(Yanfly.Parameters['Anchor X']);
Yanfly.Param.SVEAnchorY = Number(Yanfly.Parameters['Anchor Y']);
Yanfly.Param.SVESmoothing = eval(String(Yanfly.Parameters['Sprite Smoothing']));
Yanfly.Param.SVEWidth = String(Yanfly.Parameters['Sprite Width']);
Yanfly.Param.SVEWidth = Yanfly.Param.SVEWidth.toLowerCase();
Yanfly.Param.SVEHeight = String(Yanfly.Parameters['Sprite Height']);
Yanfly.Param.SVEHeight = Yanfly.Param.SVEHeight.toLowerCase();
Yanfly.Param.SVECollapse = eval(String(Yanfly.Parameters['Collapse']));
Yanfly.Param.SVEFrameSpeed = Number(Yanfly.Parameters['Frame Speed']);

Yanfly.Param.SVEBreathing = Number(Yanfly.Parameters['Enable Breathing']);
Yanfly.Param.SVEBreathSpeed = Number(Yanfly.Parameters['Breathing Speed']);
Yanfly.Param.SVEBreathXRate = Number(Yanfly.Parameters['Breathing X Rate']);
Yanfly.Param.SVEBreathYRate = Number(Yanfly.Parameters['Breathing Y Rate']);
Yanfly.Param.SVELinkBreathing = eval(Yanfly.Parameters['HP Link Breathing']);

Yanfly.Param.SVEFloatSpeed = Number(Yanfly.Parameters['Floating Speed']);
Yanfly.Param.SVEFloatRate = Number(Yanfly.Parameters['Floating Rate']);
Yanfly.Param.SVEFloatHeight = Number(Yanfly.Parameters['Floating Height']);

Yanfly.Param.SVEShowShadow = eval(String(Yanfly.Parameters['Show Shadow']));
Yanfly.Param.SVEShadowScaleX = String(Yanfly.Parameters['Shadow Scale X']);
Yanfly.Param.SVEShadowScaleY = String(Yanfly.Parameters['Shadow Scale Y']);

Yanfly.Param.SVEAttackMotion = String(Yanfly.Parameters['Attack Motion']);
Yanfly.Param.SVEIdleMotion = String(Yanfly.Parameters['Idle Motion']);
Yanfly.Param.SVEDmgMotion = String(Yanfly.Parameters['Damage Motion']);
Yanfly.Param.SVEEvadeMotion = String(Yanfly.Parameters['Evade Motion']);
Yanfly.Param.SVEEscMotion = String(Yanfly.Parameters['Escape Motion']);
Yanfly.Param.SVEGuardMotion = String(Yanfly.Parameters['Guard Motion']);
Yanfly.Param.SVEAbnMotion = String(Yanfly.Parameters['Abnormal Motion']);
Yanfly.Param.SVESleepMotion = String(Yanfly.Parameters['Sleep Motion']);
Yanfly.Param.SVEDyingMotion = String(Yanfly.Parameters['Dying Motion']);
Yanfly.Param.SVEDeadMotion = String(Yanfly.Parameters['Dead Motion']);

Yanfly.Param.SVEWeaponIndex = Number(Yanfly.Parameters['Weapon Image Index']);
Yanfly.Param.SVEWeaponMotion = {};
Yanfly.Param.SVEWeaponAnimation = {};
Yanfly.Param.SVEWeaponMotion[0] = Yanfly.Param.SVEAttackMotion.toLowerCase();
for (Yanfly.i = 1; Yanfly.i < 31; ++Yanfly.i) {
    Yanfly.s1 = 'Weapon ' + Yanfly.i + ' Motion';
    Yanfly.s2 = String(Yanfly.Parameters[Yanfly.s1]);
    Yanfly.Param.SVEWeaponMotion[Yanfly.i] = Yanfly.s2.toLowerCase();
    Yanfly.s1 = 'Weapon ' + Yanfly.i + ' Animation';
    Yanfly.s2 = Number(Yanfly.Parameters[Yanfly.s1]);
    Yanfly.Param.SVEWeaponAnimation[Yanfly.i] = Yanfly.s2;
};

//=============================================================================
// DataManager
//=============================================================================

Yanfly.SVE.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
DataManager.isDatabaseLoaded = function() {
    if (!Yanfly.SVE.DataManager_isDatabaseLoaded.call(this)) return false;
        DataManager.processSVENotetags1($dataEnemies);
    DataManager.processSVENotetags2($dataStates);
        return true;
};

DataManager.processSVENotetags1 = function(group) {
  var noteWeapon = /<(?:SIDEVIEW WEAPON):[ ](\d+),[ ](.*),[ ](\d+)>/i;
    for (var n = 1; n < group.length; n++) {
        var obj = group[n];
        var notedata = obj.note.split(/[\r\n]+/);

    obj.sideviewBattler = [];
    obj.sideviewAttackMotion = Yanfly.Param.SVEAttackMotion.toLowerCase();
    obj.sideviewIdleMotion = [];
    obj.sideviewDmgMotion = Yanfly.Param.SVEDmgMotion.toLowerCase();
    obj.sideviewEvadeMotion = Yanfly.Param.SVEEvadeMotion.toLowerCase();
    obj.sideviewEscMotion = Yanfly.Param.SVEEscMotion.toLowerCase();
    obj.sideviewGuardMotion = Yanfly.Param.SVEGuardMotion.toLowerCase();
    obj.sideviewAbnMotion = Yanfly.Param.SVEAbnMotion.toLowerCase();
    obj.sideviewSleepMotion = Yanfly.Param.SVESleepMotion.toLowerCase();
    obj.sideviewDyingMotion = Yanfly.Param.SVEDyingMotion.toLowerCase();
    obj.sideviewDeadMotion = Yanfly.Param.SVEDeadMotion.toLowerCase();
    obj.sideviewAnchorX = Yanfly.Param.SVEAnchorX;
    obj.sideviewAnchorY = Yanfly.Param.SVEAnchorY;
    obj.sideviewWeaponImage = [];
    obj.sideviewWidth = Yanfly.Param.SVEWidth;
    obj.sideviewHeight = Yanfly.Param.SVEHeight;
    obj.sideviewCollapse = Yanfly.Param.SVECollapse;
    obj.sideviewShadowShow = Yanfly.Param.SVEShowShadow;
    obj.sideviewShadowScaleX = Yanfly.Param.SVEShadowScaleX;
    obj.sideviewShadowScaleY = Yanfly.Param.SVEShadowScaleY;
    obj.spriteScaleX = 1;
    obj.spriteScaleY = 1;
    obj.sideviewFrameSpeed = Yanfly.Param.SVEFrameSpeed;
    obj.sideviewBreathing = [1, 3].contains(Yanfly.Param.SVEBreathing);
    obj.sideviewBreathSpeed = Math.max(1, Yanfly.Param.SVEBreathSpeed);
    obj.sideviewBreathXRate = Math.max(0, Yanfly.Param.SVEBreathXRate);
    obj.sideviewBreathYRate = Math.max(0, Yanfly.Param.SVEBreathYRate);
    obj.sideviewLinkBreathing = Yanfly.Param.SVELinkBreathing;
    obj.sideviewFloating = false;
    obj.sideviewFloatSpeed = Yanfly.Param.SVEFloatSpeed;
    obj.sideviewFloatRate = Yanfly.Param.SVEFloatRate;
    obj.sideviewFloatHeight = Yanfly.Param.SVEFloatHeight;

        for (var i = 0; i < notedata.length; i++) {
            var line = notedata;
       if (line.match(/<(?:SCALE SPRITE):[ ](\d+)([%%])>/i)) {
        obj.spriteScaleX = parseFloat(RegExp.$1) * 0.01;
        obj.spriteScaleY = obj.spriteScaleX;
      } else if (line.match(/<(?:SCALE SPRITE WIDTH):[ ](\d+)([%%])>/i)) {
        obj.spriteScaleX = parseFloat(RegExp.$1) * 0.01;
      } else if (line.match(/<(?:SCALE SPRITE HEIGHT):[ ](\d+)([%%])>/i)) {
        obj.spriteScaleY = parseFloat(RegExp.$1) * 0.01;
      } else if (line.match(/<(?:SIDEVIEW BATTLER):[ ](.*)>/i)) {
                obj.sideviewBattler.push(String(RegExp.$1));
        obj.sideviewBreathing = [2, 3].contains(Yanfly.Param.SVEBreathing);
            } else if (line.match(/<(?:SIDEVIEW ATTACK MOTION):[ ](.*)>/i)) {
                obj.sideviewAttackMotion = String(RegExp.$1).toLowerCase();
            } else if (line.match(/<(?:SIDEVIEW IDLE MOTION):[ ](.*)>/i)) {
                obj.sideviewIdleMotion.push(String(RegExp.$1).toLowerCase());
            } else if (line.match(/<(?:SIDEVIEW DAMAGE MOTION):[ ](.*)>/i)) {
                obj.sideviewDmgMotion.push(String(RegExp.$1).toLowerCase());
            } else if (line.match(/<(?:SIDEVIEW EVADE MOTION):[ ](.*)>/i)) {
                obj.sideviewEvadeMotion = String(RegExp.$1).toLowerCase();
            } else if (line.match(/<(?:SIDEVIEW ESCAPE MOTION):[ ](.*)>/i)) {
                obj.sideviewEscMotion = String(RegExp.$1).toLowerCase();
            } else if (line.match(/<(?:SIDEVIEW GUARD MOTION):[ ](.*)>/i)) {
                obj.sideviewGuardMotion = String(RegExp.$1).toLowerCase();
            } else if (line.match(/<(?:SIDEVIEW ABNORMAL MOTION):[ ](.*)>/i)) {
                obj.sideviewAbnMotion = String(RegExp.$1).toLowerCase();
            } else if (line.match(/<(?:SIDEVIEW SLEEP MOTION):[ ](.*)>/i)) {
                obj.sideviewSleepMotion = String(RegExp.$1).toLowerCase();
            } else if (line.match(/<(?:SIDEVIEW DYING MOTION):[ ](.*)>/i)) {
                obj.sideviewDyingMotion = String(RegExp.$1).toLowerCase();
            } else if (line.match(/<(?:SIDEVIEW DEAD MOTION):[ ](.*)>/i)) {
                obj.sideviewDeadMotion = String(RegExp.$1).toLowerCase();
            } else if (line.match(/<(?:SIDEVIEW ANCHOR X):[ ](\d+)[.](\d+)>/i)) {
                obj.sideviewAnchorX = eval(String(RegExp.$1) + '.' + String(RegExp.$2));
            } else if (line.match(/<(?:SIDEVIEW ANCHOR Y):[ ](\d+)[.](\d+)>/i)) {
                obj.sideviewAnchorY = eval(String(RegExp.$1) + '.' + String(RegExp.$2));
            } else if (line.match(/<(?:SIDEVIEW WEAPON):[ ](\d+)>/i)) {
        var weaponId = parseInt(RegExp.$1);
        var motionId = Yanfly.Param.SVEWeaponMotion[weaponId].toLowerCase();
        var aniId = Yanfly.Param.SVEWeaponAnimation[weaponId];
        var index = obj.sideviewWeaponImage.length;
        obj.sideviewWeaponImage[index] = [weaponId, motionId, aniId];
      } else if (line.match(noteWeapon)) {
        var weaponId = parseInt(RegExp.$1);
        var motionId = String(RegExp.$2).toLowerCase();
        var aniId = parseInt(RegExp.$3);
        var index = obj.sideviewWeaponImage.length;
        obj.sideviewWeaponImage[index] = [weaponId, motionId, aniId];
      } else if (line.match(/<(?:SIDEVIEW WIDTH):[ ](\d+)>/i)) {
        obj.sideviewWidth = parseInt(RegExp.$1);
      } else if (line.match(/<(?:SIDEVIEW HEIGHT):[ ](\d+)>/i)) {
        obj.sideviewHeight = parseInt(RegExp.$1);
      } else if (line.match(/<(?:SIDEVIEW COLLAPSE)>/i)) {
        obj.sideviewCollapse = true;
      } else if (line.match(/<(?:SIDEVIEW NO COLLAPSE)>/i)) {
        obj.sideviewCollapse = false;
      } else if (line.match(/<(?:SIDEVIEW SHOW SHADOW)>/i)) {
        obj.sideviewShadowShow = true;
      } else if (line.match(/<(?:SIDEVIEW HIDE SHADOW)>/i)) {
        obj.sideviewShadowShow = false;
      } else if (line.match(/<(?:SIDEVIEW SHADOW WIDTH):[ ](\d+)([%%])>/i)) {
                obj.sideviewShadowScaleX = parseFloat(RegExp.$1 * 0.01);
            } else if (line.match(/<(?:SIDEVIEW SHADOW HEIGHT):[ ](\d+)([%%])>/i)) {
                obj.sideviewShadowScaleY = parseFloat(RegExp.$1 * 0.01);
            } else if (line.match(/<(?:SIDEVIEW FRAME SPEED):[ ](\d+)>/i)) {
        obj.sideviewFrameSpeed = parseInt(RegExp.$1);
      } else if (line.match(/<(?:FLOATING|float)>/i)) {
        obj.sideviewFloating = true;
      } else if (line.match(/<(?:FLOATING SPEED):[ ](\d+)>/i)) {
        obj.sideviewFloatSpeed = Math.max(1, parseInt(RegExp.$1));
      } else if (line.match(/<(?:FLOATING RATE):[ ](\d+)[.](\d+)>/i)) {
        var rate = eval(String(RegExp.$1) + '.' + String(RegExp.$2));
        obj.sideviewFloatRate = rate;
      } else if (line.match(/<(?:FLOATING HEIGHT):[ ](\d+)>/i)) {
        obj.sideviewFloatHeight = parseInt(RegExp.$1);
      }
        }
    // Breathing
    for (var i = 0; i < notedata.length; i++) {
      var line = notedata;
      if (line.match(/<(?:BREATHING)>/i)) {
        obj.sideviewBreathing = true;
      } else if (line.match(/<(?:NO BREATHING)>/i)) {
        obj.sideviewBreathing = false;
      } else if (line.match(/<(?:BREATHING SPEED):[ ](\d+)>/i)) {
        obj.sideviewBreathSpeed = Math.max(1, parseInt(RegExp.$1));
      } else if (line.match(/<(?:BREATHING RATE X):[ ](\d+)[.](\d+)>/i)) {
        var rate = eval(String(RegExp.$1) + '.' + String(RegExp.$2));
        obj.sideviewBreathXRate = rate;
      } else if (line.match(/<(?:BREATHING RATE Y):[ ](\d+)[.](\d+)>/i)) {
        var rate = eval(String(RegExp.$1) + '.' + String(RegExp.$2));
        obj.sideviewBreathYRate = rate;
      } else if (line.match(/<(?:ENABLE HP LINK BREATHING)>/i)) {
        obj.sideviewLinkBreathing = true;
      } else if (line.match(/<(?:DISABLE HP LINK BREATHING)>/i)) {
        obj.sideviewLinkBreathing = false;
      }
    }
        // Create Defaults
        if (obj.sideviewIdleMotion.length <= 0) {
            obj.sideviewIdleMotion = [Yanfly.Param.SVEIdleMotion.toLowerCase()];
        }
        if (obj.sideviewWeaponImage.length <= 0) {
            var weaponId = Yanfly.Param.SVEWeaponIndex;
            var motionId = Yanfly.Param.SVEWeaponMotion[weaponId].toLowerCase();
            var aniId = Yanfly.Param.SVEWeaponAnimation[weaponId];
            obj.sideviewWeaponImage = [[weaponId, motionId, aniId]];
        }
    obj.sideviewFrameSpeed = Math.max(1, obj.sideviewFrameSpeed);
    }
};

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

    obj.hideSVWeapon;

    for (var i = 0; i < notedata.length; i++) {
      var line = notedata;
      if (line.match(/<(?:HIDE SIDEVIEW WEAPON)>/i)) {
        obj.hideSVWeapon = true;
      }
    }
  }
};

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

if (Yanfly.Param.SVESmoothing) {

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

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

}; // Yanfly.Param.SVESmoothing

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

Yanfly.SVE.Game_Battler_spriteWidth = Game_Battler.prototype.spriteWidth;
Game_Battler.prototype.spriteWidth = function() {
    if (this.isSideviewDimensions('width')) {
      var value = this.sideviewWidth();
      value *= Math.abs(this.spriteScaleX());
    } else {
      var value = Yanfly.SVE.Game_Battler_spriteWidth.call(this);
    }
    return value;
};

Yanfly.SVE.Game_Battler_spriteHeight = Game_Battler.prototype.spriteHeight;
Game_Battler.prototype.spriteHeight = function() {
    if (this.isSideviewDimensions('height')) {
      var value = this.sideviewHeight();
      value *= Math.abs(this.spriteScaleY());
    } else {
      var value = Yanfly.SVE.Game_Battler_spriteHeight.call(this);
    }
    return value;
};

Game_Battler.prototype.isSideviewDimensions = function(value) {
    if (!this.isEnemy()) return false;
    if (!this.hasSVBattler()) return false;
    if (value === 'width') return this.sideviewWidth() !== 'auto';
    if (value === 'height') return this.sideviewHeight() !== 'auto';
};

//=============================================================================
// Game_Enemy
//=============================================================================

Game_Enemy.prototype.actor = function() {
    return this.enemy();
};

Game_Enemy.prototype.clearSVAttributes = function() {
    this._svWeaponImageId = undefined;
    this._svAttackMotion = undefined;
    this._svAttackAnimationId = undefined;
    this._svBattlerName = undefined;
    this._svIdleMotion = undefined;
};

Game_Enemy.prototype.setupSVAttributes = function() {
    var array = this.enemy().sideviewWeaponImage;
    var newArray = Yanfly.Util.getRandomElement(array);
    this._svWeaponImageId = newArray[0];
    this._svAttackMotion = newArray[1];
    this._svAttackAnimationId = newArray[2];
    if (this._svAttackAnimationId === undefined) this._svAttackAnimationId =
      Yanfly.SVE.Game_Enemy_attackAnimationId.call(this);
};

Yanfly.SVE.Game_Enemy_attackAnimationId =
        Game_Enemy.prototype.attackAnimationId;
Game_Enemy.prototype.attackAnimationId = function() {
        if (this.hasSVBattler() && !this.isHideSVWeapon()) {
            if (this._svAttackAnimationId) return this._svAttackAnimationId;
            this.setupSVAttributes();
            return this._svAttackAnimationId;
        }
    return Yanfly.SVE.Game_Enemy_attackAnimationId.call(this);
};

Game_Enemy.prototype.svBattlerName = function() {
        if (this._svBattlerName) return this._svBattlerName;
        var array = this.enemy().sideviewBattler;
        this._svBattlerName = Yanfly.Util.getRandomElement(array);
    return this._svBattlerName;
};

Game_Enemy.prototype.hasSVBattler = function() {
    return this.svBattlerName() !== undefined;
};

Game_Enemy.prototype.weaponImageId = function() {
    if (this.isHideSVWeapon()) return 0;
        if (this._svWeaponImageId) return this._svWeaponImageId;
        this.setupSVAttributes();
    return this._svWeaponImageId;
};

Game_Enemy.prototype.attackMotion = function() {
    if (this.weaponImageId() === 0) return this.enemy().sideviewAttackMotion;
        if (this._svAttackMotion) return this._svAttackMotion;
        this.setupSVAttributes();
    return this._svAttackMotion;
};

Game_Enemy.prototype.idleMotion = function() {
        if (this._svIdleMotion) return this._svIdleMotion;
        var array = this.enemy().sideviewIdleMotion;
        this._svIdleMotion = Yanfly.Util.getRandomElement(array);
    return this._svIdleMotion;
};

Game_Enemy.prototype.damageMotion = function() {
    return this.enemy().sideviewDmgMotion;
};

Game_Enemy.prototype.evadeMotion = function() {
    return this.enemy().sideviewEvadeMotion;
};

Game_Enemy.prototype.escapeMotion = function() {
    return this.enemy().sideviewEscMotion;
};

Game_Enemy.prototype.guardMotion = function() {
    return this.enemy().sideviewGuardMotion;
};

Game_Enemy.prototype.abnormalMotion = function() {
    return this.enemy().sideviewAbnMotion;
};

Game_Enemy.prototype.sleepMotion = function() {
    return this.enemy().sideviewSleepMotion;
};

Game_Enemy.prototype.dyingMotion = function() {
    return this.enemy().sideviewDyingMotion;
};

Game_Enemy.prototype.deadMotion = function() {
    return this.enemy().sideviewDeadMotion;
};

Game_Enemy.prototype.sideviewAnchorX = function() {
    return this.enemy().sideviewAnchorX;
};

Game_Enemy.prototype.sideviewAnchorY = function() {
    return this.enemy().sideviewAnchorY;
};

Game_Enemy.prototype.anchorX = function() {
    if (this.hasSVBattler()) return this.sideviewAnchorX();
    return Game_Battler.prototype.anchorX.call(this);
};

Game_Enemy.prototype.anchorY = function() {
    if (this.hasSVBattler()) return this.sideviewAnchorY();
    return Game_Battler.prototype.anchorY.call(this);
};

Game_Enemy.prototype.sideviewWidth = function() {
    return this.enemy().sideviewWidth;
};

Game_Enemy.prototype.sideviewHeight = function() {
    return this.enemy().sideviewHeight;
};

Game_Enemy.prototype.sideviewCollapse = function() {
    return this.enemy().sideviewCollapse;
};

Game_Enemy.prototype.showSideviewShadow = function() {
    return this.enemy().sideviewShadowShow;
};

Game_Enemy.prototype.sideviewShadowScaleX = function() {
    return this.enemy().sideviewShadowScaleX;
};

Game_Enemy.prototype.sideviewShadowScaleY = function() {
    return this.enemy().sideviewShadowScaleY;
};

Game_Enemy.prototype.spriteScaleX = function() {
    if (this.hasSVBattler()) return this.enemy().spriteScaleX * -1;
    return this.enemy().spriteScaleX;
};

Game_Enemy.prototype.spriteScaleY = function() {
    return this.enemy().spriteScaleY;
};

Game_Enemy.prototype.sideviewFrameSpeed = function() {
    return this.enemy().sideviewFrameSpeed;
};

Game_Enemy.prototype.performAttack = function() {
    if (!this.hasSVBattler()) {
      return Game_Battler.prototype.performAttack.call(this);
    }
    this.forceMotion(this.attackMotion());
    this.startWeaponAnimation(this.weaponImageId());
};

Game_Enemy.prototype.performAction = function(action) {
    if (!this.hasSVBattler()) {
      return Game_Battler.prototype.performAction.call(this, action);
    }
    Game_Actor.prototype.performAction.call(this, action);
};

Yanfly.SVE.Game_Enemy_performDamage = Game_Enemy.prototype.performDamage;
Game_Enemy.prototype.performDamage = function() {
    if (!this.hasSVBattler()) {
      return Yanfly.SVE.Game_Enemy_performDamage.call(this);
    }
    Game_Battler.prototype.performDamage.call(this);
    if (this.isSpriteVisible()) {
      this.requestMotion(this.damageMotion());
    } else {
      $gameScreen.startShake(5, 5, 10);
    }
    SoundManager.playEnemyDamage();
};

Game_Enemy.prototype.performEvasion = function() {
    Game_Battler.prototype.performEvasion.call(this);
    if (!this.hasSVBattler()) return;
    this.requestMotion(this.evadeMotion());
};

Game_Enemy.prototype.performMagicEvasion = function() {
    Game_Battler.prototype.performMagicEvasion.call(this);
    if (!this.hasSVBattler()) return;
    this.requestMotion(this.evadeMotion());
};

Game_Enemy.prototype.performCounter = function() {
    Game_Battler.prototype.performCounter.call(this);
    if (!this.hasSVBattler()) return;
    this.performAttack();
};

Game_Enemy.prototype.performEscape = function() {
    if (!this.hasSVBattler()) return;
    if (!this.canMove()) return;
    this.requestMotion(this.escapeMotion());
};

Game_Enemy.prototype.isBreathing = function() {
    if (this.isDead()) return false;
    return this.enemy().sideviewBreathing;
};

Game_Enemy.prototype.breathingSpeed = function() {
    return this.enemy().sideviewBreathSpeed;
};

Game_Enemy.prototype.breathXRate = function() {
    return this.enemy().sideviewBreathXRate;
};

Game_Enemy.prototype.breathYRate = function() {
    return this.enemy().sideviewBreathYRate;
};

Game_Enemy.prototype.linkBreathing = function() {
    return this.enemy().sideviewLinkBreathing;
};

Game_Enemy.prototype.isFloating = function() {
    if (this.isDead()) return false;
    return this.enemy().sideviewFloating;
};

Game_Enemy.prototype.floatSpeed = function() {
    return this.enemy().sideviewFloatSpeed;
};

Game_Enemy.prototype.floatRate = function() {
    return this.enemy().sideviewFloatRate;
};

Game_Enemy.prototype.floatHeight = function() {
    return this.enemy().sideviewFloatHeight;
};

Game_Enemy.prototype.isHideSVWeapon = function() {
    var max = this.states().length;
    for (var i = 0; i < max; ++i) {
      var state = this.states();
      if (state && state.hideSVWeapon) return true;
    }
    return false;
};

Yanfly.SVE.Game_Enemy_transform = Game_Enemy.prototype.transform;
Game_Enemy.prototype.transform = function(enemyId) {
    this.clearSVAttributes();
    Yanfly.SVE.Game_Enemy_transform.call(this, enemyId);
    this.battler().setBattler(this);
    this.battler().setTransform(this);
};

//=============================================================================
// Game_Party
//=============================================================================

Yanfly.SVE.Game_Party_requestMotionRefresh =
    Game_Party.prototype.requestMotionRefresh;
Game_Party.prototype.requestMotionRefresh = function() {
    Yanfly.SVE.Game_Party_requestMotionRefresh.call(this);
    $gameTroop.requestMotionRefresh();
};

//=============================================================================
// Sprite_Enemy
//=============================================================================

Yanfly.SVE.Sprite_Enemy_initMembers = Sprite_Enemy.prototype.initMembers;
Sprite_Enemy.prototype.initMembers = function() {
    Yanfly.SVE.Sprite_Enemy_initMembers.call(this);
    this.initSVSprites();
};

Sprite_Enemy.prototype.initSVSprites = function() {
    this._svRand = Math.random() * 10000;
    this._svBattlerName = '';
    this._motion = null;
    this._motionCount = 0;
    this._pattern = 0;
    this._svBattlerEnabled = false;
    this.createShadowSprite();
    this.createWeaponSprite();
    this.createMainSprite();
    this.createStateSprite();
    this._effectTarget = this;
};

Sprite_Enemy.prototype.setTransform = function(battler) {
    this._shadowSprite.opacity = 0;
    this._weaponSprite.opacity = 0;
    this._mainSprite.opacity = 0;
    this._stateSprite.opacity = 0;
    this.createShadowSprite();
    this.createWeaponSprite();
    this.createMainSprite();
    this.createStateSprite();
};

Sprite_Enemy.prototype.createMainSprite = function() {
    Sprite_Actor.prototype.createMainSprite.call(this);
};

Sprite_Enemy.prototype.createShadowSprite = function() {
    this._shadowSprite = new Sprite();
    if (Yanfly.Param.SVESmoothing) {
      this._shadowSprite.bitmap = ImageManager.loadSystemSmooth('Shadow2');
    } else {
      this._shadowSprite.bitmap = ImageManager.loadSystem('Shadow2');
    }   
    this._shadowSprite.anchor.x = 0.5;
    this._shadowSprite.anchor.y = 0.5;
    this._shadowSprite.y = -2;
    this.addChild(this._shadowSprite);
    this._shadowSprite.opacity = 0;
};

Sprite_Enemy.prototype.createWeaponSprite = function() {
    Sprite_Actor.prototype.createWeaponSprite.call(this);
};

Sprite_Enemy.prototype.createStateSprite = function() {
    Sprite_Actor.prototype.createStateSprite.call(this);
};

Yanfly.SVE.Sprite_Enemy_setBattler = Sprite_Enemy.prototype.setBattler;
Sprite_Enemy.prototype.setBattler = function(battler) {
    this._svBattlerEnabled = false;
    Yanfly.SVE.Sprite_Enemy_setBattler.call(this, battler);
    this.setSVBattler(battler);
};

Sprite_Enemy.prototype.setMirror = function(value) {
    if (this._svBattlerEnabled) value = !value;
    Sprite_Battler.prototype.setMirror.call(this, value);
};

Sprite_Enemy.prototype.setSVBattler = function(battler) {
    if (!this._enemy) return;
    if (this._enemy.svBattlerName() === undefined) return;
    this._adjustMainBitmapSettings = false;
    this._actor = this._enemy;
    this._svBattlerEnabled = true;
    this._stateSprite.setup(battler);
};

Yanfly.SVE.Sprite_Enemy_update = Sprite_Enemy.prototype.update;
Sprite_Enemy.prototype.update = function() {
    Yanfly.SVE.Sprite_Enemy_update.call(this);
    if (this._svBattlerEnabled) this.updateMotion();
    this.updateBreathing();
};

Yanfly.SVE.Sprite_Enemy_updateStateSprite =
    Sprite_Enemy.prototype.updateStateSprite;
Sprite_Enemy.prototype.updateStateSprite = function() {
    if (this._enemy && this._enemy.hasSVBattler()) {
      this.updateSVStateSprite();
    } else {
      Yanfly.SVE.Sprite_Enemy_updateStateSprite.call(this);
    }
    this.updateFloatingStateSprite();
};

Sprite_Enemy.prototype.updateSVStateSprite = function() {
    var height = this._enemy.spriteHeight() * -1;
    height -= Sprite_StateIcon._iconHeight;
    this._stateIconSprite.y = height;
    this._stateSprite.y = 0;
};

Sprite_Enemy.prototype.updateFloatingStateSprite = function() {
    if (this._enemy && this._enemy.isFloating()) {
      var heightRate = this.addFloatingHeight();
      var height = this._enemy.spriteHeight();
      this._stateIconSprite.y += heightRate * height;
      this._stateSprite.y += heightRate * height;
    };
};

Sprite_Enemy.prototype.updateBreathing = function() {
    if (!this._enemy) return;
    if (this._enemy.isBreathing()) {
      var c = Graphics.frameCount + this._svRand;
      var s = this._enemy.breathingSpeed();
      var rateX = this._enemy.breathXRate();
      var rateY = this._enemy.breathYRate();
      if (this._enemy.linkBreathing()) s /= this._enemy.hpRate();
      var scaleX = Math.cos(c / s) * rateX;
      var scaleY = Math.cos(c / s) * rateY;
    } else {
      var scaleX = 0;
      var scaleY = 0;
    }
    this.scale.x = this._enemy.spriteScaleX() + scaleX;
    this.scale.y = this._enemy.spriteScaleY() + scaleY;
};

if (Imported.YEP_X_ActSeqPack2) {

Yanfly.SVE.Sprite_Battler_getFloatHeight =
    Sprite_Battler.prototype.getFloatHeight;
Sprite_Battler.prototype.getFloatHeight = function() {
    var value = Yanfly.SVE.Sprite_Battler_getFloatHeight.call(this);
    value -= this.addFloatingHeight();
    return value;
};

Sprite_Battler.prototype.addFloatingHeight = function() {
    value = 0;
    if (this._enemy && this._enemy.isFloating()) {
      var c = Graphics.frameCount + this._svRand;
      var s = this._enemy.floatSpeed();
      var rate = this._enemy.floatRate();
      value += Math.cos(c / s) * rate - rate;
      var height = this._enemy.floatHeight();
      value -= height / this._enemy.spriteHeight();
    }
    return value;
};

}; // Imported.YEP_X_ActSeqPack2

Yanfly.SVE.Sprite_Enemy_updateBitmap = Sprite_Enemy.prototype.updateBitmap;
Sprite_Enemy.prototype.updateBitmap = function() {
    Yanfly.SVE.Sprite_Enemy_updateBitmap.call(this);
    if (!this._svBattlerEnabled) this.updateScale();
    this.updateSVBitmap();
    this.adjustAnchor();
};

Sprite_Enemy.prototype.updateSVBitmap = function() {
    Sprite_Battler.prototype.updateBitmap.call(this);
    var name = this._enemy.svBattlerName();
    if (this._svBattlerEnabled && this._svBattlerName !== name) {
      this._createdDummyMainSprite = false;
      this._svBattlerName = name;
      this._mainSprite.bitmap = ImageManager.loadSvActor(name);
      this.adjustAnchor();
      this.refreshMotion();
      this.updateScale();
    } else if (this._svBattlerName === '') {
      this._svBattlerName = '';
      if (this._createdDummyMainSprite) return;
      this._createdDummyMainSprite = true;
      this._mainSprite = new Sprite_Base();
      this._mainSprite.anchor.x = 0.5;
      this._mainSprite.anchor.y = 1;
    }
};

Sprite_Enemy.prototype.adjustAnchor = function() {
    if (!this._mainSprite) return;
        this._mainSprite.anchor.x = this._enemy.sideviewAnchorX();
    this._mainSprite.anchor.y = this._enemy.sideviewAnchorY();
};

Sprite_Enemy.prototype.updateScale = function() {
    this.scale.x = this._enemy.spriteScaleX();
    this.scale.y = this._enemy.spriteScaleY();
};

Yanfly.SVE.Sprite_Enemy_updateFrame = Sprite_Enemy.prototype.updateFrame;
Sprite_Enemy.prototype.updateFrame = function() {
    if (this._svBattlerEnabled) return this.updateSVFrame();
    Yanfly.SVE.Sprite_Enemy_updateFrame.call(this);
};

Sprite_Enemy.prototype.updateSVFrame = function() {
    Sprite_Battler.prototype.updateFrame.call(this);
    var bitmap = this._mainSprite.bitmap;
    if (bitmap.width <= 0) return;
    this._effectTarget = this._mainSprite;
    var motionIndex = this._motion ? this._motion.index : 0;
    var pattern = this._pattern < 3 ? this._pattern : 1;
    var cw = bitmap.width / 9;
    var ch = bitmap.height / 6;
    var cx = Math.floor(motionIndex / 6) * 3 + pattern;
    var cy = motionIndex % 6;
    var cdh = 0;
    if (this._effectType === 'bossCollapse') {
      cdh = ch - this._effectDuration;
    }
    this.setFrame(cx * cw, cy * ch, cw, ch);
    this._mainSprite.setFrame(cx * cw, cy * ch, cw, ch - cdh);
    this.adjustMainBitmapSettings(bitmap);
    this.adjustSVShadowSettings();
};

Sprite_Enemy.prototype.adjustMainBitmapSettings = function(bitmap) {
    if (this._adjustMainBitmapSettings) return;
    this._adjustMainBitmapSettings = true;
    var svw = this._enemy.sideviewWidth();
    var svh = this._enemy.sideviewHeight();
    if (svw === 'auto') svw = bitmap.width / 9;
    if (svh === 'auto') svh = bitmap.height / 6;
    svw = Math.floor(Math.abs(svw * this._enemy.spriteScaleX()));
    svh = Math.floor(Math.abs(svh * this._enemy.spriteScaleY()));
    this.bitmap = new Bitmap(svw, svh);
};

Sprite_Enemy.prototype.adjustSVShadowSettings = function() {
    if (this._enemy.showSideviewShadow()) this._shadowSprite.opacity = 255;
    var scaleX = this._enemy.sideviewShadowScaleX();
    var scaleY = this._enemy.sideviewShadowScaleY();
    if (scaleX === 'auto') scaleX = this._mainSprite.bitmap.width / 9 / 64;
    if (scaleY === 'auto') scaleY = this._mainSprite.bitmap.width / 9 / 64;
    this._shadowSprite.scale.x = scaleX;
    this._shadowSprite.scale.y = scaleY;
};

Sprite_Enemy.prototype.updateMotion = function() {
    if (!this._svBattlerEnabled) return;
    this.setupMotion();
    this.setupWeaponAnimation();
    if (this._enemy.isMotionRefreshRequested()) {
      Sprite_Actor.prototype.refreshMotion.call(this);
      this._enemy.clearMotion();
    }
    this.updateMotionCount();
};

Sprite_Enemy.prototype.setupMotion = function() {
    if (!this._svBattlerEnabled) return;
    if (!this._enemy.isMotionRequested()) return;
    this.startMotion(this._enemy.motionType());
    this._enemy.clearMotion();
};

Sprite_Enemy.prototype.startMotion = function(motionType) {
    if (!this._svBattlerEnabled) return;
    var newMotion = Sprite_Actor.MOTIONS[motionType];
    if (this._motion === newMotion) return;
    this._motion = newMotion;
    this._motionCount = 0;
    this._pattern = 0;
};

Sprite_Enemy.prototype.setupWeaponAnimation = function() {
    if (!this._svBattlerEnabled) return;
    if (!this._enemy.isWeaponAnimationRequested()) return;
    this._weaponSprite.setup(this._enemy.weaponImageId());
    this._enemy.clearWeaponAnimation();
};

Sprite_Enemy.prototype.updateMotionCount = function() {
    if (!this._svBattlerEnabled) return;
    if (this._motion && ++this._motionCount >= this.motionSpeed()) {
      if (this._motion.loop) {
        this._pattern = (this._pattern + 1) % 4;
      } else if (this._pattern < 2) {
        this._pattern++;
      } else {
        this.refreshMotion();
      }
      this._motionCount = 0;
    }
};

Sprite_Enemy.prototype.refreshMotion = function() {
    if (!this._svBattlerEnabled) return;
    var enemy = this._enemy;
    if (!enemy) return;
    var stateMotion = enemy.stateMotionIndex();
    if (enemy.isInputting() || enemy.isActing()) {
        this.startMotion('walk');
    } else if (stateMotion === 3) {
        this.startMotion(enemy.deadMotion());
    } else if (stateMotion === 2) {
        this.startMotion(enemy.sleepMotion());
    } else if (enemy.isGuard() || enemy.isGuardWaiting()) {
        this.startMotion(enemy.guardMotion());
    } else if (stateMotion === 1) {
        this.startMotion(enemy.abnormalMotion());
    } else if (enemy.isDying()) {
        this.startMotion(enemy.dyingMotion());
    } else {
        this.startMotion(enemy.idleMotion());
    }
};

Sprite_Enemy.prototype.motionSpeed = function() {
    if (!this._enemy) return 12;
    return this._enemy.sideviewFrameSpeed() || 12;
};

Sprite_Enemy.prototype.updateSelectionEffect = function() {
    if (!this._svBattlerEnabled) {
      return Sprite_Battler.prototype.updateSelectionEffect.call(this);
    }
    var target = this._mainSprite;
    if (this._battler.isSelected()) {
        this._selectionEffectCount++;
        if (this._selectionEffectCount % 30 < 15) {
            target.setBlendColor([255, 255, 255, 64]);
        } else {
            target.setBlendColor([0, 0, 0, 0]);
        }
    } else if (this._selectionEffectCount > 0) {
        this._selectionEffectCount = 0;
        target.setBlendColor([0, 0, 0, 0]);
    }
};

Sprite_Enemy.prototype.isSideviewCollapse = function() {
    if (!this._svBattlerEnabled) return true;
    return this._enemy.sideviewCollapse();
};

Yanfly.SVE.Sprite_Enemy_updateCollapse = Sprite_Enemy.prototype.updateCollapse;
Sprite_Enemy.prototype.updateCollapse = function() {
    if (!this.isSideviewCollapse()) return;
    if (this._svBattlerEnabled) {
      this._mainSprite.blendMode = Graphics.BLEND_ADD;
      this._mainSprite.setBlendColor([255, 128, 128, 128]);
      this.opacity *= this._effectDuration / (this._effectDuration + 1);
    } else {
      Yanfly.SVE.Sprite_Enemy_updateCollapse.call(this);
    }
};

Yanfly.SVE.Sprite_Enemy_startBossCollapse =
    Sprite_Enemy.prototype.startBossCollapse;
Sprite_Enemy.prototype.startBossCollapse = function() {
    if (this._svBattlerEnabled) {
      this._effectDuration = Math.ceil(this._mainSprite.height * this.scale.y);
    this._appeared = false;
    } else {
      Yanfly.SVE.Sprite_Enemy_startBossCollapse.call(this);
    }
};

Yanfly.SVE.Sprite_Enemy_updateBossCollapse =
    Sprite_Enemy.prototype.updateBossCollapse;
Sprite_Enemy.prototype.updateBossCollapse = function() {
    if (!this.isSideviewCollapse()) return;
    if (this._svBattlerEnabled) {
      this._shake = this._effectDuration % 2 * 4 - 2;
      this._mainSprite.blendMode = Graphics.BLEND_ADD;
      this._mainSprite.setBlendColor([255, 255, 255, 255 - this.opacity]);
      this.opacity *= this._effectDuration / (this._effectDuration + 1);
      if (this._effectDuration % 20 === 19) {
        SoundManager.playBossCollapse2();
      }
    } else {
      Yanfly.SVE.Sprite_Enemy_updateBossCollapse.call(this);
    }
};

Yanfly.SVE.Sprite_Enemy_updateInstantCollapse =
    Sprite_Enemy.prototype.updateInstantCollapse;
Sprite_Enemy.prototype.updateInstantCollapse = function() {
    if (!this.isSideviewCollapse()) return;
    Yanfly.SVE.Sprite_Enemy_updateInstantCollapse.call(this);
};

//=============================================================================
// Sprite_StateIcon
//=============================================================================

Yanfly.SVE.Sprite_StateIcon_updateMirror =
    Sprite_StateIcon.prototype.updateMirror;
Sprite_StateIcon.prototype.updateMirror = function() {
    this.scale.x = 1 / Math.max(1 / 10000, Math.abs(this.parent.scale.x));
    this.scale.y = 1 / Math.max(1 / 10000, Math.abs(this.parent.scale.y));
    Yanfly.SVE.Sprite_StateIcon_updateMirror.call(this);
};

//=============================================================================
// Utilities
//=============================================================================

Yanfly.Util = Yanfly.Util || {};

Yanfly.Util.getRandomElement = function(array) {
    var value = array[Math.floor(Math.random() * array.length)];
    return value;
};

//=============================================================================
// End of File
//=============================================================================
};
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-11-30 13:58

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表