查看: 3240|回复: 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 编辑

[pre lang="javascript"]/**
* Created by Gilles on 01.11.2015.
* @email: gill.es86@gmail.com
*/

/*:
* @plugindesc 自动战斗 1
* @author Gilles Meyer
*
* @param Auto Attack Text Party
* @desc The text which will appear in the Party command Menu
* @default Auto Attack
*
* @param Auto Attack Text Actor
* @desc The text which will appear in the Actor command Menu
* @default Auto Attack
*
*
*
*/

(function() {


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

  var getEnemyWithLowestHP = function(enemies) {
    var enemyIndex = 0;
    for(var i=1; i < enemies.length; i++) {
      if(enemies.hp < enemies[enemyIndex].hp || enemies[enemyIndex].hp == 0) {
        enemyIndex = i;
      }
    }
    return enemyIndex;
  };

  
  Scene_Battle.prototype.commandAutoFight = function() {
    this.selectNextCommand();
    do {
      this.commandAutoAttack.apply(this, arguments);
    } while(BattleManager.isInputting());
    this._actorCommandWindow.deactivate();
  };

  Scene_Battle.prototype.commandAutoAttack = function() {
    BattleManager.inputtingAction().setAttack();
    var enemyIndex = getEnemyWithLowestHP(this._enemyWindow._enemies);
    var action = BattleManager.inputtingAction();
    action.setTarget(enemyIndex);
    this.selectNextCommand();
  };


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

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


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

  var _Window_ActorCommand_makeCommandList = Window_ActorCommand.prototype.makeCommandList;
  Window_ActorCommand.prototype.makeCommandList = function() {
    if(this._actor) {
      this.addCommand(autoAttackActorText, 'autoattack', this._actor.canAttack());
    }
    _Window_ActorCommand_makeCommandList.call(this, arguments);
  };


})();

[/pre]




[pre lang="javascript"]
#=============================================================================
# Battle Auto Selection
# LeBattleAutoSelection.js
# By Lecode
# Version 1.07
#-----------------------------------------------------------------------------
# TERMS OF USE
#-----------------------------------------------------------------------------
# - Credit required
# - Keep this header
# - Free for commercial use
#=============================================================================
*/
var Imported = Imported || {};
Imported.Lecode_BattleAutoSelection = true;
/*:
* @plugindesc 自动战斗2
* @author Lecode
* @version 1.06
*
* @help Skip the selection window when there is only one available enemy
* or one available ally.
*/
//#=============================================================================

(function() {

/*-------------------------------------------------------------------------
* Scene_Battle
-------------------------------------------------------------------------*/
//---- SelectEnemySelection
var oldSelectEnemySelec_method = Scene_Battle.prototype.selectEnemySelection;
Scene_Battle.prototype.selectEnemySelection = function() {
    oldSelectEnemySelec_method.call(this);
    if ( !this._enemyWindow.active ) { return; }
    if (this._enemyWindow._enemies.length == 1) {
            this._enemyWindow.processOk();
    }
};

//---- SelectActorSelection
var oldSelectActorSelec_method = Scene_Battle.prototype.selectActorSelection;
Scene_Battle.prototype.selectActorSelection = function() {
    oldSelectActorSelec_method.call(this);
    if ( !this._actorWindow.active ) { return; }
        var action = BattleManager.inputtingAction();
    if (action.isForUser() || (action.isForFriend() && action.isForAll())) {
        this._actorWindow.select(BattleManager.actor().index());
        this._actorWindow.processOk();
    } else if (action.isForDeadFriend()) {
                if ($gameParty.deadMembers().length == 1) { this._actorWindow.processOk(); }
        } else {
                if ($gameParty.aliveMembers().length == 1) { this._actorWindow.processOk(); }
        }
};


})();[/pre]

点评

别问我是哪里的脚本 我也忘了  发表于 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.

在本版发帖返回顶部