Project1

标题: 当自动战斗插件和ATC插件并存,出现冲突怎么办? [打印本页]

作者: 索里    时间: 2015-11-19 16:41
标题: 当自动战斗插件和ATC插件并存,出现冲突怎么办?
  1. /**
  2. * Created by Gilles on 01.11.2015.
  3. * @email: [email protected]
  4. */

  5. /*:
  6. * @plugindesc Allows Auto Attack in Battle. The players will always choose the enemy with the lowest hp
  7. * @author Gilles Meyer
  8. *
  9. * @param Auto Attack Text Party
  10. * @desc The text which will appear in the Party command Menu
  11. * @default Auto Attack
  12. *
  13. * @param Auto Attack Text Actor
  14. * @desc The text which will appear in the Actor command Menu
  15. * @default Auto Attack
  16. *
  17. *
  18. *
  19. */

  20. (function() {


  21.   var parameters = PluginManager.parameters('AutoBattlePlugin');
  22.   var autoAttackPartyText = String(parameters['Auto Attack Text Party'] || "自动");
  23.   var autoAttackActorText = String(parameters['Auto Attack Text Actor'] || "自动");

  24.   var getEnemyWithLowestHP = function(enemies) {
  25.     var enemyIndex = 0;
  26.     for(var i=1; i < enemies.length; i++) {
  27.       if(enemies[i].hp < enemies[enemyIndex].hp || enemies[enemyIndex].hp == 0) {
  28.         enemyIndex = i;
  29.       }
  30.     }
  31.     return enemyIndex;
  32.   };

  33.   
  34.   Scene_Battle.prototype.commandAutoFight = function() {
  35.     this.selectNextCommand();
  36.     do {
  37.       this.commandAutoAttack.apply(this, arguments);
  38.     } while(BattleManager.isInputting());
  39.     this._actorCommandWindow.deactivate();
  40.   };

  41.   Scene_Battle.prototype.commandAutoAttack = function() {
  42.     BattleManager.inputtingAction().setAttack();
  43.     var enemyIndex = getEnemyWithLowestHP(this._enemyWindow._enemies);
  44.     var action = BattleManager.inputtingAction();
  45.     action.setTarget(enemyIndex);
  46.     this.selectNextCommand();
  47.   };


  48.   // ## Autofight for Party
  49.   Window_PartyCommand.prototype.makeCommandList = function() {
  50.     this.addCommand(TextManager.fight,  'fight');
  51.     // Needs rework
  52.     this.addCommand(autoAttackPartyText,  'autofight');
  53.     this.addCommand(TextManager.escape, 'escape', BattleManager.canEscape());
  54.   };

  55.   var _Scene_Battle_createPartyCommandWindow = Scene_Battle.prototype.createPartyCommandWindow;
  56.   Scene_Battle.prototype.createPartyCommandWindow = function() {
  57.     _Scene_Battle_createPartyCommandWindow.apply(this, arguments);
  58.     this._partyCommandWindow.setHandler('autofight',  this.commandAutoFight.bind(this));
  59.   };


  60.   // ## Autofight for each Actor
  61.   var Scene_Battle_createActorCommandWindow = Scene_Battle.prototype.createActorCommandWindow;
  62.   Scene_Battle.prototype.createActorCommandWindow = function() {
  63.     Scene_Battle_createActorCommandWindow.call(this,arguments);
  64.     this._actorCommandWindow.setHandler('autoattack', this.commandAutoAttack.bind(this));
  65.   };

  66.   var _Window_ActorCommand_makeCommandList = Window_ActorCommand.prototype.makeCommandList;
  67.   Window_ActorCommand.prototype.makeCommandList = function() {
  68.     if(this._actor) {
  69.       this.addCommand(autoAttackActorText, 'autoattack', this._actor.canAttack());
  70.     }
  71.     _Window_ActorCommand_makeCommandList.call(this, arguments);
  72.   };


  73. })();
复制代码

QQ截图20151119163526.png (683.53 KB, 下载次数: 50)

QQ截图20151119163526.png

QQ截图20151119163718.png (229.07 KB, 下载次数: 45)

QQ截图20151119163718.png

QQ截图20151119163649.png (690.04 KB, 下载次数: 56)

QQ截图20151119163649.png

作者: 索里    时间: 2015-11-19 16:43
全部队友选自动时候会冲突,单个队友挨个使用自动,不会冲突,不会改代码,有谁帮忙改改吗?一楼是自动战斗的代码,或者删除全部队友能使用 自动战斗 这个 功能......
还有,用的atc战斗插件注定要舍弃头像显示插件啊(泪奔)
作者: trentswd    时间: 2015-11-19 22:48
直接去作者帖子下面回帖、
“Hello. Can you add Yanfly Plugin ATB support please?? ”

搜了一下 作者原帖 http://forums.rpgmakerweb.com/in ... auto-battle-plugin/
作者: 索里    时间: 2015-11-20 16:35
trentswd 发表于 2015-11-19 22:48
直接去作者帖子下面回帖、
“Hello. Can you add Yanfly Plugin ATB support please?? ”

网站进去了,可排版不工整,另外想回复就得注册,注册时候问的那个问题真2,每次失败朋友,你懂脚本吗?懂得话帮我删除脚本里的“全体自动”这个功能就可以了




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1