查看: 4988|回复: 3

[已经解决] 现在有MV版的CP行动条吗

[复制链接]
梦石
0
星屑
2582
在线时间
363 小时
注册时间
2015-8-15
回帖
66
发表于 2016-1-15 13:33:47 | 显示全部楼层 |阅读模式

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

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

×
以前在VA上用过壁轨的CP条,感觉非常好用且实用。因为VA的很多限制转MV了,现在想求一个MV版的CP行动条,最好是继承壁轨的,在这里召唤大神!!!!!!!!
梦石
0
星屑
60
在线时间
306 小时
注册时间
2014-8-5
回帖
403
发表于 2016-1-15 13:40:41 | 显示全部楼层
  点我进入    
       ↓      
回复

使用道具 举报

梦石
0
星屑
90
在线时间
387 小时
注册时间
2007-7-27
回帖
4075

开拓者

发表于 2016-1-15 19:07:30 | 显示全部楼层
吸吸
回复

使用道具 举报

梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2016-1-15 22:34:58 | 显示全部楼层
本帖最后由 tseyik 于 2016-1-15 22:38 编辑

http://woodpenguin.web.fc2.com/MV_Plugin/ActiveTimeBattle.html
57e74f3038295785c295a100cf35a73e.JPG
MPP_ActiveTimeBattle.js
  1. //=============================================================================
  2. // MPP_ActiveTimeBattle.js
  3. //=============================================================================
  4. // Copyright (c) 2015 Mokusei Penguin
  5. // Released under the MIT license
  6. // [url]http://opensource.org/licenses/mit-license.php[/url]
  7. //=============================================================================

  8. /*:
  9. * @plugindesc 【MPP】戦闘システムをアクティブタイムバトルに変更します。
  10. * @author 木星ペンギン
  11. *
  12. * @help ●パーティコマンド
  13. * アクターコマンド選択中か、誰もコマンド入力を行っていない状態で
  14. * キャンセルキーを押すとパーティコマンドを開くことができます。
  15. *
  16. * パーティコマンドを開いている間は、どの戦闘モードでも時間が止まります。
  17. * 一時停止の代わりです。
  18. *
  19. * ●戦闘モード(0:アクティブ, 1:ウェイト, 2:ストップ)
  20. *  アクティブ:常に時間が流れます。
  21. *  ウェイト :スキルやアイテム、対象選択中は時間が止まります。
  22. *        アクターコマンド入力中は時間が流れます。
  23. *  ストップ :コマンド入力中は常に時間が止まります。
  24. *        アクターコマンド入力中に加速ボタンを押すと時間が流れます。
  25. * ※どのモードでもパーティコマンド選択中は時間が止まります。
  26. *
  27. * ●ATゲージ
  28. * ATゲージの最大値は
  29. *  1.パーティメンバーの敏捷性の平均値(敵は含まない)
  30. *  2.オプションによるプレイヤーの設定
  31. *  3.プラグインコマンドで設定した基準値
  32. * によって決定されます。
  33. *
  34. * ATゲージの増加量は
  35. *  キャラクターの敏捷性 + 増加値
  36. * です。
  37. * プラグインコマンドで設定できる『増加値』が大きいほど、
  38. * 敏捷性の影響が小さくなります。
  39. *
  40. * ●加速ボタン
  41. * ゲームパッドではXボタン、キーボードではShift、
  42. * マウスではステータスウィンドウより上をクリックし続けることで加速します。
  43. * ただし、メッセージウィンドウが表示されている場合は加速しません。
  44. *
  45. * ●コマンド入力を行うアクターの切り替え
  46. * ゲームパッドではLB/RBボタン、キーボードではQ、Page up/W、Page down、
  47. * マウスではステータスウィンドウを左クリックすることで
  48. * クリックした対象に切り替えることができます。
  49. * (正確には左クリックを離した際に切り替わります)
  50. *
  51. * ●ステータスウィンドウのスクロール
  52. * マウスで左クリックしたままウィンドウの上下にマウスを動かすと
  53. * スクロールさせることができます。
  54. * パーティメンバーがステータスウィンドウに収まらない場合の処置です。
  55. *
  56. * ●逃走
  57. * 戦闘可能なキャラ全員が逃走に必要なATをためると逃走判定を行います。
  58. * 逃走に失敗しても逃走状態は解除されません。
  59. * パーティコマンドで戦うを選択すると解除されます。
  60. *
  61. * 『逃走状態で逃走モーションを行うかどうか』でtrueを設定した場合、
  62. * 逃走状態にある間アクターは逃走モーションを行います。
  63. * デフォルトでは後ろ向きに走るモーションがないので注意してください。
  64. *
  65. * ●スキルの詠唱時間
  66. * アイテムやスキルの速度補正をマイナスにすることで、詠唱時間が発生します。
  67. * 速度補正を-1するごとに0.5秒の詠唱時間となります。
  68. * (オプションの戦闘速度の設定によって上下します)
  69. * 詠唱が終わった時点で、行動順リストに入ります。
  70. *
  71. * 詠唱時間はオプションの戦闘速度の設定によって上下します。
  72. * 戦闘速度の基準値を変えても変化しません。
  73. *
  74. * ●複数回行動
  75. * 特徴の行動回数追加によって2回以上の行動が可能になった際の動作は保証しません。
  76. * 1回行動になるようにしてください。
  77. *
  78. * ================================
  79. * Version : 1.0
  80. * 制作 : 木星ペンギン
  81. * URL : [url]http://woodpenguin.blog.fc2.com/[/url]
  82. *
  83. * @param === Option ===
  84. *
  85. * @param ATB Mode Default
  86. * @desc 戦闘モードのデフォルト値
  87. * (0:アクティブ, 1:ウェイト, 2:ストップ)
  88. * @default 1
  89. *
  90. * @param ATB Mode Name
  91. * @desc オプションで表示する戦闘モードの項目名
  92. * 空の場合オプションには追加されません
  93. * @default 戦闘モード
  94. *
  95. * @param ATB Mode Status
  96. * @desc オプションで表示する戦闘モードのステータス名
  97. * (カンマで区切ってください)
  98. * @default アクティブ,ウェイト
  99. *
  100. * @param ATB Speed Default
  101. * @desc 戦闘速度のデフォルト値(0...4)
  102. * @default 2
  103. *
  104. * @param ATB Speed Name
  105. * @desc オプションで表示する戦闘速度の項目名
  106. * 空の場合オプションには追加されません
  107. * @default 戦闘速度
  108. *
  109. * @param ATB Speed Status
  110. * @desc オプションで表示する戦闘速度のステータス名
  111. * (カンマで区切ってください)
  112. * @default 1,2,3,4,5
  113. *
  114. * @param === Battle ===
  115. *
  116. * @param ATB Speed Base
  117. * @desc 戦闘速度の基準値
  118. * ゲーム内での変更はできない制作者側の設定
  119. * @default 6
  120. *
  121. * @param AT Increment
  122. * @desc ATゲージの増加値
  123. * @default 10
  124. *
  125. * @param Need Escape At
  126. * @desc 逃走に必要なATゲージの割合(0..100で設定)
  127. * @default 100
  128. *
  129. * @param Escape AT Cost
  130. * @desc 逃走失敗時に消費されるATゲージの割合(0..100で設定)
  131. * @default 75
  132. *
  133. * @param Escape Anime?
  134. * @desc 逃走状態で逃走モーションを行うかどうか (true/false)
  135. * @default false
  136. *
  137. * @param Input Step Forward?
  138. * @desc コマンド入力中に前進するかどうか (true/false)
  139. * @default false
  140. *
  141. * @param ATB Fast Eneble?
  142. * @desc 加速ボタンの有効/無効 (true/false)
  143. * @default true
  144. *
  145. * @param ATB Fast Rate
  146. * @desc 加速ボタンを押したときの加速度
  147. * @default 3
  148. *
  149. * @param Fast Log Eneble?
  150. * @desc 戦闘ログ早送りの有効/無効 (true/false)
  151. * 戦闘ログ早送りはツクールデフォルトの機能です
  152. * @default true
  153. *
  154. * @param === HelpWindow ===
  155. *
  156. * @param Help Window Pos
  157. * @desc ヘルプウィンドウの位置(-1:非表示, 0:上, 1:ステータスの上)
  158. * @default 1
  159. *
  160. * @param Help Window Row
  161. * @desc ヘルプウィンドウの行数
  162. * @default 1
  163. *
  164. * @param === StatusWindow ===
  165. *
  166. * @param Status Window Pos
  167. * @desc ステータスウィンドウの位置(0:左寄せ, 1:中央, 2:右寄せ)
  168. * @default 2
  169. *
  170. * @param === AT Gauge ===
  171. *
  172. * @param AT Gauge Name
  173. * @desc ATゲージの名
  174. *
  175. * @param AT Gauge Width
  176. * @desc ATゲージの幅
  177. * @default 60
  178. *
  179. * @param AT Gauge Height
  180. * @desc ATゲージの高さ
  181. * @default 12
  182. *
  183. * @param AT Charge Color1
  184. * @desc ATゲージ増加中の色1(RGBで指定)
  185. * @default 192,192,192
  186. *
  187. * @param AT Charge Color2
  188. * @desc ATゲージ増加中の色2(RGBで指定)
  189. * @default 255,255,255
  190. *
  191. * @param AT Max Color1
  192. * @desc ATゲージMaxの色1(RGBで指定)
  193. * @default 192,192,192
  194. *
  195. * @param AT Max Color2
  196. * @desc ATゲージMaxの色2(RGBで指定)
  197. * @default 255,255,192
  198. *
  199. * @param Chanting View?
  200. * @desc 詠唱ゲージを表示するかどうか
  201. * @default true
  202. *
  203. * @param AT Chanting Color1
  204. * @desc 詠唱ゲージの色1(RGBで指定)
  205. * @default 128,32,0
  206. *
  207. * @param AT Chanting Color2
  208. * @desc 詠唱ゲージの色2(RGBで指定)
  209. * @default 255,64,0
  210. *
  211. */

  212. function Window_AtbSkillStatus() {
  213.     this.initialize.apply(this, arguments);
  214. }

  215. (function() {

  216. var parameters = PluginManager.parameters('MPP_ActiveTimeBattle');
  217. var MPPlugin = {
  218.     BtStWiA_Plugin:$plugins.some(function(plugin) {
  219.         return (plugin.name === 'MPP_BtStWindowEX_TypeA' && plugin.status);
  220.     }),
  221.    
  222.     //=== Option ===
  223.     atbMode:Number(parameters['ATB Mode Default'] || 0).clamp(0, 2),
  224.     atbModeName:(parameters['ATB Mode Name'] || '戦闘モード'),
  225.     atbModeStatus:(parameters['ATB Mode Status'] || 'アクティブ,ウェイト').split(","),
  226.     atbSpeed:Number(parameters['ATB Speed Default'] || 2).clamp(0, 4),
  227.     atbSpeedName:(parameters['ATB Speed Name'] || '戦闘速度'),
  228.     atbSpeedStatus:(parameters['ATB Speed Status'] || '1,2,3,4,5').split(","),
  229.    
  230.     //=== Battle ===
  231.     atbSpeedBase:Number(parameters['ATB Speed Base'] || 6),
  232.     atIncrement:Number(parameters['AT Increment'] || 10),
  233.     needEscapeAt:Number(parameters['Need Escape At'] || 100).clamp(0, 100),
  234.     escapeAtCost:Number(parameters['Escape At Cost'] || 75).clamp(0, 100),
  235.     escapeAnime:parameters['Escape Anime?'] === 'true',
  236.     inputStepForward:parameters['Input Step Forward?'] === 'true',
  237.     atbFastEneble:parameters['ATB Fast Eneble?'] === 'true',
  238.     atbFastRate:Number(parameters['ATB Fast Rate'] || 3).clamp(0, 10),
  239.     fastLogEneble:parameters['Fast Log Eneble?'] === 'true',
  240.    
  241.     //=== HelpWindow ===
  242.     helpWindowPos:Number(parameters['Help Window Pos'] || 1).clamp(-1, 1),
  243.     helpWindowRow:Number(parameters['Help Window Row'] || 1).clamp(0, 2),
  244.    
  245.     //=== StatusWindow ===
  246.     stWindowPos:Number(parameters['Status Window Pos'] || 1).clamp(0, 2),
  247.    
  248.     //=== AT Gauge ===
  249.     atGaugeName:parameters['AT Gauge Name'] || '',
  250.     atGaugeWidth:Number(parameters['AT Gauge Width'] || 84),
  251.     atGaugeHeight:Number(parameters['AT Gauge Height'] || 12),
  252.     atChargeColor1:'rgb(%1)'.format(parameters['AT Charge Color1'] || '192,192,192'),
  253.     atChargeColor2:'rgb(%1)'.format(parameters['AT Charge Color2'] || '255,255,255'),
  254.     atMaxColor1:'rgb(%1)'.format(parameters['AT Max Color1'] || '192,192,192'),
  255.     atMaxColor2:'rgb(%1)'.format(parameters['AT Max Color2'] || '255,255,192'),
  256.     chantingView:parameters['Chanting View?'] === 'true',
  257.     atChantingColor1:'rgb(%1)'.format(parameters['Chanting Gauge Color1'] || '128,32,0'),
  258.     atChantingColor2:'rgb(%1)'.format(parameters['Chanting Gauge Color2'] || '255,64,0')
  259.    
  260. };

  261. var Alias = {};

  262. //=============================================================================
  263. // Option
  264. //=============================================================================

  265. //-----------------------------------------------------------------------------
  266. // ConfigManager

  267. ConfigManager.atbMode = MPPlugin.atbMode;
  268. ConfigManager.atbSpeed = MPPlugin.atbSpeed;

  269. //521
  270. Alias.CoMa_mp01_makeData = ConfigManager.makeData;
  271. ConfigManager.makeData = function() {
  272.     var config = Alias.CoMa_mp01_makeData.call(this);
  273.     config.atbMode = this.atbMode;
  274.     config.atbSpeed = this.atbSpeed;
  275.     return config;
  276. };

  277. //532
  278. Alias.CoMa_applyData = ConfigManager.applyData;
  279. ConfigManager.applyData = function(config) {
  280.     Alias.CoMa_applyData.call(this, config);
  281.     this.atbMode = this.readValue(config, 'atbMode', 0);
  282.     this.atbSpeed = this.readValue(config, 'atbSpeed', 2);
  283. };

  284. ConfigManager.readValue = function(config, name, def) {
  285.     return (config[name] || def);
  286. };

  287. //-----------------------------------------------------------------------------
  288. // Window_Options

  289. //2670
  290. Alias.WiOp_addGeneralOptions = Window_Options.prototype.addGeneralOptions;
  291. Window_Options.prototype.addGeneralOptions = function() {
  292.     Alias.WiOp_addGeneralOptions.call(this);
  293.     if (MPPlugin.atbModeName) {
  294.         this.addCommand(MPPlugin.atbModeName, 'atbMode');
  295.     }
  296.     if (MPPlugin.atbSpeedName) {
  297.         this.addCommand(MPPlugin.atbSpeedName, 'atbSpeed');
  298.     }
  299. };

  300. //2696
  301. Alias.WiOp_statusText = Window_Options.prototype.statusText;
  302. Window_Options.prototype.statusText = function(index) {
  303.     var symbol = this.commandSymbol(index);
  304.     var value = this.getConfigValue(symbol);
  305.     switch (symbol) {
  306.         case 'atbMode':
  307.             return MPPlugin.atbModeStatus[value];
  308.         case 'atbSpeed':
  309.             return MPPlugin.atbSpeedStatus[value];
  310.         default:
  311.             return Alias.WiOp_statusText.call(this, index);
  312.     }
  313. };

  314. //2718
  315. Alias.WiOp_processOk = Window_Options.prototype.processOk;
  316. Window_Options.prototype.processOk = function() {
  317.     var index = this.index();
  318.     var symbol = this.commandSymbol(index);
  319.     var value = this.getConfigValue(symbol);
  320.     switch (symbol) {
  321.     case 'atbMode':
  322.         value++;
  323.         if (value >= MPPlugin.atbModeStatus.length) {
  324.             value = 0;
  325.         }
  326.         value = value.clamp(0, MPPlugin.atbModeStatus.length - 1);
  327.         this.changeValue(symbol, value);               
  328.         break;
  329.     case 'atbSpeed':
  330.         value++;
  331.         if (value >= MPPlugin.atbSpeedStatus.length) {
  332.             value = 0;
  333.         }
  334.         value = value.clamp(0, MPPlugin.atbSpeedStatus.length - 1);
  335.         this.changeValue(symbol, value);               
  336.         break;
  337.     default:
  338.         Alias.WiOp_processOk.call(this);
  339.         break;
  340.     }
  341. };

  342. Alias.WiOp_cursorRight = Window_Options.prototype.cursorRight;
  343. Window_Options.prototype.cursorRight = function(wrap) {
  344.     var index = this.index();
  345.     var symbol = this.commandSymbol(index);
  346.     var value = this.getConfigValue(symbol);
  347.     switch (symbol) {
  348.     case 'atbMode':
  349.         value++;
  350.         value = value.clamp(0, MPPlugin.atbModeStatus.length - 1);
  351.         this.changeValue(symbol, value);
  352.         break;
  353.     case 'atbSpeed':
  354.         value++;
  355.         value = value.clamp(0, MPPlugin.atbSpeedStatus.length - 1);
  356.         this.changeValue(symbol, value);
  357.         break;
  358.     default:
  359.         Alias.WiOp_cursorRight.call(true, wrap);
  360.         break;
  361.     }
  362. };

  363. Alias.WiOp_cursorLeft = Window_Options.prototype.cursorLeft;
  364. Window_Options.prototype.cursorLeft = function(wrap) {
  365.     var index = this.index();
  366.     var symbol = this.commandSymbol(index);
  367.     var value = this.getConfigValue(symbol);
  368.     switch (symbol) {
  369.     case 'atbMode':
  370.         value--;
  371.         value = value.clamp(0, MPPlugin.atbModeStatus.length - 1);
  372.         this.changeValue(symbol, value);
  373.         break;
  374.     case 'atbSpeed':
  375.         value--;
  376.         value = value.clamp(0, MPPlugin.atbSpeedStatus.length - 1);
  377.         this.changeValue(symbol, value);
  378.         break;
  379.     default:
  380.         Alias.WiOp_cursorLeft.call(true, wrap);
  381.         break;
  382.     }
  383. };

  384. //=============================================================================
  385. // Battle
  386. //=============================================================================

  387. //-----------------------------------------------------------------------------
  388. // BattleManager

  389. //1779
  390. Alias.BaMa_setup = BattleManager.setup;
  391. BattleManager.setup = function(troopId, canEscape, canLose) {
  392.     Alias.BaMa_setup.call(this, troopId, canEscape, canLose);
  393.     this._userWait = false;
  394.     var rate = (7 - ConfigManager.atbSpeed) * MPPlugin.atbSpeedBase * 16;
  395.     this._maxAt = Math.max(Math.round($gameParty.agility() * rate), 10);
  396.     this._refreshHandler = null;
  397.     this._waitHandler = null;
  398.     this._escaping = false;
  399. };

  400. BattleManager.setUserWait = function(wait) {
  401.     this._userWait = wait;
  402.     this.clearActor();
  403. };

  404. BattleManager.isUserWait = function() {
  405.     return this._userWait;
  406. };

  407. BattleManager.setRefreshHandler = function(method) {
  408.     this._refreshHandler = method;
  409. };

  410. BattleManager.setWaitHandler = function(method) {
  411.     this._waitHandler = method;
  412. };

  413. BattleManager.maxAt = function() {
  414.     return this._maxAt;
  415. };

  416. BattleManager.setEscaping = function(escaping) {
  417.     this._escaping = escaping;
  418.     $gameParty.requestMotionRefresh();
  419. };

  420. BattleManager.isEscaping = function() {
  421.     return this._escaping;
  422. };

  423. BattleManager.needEscapeAt = function() {
  424.     return MPPlugin.needEscapeAt / 100;
  425. };

  426. BattleManager.escapeAtCost = function() {
  427.     return MPPlugin.escapeAtCost / 100;
  428. };

  429. //1882
  430. Alias.BaMa_update = BattleManager.update;
  431. BattleManager.update = function() {
  432.     this.updateAt();
  433.     this.updateCmdActor();
  434.     Alias.BaMa_update.call(this);
  435. };

  436. BattleManager.updateAt = function() {
  437.     if (Graphics.frameCount % 2 === 0 && !this.isAtbWait()) {
  438.         var rate = this.isFastForward() ? MPPlugin.atbFastRate : 1;
  439.         this.allBattleMembers().forEach(function(battler) {
  440.             battler.updateAt(rate);
  441.             if (battler.isMadeAction()) {
  442.                 this.addActionBattler(battler);
  443.             }
  444.         }, this);
  445.     }
  446. };

  447. BattleManager.updateCmdActor = function() {
  448.     if (this.isMessageBusy() || this.isBattleEnd()) {
  449.         return this.clearActor();
  450.     }
  451.     if (!this.isAtbWait() && !this.actor()) {
  452.         var members = $gameParty.battleMembers();
  453.         for (var i = 0; i < members.length; i++) {
  454.             if (members[i].isStandby()) {
  455.                 return this.changeActor(i);
  456.             }
  457.         }
  458.     } else if (this.actor() && !this.actor().isStandby()) {
  459.         this.clearActor();
  460.     }
  461. };

  462. BattleManager.addActionBattler = function(battler) {
  463.     this._actionBattlers.push(battler);
  464.     battler.setDecided(2);
  465. };

  466. BattleManager.deleteDeactiveBattler = function() {
  467.     this._actionBattlers = this._actionBattlers.filter(function(battler) {
  468.         if (battler.atRate() === 1) {
  469.             return true;
  470.         } else {
  471.             battler.setDecided(0);
  472.             return false;
  473.         }
  474.     });
  475.     if (this.actor() && !this.actor().isStandby()) {
  476.         this.clearActor();
  477.     }
  478. };

  479. BattleManager.isFastForward = function() {
  480.     if (!MPPlugin.atbFastEneble || this.isMessageBusy()) {
  481.         return false;
  482.     } else if (Input.isPressed('shift')) {
  483.         return true;
  484.     } else {
  485.         return TouchInput.y < this._statusWindow.y && TouchInput.isPressed();
  486.     }
  487. };

  488. BattleManager.isMessageBusy = function() {
  489.     return $gameMessage.isBusy();
  490. };

  491. BattleManager.isAtbWait = function() {
  492.     return (this._userWait || this.isMessageBusy() || this._waitHandler());
  493. };

  494. //1989
  495. Alias.BaMa_startBattle = BattleManager.startBattle;
  496. BattleManager.startBattle = function() {
  497.     Alias.BaMa_startBattle.call(this);
  498.     this.startTurn();
  499.     if (this._preemptive) {
  500.         $gameParty.members().forEach(function(member) {
  501.             member.setAt(1);
  502.         });
  503.     } else if (this._surprise) {
  504.         $gameTroop.members().forEach(function(member) {
  505.             member.setAt(1);
  506.         });
  507.     } else {
  508.         $gameParty.members().forEach(function(member) {
  509.             member.setAt(0.8 * Math.random());
  510.         });
  511.         $gameTroop.members().forEach(function(member) {
  512.             member.setAt(0.8 * Math.random());
  513.         });
  514.     }
  515.     this.refreshStatus();
  516. };

  517. //2022
  518. BattleManager.selectNextCommand = function() {
  519.     var members = $gameParty.battleMembers();
  520.     if (this.actor() && this.actor().isStandby()) {
  521.         var actionState = 'undecided';
  522.     } else {
  523.         var actionState = 'waiting';
  524.     }
  525.     for (var i = 1; i < members.length; i++) {
  526.         var n = (this._actorIndex + i).mod(members.length);
  527.         if (members[n].isStandby() && members[n].canInput()) {
  528.             return this.changeActor(n, actionState);
  529.         }
  530.     }
  531.     return this.changeActor(-1, actionState);
  532. };

  533. //2034
  534. BattleManager.selectPreviousCommand = function() {
  535.     var members = $gameParty.battleMembers();
  536.     if (this.actor() && this.actor().isStandby()) {
  537.         var actionState = 'undecided';
  538.     } else {
  539.         var actionState = 'waiting';
  540.     }
  541.     for (var i = 1; i < members.length; i++) {
  542.         var n = (this._actorIndex - i).mod(members.length);
  543.         if (members[n].isStandby() && members[n].canInput()) {
  544.             return this.changeActor(n, actionState);
  545.         }
  546.     }
  547.     return this.changeActor(-1, actionState);
  548. };

  549. //2045
  550. BattleManager.refreshStatus = function() {
  551.     this._refreshHandler();
  552. };

  553. //2049
  554. BattleManager.startTurn = function() {
  555.     this._phase = 'turn';
  556.     //this.clearActor();
  557.     //$gameTroop.increaseTurn();
  558.     //this.makeActionOrders();
  559.     $gameParty.requestMotionRefresh();
  560.     this._logWindow.startTurn();
  561. };

  562. //2058
  563. BattleManager.updateTurn = function() {
  564.     $gameParty.requestMotionRefresh();
  565.     if (!this._subject) {
  566.         this._subject = this.getNextSubject();
  567.         if (this._subject) {
  568.             this._subject.onTurnEnd();
  569.             this.refreshStatus();
  570.             this._logWindow.displayAutoAffectedStatus(this._subject);
  571.             this._logWindow.displayRegeneration(this._subject);
  572.             return;
  573.         }
  574.     }
  575.     if (this._subject) {
  576.         this.processTurn();
  577.     } else {
  578.         this.endTurn();
  579.     }
  580. };

  581. //2070
  582. BattleManager.processTurn = function() {
  583.     var subject = this._subject;
  584.     var action = subject.currentAction();
  585.     if (action) {
  586.         action.prepare();
  587.         if (action.isValid()) {
  588.             this.startAction();
  589.         }
  590.         subject.removeCurrentAction();
  591.     } else {
  592.         $gameTroop.increaseTurn();
  593.         subject.onAllActionsEnd();
  594.         subject.setAt(0);
  595.         this.refreshStatus();
  596.         this._logWindow.displayAutoAffectedStatus(subject);
  597.         this._logWindow.displayCurrentState(subject);
  598.         this._logWindow.displayRegeneration(subject);
  599.         this.endTurn();
  600.     }
  601. };

  602. //2089
  603. BattleManager.endTurn = function() {
  604.     this._phase = 'turnEnd';
  605.     this._subject = null;
  606. };

  607. //2101
  608. BattleManager.updateTurnEnd = function() {
  609.     if (!this._escaping || !$gameParty.canEscape() || !this.processEscape()) {
  610.         this.startTurn();
  611.     }
  612. };

  613. //2105
  614. Alias.BaMa_getNextSubject = BattleManager.getNextSubject;
  615. BattleManager.getNextSubject = function() {
  616.     if (this.isAtbWait()) {
  617.         return null;
  618.     }
  619.     return Alias.BaMa_getNextSubject.call(this);
  620. };

  621. //2262
  622. Alias.BaMa_processVictory = BattleManager.processVictory;
  623. BattleManager.processVictory = function() {
  624.     this.clearActor();
  625.     Alias.BaMa_processVictory.call(this);
  626. };

  627. //2274
  628. BattleManager.processEscape = function() {
  629.     //$gameParty.removeBattleStates();
  630.     $gameParty.performEscape();
  631.     SoundManager.playEscape();
  632.     var success = this._preemptive ? true : (Math.random() < this._escapeRatio);
  633.     if (success) {
  634.         this.clearActor();
  635.         this.displayEscapeSuccessMessage();
  636.         this._escaped = true;
  637.         this.processAbort();
  638.     } else {
  639.         this.displayEscapeFailureMessage();
  640.         this._escapeRatio += 0.1;
  641.         //$gameParty.clearActions();
  642.         //this.startTurn();
  643.         $gameParty.escapeFailure();
  644.     }
  645.     return success;
  646. };

  647. //-----------------------------------------------------------------------------
  648. // Game_BattlerBase

  649. //2849
  650. Alias.GaBa_initMembers = Game_BattlerBase.prototype.initMembers;
  651. Game_BattlerBase.prototype.initMembers = function() {
  652.     Alias.GaBa_initMembers.call(this);
  653.     this._at = 0;
  654.     this._ct = 0;
  655.     this._maxCt = 0;
  656.     this._turnCount = 0;
  657.     this._decided = 0;
  658. };

  659. //2307
  660. Alias.GaBa_die = Game_BattlerBase.prototype.die;
  661. Game_BattlerBase.prototype.die = function() {
  662.     Alias.GaBa_die.call(this);
  663.     this._at = 0;
  664.     this._ct = 0;
  665.     this._maxCt = 0;
  666.     this._decided = 0;
  667. };

  668. Game_BattlerBase.prototype.onMadeAction = function() {
  669.     this.setDecided(1);
  670.     var item = this.currentAction().item();
  671.     this._maxCt = Math.max(item.speed * (ConfigManager.atbSpeed - 7) * 3, 0);
  672. };

  673. Game_BattlerBase.prototype.setDecided = function(decided) {
  674.     this._decided = decided;
  675. };

  676. Game_BattlerBase.prototype.setAt = function(rate) {
  677.     this._at = Math.floor(BattleManager.maxAt() * rate);
  678.     this._at = this._at.clamp(0, BattleManager.maxAt());
  679. };

  680. Game_BattlerBase.prototype.atRate = function() {
  681.     return BattleManager.maxAt() > 0 ? this._at / BattleManager.maxAt() : 0;
  682. };

  683. Game_BattlerBase.prototype.castRate = function() {
  684.     if (this._maxCt > 0) {
  685.         return this._ct / this._maxCt;
  686.     } else {
  687.         return -1;
  688.     }
  689. };

  690. Game_BattlerBase.prototype.isStandby = function() {
  691.     return this._decided === 0 && this.atRate() === 1;
  692. };

  693. Game_BattlerBase.prototype.decided = function() {
  694.     return this._decided;
  695. };

  696. Game_BattlerBase.prototype.isMadeAction = function() {
  697.     return this._decided === 1 && this._ct === this._maxCt;
  698. };

  699. //-----------------------------------------------------------------------------
  700. // Game_Battler

  701. //2975
  702. Alias.GaBa_clearActions = Game_Battler.prototype.clearActions;
  703. Game_Battler.prototype.clearActions = function() {
  704.     Alias.GaBa_clearActions.call(this);
  705.     this._ct = 0;
  706.     this._maxCt = 0;
  707. };

  708. //3250
  709. Alias.GaBa_onBattleStart = Game_Battler.prototype.onBattleStart;
  710. Game_Battler.prototype.onBattleStart = function() {
  711.     Alias.GaBa_onBattleStart.call(this);
  712.     this._ct = 0;
  713.     this._maxCt = 0;
  714.     this._turnCount = 0;
  715.     this._decided = 0;
  716. };

  717. //3258
  718. Alias.GaBa_onAllActionsEnd = Game_Battler.prototype.onAllActionsEnd;
  719. Game_Battler.prototype.onAllActionsEnd = function() {
  720.     Alias.GaBa_onAllActionsEnd.call(this);
  721.     this._turnCount++;
  722.     this._ct = 0;
  723.     this._maxCt = 0;
  724.     this.setDecided(0);
  725.     this.setActionState('undecided');
  726. };

  727. Game_Battler.prototype.canEscape = function() {
  728.     return this.atRate() >= BattleManager.needEscapeAt();
  729. };

  730. Game_Battler.prototype.escapeFailure = function() {
  731.     if (this.atRate() === 1 && BattleManager.escapeAtCost() > 0) {
  732.         this.clearActions();
  733.     }
  734.     this.setAt(this.atRate() - BattleManager.escapeAtCost());
  735. };

  736. Game_Battler.prototype.updateAt = function(rate) {
  737.     if (!this.isAlive()) {
  738.         return;
  739.     }
  740.     if (this._at < BattleManager.maxAt()) {
  741.         this._at += (this.agi + MPPlugin.atIncrement) * rate;
  742.         if(this._at >= BattleManager.maxAt()) {
  743.             this._at = BattleManager.maxAt();
  744.             this.makeActions();
  745.         }
  746.     } else if (this._ct < this._maxCt) {
  747.         this._ct = Math.min(this._ct + rate, this._maxCt);
  748.     }
  749. };

  750. Game_Battler.prototype.atGaugeRate = function() {
  751.     if (MPPlugin.chantingView && this.castRate() >= 0) {
  752.         return this.castRate();
  753.     } else {
  754.         return this.atRate();
  755.     }
  756. };

  757. Game_Battler.prototype.atGaugeColor1 = function() {
  758.     if (MPPlugin.chantingView && this.castRate() >= 0) {
  759.         return MPPlugin.atChantingColor1;
  760.     } else if (this.atRate() < 1) {
  761.         return MPPlugin.atChargeColor1;
  762.     } else {
  763.         return MPPlugin.atMaxColor1;
  764.     }
  765. };

  766. Game_Battler.prototype.atGaugeColor2 = function() {
  767.     if (MPPlugin.chantingView && this.castRate() >= 0) {
  768.         return MPPlugin.atChantingColor2;
  769.     } else if (this.atRate() < 1) {
  770.         return MPPlugin.atChargeColor2;
  771.     } else {
  772.         return MPPlugin.atMaxColor2;
  773.     }
  774. };

  775. //-----------------------------------------------------------------------------
  776. // Game_Actor

  777. Game_Actor.prototype.onRestrict = function() {
  778.     Game_Battler.prototype.onRestrict.call(this);
  779.     if ($gameParty.inBattle() && !this._active && this.isAlive() &&
  780.             this._at === BattleManager.maxAt()) {
  781.         this.makeActions();
  782.     }
  783. };

  784. //4082
  785. Alias.GaAc_makeAutoBattleActions = Game_Actor.prototype.makeAutoBattleActions;
  786. Game_Actor.prototype.makeAutoBattleActions = function() {
  787.     Alias.GaAc_makeAutoBattleActions.call(this);
  788.     this.onMadeAction();
  789. };

  790. //4097
  791. Alias.GaAc_makeConfusionActions = Game_Actor.prototype.makeConfusionActions;
  792. Game_Actor.prototype.makeConfusionActions = function() {
  793.     Alias.GaAc_makeConfusionActions.call(this);
  794.     this.onMadeAction();
  795. };

  796. //-----------------------------------------------------------------------------
  797. // Game_Enemy

  798. //4463
  799. Game_Enemy.prototype.meetsTurnCondition = function(param1, param2) {
  800.     var n = this._turnCount;
  801.     if (param2 === 0) {
  802.         return n === param1;
  803.     } else {
  804.         return n >= param1 && n % param2 === param1 % param2;
  805.     }
  806. };

  807. //4527
  808. Alias.GaEn_makeActions = Game_Enemy.prototype.makeActions;
  809. Game_Enemy.prototype.makeActions = function() {
  810.     Alias.GaEn_makeActions.call(this);
  811.     this.onMadeAction();
  812. };

  813. //-----------------------------------------------------------------------------
  814. // Game_Unit

  815. Game_Unit.prototype.selectAll = function() {
  816.     this.members().forEach(function(member) {
  817.         member.select();
  818.     });
  819. };

  820. Game_Unit.prototype.select = function(activeMember) {
  821.     this.members().forEach(function(member) {
  822.         if (member === activeMember) {
  823.             member.select();
  824.         } else {
  825.             member.deselect();
  826.         }
  827.     });
  828. };


  829. //-----------------------------------------------------------------------------
  830. // Game_Party

  831. Game_Party.prototype.canEscape = function() {
  832.     return this.aliveMembers().every(function(member) {
  833.         return member.canEscape();
  834.     });
  835. };

  836. Game_Party.prototype.escapeFailure = function() {
  837.     this.aliveMembers().forEach(function(member) {
  838.         member.escapeFailure();
  839.     });
  840.     BattleManager.deleteDeactiveBattler();
  841. };

  842. //-----------------------------------------------------------------------------
  843. // Sprite_Actor

  844. //777
  845. Alias.SpAc_updateTargetPosition = Sprite_Actor.prototype.updateTargetPosition;
  846. Sprite_Actor.prototype.updateTargetPosition = function() {
  847.     if (MPPlugin.inputStepForward || !this._actor.isInputting()) {
  848.         Alias.SpAc_updateTargetPosition.call(this);
  849.     }
  850. };

  851. //-----------------------------------------------------------------------------
  852. // Window_BattleLog

  853. //4840
  854. Alias.WiBaLo_isFastForward = Window_BattleLog.prototype.isFastForward;
  855. Window_BattleLog.prototype.isFastForward = function() {
  856.     return (MPPlugin.fastLogEneble && Alias.WiBaLo_isFastForward.call(this));
  857. };

  858. //-----------------------------------------------------------------------------
  859. // Window_BattleStatus

  860. Window_BattleStatus.prototype.setActorCmdWindow = function(actorCmdWindow) {
  861.     this._actorCmdWindow = actorCmdWindow;
  862. };

  863. Window_BattleStatus.prototype.processTouch = function() {
  864.     if (this.isOpen() && this.isActorCmdEnabled()) {
  865.         if (TouchInput.isTriggered() && this.isTouchedInsideFrame()) {
  866.             this._touching = true;
  867.         }
  868.         if (this._touching) {
  869.             if (TouchInput.isPressed()) {
  870.                 this.onTouch(false);
  871.             } else {
  872.                 if (this.isTouchedInsideFrame()) {
  873.                     this.onTouch(true);
  874.                 }
  875.                 this._touching = false;
  876.             }
  877.         }
  878.     }
  879. };

  880. Window_BattleStatus.prototype.onTouch = function(triggered) {
  881.     var lastTopRow = this.topRow();
  882.     var x = this.canvasToLocalX(TouchInput.x);
  883.     var y = this.canvasToLocalY(TouchInput.y);
  884.     var hitIndex = this.hitTest(x, y);
  885.     if (hitIndex >= 0) {
  886.         if (triggered && this.isTouchOkEnabled()) {
  887.             var actor = $gameParty.battleMembers()[hitIndex];
  888.             if (actor && actor.isStandby()) {
  889.                 this.select(hitIndex);
  890.                 this.processOk();
  891.             }
  892.         }
  893.     } else if (this._stayCount >= 10) {
  894.         if (y < this.padding) {
  895.             this.scrollUp();
  896.         } else if (y >= this.height - this.padding) {
  897.             this.scrollDown();
  898.         }
  899.     }
  900.     if (this.topRow() !== lastTopRow) {
  901.         SoundManager.playCursor();
  902.     }
  903. };

  904. Window_BattleStatus.prototype.isActorCmdEnabled = function() {
  905.     return this._actorCmdWindow &&
  906.             (this._actorCmdWindow.active || !this._actorCmdWindow.isOpen());
  907. };

  908. Window_BattleStatus.prototype.processOk = function() {
  909.     this.updateInputData();
  910.     this.deactivate();
  911.     this.callOkHandler();
  912. };

  913. Window_BattleStatus.prototype.isCursorMovable = function() {
  914.     return false;
  915. };

  916. if (!MPPlugin.BtStWiA_Plugin) {

  917. Window_BattleStatus.prototype.update = function() {
  918.     Window_Selectable.prototype.update.call(this);
  919.     this.updateAtGauge();
  920. };

  921. Window_BattleStatus.prototype.updateAtGauge = function() {
  922.     if (this.isOpen() && this.isDrawAt() && Graphics.frameCount % 2 === 0) {
  923.         var topIndex = this.topIndex();
  924.         var width = MPPlugin.atGaugeWidth;
  925.         var height = this.lineHeight();
  926.         for (var i = 0; i < this.maxPageItems(); i++) {
  927.             var index = topIndex + i;
  928.             if (index < this.maxItems()) {
  929.                 var rect = this.gaugeAreaRect(index);
  930.                 var actor = $gameParty.battleMembers()[index];
  931.                 this.contents.clearRect(rect.x + 234, rect.y, width, height);
  932.                 this.drawActorAt(actor, rect.x + 234, rect.y, width);
  933.             }
  934.         }
  935.     }
  936. };

  937. } //if (!MPPlugin.BtStWiA_Plugin)

  938. Window_BattleStatus.prototype.isDrawAt = function() {
  939.     return MPPlugin.atGaugeWidth > 0;
  940. };

  941. //5500
  942. Alias.WiBaSt_gaugeAreaWidth = Window_BattleStatus.prototype.gaugeAreaWidth;
  943. Window_BattleStatus.prototype.gaugeAreaWidth = function() {
  944.     if (this.isDrawAt()) {
  945.         return 234 + MPPlugin.atGaugeWidth;
  946.     } else {
  947.         return Alias.WiBaSt_gaugeAreaWidth.call(this);
  948.     }
  949. };

  950. //5517
  951. Alias.WiBaSt_drawGaugeAreaWithTp = Window_BattleStatus.prototype.drawGaugeAreaWithTp;
  952. Window_BattleStatus.prototype.drawGaugeAreaWithTp = function(rect, actor) {
  953.     if (this.isDrawAt()) {
  954.         this.drawActorHp(actor, rect.x + 0, rect.y, 108);
  955.         this.drawActorMpTp(actor, rect.x + 123, rect.y, 96);
  956.         this.drawActorAt(actor, rect.x + 234, rect.y, MPPlugin.atGaugeWidth);
  957.     } else {
  958.         Alias.WiBaSt_drawGaugeAreaWithTp.call(this, rect, actor);
  959.     }
  960. };

  961. //5523
  962. Alias.WiBaSt_drawGaugeAreaWithoutTp = Window_BattleStatus.prototype.drawGaugeAreaWithoutTp;
  963. Window_BattleStatus.prototype.drawGaugeAreaWithoutTp = function(rect, actor) {
  964.     if (this.isDrawAt()) {
  965.         this.drawActorHp(actor, rect.x + 0, rect.y, 108);
  966.         this.drawActorMp(actor, rect.x + 123, rect.y, 96);
  967.         this.drawActorAt(actor, rect.x + 234, rect.y, MPPlugin.atGaugeWidth);
  968.     } else {
  969.         Alias.WiBaSt_drawGaugeAreaWithoutTp.call(this, rect, actor);
  970.     }
  971. };

  972. Window_BattleStatus.prototype.drawActorMpTp = function(actor, x, y, width) {
  973.     width = (width || 186) - 10;
  974.     this.drawGauge(x + 10, y, width, actor.tpRate(),
  975.                    this.tpGaugeColor1(), this.tpGaugeColor2());
  976.     this.drawGauge(x, y - 8, width, actor.mpRate(),
  977.                    this.mpGaugeColor1(), this.mpGaugeColor2());
  978.     this.contents.fontSize = 24;
  979.     this.changeTextColor(this.systemColor());
  980.     this.contents.drawText(TextManager.mpA, x, y + 1, 32, 24);
  981.     this.contents.drawText(TextManager.tpA, x + 22, y + 10, 32, 24);
  982.     this.contents.fontSize = this.standardFontSize();
  983. };

  984. Window_BattleStatus.prototype.drawActorAt = function(actor, x, y, width) {
  985.     width = width || 60;
  986.     var color1 = actor.atGaugeColor1();
  987.     var color2 = actor.atGaugeColor2();
  988.     this.drawAtGauge(x, y, width, actor.atGaugeRate(), color1, color2);
  989.     this.changeTextColor(this.systemColor());
  990.     this.drawText(MPPlugin.atGaugeName, x, y, 44);
  991. };

  992. Window_BattleStatus.prototype.drawAtGauge = function(x, y, width, rate, color1, color2) {
  993.     var height = MPPlugin.atGaugeHeight;
  994.     var fillW = Math.floor(width * rate);
  995.     var gaugeY = y + this.lineHeight() - height - 2;
  996.     this.contents.fillRect(x, gaugeY, width, height, this.gaugeBackColor());
  997.     this.contents.gradientFillRect(x, gaugeY, fillW, height, color1, color2);
  998.     this.contents.paintOpacity = 255 * (width * rate % 1);
  999.     this.contents.fillRect(x + fillW, gaugeY, 1, height, color2);
  1000.     this.contents.paintOpacity = 255;
  1001. };

  1002. //-----------------------------------------------------------------------------
  1003. // Window_BattleActor

  1004. Window_BattleActor.prototype.processTouch = function() {
  1005.     Window_Selectable.prototype.processTouch.call(this);
  1006. };

  1007. Window_BattleActor.prototype.onTouch = function(triggered) {
  1008.     Window_Selectable.prototype.onTouch.call(this, triggered);
  1009. };

  1010. Window_BattleActor.prototype.processOk = function() {
  1011.     Window_Selectable.prototype.processOk.call(this);
  1012. };

  1013. Window_BattleActor.prototype.isCursorMovable = function() {
  1014.     return Window_Selectable.prototype.isCursorMovable.call(this);
  1015. };

  1016. Window_BattleActor.prototype.isDrawAt = function() {
  1017.     return false;
  1018. };

  1019. Window_BattleActor.prototype.selectForItem = function() {
  1020.     var actor = BattleManager.actor();
  1021.     var action = actor.inputtingAction();
  1022.     this.setCursorFixed(false);
  1023.     this.setCursorAll(false);
  1024.     if (action.isForUser()) {
  1025.         this.setCursorFixed(true);
  1026.         this.select(actor.index());
  1027.     } else if (action.isForAll()) {
  1028.         this.setCursorAll(true);
  1029.         this.select(0);
  1030.     } else {
  1031.         this.select(actor.index());
  1032.     }
  1033. };

  1034. //5558
  1035. Alias.WiBaAc_select = Window_BattleActor.prototype.select;
  1036. Window_BattleActor.prototype.select = function(index) {
  1037.     Alias.WiBaAc_select.call(this, index);
  1038.     if (this._cursorAll) {
  1039.         $gameParty.selectAll();
  1040.     }
  1041. };

  1042. //-----------------------------------------------------------------------------
  1043. // Window_BattleEnemy

  1044. Window_BattleEnemy.prototype.isCurrentItemEnabled = function() {
  1045.     return !!this.enemy();
  1046. };

  1047. //5635
  1048. Alias.WiBaEn_refresh = Window_BattleEnemy.prototype.refresh;
  1049. Window_BattleEnemy.prototype.refresh = function() {
  1050.     Alias.WiBaEn_refresh.call(this);
  1051.     if (this.index() >= 0 && this.visible) {
  1052.         this.select(this._index.clamp(0, this.maxItems() - 1));
  1053.     }
  1054. };

  1055. //5624
  1056. Window_BattleEnemy.prototype.show = function() {
  1057.     //this.refresh();
  1058.     //this.select(0);
  1059.     Window_Selectable.prototype.show.call(this);
  1060. };

  1061. Window_BattleEnemy.prototype.selectForItem = function() {
  1062.     var actor = BattleManager.actor();
  1063.     var action = actor.inputtingAction();
  1064.     this.setCursorAll(false);
  1065.     if (action.isForAll()) {
  1066.         this.setCursorAll(true);
  1067.     }
  1068.     this.select(0);
  1069. };

  1070. //5640
  1071. Alias.WiBaEn_select = Window_BattleEnemy.prototype.select;
  1072. Window_BattleEnemy.prototype.select = function(index) {
  1073.     Alias.WiBaEn_select.call(this, index);
  1074.     if (this._cursorAll) {
  1075.         $gameTroop.selectAll();
  1076.     }
  1077. };

  1078. //-----------------------------------------------------------------------------
  1079. // Window_BattleSkill

  1080. Window_BattleSkill.prototype.setStatusWindow = function(statusWindow) {
  1081.     this._statusWindow = statusWindow;
  1082. };

  1083. Window_BattleSkill.prototype.setActor = function(actor) {
  1084.     Window_SkillList.prototype.setActor.call(this, actor);
  1085.     if (this._statusWindow) {
  1086.         this._statusWindow.setActor(actor);
  1087.     }
  1088. };

  1089. //5662
  1090. Alias.WiBaSk_show = Window_BattleSkill.prototype.show;
  1091. Window_BattleSkill.prototype.show = function() {
  1092.     if (this._statusWindow) {
  1093.         this._statusWindow.show();
  1094.     }
  1095.     Alias.WiBaSk_show.call(this);
  1096. };

  1097. //5668
  1098. Alias.WiBaSk_hide = Window_BattleSkill.prototype.hide;
  1099. Window_BattleSkill.prototype.hide = function() {
  1100.     if (this._statusWindow) {
  1101.         this._statusWindow.hide();
  1102.     }
  1103.     Alias.WiBaSk_hide.call(this);
  1104. };

  1105. //-----------------------------------------------------------------------------
  1106. // Window_AtbSkillStatus

  1107. Window_AtbSkillStatus.prototype = Object.create(Window_Base.prototype);
  1108. Window_AtbSkillStatus.prototype.constructor = Window_AtbSkillStatus;

  1109. Window_AtbSkillStatus.prototype.initialize = function(x, y, width, height) {
  1110.     Window_Base.prototype.initialize.call(this, x, y, width, height);
  1111.     this.hide();
  1112. };

  1113. Window_AtbSkillStatus.prototype.setActor = function(actor) {
  1114.     if (this._actor !== actor) {
  1115.         this._actor = actor;
  1116.         this.refresh();
  1117.     }
  1118. };

  1119. Window_AtbSkillStatus.prototype.refresh = function() {
  1120.     this.contents.clear();
  1121.     if (this._actor) {
  1122.         if ($dataSystem.optDisplayTp) {
  1123.             this.drawActorMp(this._actor, 0, 0, this.contentsWidth());
  1124.             this.drawActorTp(this._actor, 0, this.lineHeight(), this.contentsWidth());
  1125.         } else {
  1126.             this.drawActorMp(this._actor, 0, 0, this.contentsWidth());
  1127.         }
  1128.     }
  1129. };

  1130. //-----------------------------------------------------------------------------
  1131. // Sprite_Actor

  1132. //844
  1133. Alias.SpAc_refreshMotion = Sprite_Actor.prototype.refreshMotion;
  1134. Sprite_Actor.prototype.refreshMotion = function() {
  1135.     var actor = this._actor;
  1136.     if (MPPlugin.escapeAnime && actor) {
  1137.         var stateMotion = actor.stateMotionIndex();
  1138.         if (actor.isActing()) {
  1139.         } else if (stateMotion === 3) {
  1140.         } else if (stateMotion === 2) {
  1141.         } else if (BattleManager.isEscaping()) {
  1142.             return this.startMotion('escape');
  1143.         }
  1144.     }
  1145.     Alias.SpAc_refreshMotion.call(this);
  1146. };

  1147. //-----------------------------------------------------------------------------
  1148. // Scene_Battle

  1149. //2028
  1150. Alias.ScBa_start = Scene_Battle.prototype.start;
  1151. Scene_Battle.prototype.start = function() {
  1152.     BattleManager.setRefreshHandler(this.refreshStatus.bind(this));
  1153.     BattleManager.setWaitHandler(this.isAtbWait.bind(this));
  1154.     Alias.ScBa_start.call(this);
  1155. };

  1156. Scene_Battle.prototype.isAtbWait = function() {
  1157.     if (!this._partyCommandWindow.isClosed()) {
  1158.         return true;
  1159.     }
  1160.     if (ConfigManager.atbMode > 0) {
  1161.         if (this._skillWindow.visible || this._itemWindow.visible ||
  1162.                 this._actorWindow.visible || this._enemyWindow.visible) {
  1163.             return true;
  1164.         }
  1165.     }
  1166.     if (ConfigManager.atbMode > 1) {
  1167.         if (!this._actorCommandWindow.isClosed() && !BattleManager.isFastForward()) {
  1168.             return true;
  1169.         }
  1170.     }
  1171.     return false;
  1172. };

  1173. //2047
  1174. Scene_Battle.prototype.updateBattleProcess = function() {
  1175.     //if (!this.isAnyInputWindowActive() || BattleManager.isAborting() ||
  1176.     //        BattleManager.isBattleEnd()) {
  1177.         BattleManager.update();
  1178.         this.changeInputWindow();
  1179.     //}
  1180. };

  1181. //2064
  1182. Scene_Battle.prototype.changeInputWindow = function() {
  1183.     if (!this._partyCommandWindow.isClosed() || this._actorCommandWindow.isClosing()) {
  1184.         return;
  1185.     } else if (this._actor !== BattleManager.actor()) {
  1186.         this._actor = BattleManager.actor();
  1187.         if (this._actor) {
  1188.             this._actorCommandWindow.openness = 0;
  1189.             this.startActorCommandSelection();
  1190.         } else {
  1191.             this.endCommandSelection();
  1192.         }
  1193.     } else if (!this._actor) {
  1194.         if (Input.isTriggered('cancel') || TouchInput.isCancelled()) {
  1195.             SoundManager.playCancel();
  1196.             this.startPartyCommandSelection();
  1197.         }
  1198.     }
  1199. };

  1200. //2110
  1201. Scene_Battle.prototype.updateWindowPositions = function() {
  1202.     var statusX = 0;
  1203.     if (!this._partyCommandWindow.isClosed() || !this._actorCommandWindow.isClosed()) {
  1204.         statusX = this._partyCommandWindow.width;
  1205.     } else {
  1206.         statusX = this._partyCommandWindow.width * MPPlugin.stWindowPos / 2;
  1207.     }
  1208.     if (this._statusWindow.x < statusX) {
  1209.         this._statusWindow.x += 16;
  1210.         if (this._statusWindow.x > statusX) {
  1211.             this._statusWindow.x = statusX;
  1212.         }
  1213.     }
  1214.     if (this._statusWindow.x > statusX) {
  1215.         this._statusWindow.x -= 16;
  1216.         if (this._statusWindow.x < statusX) {
  1217.             this._statusWindow.x = statusX;
  1218.         }
  1219.     }
  1220. };

  1221. //2165
  1222. Alias.ScBa_createStatusWindow = Scene_Battle.prototype.createStatusWindow;
  1223. Scene_Battle.prototype.createStatusWindow = function() {
  1224.     Alias.ScBa_createStatusWindow.call(this);
  1225.     this._statusWindow.setHandler('ok',  this.onStatusOk.bind(this));
  1226. };

  1227. //2178
  1228. Alias.ScBa_createActorCommandWindow = Scene_Battle.prototype.createActorCommandWindow;
  1229. Scene_Battle.prototype.createActorCommandWindow = function() {
  1230.     Alias.ScBa_createActorCommandWindow.call(this);
  1231.     this._actorCommandWindow.setHandler('cancel', this.startPartyCommandSelection.bind(this));
  1232.     this._actorCommandWindow.setHandler('pageup', this.selectPreviousCommand.bind(this));
  1233.     this._actorCommandWindow.setHandler('pagedown', this.selectNextCommand.bind(this));
  1234.     this._statusWindow.setActorCmdWindow(this._actorCommandWindow);
  1235. };

  1236. //2188
  1237. Scene_Battle.prototype.createHelpWindow = function() {
  1238.     if (MPPlugin.helpWindowPos >= 0) {
  1239.         this._helpWindow = new Window_Help(MPPlugin.helpWindowRow);
  1240.         this._helpWindow.visible = false;
  1241.         if (MPPlugin.helpWindowPos === 1) {
  1242.             this._helpWindow.y = this._statusWindow.y - this._helpWindow.height;
  1243.         }
  1244.         this.addWindow(this._helpWindow);
  1245.     }
  1246. };

  1247. //2194
  1248. Scene_Battle.prototype.createSkillWindow = function() {
  1249.     var wy = this._statusWindow.y;
  1250.     var ww = Graphics.boxWidth - 144
  1251.     var wh = this._statusWindow.height;
  1252.     this._skillWindow = new Window_BattleSkill(0, wy, ww, wh);
  1253.     this._skillWindow.setHelpWindow(this._helpWindow);
  1254.     this._skillWindow.setHandler('ok',     this.onSkillOk.bind(this));
  1255.     this._skillWindow.setHandler('cancel', this.onSkillCancel.bind(this));
  1256.     this.addWindow(this._skillWindow);

  1257.     this._skillStatusWindow = new Window_AtbSkillStatus(ww, wy, 144, wh);
  1258.     this.addWindow(this._skillStatusWindow);
  1259.     this._skillWindow.setStatusWindow(this._skillStatusWindow);
  1260. };

  1261. //2204
  1262. Scene_Battle.prototype.createItemWindow = function() {
  1263.     var wy = this._statusWindow.y;
  1264.     var wh = this._statusWindow.height;
  1265.     this._itemWindow = new Window_BattleItem(0, wy, Graphics.boxWidth, wh);
  1266.     this._itemWindow.setHelpWindow(this._helpWindow);
  1267.     this._itemWindow.setHandler('ok',     this.onItemOk.bind(this));
  1268.     this._itemWindow.setHandler('cancel', this.onItemCancel.bind(this));
  1269.     this.addWindow(this._itemWindow);
  1270. };

  1271. //2214
  1272. Alias.ScBa_createActorWindow = Scene_Battle.prototype.createActorWindow;
  1273. Scene_Battle.prototype.createActorWindow = function() {
  1274.     Alias.ScBa_createActorWindow.call(this);
  1275.     this._actorWindow.x = Graphics.boxWidth - this._actorWindow.width;
  1276. };

  1277. //2246
  1278. Alias.ScBa_refreshStatus = Scene_Battle.prototype.refreshStatus;
  1279. Scene_Battle.prototype.refreshStatus = function() {
  1280.     Alias.ScBa_refreshStatus.call(this);
  1281.     this._actorCommandWindow.refresh();
  1282.     if (this._skillWindow.visible) {
  1283.         this._skillWindow.refresh();
  1284.     }
  1285.     if (this._itemWindow.visible) {
  1286.         this._itemWindow.refresh();
  1287.     }
  1288.     if (this._actorWindow.visible) {
  1289.         this._actorWindow.refresh();
  1290.     }
  1291.     if (this._enemyWindow.visible) {
  1292.         this._enemyWindow.refresh();
  1293.     }
  1294. };

  1295. //2246
  1296. Alias.ScBa_startPartyCommandSelection = Scene_Battle.prototype.startPartyCommandSelection;
  1297. Scene_Battle.prototype.startPartyCommandSelection = function() {
  1298.     Alias.ScBa_startPartyCommandSelection.call(this);
  1299.     this._actor = null;
  1300. };

  1301. //2254
  1302. Scene_Battle.prototype.commandFight = function() {
  1303.     BattleManager.setEscaping(false);
  1304.     this._partyCommandWindow.close();
  1305. };

  1306. //2258
  1307. Scene_Battle.prototype.commandEscape = function() {
  1308.     BattleManager.setEscaping(true);
  1309.     this._partyCommandWindow.close();
  1310. };

  1311. //2263
  1312. Alias.ScBa_startActorCommandSelection = Scene_Battle.prototype.startActorCommandSelection;
  1313. Scene_Battle.prototype.startActorCommandSelection = function() {
  1314.     SoundManager.playOk();
  1315.     Alias.ScBa_startActorCommandSelection.call(this);
  1316.     this._skillWindow.deactivate();
  1317.     this._skillWindow.hide();
  1318.     this._itemWindow.deactivate();
  1319.     this._itemWindow.hide();
  1320.     this._actorWindow.deactivate();
  1321.     this._actorWindow.hide();
  1322.     this._enemyWindow.deactivate();
  1323.     this._enemyWindow.hide();
  1324. };

  1325. //2282
  1326. Alias.ScBa_commandGuard = Scene_Battle.prototype.commandGuard;
  1327. Scene_Battle.prototype.commandGuard = function() {
  1328.     BattleManager.inputtingAction().setGuard();
  1329.     BattleManager.actor().onMadeAction();
  1330.     Alias.ScBa_commandGuard.call(this);
  1331. };

  1332. Scene_Battle.prototype.onStatusOk = function() {
  1333.     BattleManager.changeActor(this._statusWindow.index(), 'undecided');
  1334.     this.changeInputWindow();
  1335. };

  1336. //2303
  1337. Alias.ScBa_selectActorSelection = Scene_Battle.prototype.selectActorSelection;
  1338. Scene_Battle.prototype.selectActorSelection = function() {
  1339.     Alias.ScBa_selectActorSelection.call(this);
  1340.     this._actorWindow.selectForItem();
  1341. };

  1342. //2309
  1343. Alias.ScBa_onActorOk = Scene_Battle.prototype.onActorOk;
  1344. Scene_Battle.prototype.onActorOk = function() {
  1345.     BattleManager.actor().onMadeAction();
  1346.     Alias.ScBa_onActorOk.call(this);
  1347. };

  1348. //2332
  1349. Alias.ScBa_selectEnemySelection = Scene_Battle.prototype.selectEnemySelection;
  1350. Scene_Battle.prototype.selectEnemySelection = function() {
  1351.     Alias.ScBa_selectEnemySelection.call(this);
  1352.     this._enemyWindow.selectForItem();
  1353. };

  1354. //2339
  1355. Alias.ScBa_onEnemyOk = Scene_Battle.prototype.onEnemyOk;
  1356. Scene_Battle.prototype.onEnemyOk = function() {
  1357.     BattleManager.actor().onMadeAction();
  1358.     Alias.ScBa_onEnemyOk.call(this);
  1359. };

  1360. //2391
  1361. Scene_Battle.prototype.onSelectAction = function() {
  1362.     var action = BattleManager.inputtingAction();
  1363.     //this._skillWindow.hide();
  1364.     //this._itemWindow.hide();
  1365.     if (action.isForOpponent()) {
  1366.         this.selectEnemySelection();
  1367.     } else {
  1368.         this.selectActorSelection();
  1369.     }
  1370. };

  1371. //2404
  1372. Alias.ScBa_endCommandSelection = Scene_Battle.prototype.endCommandSelection;
  1373. Scene_Battle.prototype.endCommandSelection = function() {
  1374.     this._actor = null;
  1375.     Alias.ScBa_endCommandSelection.call(this);
  1376.     this._skillWindow.deactivate();
  1377.     this._skillWindow.hide();
  1378.     this._itemWindow.deactivate();
  1379.     this._itemWindow.hide();
  1380.     this._actorWindow.deactivate();
  1381.     this._actorWindow.hide();
  1382.     this._enemyWindow.deactivate();
  1383.     this._enemyWindow.hide();
  1384. };

  1385. })();
复制代码



回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部