查看: 4043|回复: 3

[已经解决] 怎么把这段“自动战斗”脚本里的英文按钮改成“自动”...

[复制链接]
梦石
0
星屑
60
在线时间
81 小时
注册时间
2015-4-19
回帖
57
发表于 2015-11-17 14:16:24 | 显示全部楼层 |阅读模式

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

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

×
  1. /**
  2. * Created by Gilles on 01.11.2015.
  3. * @email: gill.es86@gmail.com
  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'] || "Auto Attack");
  23.   var autoAttackActorText = String(parameters['Auto Attack Text Actor'] || "Auto Attack");

  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截图20151117141210.png
QQ截图20151117141058.png
梦石
0
星屑
70
在线时间
269 小时
注册时间
2015-9-6
回帖
82
发表于 2015-11-17 17:11:03 | 显示全部楼层
var autoAttackPartyText = String(parameters['Auto Attack Text Party'] || "Auto Attack");
var autoAttackActorText = String(parameters['Auto Attack Text Actor'] || "Auto Attack");
应该是这个了,Auto Attack改一下名字,试试看吧。

评分

参与人数 1梦石 +1 收起 理由
余烬之中 + 1 多谢,已经解决

查看全部评分

回复

使用道具 举报

梦石
0
星屑
60
在线时间
81 小时
注册时间
2015-4-19
回帖
57
 楼主| 发表于 2015-11-20 16:40:48 | 显示全部楼层
dc1988123 发表于 2015-11-17 17:11
var autoAttackPartyText = String(parameters['Auto Attack Text Party'] || "Auto Attack");
var autoAtt ...

多谢,已经解决,但是这个脚本和YEP的ATB脚本冲突

点评

我发现状态里有个激怒就是自动战斗,复制修改一下,导入公共事件,插件改成调用公共事件就行了,不与ATB冲突。  发表于 2015-12-5 00:16
回复

使用道具 举报

梦石
0
星屑
60
在线时间
81 小时
注册时间
2015-4-19
回帖
57
 楼主| 发表于 2015-12-5 02:45:19 | 显示全部楼层
dc1988123 发表于 2015-11-17 17:11
var autoAttackPartyText = String(parameters['Auto Attack Text Party'] || "Auto Attack");
var autoAtt ...

那么问题来了,新手不会将其调到战斗显示的界面......

点评

我也是是新手,只能改自动战斗的技能。你可以请别人帮你做个插件,队伍命令上添加一个菜单,点了菜单运行公共事件X。会的人只用写几句话。  发表于 2015-12-5 04:20
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部