查看: 6580|回复: 6

[已经解决] 关于自动战斗特性

[复制链接]

笑问情缘

梦石
0
星屑
68
在线时间
238 小时
注册时间
2006-5-3
回帖
544
发表于 2016-1-3 13:02:49 来自手机 | 显示全部楼层 |阅读模式

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

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

×
大家都知道,mv的角色和职业特性里有个自动战斗的特性,那么能否在主菜单或者事件里,设置一个角色自动战斗标记的开启和移除的开关呢?拜托大神,急需帮助,木木哒
梦石
0
星屑
497
在线时间
266 小时
注册时间
2015-12-8
回帖
729
发表于 2016-1-3 17:58:54 | 显示全部楼层
公用事件
回复

使用道具 举报

笑问情缘

梦石
0
星屑
68
在线时间
238 小时
注册时间
2006-5-3
回帖
544
 楼主| 发表于 2016-1-3 18:23:14 来自手机 | 显示全部楼层
小叮鈴 发表于 2016-1-3 17:58
公用事件

具体怎么弄啊
回复

使用道具 举报

梦石
0
星屑
60
在线时间
306 小时
注册时间
2014-8-5
回帖
403
发表于 2016-1-3 18:59:02 | 显示全部楼层
本帖最后由 夏末渐离 于 2016-1-4 17:54 编辑

[fold=插件指令。]
[pre lang="javascript"]
/*:
* @author XMJL
*
*
* 一个自动战斗模式的开关插件。
*
* Plugin Command:
* Auto add 0                             # 队伍的第一位角色设为自动模式
* Auto cut 0                             # 队伍的第一位角色设为手动模式
* Auto openAll                           # 队伍的所有人设为自动模式
* Auto clearAll                          # 队伍的所有人设为普通模式
*
*
* @help
* Plugin Command:
* Auto add 0                             # Set first actor AutoModel.
* Auto cut 0                             # Set first actor NormalModel.
* Auto openAll                           # All actor is AutoModel.
* Auto clearAll                          # All actor is NormalModel
*
*/
(function()
{
    Game_BattlerBase.prototype.isAutoBattle=function()
    {
        var normol = this.specialFlag(Game_BattlerBase.FLAG_ID_AUTO_BATTLE);
        return this._isAutoBattle || normol;
    }
    Game_Actor.prototype.autoBattleModel=function()
    {
        this._isAutoBattle = true;
    }
    Game_Actor.prototype.removeAutoBattleModel=function()
    {
        this._isAutoBattle=false;
    }
    var addOneAuto=function(actorId)
    {
        if(actorId<=$gameParty.members().length)
        $gameParty.members()[actorId].autoBattleModel();
        else
        return;
    }
    var cutOneAuto=function(actorId)
    {
       if(actorId<=$gameParty.members().length)
        $gameParty.members()[actorId].removeAutoBattleModel();
       else
        return;
    }
    var openAll=function()
    {
        for(var i=0;i<$gameParty.members().length;i++)
            $gameParty.members().autoBattleModel();
    }
    var clearAll=function()
    {
        for(var i=0;i<$gameParty.members().length;i++)
            $gameParty.members().removeAutoBattleModel();
    }
    var _Game_Interpreter_pluginCommand =
        Game_Interpreter.prototype.pluginCommand;
    Game_Interpreter.prototype.pluginCommand = function(command, args) {
        _Game_Interpreter_pluginCommand.call(this, command, args);
        if (command === 'Auto') {
            switch (args[0]) {
                case 'add':
                    addOneAuto(Number(args[1]));
                    break;
                case 'cut':
                    cutOneAuto(Number(args[1]));
                    break;
                case 'openAll':
                    openAll();
                    break;
                case 'clearAll':
                    clearAll();
                    break;
            }
        }
    };
})();
[/pre]
[/fold]

点评

感谢前辈的耐心指导……自己的代码果然还是……囧  发表于 2016-1-4 18:04
第25行无意义。还有别把原本的是否自动战斗的判定扔掉啊  发表于 2016-1-4 15:05
不能用 this._isAutoBattle = true 这种方式来写么 囧  发表于 2016-1-4 14:09
对啊0.0我先去上课,晚上再回来捣鼓存档问题。  发表于 2016-1-4 14:06
喂喂喂 你这样还是存不了档吧?  发表于 2016-1-4 14:05

评分

参与人数 1梦石 +1 收起 理由
余烬之中 + 1 0x0

查看全部评分

  点我进入    
       ↓      
回复

使用道具 举报

梦石
0
星屑
223
在线时间
85 小时
注册时间
2015-12-22
回帖
48
发表于 2016-1-3 19:01:17 | 显示全部楼层
首先做一个自动战斗的状态,再做个公共事件添加或去掉全员的这个状态就可以了

评分

参与人数 1梦石 +1 收起 理由
余烬之中 + 1 0x0

查看全部评分

回复

使用道具 举报

梦石
0
星屑
70
在线时间
269 小时
注册时间
2015-9-6
回帖
82
发表于 2016-1-3 19:05:50 | 显示全部楼层
有个简单的办法:
在防具里新增一个新饰品,特性选自动战斗和锁定装备。
如果开关打开,-增减防具(新饰品)-改变装备(新饰品)
如果开关关闭,-增减防具(新饰品)(包括装备)

评分

参与人数 1梦石 +1 收起 理由
余烬之中 + 1 0x0

查看全部评分

回复

使用道具 举报

笑问情缘

梦石
0
星屑
68
在线时间
238 小时
注册时间
2006-5-3
回帖
544
 楼主| 发表于 2016-1-3 23:47:34 来自手机 | 显示全部楼层
谢谢各位,明天我试试看
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部