查看: 3313|回复: 10

[已经过期] 你好,请问哪位大神有自动战斗脚本?

[复制链接]
梦石
0
星屑
50
在线时间
34 小时
注册时间
2017-3-25
回帖
31
发表于 2017-7-24 23:05:38 | 显示全部楼层 |阅读模式

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

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

×
MV里面的怪物自动战斗AI不是很理想,而且希望是可以切换成手动,和自动的,希望有大大可以分享下,或者传授一些方法。
梦石
0
星屑
50
在线时间
34 小时
注册时间
2017-3-25
回帖
31
 楼主| 发表于 2017-7-24 23:11:59 | 显示全部楼层
要的是玩家的自动战斗方法或者脚本。

点评

自动战斗有点扯淡 我明明必赢 居然死了  发表于 2017-7-25 04:18
回复

使用道具 举报

梦石
0
星屑
2457
在线时间
912 小时
注册时间
2014-10-14
回帖
1155

开拓者

发表于 2017-7-25 04:20:54 | 显示全部楼层
本帖最后由 j296196585 于 2017-7-25 04:22 编辑
  1. /**
  2. * Created by Gilles on 01.11.2015.
  3. * @email: [email]gill.es86@gmail.com[/email]
  4. */

  5. /*:
  6. * @plugindesc 自动战斗 1
  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. })();

复制代码





  1. #=============================================================================
  2. # Battle Auto Selection
  3. # LeBattleAutoSelection.js
  4. # By Lecode
  5. # Version 1.07
  6. #-----------------------------------------------------------------------------
  7. # TERMS OF USE
  8. #-----------------------------------------------------------------------------
  9. # - Credit required
  10. # - Keep this header
  11. # - Free for commercial use
  12. #=============================================================================
  13. */
  14. var Imported = Imported || {};
  15. Imported.Lecode_BattleAutoSelection = true;
  16. /*:
  17. * @plugindesc 自动战斗2
  18. * @author Lecode
  19. * @version 1.06
  20. *
  21. * @help Skip the selection window when there is only one available enemy
  22. * or one available ally.
  23. */
  24. //#=============================================================================

  25. (function() {

  26. /*-------------------------------------------------------------------------
  27. * Scene_Battle
  28. -------------------------------------------------------------------------*/
  29. //---- SelectEnemySelection
  30. var oldSelectEnemySelec_method = Scene_Battle.prototype.selectEnemySelection;
  31. Scene_Battle.prototype.selectEnemySelection = function() {
  32.     oldSelectEnemySelec_method.call(this);
  33.     if ( !this._enemyWindow.active ) { return; }
  34.     if (this._enemyWindow._enemies.length == 1) {
  35.             this._enemyWindow.processOk();
  36.     }
  37. };

  38. //---- SelectActorSelection
  39. var oldSelectActorSelec_method = Scene_Battle.prototype.selectActorSelection;
  40. Scene_Battle.prototype.selectActorSelection = function() {
  41.     oldSelectActorSelec_method.call(this);
  42.     if ( !this._actorWindow.active ) { return; }
  43.         var action = BattleManager.inputtingAction();
  44.     if (action.isForUser() || (action.isForFriend() && action.isForAll())) {
  45.         this._actorWindow.select(BattleManager.actor().index());
  46.         this._actorWindow.processOk();
  47.     } else if (action.isForDeadFriend()) {
  48.                 if ($gameParty.deadMembers().length == 1) { this._actorWindow.processOk(); }
  49.         } else {
  50.                 if ($gameParty.aliveMembers().length == 1) { this._actorWindow.processOk(); }
  51.         }
  52. };


  53. })();
复制代码

点评

别问我是哪里的脚本 我也忘了  发表于 2017-7-25 04:23
------落尽红樱君不见,轻绘梨花泪沾衣。~~~
回复 1 0

使用道具 举报

梦石
0
星屑
50
在线时间
34 小时
注册时间
2017-3-25
回帖
31
 楼主| 发表于 2017-7-25 07:37:30 | 显示全部楼层
j296196585 发表于 2017-7-25 04:20
/**
* Created by Gilles on 01.11.2015.
* @email:

太感谢了!
回复

使用道具 举报

梦石
0
星屑
50
在线时间
34 小时
注册时间
2017-3-25
回帖
31
 楼主| 发表于 2017-7-25 09:31:44 | 显示全部楼层
j296196585 发表于 2017-7-25 04:20
/**
* Created by Gilles on 01.11.2015.
* @email:

请问下,这个自动攻击不是很智能,因为不放技能,有没那种可以放技能的?

点评

也许是你姿势不对 反正我是能用  发表于 2017-7-25 09:44
回复

使用道具 举报

梦石
0
星屑
50
在线时间
34 小时
注册时间
2017-3-25
回帖
31
 楼主| 发表于 2017-7-25 10:28:12 | 显示全部楼层
j296196585 发表于 2017-7-25 04:20
/**
* Created by Gilles on 01.11.2015.
* @email:

能方便加个QQ吗?380617414
回复

使用道具 举报

梦石
0
星屑
50
在线时间
34 小时
注册时间
2017-3-25
回帖
31
 楼主| 发表于 2017-7-25 10:31:13 | 显示全部楼层
j296196585 发表于 2017-7-25 04:20
/**
* Created by Gilles on 01.11.2015.
* @email:

大神,应该是姿势不太对,希望能多和你取取经{:2_249:}
回复

使用道具 举报

梦石
0
星屑
2457
在线时间
912 小时
注册时间
2014-10-14
回帖
1155

开拓者

发表于 2017-7-25 11:03:38 | 显示全部楼层
18503097404 发表于 2017-7-25 10:31
大神,应该是姿势不太对,希望能多和你取取经

自动战斗确实不能使用技能 不过你要是用MOG 系统整合 就知道他的好了
------落尽红樱君不见,轻绘梨花泪沾衣。~~~
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部