查看: 1996|回复: 2

[有事请教] 请教一下伪回合制

[复制链接]
梦石
0
星屑
81
在线时间
33 小时
注册时间
2009-5-7
回帖
20
发表于 2018-6-13 09:46:55 | 显示全部楼层 |阅读模式

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

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

×
构思是还是回合制的页面,但是轮到我方行动时对方的行动条不会停止,对方行动条满后会进行攻击操作,我方可以把技能或攻击设置到快捷键上,这样的伪回合制应该怎样实现呢?
梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2018-6-13 13:26:06 | 显示全部楼层
本帖最后由 tseyik 于 2018-6-13 13:33 编辑

http://woodpenguin.web.fc2.com/MV_Plugin/ActiveTimeBattle.html
アクティブタイムバトル

点击展开/收起
  1. //=============================================================================
  2. // MPP_ActiveTimeBattle.js
  3. //=============================================================================
  4. // Copyright (c) 2018 Mokusei Penguin
  5. // Released under the MIT license
  6. // [url]http://opensource.org/licenses/mit-license.php[/url]
  7. //=============================================================================

  8. /*:
  9. * @plugindesc 【ver.2.4】戦闘システムをアクティブタイムバトルに変更します。
  10. * @author 木星ペンギン
  11. *
  12. * @help ▼ システム説明
  13. * --------------------------------
  14. *  〇 パーティコマンド
  15. *   アクターコマンド選択中か、誰もコマンド入力を行っていない状態で
  16. *   キャンセルキーを押すとパーティコマンドを開くことができます。
  17. *
  18. *   パーティコマンドを開いている間は、どの戦闘モードでも時間が止まります。
  19. *   一時停止の代わりです。
  20. *
  21. *  〇 バトルイベントの実行
  22. *   イベント実行中にも時間は止まります。
  23. *
  24. *  〇 戦闘モード(active, slow, wait, stop)
  25. *   active : 常に時間が流れます。
  26. *   slow   : 常に時間が経過しますが、コマンド入力中は時間の流れが遅くなり、
  27. *            そうでない場合は常に加速されます。
  28. *   wait   : スキルやアイテム、対象選択中は時間が止まります。
  29. *           アクターコマンド入力中は時間が流れます。
  30. *   stop   : コマンド入力中は常に時間が止まります。
  31. *            アクターコマンド入力中に加速ボタンを押すと時間が流れます。
  32. *   ※どのモードでもパーティコマンド選択中、イベント実行中は時間が止まります。
  33. *
  34. *  〇 ATゲージ
  35. *   ATゲージの最大値は
  36. *    1.パーティメンバーの敏捷性の平均値(敵は含まない)
  37. *    2.オプションによるプレイヤーの設定
  38. *    3.プラグインコマンドで設定した基準値
  39. *   によって決定されます。
  40. *
  41. *   ATゲージの増加量は
  42. *    キャラクターの敏捷性 + 増加値
  43. *   です。
  44. *   プラグインコマンドで設定した[増加値]が大きいほど、
  45. *   敏捷性の影響が小さくなります。
  46. *
  47. *  〇 逃げる
  48. *   戦闘可能なキャラ全員が逃走に必要なATをためると逃走判定を行います。
  49. *   逃走に失敗しても逃走状態は解除されません。
  50. *   パーティコマンドで戦うを選択すると解除されます。
  51. *
  52. *  〇 アイテム/スキルの詠唱時間
  53. *   アイテム/スキルの速度補正をマイナスにすることで、詠唱時間が発生します。
  54. *   速度補正を-1するごとに約0.5秒の詠唱時間となります。
  55. *   詠唱が終わった時点で、行動順リストに入ります。
  56. *
  57. *   詠唱時間はオプションの[戦闘速度]の設定によって上下します。
  58. *   [戦闘速度の基準値]を変えても変化しません。
  59. *
  60. *  〇 複数回行動
  61. *   特徴の[行動回数追加]によって2回以上の行動が可能になった際の動作は
  62. *   保証しません。
  63. *   1回行動になるようにしてください。
  64. *
  65. * ================================================================
  66. * ▼ 操作関連
  67. * --------------------------------
  68. *  〇 加速ボタン
  69. *   ゲームパッドではXボタン、キーボードではShift、
  70. *   タッチ操作ではステータスウィンドウより上をタッチし続けることで加速します。
  71. *   ただし、メッセージウィンドウが表示されている場合は加速しません。
  72. *
  73. *  〇 コマンド入力を行うアクターの切り替え
  74. *   ゲームパッドではLB/RBボタン、キーボードではQ、Page up/W、Page down、
  75. *   タッチ操作ではステータスウィンドウをタッチすることで
  76. *   選択した対象に切り替えることができます。
  77. *   (正確にはタッチを離した際に切り替わります)
  78. *
  79. *  〇 ステータスウィンドウのスクロール
  80. *   タッチ操作でタッチしたままウィンドウを上下に動かすと
  81. *   スクロールさせることができます。
  82. *   パーティメンバーがステータスウィンドウに収まらない場合の処置です。
  83. *
  84. * ================================================================
  85. * ▼ プラグインパラメータ 詳細
  86. * --------------------------------
  87. *  〇 Escape Anime? (逃走状態で逃走モーションを行うかどうか)
  88. *   有効にすると逃走状態にある間アクターは逃走モーションを行います。
  89. *   デフォルトでは後ろ向きに走るモーションはありません。
  90. *
  91. * --------------------------------
  92. *  〇 Change Mode in Battle _v2 (戦闘中に戦闘モードを変更可能にするかどうか)
  93. *   戦闘モードの変更はパーティコマンドから行えます。
  94. *
  95. * ================================
  96. * 制作 : 木星ペンギン
  97. * URL : [url]http://woodpenguin.blog.fc2.com/[/url]
  98. *
  99. * @param === Base ===
  100. * @default 【基本設定】
  101. *
  102. * @param ATB Mode Default _v2
  103. * @type select
  104. * @option active
  105. * @option slow
  106. * @option wait
  107. * @option stop
  108. * @desc 戦闘モードのデフォルト値
  109. * @default wait
  110. * @parent === Base ===
  111. *
  112. * @param ATB Speed Base
  113. * @type number
  114. * @desc 戦闘速度の基準値
  115. * ゲーム内での変更はできない制作者側の設定
  116. * @default 6
  117. * @parent === Base ===
  118. *
  119. * @param AT Increment
  120. * @type number
  121. * @desc ATゲージの増加値
  122. * @default 10
  123. * @parent === Base ===
  124. *
  125. * @param Mode Slow Fast Rate
  126. * @desc 戦闘モード[slow]時のコマンド入力中でない場合の時間加速度
  127. * @default 1.5
  128. * @parent === Base ===
  129. *
  130. * @param Mode Slow Rate
  131. * @desc 戦闘モード[slow]時のコマンド入力中の時間加速度
  132. * @default 0.5
  133. * @parent === Base ===
  134. *
  135. * @param Mode Stop Fast Eneble?
  136. * @type boolean
  137. * @desc 戦闘モード[sto0]時のコマンド入力中の加速ボタンを有効にするかどうか
  138. * @default true
  139. * @parent === Base ===
  140. *
  141. * *
  142. * @param === Option ===
  143. * @default 【オプション画面】
  144. *
  145. * @param ATB Mode Name _v2
  146. * @desc オプションで表示する戦闘モードの項目名
  147. * (空の場合オプションには追加されません)
  148. * @default 戦闘モード
  149. * @parent === Option ===
  150. *
  151. * @param ATB Mode Status _v2
  152. * @type select[]
  153. * @option active
  154. * @option slow
  155. * @option wait
  156. * @option stop
  157. * @desc オプションで表示する戦闘モードの表示順
  158. * @default ["active","wait"]
  159. * @parent === Option ===
  160. *
  161. * @param ATB Mode Texts _v2
  162. * @type struct<ModeStatus>
  163. * @desc 用語[戦闘モード]
  164. * @default {"active":"アクティブ","slow":"スロー","wait":"ウェイト","stop":"ストップ"}
  165. * @parent === Option ===
  166. *
  167. * @param ATB Speed Default
  168. * @type number
  169. * @max 4
  170. * @desc 戦闘速度のデフォルト値(0~4)
  171. * @default 2
  172. * @parent === Option ===
  173. *
  174. * @param ATB Speed Name
  175. * @desc オプションで表示する戦闘速度の項目名
  176. * (空の場合オプションには追加されません)
  177. * @default 戦闘速度
  178. * @parent === Option ===
  179. *
  180. * @param ATB Speed Status
  181. * @desc オプションで表示する戦闘速度のステータス名
  182. * (カンマで区切ってください)
  183. * @default 1,2,3,4,5
  184. * @parent === Option ===
  185. *
  186. *
  187. * @param === Battle ===
  188. * @default 【戦闘関連】
  189. *
  190. * @param Reset AT Die?
  191. * @type boolean
  192. * @desc 戦闘不能時にATゲージをリセットするかどうか?
  193. * @default true
  194. * @parent === Battle ===
  195. *
  196. * @param Need Escape At
  197. * @type number
  198. * @max 100
  199. * @desc 逃走に必要なATゲージの割合(0~100)
  200. * @default 100
  201. * @parent === Battle ===
  202. *
  203. * @param Escape AT Cost
  204. * @type number
  205. * @max 100
  206. * @desc 逃走失敗時に消費されるATゲージの割合(0~100)
  207. * @default 75
  208. * @parent === Battle ===
  209. *
  210. * @param Escape Anime?
  211. * @type boolean
  212. * @desc 逃走状態で逃走モーションを行うかどうか
  213. * @default false
  214. * @parent === Battle ===
  215. *
  216. * @param Input Step Forward?
  217. * @type boolean
  218. * @desc コマンド入力中に前進するかどうか
  219. * @default false
  220. * @parent === Battle ===
  221. *
  222. * @param ATB Fast Eneble?
  223. * @type boolean
  224. * @desc 加速ボタンの有効/無効
  225. * @default true
  226. * @parent === Battle ===
  227. *
  228. * @param ATB Fast Rate
  229. * @desc 加速ボタンを押したときの加速度
  230. * @default 2.0
  231. * @parent === Battle ===
  232. *
  233. * @param Fast Log Eneble?
  234. * @type boolean
  235. * @desc 戦闘ログ早送りの有効/無効
  236. * 戦闘ログ早送りはツクールデフォルトの機能です
  237. * @default true
  238. * @parent === Battle ===
  239. *
  240. * @param Active SE _v2
  241. * @type struct<SE>
  242. * @desc 行動順が回ってきたときのSE
  243. * @default {"Name":"Decision1","Volume":"90","Pitch":"100","Pan":"0"}
  244. * @parent === Battle ===
  245. *
  246. * @param Change Mode in Battle _v2
  247. * @type boolean
  248. * @desc 戦闘中に戦闘モードを変更可能にするかどうか
  249. * @default false
  250. * @parent === Battle ===
  251. *
  252. * @param Fast Cancel By Input
  253. * @type boolean
  254. * @desc コマンド入力を行う際、加速を一旦解除するかどうか
  255. * @default true
  256. * @parent === Battle ===
  257. *
  258. * @param Stop Time On Action
  259. * @type boolean
  260. * @desc アクション中に時間を止めるかどうか
  261. * @default false
  262. * @parent === Battle ===
  263. *
  264. *
  265. *
  266. * @param === Window ===
  267. * @default 【ウィンドウ】
  268. *
  269. * @param Help Window Pos
  270. * @type number
  271. * @min -1
  272. * @max 1
  273. * @desc ヘルプウィンドウの位置
  274. * (-1:非表示, 0:上, 1:ステータスの上)
  275. * @default 1
  276. * @parent === Window ===
  277. *
  278. * @param Help Window Row
  279. * @type number
  280. * @desc ヘルプウィンドウの行数
  281. * @default 1
  282. * @parent === Window ===
  283. *
  284. * @param Status Window Pos
  285. * @type number
  286. * @max 2
  287. * @desc ステータスウィンドウの位置
  288. * (0:左寄せ, 1:中央, 2:右寄せ)
  289. * @default 2
  290. * @parent === Window ===
  291. *
  292. * @param Skill Window HP Draw?
  293. * @type boolean
  294. * @desc スキルウィンドウ表示中にHPを表示するかどうか
  295. * @default false
  296. * @parent === Window ===
  297. *
  298. *
  299. * @param === AT Gauge ===
  300. * @default 【ATゲージ】
  301. *
  302. * @param AT Gauge Name
  303. * @desc ATゲージ名
  304. * @default
  305. * @parent === AT Gauge ===
  306. *
  307. * @param AT Gauge Width
  308. * @type number
  309. * @desc ATゲージの幅
  310. * @default 60
  311. * @parent === AT Gauge ===
  312. *
  313. * @param AT Gauge Height
  314. * @type number
  315. * @desc ATゲージの高さ
  316. * @default 12
  317. * @parent === AT Gauge ===
  318. *
  319. * @param AT Charge Color1
  320. * @desc ATゲージ増加中の色1(RGBで指定)
  321. * @default 192,192,192
  322. * @parent === AT Gauge ===
  323. *
  324. * @param AT Charge Color2
  325. * @desc ATゲージ増加中の色2(RGBで指定)
  326. * @default 255,255,255
  327. * @parent === AT Gauge ===
  328. *
  329. * @param AT Max Color1
  330. * @desc ATゲージMaxの色1(RGBで指定)
  331. * @default 192,192,192
  332. * @parent === AT Gauge ===
  333. *
  334. * @param AT Max Color2
  335. * @desc ATゲージMaxの色2(RGBで指定)
  336. * @default 255,255,192
  337. * @parent === AT Gauge ===
  338. *
  339. * @param Chanting View?
  340. * @type boolean
  341. * @desc 詠唱ゲージを表示するかどうか
  342. * @default true
  343. * @parent === AT Gauge ===
  344. *
  345. * @param AT Chanting Color1
  346. * @desc 詠唱ゲージの色1(RGBで指定)
  347. * @default 128,32,0
  348. * @parent === AT Gauge ===
  349. *
  350. * @param AT Chanting Color2
  351. * @desc 詠唱ゲージの色2(RGBで指定)
  352. * @default 255,64,0
  353. * @parent === AT Gauge ===
  354. *
  355. * @param Escaping Change?
  356. * @type boolean
  357. * @desc 逃走中にゲージの色を変更するかどうか
  358. * @default true
  359. * @parent === AT Gauge ===
  360. *
  361. * @param AT Escaping Color1
  362. * @desc 詠唱ゲージの色1(RGBで指定)
  363. * @default 192,192,192
  364. * @parent === AT Gauge ===
  365. *
  366. * @param AT Escaping Color2
  367. * @desc 詠唱ゲージの色2(RGBで指定)
  368. * @default 192,192,255
  369. * @parent === AT Gauge ===
  370. *
  371. */

  372. /*~struct~ModeStatus:
  373. * @param active
  374. * @default アクティブ
  375. *
  376. * @param slow
  377. * @default スロー
  378. *
  379. * @param wait
  380. * @default ウェイト
  381. *
  382. * @param stop
  383. * @default ストップ
  384. *
  385. */

  386. /*~struct~SE:
  387. * @param Name
  388. * @desc ファイル名
  389. * @default Decision1
  390. * @require 1
  391. * @dir audio/se
  392. * @type file
  393. *
  394. * @param Volume
  395. * @type number
  396. * @max 100
  397. * @desc 音量
  398. * @default 90
  399. *
  400. * @param Pitch
  401. * @type number
  402. * @min 50
  403. * @max 150
  404. * @desc ピッチ
  405. * @default 100
  406. *
  407. * @param Pan
  408. * @type number
  409. * @min -100
  410. * @max 100
  411. * @desc 位相
  412. * @default 0
  413. *
  414. */

  415. function Window_AtbSkillStatus() {
  416.     this.initialize.apply(this, arguments);
  417. }

  418. (function() {

  419. var MPPlugin = {};

  420. (function() {
  421.    
  422.     var parameters = PluginManager.parameters('MPP_ActiveTimeBattle')
  423.    
  424.     MPPlugin.contains = {};
  425.     MPPlugin.contains['ComBat'] = $plugins.some(function(plugin) {
  426.         return (plugin.name === 'MPP_CommonBattle' && plugin.status);
  427.     });
  428.    
  429.     //=== Base ===
  430.     MPPlugin.atbMode = parameters['ATB Mode Default _v2'] || "wait";
  431.     MPPlugin.atbSpeedBase = Number(parameters['ATB Speed Base'] || 6);
  432.     MPPlugin.atIncrement = Number(parameters['AT Increment'] || 10);
  433.     MPPlugin.ModeSlowFastRate = Number(parameters['Mode Slow Fast Rate'] || 2);
  434.     MPPlugin.ModeSlowRate = Number(parameters['Mode Slow Rate'] || 0.25);
  435.     MPPlugin.ModeStopFastEneble = !!eval(parameters['Mode Stop Fast Eneble?']);
  436.    
  437.     //=== Option ===
  438.     MPPlugin.atbModeName = parameters['ATB Mode Name _v2'];
  439.     MPPlugin.atbModeStatus = JSON.parse(parameters['ATB Mode Status _v2']);
  440.     MPPlugin.atbModeTexts = JSON.parse(parameters['ATB Mode Texts _v2']);
  441.     MPPlugin.atbSpeed = Number(parameters['ATB Speed Default'] || 2).clamp(0, 4);
  442.     MPPlugin.atbSpeedName = parameters['ATB Speed Name'];
  443.     MPPlugin.atbSpeedStatus = (parameters['ATB Speed Status'] || '1,2,3,4,5').split(',');

  444.     //=== Battle ===
  445.     MPPlugin.resetAtDie = !!eval(parameters['Reset AT Die?']);
  446.     MPPlugin.needEscapeAt = Number(parameters['Need Escape At'] || 100).clamp(0, 100);
  447.     MPPlugin.escapeAtCost = Number(parameters['Escape At Cost'] || 75).clamp(0, 100);
  448.     MPPlugin.escapeAnime = !!eval(parameters['Escape Anime?']);
  449.     MPPlugin.inputStepForward = !!eval(parameters['Input Step Forward?']);
  450.     MPPlugin.atbFastEneble = !!eval(parameters['ATB Fast Eneble?']);
  451.     MPPlugin.atbFastRate = Number(parameters['ATB Fast Rate'] || 3).clamp(0, 10);
  452.     MPPlugin.fastLogEneble = !!eval(parameters['Fast Log Eneble?']);
  453.     var se = JSON.parse(parameters['Active SE _v2']);
  454.     MPPlugin.ActiveSE = {
  455.         name:se.Name || "",
  456.         volume:Number(se.Volume || 90),
  457.         pitch:Number(se.Pitch || 100),
  458.         pan:Number(se.Pan || 0)
  459.     };
  460.     MPPlugin.ChangeModeInBattle = !!eval(parameters['Change Mode in Battle _v2']);
  461.     MPPlugin.FastCancelByInput = !!eval(parameters['Fast Cancel By Input']);
  462.     MPPlugin.StopTimeOnAction = !!eval(parameters['Stop Time On Action']);

  463.     //=== Window ===
  464.     MPPlugin.helpWindowPos = Number(parameters['Help Window Pos'] || 1).clamp(-1, 1);
  465.     MPPlugin.helpWindowRow = Number(parameters['Help Window Row'] || 1).clamp(0, 2);
  466.     MPPlugin.stWindowPos = Number(parameters['Status Window Pos'] || 1).clamp(0, 2);
  467.     MPPlugin.SkillWindowHpDraw = !!eval(parameters['Skill Window HP Draw?']);

  468.     //=== AT Gauge ===
  469.     MPPlugin.atGaugeName = parameters['AT Gauge Name'] || '';
  470.     MPPlugin.atGaugeWidth = Number(parameters['AT Gauge Width'] || 84);
  471.     MPPlugin.atGaugeHeight = Number(parameters['AT Gauge Height'] || 12);
  472.     MPPlugin.atChargeColor1 = 'rgb(%1)'.format(parameters['AT Charge Color1'] || '192,192,192');
  473.     MPPlugin.atChargeColor2 = 'rgb(%1)'.format(parameters['AT Charge Color2'] || '255,255,255');
  474.     MPPlugin.atMaxColor1 = 'rgb(%1)'.format(parameters['AT Max Color1'] || '192,192,192');
  475.     MPPlugin.atMaxColor2 = 'rgb(%1)'.format(parameters['AT Max Color2'] || '255,255,192');
  476.     MPPlugin.chantingView = !!eval(parameters['Chanting View?']);
  477.     MPPlugin.atChantingColor1 = 'rgb(%1)'.format(parameters['AT Chanting Color1'] || '128,32,0');
  478.     MPPlugin.atChantingColor2 = 'rgb(%1)'.format(parameters['AT Chanting Color2'] || '255,64,0');
  479.     MPPlugin.EscapingChange = !!eval(parameters['Escaping Change?']);
  480.     MPPlugin.atEscapingColor1 = 'rgb(%1)'.format(parameters['AT Escaping Color1'] || '192,192,192');
  481.     MPPlugin.atEscapingColor2 = 'rgb(%1)'.format(parameters['AT Escaping Color2'] || '192,192,255');
  482.    
  483. })();

  484. var Alias = {};

  485. //=============================================================================
  486. // Option
  487. //=============================================================================

  488. //-----------------------------------------------------------------------------
  489. // ConfigManager

  490. ConfigManager.atbMode = MPPlugin.atbModeStatus.indexOf(MPPlugin.atbMode);
  491. if (ConfigManager.atbMode === -1) ConfigManager.atbMode = 2;
  492. ConfigManager.atbSpeed = MPPlugin.atbSpeed;

  493. ConfigManager.mppParams = ConfigManager.mppParams || [];
  494. ConfigManager.mppParams.push({
  495.     symbol:'atbMode',
  496.     name:  MPPlugin.atbModeName,
  497.     status:MPPlugin.atbModeStatus.map(function(mode) {
  498.         return MPPlugin.atbModeTexts[mode];
  499.     })
  500. });
  501. ConfigManager.mppParams.push({
  502.     symbol:'atbSpeed',
  503.     name:  MPPlugin.atbSpeedName,
  504.     status:MPPlugin.atbSpeedStatus
  505. });

  506. if (!ConfigManager.MppOption2) {

  507. //71
  508. Alias.CoMa_makeData = ConfigManager.makeData;
  509. ConfigManager.makeData = function() {
  510.     var config = Alias.CoMa_makeData.call(this);
  511.     var params = this.mppParams;
  512.     for (var i = 0; i < params.length; i++) {
  513.         var symbol = params[i].symbol;
  514.         config[symbol] = this[symbol];
  515.     }
  516.     return config;
  517. };

  518. //82
  519. Alias.CoMa_applyData = ConfigManager.applyData;
  520. ConfigManager.applyData = function(config) {
  521.     Alias.CoMa_applyData.call(this, config);
  522.     var params = this.mppParams;
  523.     for (var i = 0; i < params.length; i++) {
  524.         var symbol = params[i].symbol;
  525.         if (typeof config[symbol] === 'number')
  526.             this[symbol] = config[symbol];
  527.     }
  528. };

  529. //-----------------------------------------------------------------------------
  530. // Window_Options

  531. //31
  532. Alias.WiOp_makeCommandList = Window_Options.prototype.makeCommandList;
  533. Window_Options.prototype.makeCommandList = function() {
  534.     var params = ConfigManager.mppParams;
  535.     for (var i = 0; i < params.length; i++) {
  536.         var param = params[i];
  537.         if (param.name)
  538.             this.addCommand(param.name, param.symbol);
  539.     }
  540.     Alias.WiOp_makeCommandList.call(this);
  541. };

  542. Window_Options.prototype.isMppSymbol2 = function(symbol) {
  543.     return ConfigManager.mppParams.some(function(param) {
  544.         return param.symbol === symbol;
  545.     });
  546. };

  547. Window_Options.prototype.getMppStatus2 = function(symbol) {
  548.     var params = ConfigManager.mppParams;
  549.     for (var i = 0; i < params.length; i++) {
  550.         if (params[i].symbol === symbol)
  551.             return params[i].status;
  552.     }
  553.     return [];
  554. };

  555. //62
  556. Alias.WiOp_statusText = Window_Options.prototype.statusText;
  557. Window_Options.prototype.statusText = function(index) {
  558.     var symbol = this.commandSymbol(index);
  559.     if (this.isMppSymbol2(symbol)) {
  560.         var status = this.getMppStatus2(symbol);
  561.         var value = this.getConfigValue(symbol);
  562.         return status[value];
  563.     } else {
  564.         return Alias.WiOp_statusText.call(this, index);
  565.     }
  566. };

  567. //84
  568. Alias.WiOp_processOk = Window_Options.prototype.processOk;
  569. Window_Options.prototype.processOk = function() {
  570.     var index = this.index();
  571.     var symbol = this.commandSymbol(index);
  572.     if (this.isMppSymbol2(symbol)) {
  573.         var status = this.getMppStatus2(symbol);
  574.         var value = this.getConfigValue(symbol);
  575.         value++;
  576.         if (value >= status.length) value = 0;
  577.         value = value.clamp(0, status.length - 1);
  578.         this.changeValue(symbol, value);
  579.     } else {
  580.         Alias.WiOp_processOk.call(this);
  581.     }
  582. };

  583. //100
  584. Alias.WiOp_cursorRight = Window_Options.prototype.cursorRight;
  585. Window_Options.prototype.cursorRight = function(wrap) {
  586.     var index = this.index();
  587.     var symbol = this.commandSymbol(index);
  588.     if (this.isMppSymbol2(symbol)) {
  589.         var status = this.getMppStatus2(symbol);
  590.         var value = this.getConfigValue(symbol);
  591.         value++;
  592.         value = value.clamp(0, status.length - 1);
  593.         this.changeValue(symbol, value);
  594.     } else {
  595.         Alias.WiOp_cursorRight.call(this, wrap);
  596.     }
  597. };

  598. //113
  599. Alias.WiOp_cursorLeft = Window_Options.prototype.cursorLeft;
  600. Window_Options.prototype.cursorLeft = function(wrap) {
  601.     var index = this.index();
  602.     var symbol = this.commandSymbol(index);
  603.     if (this.isMppSymbol2(symbol)) {
  604.         var status = this.getMppStatus2(symbol);
  605.         var value = this.getConfigValue(symbol);
  606.         value--;
  607.         value = value.clamp(0, status.length - 1);
  608.         this.changeValue(symbol, value);
  609.     } else {
  610.         Alias.WiOp_cursorLeft.call(this, wrap);
  611.     }
  612. };

  613. ConfigManager.MppOption2 = true;
  614. }

  615. //=============================================================================
  616. // Main
  617. //=============================================================================

  618. //-----------------------------------------------------------------------------
  619. // BattleManager

  620. //10
  621. Alias.BaMa_setup = BattleManager.setup;
  622. BattleManager.setup = function(troopId, canEscape, canLose) {
  623.     Alias.BaMa_setup.call(this, troopId, canEscape, canLose);
  624.     var rate = (7 - ConfigManager.atbSpeed) * MPPlugin.atbSpeedBase * 16;
  625.     this._maxAt = Math.max(Math.round($gameParty.agility() * rate), 10);
  626.     this._refreshHandler = null;
  627.     this._waitHandler = null;
  628.     this._escaping = false;
  629.     this._atbFast = false;
  630. };

  631. BattleManager.atbMode = function() {
  632.     return MPPlugin.atbModeStatus[ConfigManager.atbMode];
  633. };

  634. BattleManager.maxAt = function() {
  635.     return this._maxAt;
  636. };

  637. BattleManager.setEscaping = function(escaping) {
  638.     this._escaping = escaping;
  639.     $gameParty.requestMotionRefresh();
  640. };

  641. BattleManager.isEscaping = function() {
  642.     return this._escaping;
  643. };

  644. BattleManager.needEscapeAt = function() {
  645.     return MPPlugin.needEscapeAt / 100;
  646. };

  647. BattleManager.escapeAtCost = function() {
  648.     return MPPlugin.escapeAtCost / 100;
  649. };

  650. //114
  651. Alias.BaMa_update = BattleManager.update;
  652. BattleManager.update = function() {
  653.     this.updateATB();
  654.     this.updateCmdActor();
  655.     Alias.BaMa_update.call(this);
  656. };

  657. BattleManager.updateATB = function() {
  658.     if (!this._atbFast && this.isTriggeredFast()) {
  659.         this._atbFast = true;
  660.     } else if (this._atbFast && !this.isPressedFast()) {
  661.         this._atbFast = false;
  662.     }
  663.     if (Graphics.frameCount % 2 === 0 && !this.isAtbWait()) {
  664.         var rate = this.atbRealRate();
  665.         this.allBattleMembers().forEach(function(battler) {
  666.             battler.updateATB(rate);
  667.             if (battler.isMadeAction())
  668.                 this.addActionBattler(battler);
  669.         }, this);
  670.     }
  671. };

  672. BattleManager.isTriggeredFast = function() {
  673.     return Input.isTriggered('shift') ||
  674.             (TouchInput.isTriggered() && TouchInput.y < this._statusWindow.y);
  675. };

  676. BattleManager.isPressedFast = function() {
  677.     return Input.isPressed('shift') ||
  678.             (TouchInput.isPressed() && TouchInput.y < this._statusWindow.y);
  679. };

  680. BattleManager.atbRealRate = function() {
  681.     if (this.isFastForward()) {
  682.         return MPPlugin.atbFastRate;
  683.     } else if (BattleManager.atbMode() === "slow") {
  684.         if (this.actor()) {
  685.             return MPPlugin.ModeSlowRate;
  686.         } else {
  687.             return MPPlugin.ModeSlowFastRate;
  688.         }
  689.     } else {
  690.         return 1;
  691.     }
  692. };

  693. BattleManager.updateCmdActor = function() {
  694.     if (this.isEvantWait() || this.isBattleEnd())
  695.         return this.clearActor();
  696.     if (!this.isAtbWait() && !this.actor()) {
  697.         var members = $gameParty.battleMembers();
  698.         for (var i = 0; i < members.length; i++) {
  699.             if (members[i].isStandby()) {
  700.                 return this.changeActor(i);
  701.             }
  702.         }
  703.     } else if (this.actor() && !this.actor().isStandby()) {
  704.         this.clearActor();
  705.     }
  706. };

  707. BattleManager.addActionBattler = function(battler) {
  708.     this._actionBattlers.push(battler);
  709.     battler.setDecided(2);
  710. };

  711. BattleManager.deleteDeactiveBattler = function() {
  712.     this._actionBattlers = this._actionBattlers.filter(function(battler) {
  713.         if (battler.atRate() === 1) {
  714.             return true;
  715.         } else {
  716.             battler.setDecided(0);
  717.             return false;
  718.         }
  719.     });
  720.     if (this.actor() && !this.actor().isStandby()) {
  721.         this.clearActor();
  722.     }
  723. };

  724. BattleManager.isFastForward = function() {
  725.     return MPPlugin.atbFastEneble && this._atbFast;
  726. };

  727. BattleManager.isEvantWait = function() {
  728.     return $gameTroop.isEventRunning() || $gameMessage.isBusy();
  729. };

  730. BattleManager.isAtbWait = function() {
  731.     if (MPPlugin.StopTimeOnAction && this._subject) {
  732.         return true;
  733.     }
  734.     return (this.isEvantWait() || this._waitHandler());
  735. };

  736. //221
  737. Alias.BaMa_startBattle = BattleManager.startBattle;
  738. BattleManager.startBattle = function() {
  739.     Alias.BaMa_startBattle.call(this);
  740.     this.setupAllBattlerAt();
  741.     this.startTurn();
  742. };

  743. BattleManager.setupAllBattlerAt = function() {
  744.     if (this._preemptive) {
  745.         $gameParty.members().forEach(function(member) {
  746.             member.setAt(1);
  747.         });
  748.     } else if (this._surprise) {
  749.         $gameTroop.members().forEach(function(member) {
  750.             member.setAt(1);
  751.         });
  752.     } else {
  753.         $gameParty.members().forEach(function(member) {
  754.             member.setAt(0.8 * Math.random());
  755.         });
  756.         $gameTroop.members().forEach(function(member) {
  757.             member.setAt(0.8 * Math.random());
  758.         });
  759.     }
  760.     this.refreshStatus();
  761. };

  762. //254
  763. BattleManager.selectNextCommand = function() {
  764.     var members = $gameParty.battleMembers();
  765.     if (this.actor() && this.actor().isStandby()) {
  766.         var actionState = 'undecided';
  767.     } else {
  768.         var actionState = 'waiting';
  769.     }
  770.     for (var i = 1; i < members.length; i++) {
  771.         var n = (this._actorIndex + i).mod(members.length);
  772.         if (members[n].isStandby() && members[n].canInput()) {
  773.             return this.changeActor(n, actionState);
  774.         }
  775.     }
  776.     return this.changeActor(-1, actionState);
  777. };

  778. //266
  779. BattleManager.selectPreviousCommand = function() {
  780.     var members = $gameParty.battleMembers();
  781.     if (this.actor() && this.actor().isStandby()) {
  782.         var actionState = 'undecided';
  783.     } else {
  784.         var actionState = 'waiting';
  785.     }
  786.     for (var i = 1; i < members.length; i++) {
  787.         var n = (this._actorIndex - i).mod(members.length);
  788.         if (members[n].isStandby() && members[n].canInput()) {
  789.             return this.changeActor(n, actionState);
  790.         }
  791.     }
  792.     return this.changeActor(-1, actionState);
  793. };

  794. //277
  795. BattleManager.refreshStatus = function() {
  796.     this._refreshHandler();
  797. };

  798. //281
  799. BattleManager.startTurn = function() {
  800.     this._phase = 'turn';
  801.     //this.clearActor();
  802.     //$gameTroop.increaseTurn();
  803.     //this.makeActionOrders();
  804.     $gameParty.requestMotionRefresh();
  805.     this._logWindow.startTurn();
  806. };

  807. //290
  808. BattleManager.updateTurn = function() {
  809.     $gameParty.requestMotionRefresh();
  810.     if (!this._subject) {
  811.         this._subject = this.getNextSubject();
  812.         if (this._subject) {
  813.             this._subject.onTurnEnd();
  814.             this.refreshStatus();
  815.             this._logWindow.displayAutoAffectedStatus(this._subject);
  816.             this._logWindow.displayRegeneration(this._subject);
  817.             if (this._logWindow.isBusy()) return;
  818.         }
  819.     }
  820.     if (this._subject) {
  821.         this.processTurn();
  822.     } else {
  823.         this.endTurn();
  824.     }
  825. };

  826. //302
  827. BattleManager.processTurn = function() {
  828.     var subject = this._subject;
  829.     var action = subject.currentAction();
  830.     if (action) {
  831.         action.prepare();
  832.         if (action.isValid()) {
  833.             this.startAction();
  834.         }
  835.         subject.removeCurrentAction();
  836.     } else {
  837.         $gameTroop.increaseTurn();
  838.         subject.onAllActionsEnd();
  839.         subject.resetAt(this._action ? this._action.item() : null);
  840.         this.refreshStatus();
  841.         this._logWindow.displayAutoAffectedStatus(subject);
  842.         this._logWindow.displayCurrentState(subject);
  843.         this._logWindow.displayRegeneration(subject);
  844.         this.endTurn();
  845.     }
  846. };

  847. //321
  848. BattleManager.endTurn = function() {
  849.     this._phase = 'turnEnd';
  850.     this._subject = null;
  851. };

  852. //340
  853. BattleManager.updateTurnEnd = function() {
  854.     if (!this._escaping || !$gameParty.canEscape() || !this.processEscape()) {
  855.         this.startTurn();
  856.     }
  857. };

  858. //344
  859. Alias.BaMa_getNextSubject = BattleManager.getNextSubject;
  860. BattleManager.getNextSubject = function() {
  861.     if (this.isAtbWait() || this._logWindow.isBusy()) return null;
  862.     return Alias.BaMa_getNextSubject.call(this);
  863. };

  864. //515
  865. BattleManager.processEscape = function() {
  866.     $gameParty.performEscape();
  867.     SoundManager.playEscape();
  868.     var success = this._preemptive ? true : (Math.random() < this._escapeRatio);
  869.     if (success) {
  870.         this.displayEscapeSuccessMessage();
  871.         this._escaped = true;
  872.         this.processAbort();
  873.     } else {
  874.         this.displayEscapeFailureMessage();
  875.         this._escapeRatio += 0.1;
  876.         //$gameParty.clearActions();
  877.         //this.startTurn();
  878.         $gameParty.escapeFailure();
  879.     }
  880.     return success;
  881. };

  882. //550
  883. Alias.BaMa_endBattle = BattleManager.endBattle;
  884. BattleManager.endBattle = function(result) {
  885.     Alias.BaMa_endBattle.call(this, result);
  886.     this.clearActor();
  887. };

  888. //-----------------------------------------------------------------------------
  889. // Game_BattlerBase

  890. //110
  891. Alias.GaBa_initMembers = Game_BattlerBase.prototype.initMembers;
  892. Game_BattlerBase.prototype.initMembers = function() {
  893.     Alias.GaBa_initMembers.call(this);
  894.     this._at = 0;
  895.     this._ct = 0;
  896.     this._maxCt = 0;
  897.     this._turnCount = 0;
  898.     this._decided = 0;
  899. };

  900. //235
  901. Alias.GaBa_die = Game_BattlerBase.prototype.die;
  902. Game_BattlerBase.prototype.die = function() {
  903.     Alias.GaBa_die.call(this);
  904.     if (MPPlugin.resetAtDie) {
  905.         this._at = 0;
  906.     } else {
  907.         this._at = Math.min(this._at, BattleManager.maxAt() - 1);
  908.     }
  909.     this._ct = 0;
  910.     this._maxCt = 0;
  911.     this._decided = 0;
  912. };

  913. Game_BattlerBase.prototype.onMadeAction = function() {
  914.     this.setDecided(1);
  915.     this._ct = 0;
  916.     this._maxCt = 0;
  917.     var action = this.currentAction();
  918.     if (action) {
  919.         var item = action.item();
  920.         if (item) {
  921.             this._maxCt = Math.max(item.speed * (ConfigManager.atbSpeed - 7) * 3, 0);
  922.         }
  923.     }
  924. };

  925. Game_BattlerBase.prototype.setDecided = function(decided) {
  926.     this._decided = decided;
  927. };

  928. Game_BattlerBase.prototype.setAt = function(value) {
  929.     this._at = Math.floor(BattleManager.maxAt() * value);
  930.     this._at = this._at.clamp(0, BattleManager.maxAt() - 1);
  931. };

  932. Game_BattlerBase.prototype.atRate = function() {
  933.     return BattleManager.maxAt() > 0 ? this._at / BattleManager.maxAt() : 0;
  934. };

  935. Game_BattlerBase.prototype.castRate = function() {
  936.     if (this._maxCt > 0) {
  937.         return this._ct / this._maxCt;
  938.     } else {
  939.         return -1;
  940.     }
  941. };

  942. Game_BattlerBase.prototype.isStandby = function() {
  943.     return this._decided === 0 && this.atRate() === 1;
  944. };

  945. Game_BattlerBase.prototype.decided = function() {
  946.     return this._decided;
  947. };

  948. Game_BattlerBase.prototype.isMadeAction = function() {
  949.     return this._decided === 1 && this._ct === this._maxCt;
  950. };

  951. Game_BattlerBase.prototype.isStandby = function() {
  952.     return this._decided === 0 && this.atRate() === 1;
  953. };

  954. //-----------------------------------------------------------------------------
  955. // Game_Battler

  956. //59
  957. Alias.GaBa_requestMotion = Game_Battler.prototype.requestMotion;
  958. Game_Battler.prototype.requestMotion = function(motionType) {
  959.     Alias.GaBa_requestMotion.call(this, motionType);
  960.     this._motionRefresh = false;
  961. };

  962. //144
  963. Alias.GaBa_clearActions = Game_Battler.prototype.clearActions;
  964. Game_Battler.prototype.clearActions = function() {
  965.     Alias.GaBa_clearActions.call(this);
  966.     this._ct = 0;
  967.     this._maxCt = 0;
  968. };

  969. Game_Battler.prototype.setAt = function(value) {
  970.     if (this.atRate() === 1 && value >= 1) return;
  971.     Game_BattlerBase.prototype.setAt.call(this, value);
  972.     if (this._decided > 0 && this.atRate() < 1) {
  973.         this.setDecided(0);
  974.         this.clearActions();
  975.         BattleManager.deleteDeactiveBattler();
  976.     }
  977. };

  978. Game_Battler.prototype.gainAt = function(value) {
  979.     this.setAt(this.atRate() + value);
  980. };

  981. Game_Battler.prototype.resetAt = function(item) {
  982.     this.setAt(0);
  983. };

  984. //419
  985. Alias.GaBa_onBattleStart = Game_Battler.prototype.onBattleStart;
  986. Game_Battler.prototype.onBattleStart = function() {
  987.     Alias.GaBa_onBattleStart.call(this);
  988.     this._ct = 0;
  989.     this._maxCt = 0;
  990.     this._turnCount = 0;
  991.     this._decided = 0;
  992. };

  993. //427
  994. Alias.GaBa_onAllActionsEnd = Game_Battler.prototype.onAllActionsEnd;
  995. Game_Battler.prototype.onAllActionsEnd = function() {
  996.     Alias.GaBa_onAllActionsEnd.apply(this, arguments);
  997.     this.regenerateAll();
  998.     this._turnCount++;
  999.     this._ct = 0;
  1000.     this._maxCt = 0;
  1001.     this.setDecided(0);
  1002.     this.setActionState('undecided');
  1003. };

  1004. //433
  1005. Alias.GaBa_onTurnEnd = Game_Battler.prototype.onTurnEnd;
  1006. Game_Battler.prototype.onTurnEnd = function() {
  1007.     if ($gameParty.inBattle()) {
  1008.         this.clearResult();
  1009.         //this.regenerateAll();
  1010.         this.updateStateTurns();
  1011.         this.updateBuffTurns();
  1012.         this.removeStatesAuto(2);
  1013.     } else {
  1014.         Alias.GaBa_onTurnEnd.call(this);
  1015.     }
  1016. };

  1017. Game_Battler.prototype.canEscape = function() {
  1018.     return this.atRate() >= BattleManager.needEscapeAt();
  1019. };

  1020. Game_Battler.prototype.escapeFailure = function() {
  1021.     if (this.atRate() === 1 && BattleManager.escapeAtCost() > 0) {
  1022.         this.clearActions();
  1023.     }
  1024.     this.gainAt(-BattleManager.escapeAtCost());
  1025. };

  1026. Game_Battler.prototype.updateATB = function(rate) {
  1027.     if (!this.isAlive()) return;
  1028.     if (this._at < BattleManager.maxAt()) {
  1029.         this._at += (this.agi + MPPlugin.atIncrement) * rate;
  1030.         if(this._at >= BattleManager.maxAt()) {
  1031.             this._at = BattleManager.maxAt();
  1032.             this.makeActions();
  1033.         }
  1034.     } else if (this._ct < this._maxCt) {
  1035.         this._ct = Math.min(this._ct + rate, this._maxCt);
  1036.     }
  1037. };

  1038. Game_Battler.prototype.atGaugeRate = function() {
  1039.     if (MPPlugin.chantingView && this.castRate() >= 0) {
  1040.         return this.castRate();
  1041.     } else {
  1042.         return this.atRate();
  1043.     }
  1044. };

  1045. Game_Battler.prototype.atGaugeColor1 = function() {
  1046.     var color = this.atGaugeColorEx1();
  1047.     if (color) return color;
  1048.     return (this.atRate() < 1 ? MPPlugin.atChargeColor1 : MPPlugin.atMaxColor1);
  1049. };

  1050. Game_Battler.prototype.atGaugeColor2 = function() {
  1051.     var color = this.atGaugeColorEx2();
  1052.     if (color) return color;
  1053.     return (this.atRate() < 1 ? MPPlugin.atChargeColor2 : MPPlugin.atMaxColor2);
  1054. };

  1055. Game_Battler.prototype.atGaugeColorEx1 = function() {
  1056.     if (MPPlugin.chantingView && this.castRate() >= 0) {
  1057.         return MPPlugin.atChantingColor1;
  1058.     } else if (MPPlugin.EscapingChange && this.isActor() &&
  1059.             BattleManager.isEscaping() && this.isAlive()) {
  1060.         return MPPlugin.atEscapingColor1;
  1061.     }
  1062.     return null;
  1063. };

  1064. Game_Battler.prototype.atGaugeColorEx2 = function() {
  1065.     if (MPPlugin.chantingView && this.castRate() >= 0) {
  1066.         return MPPlugin.atChantingColor2;
  1067.     } else if (MPPlugin.EscapingChange && this.isActor() &&
  1068.             BattleManager.isEscaping() && this.isAlive()) {
  1069.         return MPPlugin.atEscapingColor2;
  1070.     }
  1071.     return null;
  1072. };

  1073. //-----------------------------------------------------------------------------
  1074. // Game_Actor

  1075. if (Game_Actor.prototype.hasOwnProperty('onRestrict')) {
  1076.     Alias.GaAc_onRestrict = Game_Actor.prototype.onRestrict;
  1077. }
  1078. Game_Actor.prototype.onRestrict = function() {
  1079.     if (Alias.GaAc_onRestrict) {
  1080.         Alias.GaAc_onRestrict.call(this);
  1081.     } else {
  1082.         Game_Battler.prototype.onRestrict.call(this);
  1083.     }
  1084.     if ($gameParty.inBattle() && !this._active && this.isAlive() &&
  1085.             this._at === BattleManager.maxAt()) {
  1086.         this.makeActions();
  1087.     }
  1088. };

  1089. //689
  1090. Alias.GaAc_performVictory = Game_Actor.prototype.performVictory;
  1091. Game_Actor.prototype.performVictory = function() {
  1092.     Alias.GaAc_performVictory.call(this);
  1093.     this.setDecided(0);
  1094. };

  1095. //714
  1096. Alias.GaAc_makeAutoBattleActions = Game_Actor.prototype.makeAutoBattleActions;
  1097. Game_Actor.prototype.makeAutoBattleActions = function() {
  1098.     Alias.GaAc_makeAutoBattleActions.call(this);
  1099.     this.onMadeAction();
  1100. };

  1101. //729
  1102. Alias.GaAc_makeConfusionActions = Game_Actor.prototype.makeConfusionActions;
  1103. Game_Actor.prototype.makeConfusionActions = function() {
  1104.     Alias.GaAc_makeConfusionActions.call(this);
  1105.     this.onMadeAction();
  1106. };

  1107. //736
  1108. Alias.GaAc_makeActions = Game_Actor.prototype.makeActions;
  1109. Game_Actor.prototype.makeActions = function() {
  1110.     Alias.GaAc_makeActions.call(this);
  1111.     if (!this.canInput()) this.onMadeAction();
  1112. };

  1113. //-----------------------------------------------------------------------------
  1114. // Game_Enemy

  1115. //214
  1116. Game_Enemy.prototype.meetsTurnCondition = function(param1, param2) {
  1117.     var n = this._turnCount;
  1118.     if (param2 === 0) {
  1119.         return n === param1;
  1120.     } else {
  1121.         return n >= param1 && n % param2 === param1 % param2;
  1122.     }
  1123. };

  1124. //278
  1125. Alias.GaEn_makeActions = Game_Enemy.prototype.makeActions;
  1126. Game_Enemy.prototype.makeActions = function() {
  1127.     Alias.GaEn_makeActions.call(this);
  1128.     this.onMadeAction();
  1129. };

  1130. //-----------------------------------------------------------------------------
  1131. // Game_Unit

  1132. Game_Unit.prototype.selectAll = function() {
  1133.     this.members().forEach(function(member) {
  1134.         member.select();
  1135.     });
  1136. };

  1137. Game_Unit.prototype.select = function(activeMember) {
  1138.     this.members().forEach(function(member) {
  1139.         if (member === activeMember) {
  1140.             member.select();
  1141.         } else {
  1142.             member.deselect();
  1143.         }
  1144.     });
  1145. };


  1146. //-----------------------------------------------------------------------------
  1147. // Game_Party

  1148. Game_Party.prototype.canEscape = function() {
  1149.     return this.aliveMembers().every(function(member) {
  1150.         return member.canEscape();
  1151.     });
  1152. };

  1153. Game_Party.prototype.escapeFailure = function() {
  1154.     this.aliveMembers().forEach(function(member) {
  1155.         member.escapeFailure();
  1156.     });
  1157.     BattleManager.deleteDeactiveBattler();
  1158. };

  1159. //179
  1160. Alias.GaPa_addActor = Game_Party.prototype.addActor;
  1161. Game_Party.prototype.addActor = function(actorId) {
  1162.     Alias.GaPa_addActor.call(this, actorId);
  1163.     if (this.inBattle())
  1164.         BattleManager.refreshStatus();
  1165. };

  1166. //187
  1167. Alias.GaPa_removeActor = Game_Party.prototype.removeActor;
  1168. Game_Party.prototype.removeActor = function(actorId) {
  1169.     Alias.GaPa_removeActor.call(this, actorId);
  1170.     if (this.inBattle())
  1171.         BattleManager.refreshStatus();
  1172. };

  1173. //-----------------------------------------------------------------------------
  1174. // Game_Troop

  1175. if (!MPPlugin.contains['ComBat']) {

  1176. //152
  1177. Alias.GaTr_setupBattleEvent = Game_Troop.prototype.setupBattleEvent;
  1178. Game_Troop.prototype.setupBattleEvent = function() {
  1179.     var lastRunning = this._interpreter.isRunning();
  1180.     Alias.GaTr_setupBattleEvent.call(this);
  1181.     if (!lastRunning && this._interpreter.isRunning()) {
  1182.         BattleManager.setEscaping(false);
  1183.     }
  1184. };

  1185. }// if (!MPPlugin.contains['ComBat'])

  1186. //-----------------------------------------------------------------------------
  1187. // Window_BattleLog

  1188. //121
  1189. Alias.WiBaLo_isFastForward = Window_BattleLog.prototype.isFastForward;
  1190. Window_BattleLog.prototype.isFastForward = function() {
  1191.     return (MPPlugin.fastLogEneble && Alias.WiBaLo_isFastForward.call(this));
  1192. };

  1193. //-----------------------------------------------------------------------------
  1194. // Window_PartyCommand

  1195. //28
  1196. Alias.WiPaCo_makeCommandList = Window_PartyCommand.prototype.makeCommandList;
  1197. Window_PartyCommand.prototype.makeCommandList = function() {
  1198.     Alias.WiPaCo_makeCommandList.call(this);
  1199.     if (MPPlugin.ChangeModeInBattle) {
  1200.         var mode = BattleManager.atbMode();
  1201.         var name = "[" + MPPlugin.atbModeTexts[mode] + "]";
  1202.         this.addCommand(name, 'atbMode');
  1203.     }
  1204. };

  1205. //-----------------------------------------------------------------------------
  1206. // Window_BattleStatus

  1207. Window_BattleStatus.prototype.setActorCmdWindow = function(actorCmdWindow) {
  1208.     this._actorCmdWindow = actorCmdWindow;
  1209. };

  1210. Window_BattleStatus.prototype.isActorCmdEnabled = function() {
  1211.     return this._actorCmdWindow &&
  1212.             (this._actorCmdWindow.active || !this._actorCmdWindow.isOpen());
  1213. };

  1214. Window_BattleStatus.prototype.processHandling = function() {
  1215.     if (this.isOpen() && this.isActorCmdEnabled()) {
  1216.         if (this.isHandled('pagedown') && Input.isTriggered('pagedown')) {
  1217.             this.processPagedown();
  1218.         } else if (this.isHandled('pageup') && Input.isTriggered('pageup')) {
  1219.             this.processPageup();
  1220.         }
  1221.     }
  1222. };

  1223. Window_BattleStatus.prototype.processTouch = function() {
  1224.     if (this.isOpen() && this.isActorCmdEnabled()) {
  1225.         if (TouchInput.isTriggered() && this.isTouchedInsideFrame()) {
  1226.             this._touching = true;
  1227.             this.updateInputData();
  1228.         }
  1229.         if (this._touching) {
  1230.             if (TouchInput.isPressed()) {
  1231.                 this.onTouch(false);
  1232.             } else {
  1233.                 if (this.isTouchedInsideFrame()) {
  1234.                     this.onTouch(true);
  1235.                 }
  1236.                 this._touching = false;
  1237.             }
  1238.         }
  1239.     }
  1240. };

  1241. Window_BattleStatus.prototype.onTouch = function(triggered) {
  1242.     var lastTopRow = this.topRow();
  1243.     var x = this.canvasToLocalX(TouchInput.x);
  1244.     var y = this.canvasToLocalY(TouchInput.y);
  1245.     var hitIndex = this.hitTest(x, y);
  1246.     if (hitIndex >= 0) {
  1247.         if (triggered && this.isTouchOkEnabled()) {
  1248.             var actor = $gameParty.battleMembers()[hitIndex];
  1249.             if (actor && actor.isStandby()) {
  1250.                 this.select(hitIndex);
  1251.                 this.processOk();
  1252.             }
  1253.         }
  1254.     } else if (this._stayCount >= 10) {
  1255.         if (y < this.padding) {
  1256.             this.scrollUp();
  1257.         } else if (y >= this.height - this.padding) {
  1258.             this.scrollDown();
  1259.         }
  1260.     }
  1261.     if (this.topRow() !== lastTopRow) {
  1262.         SoundManager.playCursor();
  1263.     }
  1264. };

  1265. Window_BattleStatus.prototype.processOk = function() {
  1266.     this.updateInputData();
  1267.     this.deactivate();
  1268.     this.callOkHandler();
  1269. };

  1270. Window_BattleStatus.prototype.processPageup = function() {
  1271.     this.updateInputData();
  1272.     this.deactivate();
  1273.     this.callHandler('pageup');
  1274. };

  1275. Window_BattleStatus.prototype.processPagedown = function() {
  1276.     this.updateInputData();
  1277.     this.deactivate();
  1278.     this.callHandler('pagedown');
  1279. };

  1280. Window_BattleStatus.prototype.isCursorMovable = function() {
  1281.     return false;
  1282. };

  1283. Window_BattleStatus.prototype.isDrawAt = function() {
  1284.     return MPPlugin.atGaugeWidth > 0;
  1285. };

  1286. //39
  1287. Alias.WiBaSt_refresh = Window_BattleStatus.prototype.refresh;
  1288. Window_BattleStatus.prototype.refresh = function() {
  1289.     this.clearUpdateDrawer();
  1290.     Alias.WiBaSt_refresh.call(this);
  1291. };

  1292. //63
  1293. Alias.WiBaSt_gaugeAreaWidth = Window_BattleStatus.prototype.gaugeAreaWidth;
  1294. Window_BattleStatus.prototype.gaugeAreaWidth = function() {
  1295.     if (this.isDrawAt()) {
  1296.         return 234 + MPPlugin.atGaugeWidth;
  1297.     } else {
  1298.         return Alias.WiBaSt_gaugeAreaWidth.call(this);
  1299.     }
  1300. };

  1301. //80
  1302. Alias.WiBaSt_drawGaugeAreaWithTp = Window_BattleStatus.prototype.drawGaugeAreaWithTp;
  1303. Window_BattleStatus.prototype.drawGaugeAreaWithTp = function(rect, actor) {
  1304.     if (this.isDrawAt()) {
  1305.         this.drawActorHp(actor, rect.x + 0, rect.y, 108);
  1306.         this.drawActorMpTp(actor, rect.x + 123, rect.y, 96);
  1307.         this.drawActorAt(actor, rect.x + 234, rect.y, MPPlugin.atGaugeWidth);
  1308.     } else {
  1309.         Alias.WiBaSt_drawGaugeAreaWithTp.call(this, rect, actor);
  1310.     }
  1311. };

  1312. //86
  1313. Alias.WiBaSt_drawGaugeAreaWithoutTp = Window_BattleStatus.prototype.drawGaugeAreaWithoutTp;
  1314. Window_BattleStatus.prototype.drawGaugeAreaWithoutTp = function(rect, actor) {
  1315.     if (this.isDrawAt()) {
  1316.         this.drawActorHp(actor, rect.x + 0, rect.y, 108);
  1317.         this.drawActorMp(actor, rect.x + 123, rect.y, 96);
  1318.         this.drawActorAt(actor, rect.x + 234, rect.y, MPPlugin.atGaugeWidth);
  1319.     } else {
  1320.         Alias.WiBaSt_drawGaugeAreaWithoutTp.call(this, rect, actor);
  1321.     }
  1322. };

  1323. Window_BattleStatus.prototype.drawActorMpTp = function(actor, x, y, width) {
  1324.     width = (width || 186) - 10;
  1325.     this.drawGauge(x + 10, y, width, actor.tpRate(),
  1326.                    this.tpGaugeColor1(), this.tpGaugeColor2());
  1327.     this.drawGauge(x, y - 8, width, actor.mpRate(),
  1328.                    this.mpGaugeColor1(), this.mpGaugeColor2());
  1329.     this.contents.fontSize = 24;
  1330.     this.changeTextColor(this.systemColor());
  1331.     this.contents.drawText(TextManager.mpA, x, y + 1, 32, 24);
  1332.     this.contents.drawText(TextManager.tpA, x + 22, y + 10, 32, 24);
  1333.     this.contents.fontSize = this.standardFontSize();
  1334. };

  1335. Window_BattleStatus.prototype.drawActorAt = function(actor, x, y, width, drawer) {
  1336.     width = width || 60;
  1337.     var color1 = actor.atGaugeColor1();
  1338.     var color2 = actor.atGaugeColor2();
  1339.     this.drawAtGauge(x, y, width, actor.atGaugeRate(), color1, color2);
  1340.     this.changeTextColor(this.systemColor());
  1341.     this.drawText(MPPlugin.atGaugeName, x, y, 44);
  1342.    
  1343.     if (drawer === undefined) drawer = true;
  1344.     if (drawer) {
  1345.         var process = this.actorAtDrawer.bind(this, actor, x, y, width);
  1346.         this.addUpdateDrawer(process);
  1347.     }
  1348. };

  1349. Window_BattleStatus.prototype.drawAtGauge = function(x, y, width, rate, color1, color2) {
  1350.     var height = MPPlugin.atGaugeHeight;
  1351.     var fillW = width * rate;
  1352.     var gaugeY = y + this.lineHeight() - height - 2;
  1353.     this.contents.fillRect(x, gaugeY, width, height, this.gaugeBackColor());
  1354.     this.contents.gradientFillRect(x, gaugeY, fillW, height, color1, color2);
  1355. };

  1356. Window_BattleStatus.prototype.actorAtDrawer = function(actor, x, y, width) {
  1357.     if (Graphics.frameCount % 2 === 0) {
  1358.         this.contents.clearRect(x, y, width, this.lineHeight());
  1359.         this.drawActorAt(actor, x, y, width, false);
  1360.     }
  1361.     return true;
  1362. };

  1363. //-----------------------------------------------------------------------------
  1364. // Window_BattleActor

  1365. Window_BattleActor.prototype.processHandling = function() {
  1366.     Window_Selectable.prototype.processHandling.call(this);
  1367. };

  1368. Window_BattleActor.prototype.processTouch = function() {
  1369.     Window_Selectable.prototype.processTouch.call(this);
  1370. };

  1371. Window_BattleActor.prototype.onTouch = function(triggered) {
  1372.     Window_Selectable.prototype.onTouch.call(this, triggered);
  1373. };

  1374. Window_BattleActor.prototype.processOk = function() {
  1375.     Window_Selectable.prototype.processOk.call(this);
  1376. };

  1377. Window_BattleActor.prototype.isCursorMovable = function() {
  1378.     return Window_Selectable.prototype.isCursorMovable.call(this);
  1379. };

  1380. Window_BattleActor.prototype.isDrawAt = function() {
  1381.     return false;
  1382. };

  1383. Window_BattleActor.prototype.selectForItem = function() {
  1384.     var actor = BattleManager.actor();
  1385.     var action = actor.inputtingAction();
  1386.     this.setCursorFixed(false);
  1387.     this.setCursorAll(false);
  1388.     if (action.isForUser()) {
  1389.         this.setCursorFixed(true);
  1390.         this.select(actor.index());
  1391.     } else if (action.isForAll()) {
  1392.         this.setCursorAll(true);
  1393.         this.select(0);
  1394.     } else {
  1395.         this.select(actor.index());
  1396.     }
  1397. };

  1398. //31
  1399. Alias.WiBaAc_select = Window_BattleActor.prototype.select;
  1400. Window_BattleActor.prototype.select = function(index) {
  1401.     Alias.WiBaAc_select.call(this, index);
  1402.     if (this._cursorAll) $gameParty.selectAll();
  1403. };

  1404. if (Window_BattleActor.prototype.hasOwnProperty('hitTest')) {
  1405.     Alias.WiBaAc_hitTest = Window_BattleActor.prototype.hitTest;
  1406. }
  1407. Window_BattleActor.prototype.hitTest = function(x, y) {
  1408.     var _super = Alias.WiBaAc_hitTest || Window_BattleStatus.prototype.hitTest;
  1409.     var result = _super.apply(this, arguments);
  1410.     if (result >= 0 && this._cursorAll && this.isContentsArea(x, y)) {
  1411.         return 0;
  1412.     }
  1413.     return result;
  1414. };

  1415. //-----------------------------------------------------------------------------
  1416. // Window_BattleEnemy

  1417. Window_BattleEnemy.prototype.isCurrentItemEnabled = function() {
  1418.     return !!this.enemy();
  1419. };

  1420. //58
  1421. Window_BattleEnemy.prototype.show = function() {
  1422.     //this.refresh();
  1423.     //this.select(0);
  1424.     Window_Selectable.prototype.show.call(this);
  1425. };

  1426. Window_BattleEnemy.prototype.selectForItem = function() {
  1427.     var actor = BattleManager.actor();
  1428.     var action = actor.inputtingAction();
  1429.     this.setCursorAll(false);
  1430.     if (action.isForAll())
  1431.         this.setCursorAll(true);
  1432.     this.select(0);
  1433. };

  1434. if (Window_BattleEnemy.prototype.hasOwnProperty('hitTest')) {
  1435.     Alias.WiBaEn_hitTest = Window_BattleEnemy.prototype.hitTest;
  1436. }
  1437. Window_BattleEnemy.prototype.hitTest = function(x, y) {
  1438.     var _super = Alias.WiBaEn_hitTest || Window_Selectable.prototype.hitTest;
  1439.     var result = _super.apply(this, arguments);
  1440.     if (result >= 0 && this._cursorAll && this.isContentsArea(x, y)) {
  1441.         return 0;
  1442.     }
  1443.     return result;
  1444. };

  1445. //69
  1446. Alias.WiBaEn_refresh = Window_BattleEnemy.prototype.refresh;
  1447. Window_BattleEnemy.prototype.refresh = function() {
  1448.     Alias.WiBaEn_refresh.call(this);
  1449.     if (this.index() >= 0)
  1450.         this.select(this._index.clamp(0, this.maxItems() - 1));
  1451. };

  1452. //74
  1453. Alias.WiBaEn_select = Window_BattleEnemy.prototype.select;
  1454. Window_BattleEnemy.prototype.select = function(index) {
  1455.     Alias.WiBaEn_select.call(this, index);
  1456.     if (this._cursorAll) $gameTroop.selectAll();
  1457. };


  1458. //-----------------------------------------------------------------------------
  1459. // Window_BattleSkill

  1460. Window_BattleSkill.prototype.setStatusWindow = function(statusWindow) {
  1461.     this._statusWindow = statusWindow;
  1462. };

  1463. Window_BattleSkill.prototype.setActor = function(actor) {
  1464.     Window_SkillList.prototype.setActor.call(this, actor);
  1465.     if (this._statusWindow)
  1466.         this._statusWindow.setActor(actor);
  1467. };

  1468. //18
  1469. Alias.WiBaSk_show = Window_BattleSkill.prototype.show;
  1470. Window_BattleSkill.prototype.show = function() {
  1471.     if (this._statusWindow)
  1472.         this._statusWindow.show();
  1473.     Alias.WiBaSk_show.call(this);
  1474. };

  1475. //24
  1476. Alias.WiBaSk_hide = Window_BattleSkill.prototype.hide;
  1477. Window_BattleSkill.prototype.hide = function() {
  1478.     if (this._statusWindow)
  1479.         this._statusWindow.hide();
  1480.     Alias.WiBaSk_hide.call(this);
  1481. };

  1482. //-----------------------------------------------------------------------------
  1483. // Window_AtbSkillStatus

  1484. Window_AtbSkillStatus.prototype = Object.create(Window_Base.prototype);
  1485. Window_AtbSkillStatus.prototype.constructor = Window_AtbSkillStatus;

  1486. Window_AtbSkillStatus.prototype.initialize = function(x, y, width, height) {
  1487.     Window_Base.prototype.initialize.call(this, x, y, width, height);
  1488.     this.hide();
  1489. };

  1490. Window_AtbSkillStatus.prototype.setActor = function(actor) {
  1491.     if (this._actor !== actor) {
  1492.         this._actor = actor;
  1493.         this.refresh();
  1494.     }
  1495. };

  1496. Window_AtbSkillStatus.prototype.refresh = function() {
  1497.     this.contents.clear();
  1498.     if (this._actor) {
  1499.         var y = 0;
  1500.         var height = this.lineHeight();
  1501.         if (MPPlugin.SkillWindowHpDraw) {
  1502.             this.drawActorHp(this._actor, 0, 0, this.contentsWidth());
  1503.             y += height;
  1504.         }
  1505.         if ($dataSystem.optDisplayTp) {
  1506.             this.drawActorMp(this._actor, 0, y, this.contentsWidth());
  1507.             this.drawActorTp(this._actor, 0, y + height, this.contentsWidth());
  1508.         } else {
  1509.             this.drawActorMp(this._actor, 0, y, this.contentsWidth());
  1510.         }
  1511.     }
  1512. };

  1513. //-----------------------------------------------------------------------------
  1514. // Sprite_Actor

  1515. //141
  1516. Alias.SpAc_updateTargetPosition = Sprite_Actor.prototype.updateTargetPosition;
  1517. Sprite_Actor.prototype.updateTargetPosition = function() {
  1518.     if (MPPlugin.inputStepForward || !this._actor.isInputting()) {
  1519.         Alias.SpAc_updateTargetPosition.call(this);
  1520.     }
  1521. };

  1522. //208
  1523. Alias.SpAc_refreshMotion = Sprite_Actor.prototype.refreshMotion;
  1524. Sprite_Actor.prototype.refreshMotion = function() {
  1525.     if (MPPlugin.escapeAnime) {
  1526.         var actor = this._actor;
  1527.         if (BattleManager.isEscaping() && actor && !actor.isActing() &&
  1528.             actor.stateMotionIndex() < 2) {
  1529.             return this.startMotion('escape');
  1530.         }
  1531.     }
  1532.     Alias.SpAc_refreshMotion.call(this);
  1533. };

  1534. //-----------------------------------------------------------------------------
  1535. // Scene_Battle

  1536. //22
  1537. Alias.ScBa_start = Scene_Battle.prototype.start;
  1538. Scene_Battle.prototype.start = function() {
  1539.     BattleManager._refreshHandler = this.refreshStatus.bind(this);
  1540.     BattleManager._waitHandler = this.isAtbWait.bind(this);
  1541.     Alias.ScBa_start.call(this);
  1542. };

  1543. Scene_Battle.prototype.isAtbWait = function() {
  1544.     if (!this._partyCommandWindow.isClosed()) return true;
  1545.     var mode = BattleManager.atbMode();
  1546.     if (mode === "wait") {
  1547.         if (this._skillWindow.visible || this._itemWindow.visible ||
  1548.                 this._actorWindow.visible || this._enemyWindow.visible) {
  1549.             return true;
  1550.         }
  1551.     } else if (mode === "stop") {
  1552.         if (!!this._actor && (!MPPlugin.ModeStopFastEneble ||
  1553.                 !BattleManager.isFastForward())) {
  1554.             return true;
  1555.         }
  1556.     }
  1557.     return false;
  1558. };

  1559. //41
  1560. Scene_Battle.prototype.updateBattleProcess = function() {
  1561.     //if (!this.isAnyInputWindowActive() || BattleManager.isAborting() ||
  1562.     //        BattleManager.isBattleEnd()) {
  1563.         BattleManager.update();
  1564.         this.changeInputWindow();
  1565.     //}
  1566. };

  1567. //58
  1568. Scene_Battle.prototype.changeInputWindow = function() {
  1569.     if (!this._partyCommandWindow.isClosed() ||
  1570.             this._actorCommandWindow.isClosing()) {
  1571.         return;
  1572.     } else if (this._actor !== BattleManager.actor()) {
  1573.         if (MPPlugin.FastCancelByInput)
  1574.             BattleManager._atbFast = false;
  1575.         this._actor = BattleManager.actor();
  1576.         if (this._actor) {
  1577.             this._actorCommandWindow.openness = 0;
  1578.             this.startActorCommandSelection();
  1579.         } else {
  1580.             this.endCommandSelection();
  1581.         }
  1582.     } else if (!this._actor && !BattleManager.isBattleEnd()) {
  1583.         if (Input.isTriggered('cancel') || TouchInput.isCancelled()) {
  1584.             SoundManager.playCancel();
  1585.             this.startPartyCommandSelection();
  1586.         }
  1587.     }
  1588. };

  1589. //82
  1590. Alias.ScBa_terminate = Scene_Battle.prototype.terminate;
  1591. Scene_Battle.prototype.terminate = function() {
  1592.     Alias.ScBa_terminate.call(this);
  1593.     if (this._changeAtbMode) ConfigManager.save();
  1594. };

  1595. //106
  1596. Scene_Battle.prototype.updateWindowPositions = function() {
  1597.     var statusX = 0;
  1598.     if (!this._partyCommandWindow.isClosed() || !this._actorCommandWindow.isClosed()) {
  1599.         statusX = this._partyCommandWindow.width;
  1600.     } else {
  1601.         statusX = this._partyCommandWindow.width * MPPlugin.stWindowPos / 2;
  1602.     }
  1603.     if (this._statusWindow.x < statusX) {
  1604.         this._statusWindow.x += 16;
  1605.         if (this._statusWindow.x > statusX) {
  1606.             this._statusWindow.x = statusX;
  1607.         }
  1608.     }
  1609.     if (this._statusWindow.x > statusX) {
  1610.         this._statusWindow.x -= 16;
  1611.         if (this._statusWindow.x < statusX) {
  1612.             this._statusWindow.x = statusX;
  1613.         }
  1614.     }
  1615. };

  1616. //161
  1617. Alias.ScBa_createStatusWindow = Scene_Battle.prototype.createStatusWindow;
  1618. Scene_Battle.prototype.createStatusWindow = function() {
  1619.     Alias.ScBa_createStatusWindow.call(this);
  1620.     this._statusWindow.setHandler('ok',  this.onStatusOk.bind(this));
  1621.     this._statusWindow.setHandler('pageup', this.selectPreviousCommand.bind(this));
  1622.     this._statusWindow.setHandler('pagedown', this.selectNextCommand.bind(this));
  1623. };

  1624. //166
  1625. Alias.ScBa_createPartyCommandWindow = Scene_Battle.prototype.createPartyCommandWindow;
  1626. Scene_Battle.prototype.createPartyCommandWindow = function() {
  1627.     Alias.ScBa_createPartyCommandWindow.call(this);
  1628.     this._partyCommandWindow.setHandler('atbMode', this.onAtbMode.bind(this));
  1629.     this._partyCommandWindow.setHandler('cancel', this.onPartyCancel.bind(this));
  1630. };

  1631. //174
  1632. Alias.ScBa_createActorCommandWindow = Scene_Battle.prototype.createActorCommandWindow;
  1633. Scene_Battle.prototype.createActorCommandWindow = function() {
  1634.     Alias.ScBa_createActorCommandWindow.call(this);
  1635.     this._actorCommandWindow.setHandler('cancel', this.startPartyCommandSelection.bind(this));
  1636.     this._statusWindow.setActorCmdWindow(this._actorCommandWindow);
  1637. };

  1638. //184
  1639. Scene_Battle.prototype.createHelpWindow = function() {
  1640.     if (MPPlugin.helpWindowPos >= 0) {
  1641.         this._helpWindow = new Window_Help(MPPlugin.helpWindowRow);
  1642.         this._helpWindow.visible = false;
  1643.         if (MPPlugin.helpWindowPos === 1) {
  1644.             this._helpWindow.y = this._statusWindow.y - this._helpWindow.height;
  1645.         }
  1646.         this.addWindow(this._helpWindow);
  1647.     }
  1648. };

  1649. //190
  1650. Scene_Battle.prototype.createSkillWindow = function() {
  1651.     var wy = this._statusWindow.y;
  1652.     var ww = Graphics.boxWidth - 144
  1653.     var wh = this._statusWindow.height;
  1654.     this._skillWindow = new Window_BattleSkill(0, wy, ww, wh);
  1655.     this._skillWindow.setHelpWindow(this._helpWindow);
  1656.     this._skillWindow.setHandler('ok',     this.onSkillOk.bind(this));
  1657.     this._skillWindow.setHandler('cancel', this.onSkillCancel.bind(this));
  1658.     this.addWindow(this._skillWindow);

  1659.     this._skillStatusWindow = new Window_AtbSkillStatus(ww, wy, 144, wh);
  1660.     this.addWindow(this._skillStatusWindow);
  1661.     this._skillWindow.setStatusWindow(this._skillStatusWindow);
  1662. };

  1663. //200
  1664. Scene_Battle.prototype.createItemWindow = function() {
  1665.     var wy = this._statusWindow.y;
  1666.     var wh = this._statusWindow.height;
  1667.     this._itemWindow = new Window_BattleItem(0, wy, Graphics.boxWidth, wh);
  1668.     this._itemWindow.setHelpWindow(this._helpWindow);
  1669.     this._itemWindow.setHandler('ok',     this.onItemOk.bind(this));
  1670.     this._itemWindow.setHandler('cancel', this.onItemCancel.bind(this));
  1671.     this.addWindow(this._itemWindow);
  1672. };

  1673. //210
  1674. Alias.ScBa_createActorWindow = Scene_Battle.prototype.createActorWindow;
  1675. Scene_Battle.prototype.createActorWindow = function() {
  1676.     Alias.ScBa_createActorWindow.call(this);
  1677.     this._actorWindow.x = Graphics.boxWidth - this._actorWindow.width;
  1678. };

  1679. //238
  1680. Alias.ScBa_refreshStatus = Scene_Battle.prototype.refreshStatus;
  1681. Scene_Battle.prototype.refreshStatus = function() {
  1682.     Alias.ScBa_refreshStatus.call(this);
  1683.     this._actorCommandWindow.refresh();
  1684.     if (this._skillWindow.visible) this._skillWindow.refresh();
  1685.     if (this._skillStatusWindow.visible) this._skillStatusWindow.refresh();
  1686.     if (this._itemWindow.visible)  this._itemWindow.refresh();
  1687.     if (this._actorWindow.visible) this._actorWindow.refresh();
  1688.     if (this._enemyWindow.visible) this._enemyWindow.refresh();
  1689. };

  1690. //242
  1691. Alias.ScBa_startPartyCommandSelection = Scene_Battle.prototype.startPartyCommandSelection;
  1692. Scene_Battle.prototype.startPartyCommandSelection = function() {
  1693.     Alias.ScBa_startPartyCommandSelection.call(this);
  1694.     this._actor = null;
  1695. };

  1696. //250
  1697. Scene_Battle.prototype.commandFight = function() {
  1698.     BattleManager.setEscaping(false);
  1699.     this._partyCommandWindow.close();
  1700. };

  1701. //254
  1702. Scene_Battle.prototype.commandEscape = function() {
  1703.     BattleManager.setEscaping(true);
  1704.     this._partyCommandWindow.close();
  1705. };

  1706. Scene_Battle.prototype.onAtbMode = function() {
  1707.     var status = MPPlugin.atbModeStatus;
  1708.     var value = ConfigManager.atbMode;
  1709.     ConfigManager.atbMode = (value + 1) % status.length;
  1710.     this._changeAtbMode = true;
  1711.     this._partyCommandWindow.refresh();
  1712.     this._partyCommandWindow.activate();
  1713. };

  1714. Scene_Battle.prototype.onPartyCancel = function() {
  1715.     this._partyCommandWindow.close();
  1716. };

  1717. //259
  1718. Alias.ScBa_startActorCommandSelection = Scene_Battle.prototype.startActorCommandSelection;
  1719. Scene_Battle.prototype.startActorCommandSelection = function() {
  1720.     AudioManager.playStaticSe(MPPlugin.ActiveSE);
  1721.     Alias.ScBa_startActorCommandSelection.call(this);
  1722.     this._skillWindow.deactivate();
  1723.     this._skillWindow.hide();
  1724.     this._itemWindow.deactivate();
  1725.     this._itemWindow.hide();
  1726.     this._actorWindow.deactivate();
  1727.     this._actorWindow.hide();
  1728.     this._enemyWindow.deactivate();
  1729.     this._enemyWindow.hide();
  1730. };

  1731. //278
  1732. Alias.ScBa_commandGuard = Scene_Battle.prototype.commandGuard;
  1733. Scene_Battle.prototype.commandGuard = function() {
  1734.     BattleManager.inputtingAction().setGuard();
  1735.     BattleManager.actor().onMadeAction();
  1736.     Alias.ScBa_commandGuard.call(this);
  1737. };

  1738. Scene_Battle.prototype.onStatusOk = function() {
  1739.     BattleManager.changeActor(this._statusWindow.index(), 'undecided');
  1740.     this.changeInputWindow();
  1741. };

  1742. //299
  1743. Alias.ScBa_selectActorSelection = Scene_Battle.prototype.selectActorSelection;
  1744. Scene_Battle.prototype.selectActorSelection = function() {
  1745.     Alias.ScBa_selectActorSelection.call(this);
  1746.     this._actorWindow.selectForItem();
  1747. };

  1748. //305
  1749. Alias.ScBa_onActorOk = Scene_Battle.prototype.onActorOk;
  1750. Scene_Battle.prototype.onActorOk = function() {
  1751.     BattleManager.actor().onMadeAction();
  1752.     Alias.ScBa_onActorOk.call(this);
  1753. };

  1754. //328
  1755. Alias.ScBa_selectEnemySelection = Scene_Battle.prototype.selectEnemySelection;
  1756. Scene_Battle.prototype.selectEnemySelection = function() {
  1757.     Alias.ScBa_selectEnemySelection.call(this);
  1758.     this._enemyWindow.selectForItem();
  1759. };

  1760. //335
  1761. Alias.ScBa_onEnemyOk = Scene_Battle.prototype.onEnemyOk;
  1762. Scene_Battle.prototype.onEnemyOk = function() {
  1763.     BattleManager.actor().onMadeAction();
  1764.     Alias.ScBa_onEnemyOk.call(this);
  1765. };

  1766. //387
  1767. Scene_Battle.prototype.onSelectAction = function() {
  1768.     var action = BattleManager.inputtingAction();
  1769.     //this._skillWindow.hide();
  1770.     //this._itemWindow.hide();
  1771.     if (action.isForOpponent()) {
  1772.         this.selectEnemySelection();
  1773.     } else {
  1774.         this.selectActorSelection();
  1775.     }
  1776. };

  1777. //400
  1778. Alias.ScBa_endCommandSelection = Scene_Battle.prototype.endCommandSelection;
  1779. Scene_Battle.prototype.endCommandSelection = function() {
  1780.     this._actor = null;
  1781.     Alias.ScBa_endCommandSelection.call(this);
  1782.     this._skillWindow.deactivate();
  1783.     this._skillWindow.hide();
  1784.     this._itemWindow.deactivate();
  1785.     this._itemWindow.hide();
  1786.     this._actorWindow.deactivate();
  1787.     this._actorWindow.hide();
  1788.     this._enemyWindow.deactivate();
  1789.     this._enemyWindow.hide();
  1790. };


  1791. })();


  1792. //=============================================================================
  1793. // UpdateDrawer
  1794. //=============================================================================

  1795. (function() {

  1796. if (!Window_Base.MPP_UpdateDrawer) {

  1797. var Alias = {};

  1798. //-----------------------------------------------------------------------------
  1799. // Window_Base

  1800. //13
  1801. Alias.WiBa_initialize = Window_Base.prototype.initialize;
  1802. Window_Base.prototype.initialize = function(x, y, width, height) {
  1803.     Alias.WiBa_initialize.apply(this, arguments);
  1804.     this._updateDrawers = [];
  1805. };

  1806. //105
  1807. Alias.WiBa_update = Window_Base.prototype.update;
  1808. Window_Base.prototype.update = function() {
  1809.     Alias.WiBa_update.apply(this, arguments);
  1810.     this.updateDrawer();
  1811. };

  1812. Window_Base.prototype.updateDrawer = function() {
  1813.     if (this.isOpen() && this.visible && this._updateDrawers.length > 0) {
  1814.         this._updateDrawers = this._updateDrawers.filter(function(process) {
  1815.             return process();
  1816.         });
  1817.     }
  1818. };

  1819. Window_Base.prototype.addUpdateDrawer = function(process) {
  1820.     this._updateDrawers.push(process);
  1821. };

  1822. Window_Base.prototype.clearUpdateDrawer = function() {
  1823.     this._updateDrawers = [];
  1824. };

  1825. Window_Base.MPP_UpdateDrawer = 1;
  1826. } //if (!Window_Base.MPP_UpdateDrawer || Window_Base.MPP_UpdateDrawer < 1.0)


  1827. })();
复制代码



附加功能

    ATステート
    ATゲージ色変更
    逃走ボタン
    タイムライン
    ATゲージ
    クールダウン
回复

使用道具 举报

梦石
0
星屑
81
在线时间
33 小时
注册时间
2009-5-7
回帖
20
 楼主| 发表于 2018-6-15 00:01:41 | 显示全部楼层
tseyik 发表于 2018-6-13 13:26
http://woodpenguin.web.fc2.com/MV_Plugin/ActiveTimeBattle.html
アクティブタイムバトル

谢谢大佬,这两天上班忙没看见,明天研究一下…
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部