Project1

标题: 求脚本DMV_MapMenuButtons.js的范例啊 [打印本页]

作者: v2sam    时间: 2015-11-18 23:30
标题: 求脚本DMV_MapMenuButtons.js的范例啊

http://www.dekyde.com/dmv-mapbuttons

我照着上面弄了事件循环,结果是undefined is not function,搞不懂啊,苦手了,求范例

15-11-03-04-38-19-83078.zip

2.94 KB, 下载次数: 189


作者: tseyik    时间: 2015-11-18 23:45
本帖最后由 tseyik 于 2015-11-19 00:01 编辑

有没有安DMV_Core
所有DMV_xxx都要先安DMV_Core
https://raw.githubusercontent.com/Dekita/DMV/master/DMV_Core.js
作者: v2sam    时间: 2015-11-20 16:30
趁周末顶一下,再没人就下架了
作者: 索里    时间: 2015-11-20 16:38
tseyik 发表于 2015-11-18 23:45
有没有安DMV_Core
所有DMV_xxx都要先安DMV_Core
https://raw.githubusercontent.com/Dekita/DMV/master/DMV ...

大哥可以帮忙吧这个脚本里的“全体成员自动”功能删除吗?单体自动的留着,谢谢了
作者: 索里    时间: 2015-11-20 16:39
本帖最后由 余烬之中 于 2015-11-23 14:37 编辑
tseyik 发表于 2015-11-18 23:45
有没有安DMV_Core
所有DMV_xxx都要先安DMV_Core
https://raw.githubusercontent.com/Dekita/DMV/master/DMV ...


JAVASCRIPT 代码复制
  1. /**
  2.  * Created by Gilles on 01.11.2015.
  3.  * @email: [email][email protected][/email]
  4.  */
  5.  
  6. /*:
  7.  * @plugindesc Allows Auto Attack in Battle. The players will always choose the enemy with the lowest hp
  8.  * @author Gilles Meyer
  9.  *
  10.  * @param Auto Attack Text Party
  11.  * @desc The text which will appear in the Party command Menu
  12.  * @default Auto Attack
  13.  *
  14.  * @param Auto Attack Text Actor
  15.  * @desc The text which will appear in the Actor command Menu
  16.  * @default Auto Attack
  17.  *
  18.  *
  19.  *
  20.  */
  21.  
  22. (function() {
  23.  
  24.  
  25.   var parameters = PluginManager.parameters('AutoBattlePlugin');
  26.   var autoAttackPartyText = String(parameters['Auto Attack Text Party'] || "自动");
  27.   var autoAttackActorText = String(parameters['Auto Attack Text Actor'] || "自动");
  28.  
  29.   var getEnemyWithLowestHP = function(enemies) {
  30.     var enemyIndex = 0;
  31.     for(var i=1; i < enemies.length; i++) {
  32.       if(enemies[i].hp < enemies[enemyIndex].hp || enemies[enemyIndex].hp == 0) {
  33.         enemyIndex = i;
  34.       }
  35.     }
  36.     return enemyIndex;
  37.   };
  38.  
  39.  
  40.   Scene_Battle.prototype.commandAutoFight = function() {
  41.     this.selectNextCommand();
  42.     do {
  43.       this.commandAutoAttack.apply(this, arguments);
  44.     } while(BattleManager.isInputting());
  45.     this._actorCommandWindow.deactivate();
  46.   };
  47.  
  48.   Scene_Battle.prototype.commandAutoAttack = function() {
  49.     BattleManager.inputtingAction().setAttack();
  50.     var enemyIndex = getEnemyWithLowestHP(this._enemyWindow._enemies);
  51.     var action = BattleManager.inputtingAction();
  52.     action.setTarget(enemyIndex);
  53.     this.selectNextCommand();
  54.   };
  55.  
  56.  
  57.   // ## Autofight for Party
  58.   Window_PartyCommand.prototype.makeCommandList = function() {
  59.     this.addCommand(TextManager.fight,  'fight');
  60.     // Needs rework
  61.     this.addCommand(autoAttackPartyText,  'autofight');
  62.     this.addCommand(TextManager.escape, 'escape', BattleManager.canEscape());
  63.   };
  64.  
  65.   var _Scene_Battle_createPartyCommandWindow = Scene_Battle.prototype.createPartyCommandWindow;
  66.   Scene_Battle.prototype.createPartyCommandWindow = function() {
  67.     _Scene_Battle_createPartyCommandWindow.apply(this, arguments);
  68.     this._partyCommandWindow.setHandler('autofight',  this.commandAutoFight.bind(this));
  69.   };
  70.  
  71.  
  72.   // ## Autofight for each Actor
  73.   var Scene_Battle_createActorCommandWindow = Scene_Battle.prototype.createActorCommandWindow;
  74.   Scene_Battle.prototype.createActorCommandWindow = function() {
  75.     Scene_Battle_createActorCommandWindow.call(this,arguments);
  76.     this._actorCommandWindow.setHandler('autoattack', this.commandAutoAttack.bind(this));
  77.   };
  78.  
  79.   var _Window_ActorCommand_makeCommandList = Window_ActorCommand.prototype.makeCommandList;
  80.   Window_ActorCommand.prototype.makeCommandList = function() {
  81.     if(this._actor) {
  82.       this.addCommand(autoAttackActorText, 'autoattack', this._actor.canAttack());
  83.     }
  84.     _Window_ActorCommand_makeCommandList.call(this, arguments);
  85.   };
  86.  
  87.  
  88. })();

作者: v2sam    时间: 2015-11-23 14:14
还是没人,BZ帮结贴吧
作者: tseyik    时间: 2015-11-23 15:51
本帖最后由 tseyik 于 2015-11-23 16:03 编辑

PictureCallCommon








ChangeMapTouchPolicy
PictureCallCommon






欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1