扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 130|回复: 0

[转载发布] 怎么把这段“自动战斗”脚本里的英文按钮改成“自动”...

[复制链接]
累计送礼:
0 个
累计收礼:
0 个
  • TA的每日心情
    开心
    2025-2-4 02:05
  • 签到天数: 110 天

    连续签到: 2 天

    [LV.6]常住居民II

    2327

    主题

    395

    回帖

    1万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    6
    卡币
    10465
    OK点
    16
    推广点
    0
    同能卷
    0
    积分
    13215

    灌水之王

    发表于 2024-2-16 11:44:50 | 显示全部楼层 |阅读模式
    1. /** * Created by Gilles on 01.11.2015. * @email: [email protected] *//*: * @plugindesc Allows Auto Attack in Battle. The players will always choose the enemy with the lowest hp * @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[i].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);  };})();复制代码
    复制代码


                本帖来自P1论坛作者索里,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址:https://rpg.blue/forum.php?mod=viewthread&tid=385829  若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。

    本帖子中包含更多资源

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

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2025-3-10 16:08 , Processed in 0.133258 second(s), 54 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表