扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 143|回复: 0

[转载发布] 求请教怎么使用敌人动态战斗脚本

[复制链接]
累计送礼:
0 个
累计收礼:
0 个
  • TA的每日心情
    开心
    2025-2-4 02:05
  • 签到天数: 110 天

    连续签到: 2 天

    [LV.6]常住居民II

    2327

    主题

    395

    回帖

    1万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    6
    卡币
    10465
    OK点
    16
    推广点
    0
    同能卷
    0
    积分
    13215

    灌水之王

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



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

                本帖来自P1论坛作者309988769,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址:https://rpg.blue/forum.php?mod=viewthread&tid=384994  若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2025-3-10 16:51 , Processed in 0.135323 second(s), 53 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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