Zarsla

Enhanced MP

Aug 2nd, 2017
92
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // Yanfly Engine Plugins - Enhanced MP
  3. // YEP_EnhancedMP.js
  4. //=============================================================================
  5.  
  6. var Imported = Imported || {};
  7. Imported.YEP_EnhancedMP = true;
  8.  
  9. var Yanfly = Yanfly || {};
  10. Yanfly.EMP = Yanfly.EMP || {};
  11. Yanfly.EMP.version = 1.0;
  12.  
  13. //=============================================================================
  14. /*:
  15. * @plugindesc v1.00 Gives you more control over how MP is handled in
  16. * your game in addition to letting players switch MP modes.
  17. * @author Yanfly Engine Plugins
  18. *
  19. * @param ---General---
  20. * @default
  21. *
  22. * @param Command Name
  23. * @desc This is the command name shown in the skill menu.
  24. * @default MP Mode
  25. *
  26. * @param Show Command
  27. * @desc Show the MP Mode command by default?
  28. * NO - false YES - true
  29. * @default true
  30. *
  31. * @param Enable Command
  32. * @desc Enable the MP Mode command by default?
  33. * NO - false YES - true
  34. * @default true
  35. *
  36. * @param Change Reset
  37. * @desc Reset MP to 0 whenever the MP mode is changed?
  38. * NO - false YES - true
  39. * @default true
  40. *
  41. * @param Equipped Color
  42. * @desc This is the text color used for the equipped MP mode.
  43. * @default 17
  44. *
  45. * @param Default Mode
  46. * @desc This is the default mode everybody starts with unless
  47. * changed through notetags.
  48. * @default 1
  49. *
  50. * @param Default Unlocks
  51. * @desc These are the MP modes unlocked by default. Separate the
  52. * modes with a space in between.
  53. * @default 1 2 3 4
  54. *
  55. * @param Crisis HP
  56. * @desc This is the rate for what is considered to be low HP.
  57. * @default 0.25
  58. *
  59. * @param Crisis MP
  60. * @desc This is the rate for what is considered to be low MP.
  61. * @default 0.25
  62. *
  63. * @param Dead MP Gain
  64. * @desc Allow dead characters to gain MP from MP modes while dead?
  65. * NO - false YES - true
  66. * @default false
  67. *
  68. * @param ---Mode 1 Settings---
  69. * @default
  70. *
  71. * @param Mode 1 Name
  72. * @desc The name used for this MP mode.
  73. * @default Normal
  74. *
  75. * @param Mode 1 Icon
  76. * @desc The icon used for this MP mode.
  77. * @default 72
  78. *
  79. * @param Mode 1 Help Line 1
  80. * @desc The 1st help description line used for this MP mode.
  81. * @default MP acts like normal.
  82. *
  83. * @param Mode 1 Help Line 2
  84. * @desc The 2nd help description line used for this MP mode.
  85. * @default
  86. *
  87. * @param Mode 1 Max MP
  88. * @desc The formula used to determine the max MP for this mode.
  89. * @default user.mmp
  90. *
  91. * @param Mode 1 Preserve
  92. * @desc true - Carry MP from one battle to the next.
  93. * false - Reset the initial MP count each battle.
  94. * @default true
  95. *
  96. * @param Mode 1 Initial MP
  97. * @desc Formula for much MP is gained at the start of battle.
  98. * @default 0
  99. *
  100. * @param Mode 1 Regen MP
  101. * @desc Formula for how much MP is gained upon regeneration.
  102. * @default user.mmp * user.mrg
  103. *
  104. * @param Mode 1 Take HP DMG
  105. * @desc Formula for how much MP is gained taking HP damage.
  106. * @default 0
  107. *
  108. * @param Mode 1 Deal HP DMG
  109. * @desc Formula for how much MP is gained dealing HP damage.
  110. * @default 0
  111. *
  112. * @param Mode 1 Heal HP DMG
  113. * @desc Formula for how much MP is gained healing HP damage.
  114. * @default 0
  115. *
  116. * @param Mode 1 Ally HP DMG
  117. * @desc Formula for how much MP is gained for ally HP damage.
  118. * @default 0
  119. *
  120. * @param Mode 1 Take MP DMG
  121. * @desc Formula for how much MP is gained taking MP damage.
  122. * @default 0
  123. *
  124. * @param Mode 1 Deal MP DMG
  125. * @desc Formula for how much MP is gained dealing MP damage.
  126. * @default 0
  127. *
  128. * @param Mode 1 Heal MP DMG
  129. * @desc Formula for how much MP is gained healing MP damage.
  130. * @default 0
  131. *
  132. * @param Mode 1 Ally MP DMG
  133. * @desc Formula for how much MP is gained for ally MP damage.
  134. * @default 0
  135. *
  136. * @param Mode 1 Deal State
  137. * @desc Formula MP gained when user inflicts a state on a foe.
  138. * @default 0
  139. *
  140. * @param Mode 1 Gain State
  141. * @desc Formula MP gained when user gains a state from a foe.
  142. * @default 0
  143. *
  144. * @param Mode 1 Kill Ally
  145. * @desc Formula for how much MP is gained when an ally is killed.
  146. * @default 0
  147. *
  148. * @param Mode 1 Kill Enemy
  149. * @desc Formula for how much MP is gained when a foe is killed.
  150. * @default 0
  151. *
  152. * @param Mode 1 Win Battle
  153. * @desc Formula for how much MP is gained when a battle is won.
  154. * @default 0
  155. *
  156. * @param Mode 1 Flee Battle
  157. * @desc Formula for how much MP is gained when a battle is fled.
  158. * @default 0
  159. *
  160. * @param Mode 1 Lose Battle
  161. * @desc Formula for how much MP is gained when a battle is lost.
  162. * @default 0
  163. *
  164. * @param Mode 1 Crisis HP
  165. * @desc Formula for MP gained during the MP regeneration timing
  166. * with crisis amounts of HP.
  167. * @default 0
  168. *
  169. * @param Mode 1 Crisis MP
  170. * @desc Formula for MP gained during the MP regeneration timing
  171. * with crisis amounts of MP.
  172. * @default 0
  173. *
  174. * @param Mode 1 Only Member
  175. * @desc Formula for MP gained during the MP regeneration timing
  176. * as the only ally alive.
  177. * @default 0
  178. *
  179. * @param Mode 1 Evasion
  180. * @desc Formula for how much MP is gained when user evades an attack.
  181. * @default 0
  182. *
  183. * @param ---Mode 2 Settings---
  184. * @default
  185. *
  186. * @param Mode 2 Name
  187. * @desc The name used for this MP mode.
  188. * @default Comrade
  189. *
  190. * @param Mode 2 Icon
  191. * @desc The icon used for this MP mode.
  192. * @default 84
  193. *
  194. * @param Mode 2 Help Line 1
  195. * @desc The 1st help description line used for this MP mode.
  196. * @default Raise MP whenever allies take damage.
  197. *
  198. * @param Mode 2 Help Line 2
  199. * @desc The 2nd help description line used for this MP mode.
  200. * @default
  201. *
  202. * @param Mode 2 Max MP
  203. * @desc The formula used to determine the max MP for this mode.
  204. * @default user.mmp
  205. *
  206. * @param Mode 2 Preserve
  207. * @desc true - Carry MP from one battle to the next.
  208. * false - Reset the initial MP count each battle.
  209. * @default true
  210. *
  211. * @param Mode 2 Initial MP
  212. * @desc Formula for much MP is gained at the start of battle.
  213. * @default 0
  214. *
  215. * @param Mode 2 Regen MP
  216. * @desc Formula for how much MP is gained upon regeneration.
  217. * @default user.mmp * user.mrg
  218. *
  219. * @param Mode 2 Take HP DMG
  220. * @desc Formula for how much MP is gained taking HP damage.
  221. * @default 0
  222. *
  223. * @param Mode 2 Deal HP DMG
  224. * @desc Formula for how much MP is gained dealing HP damage.
  225. * @default 0
  226. *
  227. * @param Mode 2 Heal HP DMG
  228. * @desc Formula for how much MP is gained healing HP damage.
  229. * @default 0
  230. *
  231. * @param Mode 2 Ally HP DMG
  232. * @desc Formula for how much MP is gained for ally HP damage.
  233. * @default 20 * user.mmp
  234. *
  235. * @param Mode 2 Take MP DMG
  236. * @desc Formula for how much MP is gained taking MP damage.
  237. * @default 0
  238. *
  239. * @param Mode 2 Deal MP DMG
  240. * @desc Formula for how much MP is gained dealing MP damage.
  241. * @default 0
  242. *
  243. * @param Mode 2 Heal MP DMG
  244. * @desc Formula for how much MP is gained healing MP damage.
  245. * @default 0
  246. *
  247. * @param Mode 2 Ally MP DMG
  248. * @desc Formula for how much MP is gained for ally MP damage.
  249. * @default 0
  250. *
  251. * @param Mode 2 Deal State
  252. * @desc Formula MP gained when user inflicts a state on a foe.
  253. * @default 0
  254. *
  255. * @param Mode 2 Gain State
  256. * @desc Formula MP gained when user gains a state from a foe.
  257. * @default 0
  258. *
  259. * @param Mode 2 Kill Ally
  260. * @desc Formula for how much MP is gained when an ally is killed.
  261. * @default 0
  262. *
  263. * @param Mode 2 Kill Enemy
  264. * @desc Formula for how much MP is gained when a foe is killed.
  265. * @default 0
  266. *
  267. * @param Mode 2 Win Battle
  268. * @desc Formula for how much MP is gained when a battle is won.
  269. * @default 0
  270. *
  271. * @param Mode 2 Flee Battle
  272. * @desc Formula for how much MP is gained when a battle is fled.
  273. * @default 0
  274. *
  275. * @param Mode 2 Lose Battle
  276. * @desc Formula for how much MP is gained when a battle is lost.
  277. * @default 0
  278. *
  279. * @param Mode 2 Crisis HP
  280. * @desc Formula for MP gained during the MP regeneration timing
  281. * with crisis amounts of HP.
  282. * @default 0
  283. *
  284. * @param Mode 2 Crisis MP
  285. * @desc Formula for MP gained during the MP regeneration timing
  286. * with crisis amounts of MP.
  287. * @default 0
  288. *
  289. * @param Mode 2 Only Member
  290. * @desc Formula for MP gained during the MP regeneration timing
  291. * as the only ally alive.
  292. * @default 0
  293. *
  294. * @param Mode 2 Evasion
  295. * @desc Formula for how much MP is gained when user evades an attack.
  296. * @default 0
  297. *
  298. * @param ---Mode 3 Settings---
  299. * @default
  300. *
  301. * @param Mode 3 Name
  302. * @desc The name used for this MP mode.
  303. * @default Warrior
  304. *
  305. * @param Mode 3 Icon
  306. * @desc The icon used for this MP mode.
  307. * @default 77
  308. *
  309. * @param Mode 3 Help Line 1
  310. * @desc The 1st help description line used for this MP mode.
  311. * @default Raise MP by attacking and dealing HP damage.
  312. *
  313. * @param Mode 3 Help Line 2
  314. * @desc The 2nd help description line used for this MP mode.
  315. * @default
  316. *
  317. * @param Mode 3 Max MP
  318. * @desc The formula used to determine the max MP for this mode.
  319. * @default user.mmp
  320. *
  321. * @param Mode 3 Preserve
  322. * @desc true - Carry MP from one battle to the next.
  323. * false - Reset the initial MP count each battle.
  324. * @default true
  325. *
  326. * @param Mode 3 Initial MP
  327. * @desc Formula for much MP is gained at the start of battle.
  328. * @default 0
  329. *
  330. * @param Mode 3 Regen MP
  331. * @desc Formula for how much MP is gained upon regeneration.
  332. * @default user.mmp * user.mrg
  333. *
  334. * @param Mode 3 Take HP DMG
  335. * @desc Formula for how much MP is gained taking HP damage.
  336. * @default 0
  337. *
  338. * @param Mode 3 Deal HP DMG
  339. * @desc Formula for how much MP is gained dealing HP damage.
  340. * @default Math.min(16, value * 100 / target.mhp) * user.mmp
  341. *
  342. * @param Mode 3 Heal HP DMG
  343. * @desc Formula for how much MP is gained healing HP damage.
  344. * @default 0
  345. *
  346. * @param Mode 3 Ally HP DMG
  347. * @desc Formula for how much MP is gained for ally HP damage.
  348. * @default 0
  349. *
  350. * @param Mode 3 Take MP DMG
  351. * @desc Formula for how much MP is gained taking MP damage.
  352. * @default 0
  353. *
  354. * @param Mode 3 Deal MP DMG
  355. * @desc Formula for how much MP is gained dealing MP damage.
  356. * @default 0
  357. *
  358. * @param Mode 3 Heal MP DMG
  359. * @desc Formula for how much MP is gained healing MP damage.
  360. * @default 0
  361. *
  362. * @param Mode 3 Ally MP DMG
  363. * @desc Formula for how much MP is gained for ally MP damage.
  364. * @default 0
  365. *
  366. * @param Mode 3 Deal State
  367. * @desc Formula MP gained when user inflicts a state on a foe.
  368. * @default 0
  369. *
  370. * @param Mode 3 Gain State
  371. * @desc Formula MP gained when user gains a state from a foe.
  372. * @default 0
  373. *
  374. * @param Mode 3 Kill Ally
  375. * @desc Formula for how much MP is gained when an ally is killed.
  376. * @default 0
  377. *
  378. * @param Mode 3 Kill Enemy
  379. * @desc Formula for how much MP is gained when a foe is killed.
  380. * @default 0
  381. *
  382. * @param Mode 3 Win Battle
  383. * @desc Formula for how much MP is gained when a battle is won.
  384. * @default 0
  385. *
  386. * @param Mode 3 Flee Battle
  387. * @desc Formula for how much MP is gained when a battle is fled.
  388. * @default 0
  389. *
  390. * @param Mode 3 Lose Battle
  391. * @desc Formula for how much MP is gained when a battle is lost.
  392. * @default 0
  393. *
  394. * @param Mode 3 Crisis HP
  395. * @desc Formula for MP gained during the MP regeneration timing
  396. * with crisis amounts of HP.
  397. * @default 0
  398. *
  399. * @param Mode 3 Crisis MP
  400. * @desc Formula for MP gained during the MP regeneration timing
  401. * with crisis amounts of MP.
  402. * @default 0
  403. *
  404. * @param Mode 3 Only Member
  405. * @desc Formula for MP gained during the MP regeneration timing
  406. * as the only ally alive.
  407. * @default 0
  408. *
  409. * @param Mode 3 Evasion
  410. * @desc Formula for how much MP is gained when user evades an attack.
  411. * @default 0
  412. *
  413. * @param ---Mode 4 Settings---
  414. * @default
  415. *
  416. * @param Mode 4 Name
  417. * @desc The name used for this MP mode.
  418. * @default Healer
  419. *
  420. * @param Mode 4 Icon
  421. * @desc The icon used for this MP mode.
  422. * @default 72
  423. *
  424. * @param Mode 4 Help Line 1
  425. * @desc The 1st help description line used for this MP mode.
  426. * @default Raise MP by healing HP.
  427. *
  428. * @param Mode 4 Help Line 2
  429. * @desc The 2nd help description line used for this MP mode.
  430. * @default
  431. *
  432. * @param Mode 4 Max MP
  433. * @desc The formula used to determine the max MP for this mode.
  434. * @default user.mmp
  435. *
  436. * @param Mode 4 Preserve
  437. * @desc true - Carry MP from one battle to the next.
  438. * false - Reset the initial MP count each battle.
  439. * @default true
  440. *
  441. * @param Mode 4 Initial MP
  442. * @desc Formula for much MP is gained at the start of battle.
  443. * @default 0
  444. *
  445. * @param Mode 4 Regen MP
  446. * @desc Formula for how much MP is gained upon regeneration.
  447. * @default user.mmp * user.mrg
  448. *
  449. * @param Mode 4 Take HP DMG
  450. * @desc Formula for how much MP is gained taking HP damage.
  451. * @default 0
  452. *
  453. * @param Mode 4 Deal HP DMG
  454. * @desc Formula for how much MP is gained dealing HP damage.
  455. * @default 0
  456. *
  457. * @param Mode 4 Heal HP DMG
  458. * @desc Formula for how much MP is gained healing HP damage.
  459. * @default Math.min(16, value * -100 / target.mhp) * user.mmp
  460. *
  461. * @param Mode 4 Ally HP DMG
  462. * @desc Formula for how much MP is gained for ally HP damage.
  463. * @default 0
  464. *
  465. * @param Mode 4 Take MP DMG
  466. * @desc Formula for how much MP is gained taking MP damage.
  467. * @default 0
  468. *
  469. * @param Mode 4 Deal MP DMG
  470. * @desc Formula for how much MP is gained dealing MP damage.
  471. * @default 0
  472. *
  473. * @param Mode 4 Heal MP DMG
  474. * @desc Formula for how much MP is gained healing MP damage.
  475. * @default 0
  476. *
  477. * @param Mode 4 Ally MP DMG
  478. * @desc Formula for how much MP is gained for ally MP damage.
  479. * @default 0
  480. *
  481. * @param Mode 4 Deal State
  482. * @desc Formula MP gained when user inflicts a state on a foe.
  483. * @default 0
  484. *
  485. * @param Mode 4 Gain State
  486. * @desc Formula MP gained when user gains a state from a foe.
  487. * @default 0
  488. *
  489. * @param Mode 4 Kill Ally
  490. * @desc Formula for how much MP is gained when an ally is killed.
  491. * @default 0
  492. *
  493. * @param Mode 4 Kill Enemy
  494. * @desc Formula for how much MP is gained when a foe is killed.
  495. * @default 0
  496. *
  497. * @param Mode 4 Win Battle
  498. * @desc Formula for how much MP is gained when a battle is won.
  499. * @default 0
  500. *
  501. * @param Mode 4 Flee Battle
  502. * @desc Formula for how much MP is gained when a battle is fled.
  503. * @default 0
  504. *
  505. * @param Mode 4 Lose Battle
  506. * @desc Formula for how much MP is gained when a battle is lost.
  507. * @default 0
  508. *
  509. * @param Mode 4 Crisis HP
  510. * @desc Formula for MP gained during the MP regeneration timing
  511. * with crisis amounts of HP.
  512. * @default 0
  513. *
  514. * @param Mode 4 Crisis MP
  515. * @desc Formula for MP gained during the MP regeneration timing
  516. * with crisis amounts of MP.
  517. * @default 0
  518. *
  519. * @param Mode 4 Only Member
  520. * @desc Formula for MP gained during the MP regeneration timing
  521. * as the only ally alive.
  522. * @default 0
  523. *
  524. * @param Mode 4 Evasion
  525. * @desc Formula for how much MP is gained when user evades an attack.
  526. * @default 0
  527. *
  528. * @param ---Mode 5 Settings---
  529. * @default
  530. *
  531. * @param Mode 5 Name
  532. * @desc The name used for this MP mode.
  533. * @default Breaker
  534. *
  535. * @param Mode 5 Icon
  536. * @desc The icon used for this MP mode.
  537. * @default 174
  538. *
  539. * @param Mode 5 Help Line 1
  540. * @desc The 1st help description line used for this MP mode.
  541. * @default Raise MP whenever user deals MP damage, receives MP damage,
  542. *
  543. * @param Mode 5 Help Line 2
  544. * @desc The 2nd help description line used for this MP mode.
  545. * @default or an ally receives MP damage.
  546. *
  547. * @param Mode 5 Max MP
  548. * @desc The formula used to determine the max MP for this mode.
  549. * @default user.mmp
  550. *
  551. * @param Mode 5 Preserve
  552. * @desc true - Carry MP from one battle to the next.
  553. * false - Reset the initial MP count each battle.
  554. * @default true
  555. *
  556. * @param Mode 5 Initial MP
  557. * @desc Formula for much MP is gained at the start of battle.
  558. * @default 0
  559. *
  560. * @param Mode 5 Regen MP
  561. * @desc Formula for how much MP is gained upon regeneration.
  562. * @default user.mmp * user.mrg
  563. *
  564. * @param Mode 5 Take HP DMG
  565. * @desc Formula for how much MP is gained taking HP damage.
  566. * @default 0
  567. *
  568. * @param Mode 5 Deal HP DMG
  569. * @desc Formula for how much MP is gained dealing HP damage.
  570. * @default 0
  571. *
  572. * @param Mode 5 Heal HP DMG
  573. * @desc Formula for how much MP is gained healing HP damage.
  574. * @default 0
  575. *
  576. * @param Mode 5 Ally HP DMG
  577. * @desc Formula for how much MP is gained for ally HP damage.
  578. * @default 0
  579. *
  580. * @param Mode 5 Take MP DMG
  581. * @desc Formula for how much MP is gained taking MP damage.
  582. * @default 50 * damageRate * user.mmp
  583. *
  584. * @param Mode 5 Deal MP DMG
  585. * @desc Formula for how much MP is gained dealing MP damage.
  586. * @default Math.min(16, value / 4) * user.mmp
  587. *
  588. * @param Mode 5 Heal MP DMG
  589. * @desc Formula for how much MP is gained healing MP damage.
  590. * @default 0
  591. *
  592. * @param Mode 5 Ally MP DMG
  593. * @desc Formula for how much MP is gained for ally MP damage.
  594. * @default 20 * user.mmp
  595. *
  596. * @param Mode 5 Deal State
  597. * @desc Formula MP gained when user inflicts a state on a foe.
  598. * @default 0
  599. *
  600. * @param Mode 5 Gain State
  601. * @desc Formula MP gained when user gains a state from a foe.
  602. * @default 0
  603. *
  604. * @param Mode 5 Kill Ally
  605. * @desc Formula for how much MP is gained when an ally is killed.
  606. * @default 0
  607. *
  608. * @param Mode 5 Kill Enemy
  609. * @desc Formula for how much MP is gained when a foe is killed.
  610. * @default 0
  611. *
  612. * @param Mode 5 Win Battle
  613. * @desc Formula for how much MP is gained when a battle is won.
  614. * @default 0
  615. *
  616. * @param Mode 5 Flee Battle
  617. * @desc Formula for how much MP is gained when a battle is fled.
  618. * @default 0
  619. *
  620. * @param Mode 5 Lose Battle
  621. * @desc Formula for how much MP is gained when a battle is lost.
  622. * @default 0
  623. *
  624. * @param Mode 5 Crisis HP
  625. * @desc Formula for MP gained during the MP regeneration timing
  626. * with crisis amounts of HP.
  627. * @default 0
  628. *
  629. * @param Mode 5 Crisis MP
  630. * @desc Formula for MP gained during the MP regeneration timing
  631. * with crisis amounts of MP.
  632. * @default 0
  633. *
  634. * @param Mode 5 Only Member
  635. * @desc Formula for MP gained during the MP regeneration timing
  636. * as the only ally alive.
  637. * @default 0
  638. *
  639. * @param Mode 5 Evasion
  640. * @desc Formula for how much MP is gained when user evades an attack.
  641. * @default 0
  642. *
  643. * @param ---Mode 6 Settings---
  644. * @default
  645. *
  646. * @param Mode 6 Name
  647. * @desc The name used for this MP mode.
  648. * @default Booster
  649. *
  650. * @param Mode 6 Icon
  651. * @desc The icon used for this MP mode.
  652. * @default 166
  653. *
  654. * @param Mode 6 Help Line 1
  655. * @desc The 1st help description line used for this MP mode.
  656. * @default Raise MP whenever user recovers MP for an ally.
  657. *
  658. * @param Mode 6 Help Line 2
  659. * @desc The 2nd help description line used for this MP mode.
  660. * @default
  661. *
  662. * @param Mode 6 Max MP
  663. * @desc The formula used to determine the max MP for this mode.
  664. * @default user.mmp
  665. *
  666. * @param Mode 6 Preserve
  667. * @desc true - Carry MP from one battle to the next.
  668. * false - Reset the initial MP count each battle.
  669. * @default true
  670. *
  671. * @param Mode 6 Initial MP
  672. * @desc Formula for much MP is gained at the start of battle.
  673. * @default 0
  674. *
  675. * @param Mode 6 Regen MP
  676. * @desc Formula for how much MP is gained upon regeneration.
  677. * @default user.mmp * user.mrg
  678. *
  679. * @param Mode 6 Take HP DMG
  680. * @desc Formula for how much MP is gained taking HP damage.
  681. * @default 0
  682. *
  683. * @param Mode 6 Deal HP DMG
  684. * @desc Formula for how much MP is gained dealing HP damage.
  685. * @default 0
  686. *
  687. * @param Mode 6 Heal HP DMG
  688. * @desc Formula for how much MP is gained healing HP damage.
  689. * @default 0
  690. *
  691. * @param Mode 6 Ally HP DMG
  692. * @desc Formula for how much MP is gained for ally HP damage.
  693. * @default 0
  694. *
  695. * @param Mode 6 Take MP DMG
  696. * @desc Formula for how much MP is gained taking MP damage.
  697. *
  698. * @param Mode 6 Deal MP DMG
  699. * @default 0
  700. * @desc Formula for how much MP is gained dealing MP damage.
  701. * @default 0
  702. *
  703. * @param Mode 6 Heal MP DMG
  704. * @desc Formula for how much MP is gained healing MP damage.
  705. * @default Math.min(16, value / -4) * user.mmp
  706. *
  707. * @param Mode 6 Ally MP DMG
  708. * @desc Formula for how much MP is gained for ally MP damage.
  709. * @default 0
  710. *
  711. * @param Mode 6 Deal State
  712. * @desc Formula MP gained when user inflicts a state on a foe.
  713. * @default 0
  714. *
  715. * @param Mode 6 Gain State
  716. * @desc Formula MP gained when user gains a state from a foe.
  717. * @default 0
  718. *
  719. * @param Mode 6 Kill Ally
  720. * @desc Formula for how much MP is gained when an ally is killed.
  721. * @default 0
  722. *
  723. * @param Mode 6 Kill Enemy
  724. * @desc Formula for how much MP is gained when a foe is killed.
  725. * @default 0
  726. *
  727. * @param Mode 6 Win Battle
  728. * @desc Formula for how much MP is gained when a battle is won.
  729. * @default 0
  730. *
  731. * @param Mode 6 Flee Battle
  732. * @desc Formula for how much MP is gained when a battle is fled.
  733. * @default 0
  734. *
  735. * @param Mode 6 Lose Battle
  736. * @desc Formula for how much MP is gained when a battle is lost.
  737. * @default 0
  738. *
  739. * @param Mode 6 Crisis HP
  740. * @desc Formula for MP gained during the MP regeneration timing
  741. * with crisis amounts of HP.
  742. * @default 0
  743. *
  744. * @param Mode 6 Crisis MP
  745. * @desc Formula for MP gained during the MP regeneration timing
  746. * with crisis amounts of MP.
  747. * @default 0
  748. *
  749. * @param Mode 6 Only Member
  750. * @desc Formula for MP gained during the MP regeneration timing
  751. * as the only ally alive.
  752. * @default 0
  753. *
  754. * @param Mode 6 Evasion
  755. * @desc Formula for how much MP is gained when user evades an attack.
  756. * @default 0
  757. *
  758. * @param ---Mode 7 Settings---
  759. * @default
  760. *
  761. * @param Mode 7 Name
  762. * @desc The name used for this MP mode.
  763. * @default Slayer
  764. *
  765. * @param Mode 7 Icon
  766. * @desc The icon used for this MP mode.
  767. * @default 76
  768. *
  769. * @param Mode 7 Help Line 1
  770. * @desc The 1st help description line used for this MP mode.
  771. * @default Raise MP whenever an enemy is killed.
  772. *
  773. * @param Mode 7 Help Line 2
  774. * @desc The 2nd help description line used for this MP mode.
  775. * @default
  776. *
  777. * @param Mode 7 Max MP
  778. * @desc The formula used to determine the max MP for this mode.
  779. * @default user.mmp
  780. *
  781. * @param Mode 7 Preserve
  782. * @desc true - Carry MP from one battle to the next.
  783. * false - Reset the initial MP count each battle.
  784. * @default true
  785. *
  786. * @param Mode 7 Initial MP
  787. * @desc Formula for much MP is gained at the start of battle.
  788. * @default 0
  789. *
  790. * @param Mode 7 Regen MP
  791. * @desc Formula for how much MP is gained upon regeneration.
  792. * @default user.mmp * user.mrg
  793. *
  794. * @param Mode 7 Take HP DMG
  795. * @desc Formula for how much MP is gained taking HP damage.
  796. * @default 0
  797. *
  798. * @param Mode 7 Deal HP DMG
  799. * @desc Formula for how much MP is gained dealing HP damage.
  800. * @default 0
  801. *
  802. * @param Mode 7 Heal HP DMG
  803. * @desc Formula for how much MP is gained healing HP damage.
  804. * @default 0
  805. *
  806. * @param Mode 7 Ally HP DMG
  807. * @desc Formula for how much MP is gained for ally HP damage.
  808. * @default 0
  809. *
  810. * @param Mode 7 Take MP DMG
  811. * @desc Formula for how much MP is gained taking MP damage.
  812. * @default 0
  813. *
  814. * @param Mode 7 Deal MP DMG
  815. * @desc Formula for how much MP is gained dealing MP damage.
  816. * @default 0
  817. *
  818. * @param Mode 7 Heal MP DMG
  819. * @desc Formula for how much MP is gained healing MP damage.
  820. * @default 0
  821. *
  822. * @param Mode 7 Ally MP DMG
  823. * @desc Formula for how much MP is gained for ally MP damage.
  824. * @default 0
  825. *
  826. * @param Mode 7 Deal State
  827. * @desc Formula MP gained when user inflicts a state on a foe.
  828. * @default 0
  829. *
  830. * @param Mode 7 Gain State
  831. * @desc Formula MP gained when user gains a state from a foe.
  832. * @default 0
  833. *
  834. * @param Mode 7 Kill Ally
  835. * @desc Formula for how much MP is gained when an ally is killed.
  836. * @default 0
  837. *
  838. * @param Mode 7 Kill Enemy
  839. * @desc Formula for how much MP is gained when a foe is killed.
  840. * @default 25 * user.mmp
  841. *
  842. * @param Mode 7 Win Battle
  843. * @desc Formula for how much MP is gained when a battle is won.
  844. * @default 0
  845. *
  846. * @param Mode 7 Flee Battle
  847. * @desc Formula for how much MP is gained when a battle is fled.
  848. * @default 0
  849. *
  850. * @param Mode 7 Lose Battle
  851. * @desc Formula for how much MP is gained when a battle is lost.
  852. * @default 0
  853. *
  854. * @param Mode 7 Crisis HP
  855. * @desc Formula for MP gained during the MP regeneration timing
  856. * with crisis amounts of HP.
  857. * @default 0
  858. *
  859. * @param Mode 7 Crisis MP
  860. * @desc Formula for MP gained during the MP regeneration timing
  861. * with crisis amounts of MP.
  862. * @default 0
  863. *
  864. * @param Mode 7 Only Member
  865. * @desc Formula for MP gained during the MP regeneration timing
  866. * as the only ally alive.
  867. * @default 0
  868. *
  869. * @param Mode 7 Evasion
  870. * @desc Formula for how much MP is gained when user evades an attack.
  871. * @default 0
  872. *
  873. * @param ---Mode 8 Settings---
  874. * @default
  875. *
  876. * @param Mode 8 Name
  877. * @desc The name used for this MP mode.
  878. * @default Avenger
  879. *
  880. * @param Mode 8 Icon
  881. * @desc The icon used for this MP mode.
  882. * @default 1
  883. *
  884. * @param Mode 8 Help Line 1
  885. * @desc The 1st help description line used for this MP mode.
  886. * @default Raise MP whenever an ally is killed.
  887. *
  888. * @param Mode 8 Help Line 2
  889. * @desc The 2nd help description line used for this MP mode.
  890. * @default
  891. *
  892. * @param Mode 8 Max MP
  893. * @desc The formula used to determine the max MP for this mode.
  894. * @default user.mmp
  895. *
  896. * @param Mode 8 Preserve
  897. * @desc true - Carry MP from one battle to the next.
  898. * false - Reset the initial MP count each battle.
  899. * @default true
  900. *
  901. * @param Mode 8 Initial MP
  902. * @desc Formula for much MP is gained at the start of battle.
  903. * @default 0
  904. *
  905. * @param Mode 8 Regen MP
  906. * @desc Formula for how much MP is gained upon regeneration.
  907. * @default user.mmp * user.mrg
  908. *
  909. * @param Mode 8 Take HP DMG
  910. * @desc Formula for how much MP is gained taking HP damage.
  911. * @default 0
  912. *
  913. * @param Mode 8 Deal HP DMG
  914. * @desc Formula for how much MP is gained dealing HP damage.
  915. * @default 0
  916. *
  917. * @param Mode 8 Heal HP DMG
  918. * @desc Formula for how much MP is gained healing HP damage.
  919. * @default 0
  920. *
  921. * @param Mode 8 Ally HP DMG
  922. * @desc Formula for how much MP is gained for ally HP damage.
  923. * @default 0
  924. *
  925. * @param Mode 8 Take MP DMG
  926. * @desc Formula for how much MP is gained taking MP damage.
  927. * @default 0
  928. *
  929. * @param Mode 8 Deal MP DMG
  930. * @desc Formula for how much MP is gained dealing MP damage.
  931. * @default 0
  932. *
  933. * @param Mode 8 Heal MP DMG
  934. * @desc Formula for how much MP is gained healing MP damage.
  935. * @default 0
  936. *
  937. * @param Mode 8 Ally MP DMG
  938. * @desc Formula for how much MP is gained for ally MP damage.
  939. * @default 0
  940. *
  941. * @param Mode 8 Deal State
  942. * @desc Formula MP gained when user inflicts a state on a foe.
  943. * @default 0
  944. *
  945. * @param Mode 8 Gain State
  946. * @desc Formula MP gained when user gains a state from a foe.
  947. * @default 0
  948. *
  949. * @param Mode 8 Kill Ally
  950. * @desc Formula for how much MP is gained when an ally is killed.
  951. * @default 50 * user.mmp
  952. *
  953. * @param Mode 8 Kill Enemy
  954. * @desc Formula for how much MP is gained when a foe is killed.
  955. * @default 0
  956. *
  957. * @param Mode 8 Win Battle
  958. * @desc Formula for how much MP is gained when a battle is won.
  959. * @default 0
  960. *
  961. * @param Mode 8 Flee Battle
  962. * @desc Formula for how much MP is gained when a battle is fled.
  963. * @default 0
  964. *
  965. * @param Mode 8 Lose Battle
  966. * @desc Formula for how much MP is gained when a battle is lost.
  967. * @default 0
  968. *
  969. * @param Mode 8 Crisis HP
  970. * @desc Formula for MP gained during the MP regeneration timing
  971. * with crisis amounts of HP.
  972. * @default 0
  973. *
  974. * @param Mode 8 Crisis MP
  975. * @desc Formula for MP gained during the MP regeneration timing
  976. * with crisis amounts of MP.
  977. * @default 0
  978. *
  979. * @param Mode 8 Only Member
  980. * @desc Formula for MP gained during the MP regeneration timing
  981. * as the only ally alive.
  982. * @default 0
  983. *
  984. * @param Mode 8 Evasion
  985. * @desc Formula for how much MP is gained when user evades an attack.
  986. * @default 0
  987. *
  988. * @param ---Mode 9 Settings---
  989. * @default
  990. *
  991. * @param Mode 9 Name
  992. * @desc The name used for this MP mode.
  993. * @default Winner
  994. *
  995. * @param Mode 9 Icon
  996. * @desc The icon used for this MP mode.
  997. * @default 73
  998. *
  999. * @param Mode 9 Help Line 1
  1000. * @desc The 1st help description line used for this MP mode.
  1001. * @default Raise MP whenever your party defeats all enemies.
  1002. *
  1003. * @param Mode 9 Help Line 2
  1004. * @desc The 2nd help description line used for this MP mode.
  1005. * @default
  1006. *
  1007. * @param Mode 9 Max MP
  1008. * @desc The formula used to determine the max MP for this mode.
  1009. * @default user.mmp
  1010. *
  1011. * @param Mode 9 Preserve
  1012. * @desc true - Carry MP from one battle to the next.
  1013. * false - Reset the initial MP count each battle.
  1014. * @default true
  1015. *
  1016. * @param Mode 9 Initial MP
  1017. * @desc Formula for much MP is gained at the start of battle.
  1018. * @default 0
  1019. *
  1020. * @param Mode 9 Regen MP
  1021. * @desc Formula for how much MP is gained upon regeneration.
  1022. * @default user.mmp * user.mrg
  1023. *
  1024. * @param Mode 9 Take HP DMG
  1025. * @desc Formula for how much MP is gained taking HP damage.
  1026. * @default 0
  1027. *
  1028. * @param Mode 9 Deal HP DMG
  1029. * @desc Formula for how much MP is gained dealing HP damage.
  1030. * @default 0
  1031. *
  1032. * @param Mode 9 Heal HP DMG
  1033. * @desc Formula for how much MP is gained healing HP damage.
  1034. * @default 0
  1035. *
  1036. * @param Mode 9 Ally HP DMG
  1037. * @desc Formula for how much MP is gained for ally HP damage.
  1038. * @default 0
  1039. *
  1040. * @param Mode 9 Take MP DMG
  1041. * @desc Formula for how much MP is gained taking MP damage.
  1042. * @default 0
  1043. *
  1044. * @param Mode 9 Deal MP DMG
  1045. * @desc Formula for how much MP is gained dealing MP damage.
  1046. * @default 0
  1047. *
  1048. * @param Mode 9 Heal MP DMG
  1049. * @desc Formula for how much MP is gained healing MP damage.
  1050. * @default 0
  1051. *
  1052. * @param Mode 9 Ally MP DMG
  1053. * @desc Formula for how much MP is gained for ally MP damage.
  1054. * @default 0
  1055. *
  1056. * @param Mode 9 Deal State
  1057. * @desc Formula MP gained when user inflicts a state on a foe.
  1058. * @default 0
  1059. *
  1060. * @param Mode 9 Gain State
  1061. * @desc Formula MP gained when user gains a state from a foe.
  1062. * @default 0
  1063. *
  1064. * @param Mode 9 Kill Ally
  1065. * @desc Formula for how much MP is gained when an ally is killed.
  1066. * @default 0
  1067. *
  1068. * @param Mode 9 Kill Enemy
  1069. * @desc Formula for how much MP is gained when a foe is killed.
  1070. * @default 0
  1071. *
  1072. * @param Mode 9 Win Battle
  1073. * @desc Formula for how much MP is gained when a battle is won.
  1074. * @default 20 * user.mmp
  1075. *
  1076. * @param Mode 9 Flee Battle
  1077. * @desc Formula for how much MP is gained when a battle is fled.
  1078. * @default 0
  1079. *
  1080. * @param Mode 9 Lose Battle
  1081. * @desc Formula for how much MP is gained when a battle is lost.
  1082. * @default 0
  1083. *
  1084. * @param Mode 9 Crisis HP
  1085. * @desc Formula for MP gained during the MP regeneration timing
  1086. * with crisis amounts of HP.
  1087. * @default 0
  1088. *
  1089. * @param Mode 9 Crisis MP
  1090. * @desc Formula for MP gained during the MP regeneration timing
  1091. * with crisis amounts of MP.
  1092. * @default 0
  1093. *
  1094. * @param Mode 9 Only Member
  1095. * @desc Formula for MP gained during the MP regeneration timing
  1096. * as the only ally alive.
  1097. * @default 0
  1098. *
  1099. * @param Mode 9 Evasion
  1100. * @desc Formula for how much MP is gained when user evades an attack.
  1101. * @default 0
  1102. *
  1103. * @param ---Mode 10 Settings--
  1104. * @default
  1105. *
  1106. * @param Mode 10 Name
  1107. * @desc The name used for this MP mode.
  1108. * @default Coward
  1109. *
  1110. * @param Mode 10 Icon
  1111. * @desc The icon used for this MP mode.
  1112. * @default 74
  1113. *
  1114. * @param Mode 10 Help Line 1
  1115. * @desc The 1st help description line used for this MP mode.
  1116. * @default Raise MP whenever your party escapes from battle or
  1117. *
  1118. * @param Mode 10 Help Line 2
  1119. * @desc The 2nd help description line used for this MP mode.
  1120. * @default lose a battle.
  1121. *
  1122. * @param Mode 10 Max MP
  1123. * @desc The formula used to determine the max MP for this mode.
  1124. * @default user.mmp
  1125. *
  1126. * @param Mode 10 Preserve
  1127. * @desc true - Carry MP from one battle to the next.
  1128. * false - Reset the initial MP count each battle.
  1129. * @default true
  1130. *
  1131. * @param Mode 10 Initial MP
  1132. * @desc Formula for much MP is gained at the start of battle.
  1133. * @default 0
  1134. *
  1135. * @param Mode 10 Regen MP
  1136. * @desc Formula for how much MP is gained upon regeneration.
  1137. * @default user.mmp * user.mrg
  1138. *
  1139. * @param Mode 10 Take HP DMG
  1140. * @desc Formula for how much MP is gained taking HP damage.
  1141. * @default 0
  1142. *
  1143. * @param Mode 10 Deal HP DMG
  1144. * @desc Formula for how much MP is gained dealing HP damage.
  1145. * @default 0
  1146. *
  1147. * @param Mode 10 Heal HP DMG
  1148. * @desc Formula for how much MP is gained healing HP damage.
  1149. * @default 0
  1150. *
  1151. * @param Mode 10 Ally HP DMG
  1152. * @desc Formula for how much MP is gained for ally HP damage.
  1153. * @default 0
  1154. *
  1155. * @param Mode 10 Take MP DMG
  1156. * @desc Formula for how much MP is gained taking MP damage.
  1157. * @default 0
  1158. *
  1159. * @param Mode 10 Deal MP DMG
  1160. * @desc Formula for how much MP is gained dealing MP damage.
  1161. * @default 0
  1162. *
  1163. * @param Mode 10 Heal MP DMG
  1164. * @desc Formula for how much MP is gained healing MP damage.
  1165. * @default 0
  1166. *
  1167. * @param Mode 10 Ally MP DMG
  1168. * @desc Formula for how much MP is gained for ally MP damage.
  1169. * @default 0
  1170. *
  1171. * @param Mode 10 Deal State
  1172. * @desc Formula MP gained when user inflicts a state on a foe.
  1173. * @default 0
  1174. *
  1175. * @param Mode 10 Gain State
  1176. * @desc Formula MP gained when user gains a state from a foe.
  1177. * @default 0
  1178. *
  1179. * @param Mode 10 Kill Ally
  1180. * @desc Formula for how much MP is gained when an ally is killed.
  1181. * @default 0
  1182. *
  1183. * @param Mode 10 Kill Enemy
  1184. * @desc Formula for how much MP is gained when a foe is killed.
  1185. * @default 0
  1186. *
  1187. * @param Mode 10 Win Battle
  1188. * @desc Formula for how much MP is gained when a battle is won.
  1189. * @default 0
  1190. *
  1191. * @param Mode 10 Flee Battle
  1192. * @desc Formula for how much MP is gained when a battle is fled.
  1193. * @default 20 * user.mmp
  1194. *
  1195. * @param Mode 10 Lose Battle
  1196. * @desc Formula for how much MP is gained when a battle is lost.
  1197. * @default 20 * user.mmp
  1198. *
  1199. * @param Mode 10 Crisis HP
  1200. * @desc Formula for MP gained during the MP regeneration timing
  1201. * with crisis amounts of HP.
  1202. * @default 0
  1203. *
  1204. * @param Mode 10 Crisis MP
  1205. * @desc Formula for MP gained during the MP regeneration timing
  1206. * with crisis amounts of MP.
  1207. * @default 0
  1208. *
  1209. * @param Mode 10 Only Member
  1210. * @desc Formula for MP gained during the MP regeneration timing
  1211. * as the only ally alive.
  1212. * @default 0
  1213. *
  1214. * @param Mode 10 Evasion
  1215. * @desc Formula for how much MP is gained when user evades an attack.
  1216. * @default 0
  1217. *
  1218. * @param ---Mode 11 Settings--
  1219. * @default
  1220. *
  1221. * @param Mode 11 Name
  1222. * @desc The name used for this MP mode.
  1223. * @default Daredevil
  1224. *
  1225. * @param Mode 11 Icon
  1226. * @desc The icon used for this MP mode.
  1227. * @default 48
  1228. *
  1229. * @param Mode 11 Help Line 1
  1230. * @desc The 1st help description line used for this MP mode.
  1231. * @default Raise MP whenever user ends a turn with low HP.
  1232. *
  1233. * @param Mode 11 Help Line 2
  1234. * @desc The 2nd help description line used for this MP mode.
  1235. * @default
  1236. *
  1237. * @param Mode 11 Max MP
  1238. * @desc The formula used to determine the max MP for this mode.
  1239. * @default user.mmp
  1240. *
  1241. * @param Mode 11 Preserve
  1242. * @desc true - Carry MP from one battle to the next.
  1243. * false - Reset the initial MP count each battle.
  1244. * @default true
  1245. *
  1246. * @param Mode 11 Initial MP
  1247. * @desc Formula for much MP is gained at the start of battle.
  1248. * @default 0
  1249. *
  1250. * @param Mode 11 Regen MP
  1251. * @desc Formula for how much MP is gained upon regeneration.
  1252. * @default user.mmp * user.mrg
  1253. *
  1254. * @param Mode 11 Take HP DMG
  1255. * @desc Formula for how much MP is gained taking HP damage.
  1256. * @default 0
  1257. *
  1258. * @param Mode 11 Deal HP DMG
  1259. * @desc Formula for how much MP is gained dealing HP damage.
  1260. * @default 0
  1261. *
  1262. * @param Mode 11 Heal HP DMG
  1263. * @desc Formula for how much MP is gained healing HP damage.
  1264. * @default 0
  1265. *
  1266. * @param Mode 11 Ally HP DMG
  1267. * @desc Formula for how much MP is gained for ally HP damage.
  1268. * @default 0
  1269. *
  1270. * @param Mode 11 Take MP DMG
  1271. * @desc Formula for how much MP is gained taking MP damage.
  1272. * @default 0
  1273. *
  1274. * @param Mode 11 Deal MP DMG
  1275. * @desc Formula for how much MP is gained dealing MP damage.
  1276. * @default 0
  1277. *
  1278. * @param Mode 11 Heal MP DMG
  1279. * @desc Formula for how much MP is gained healing MP damage.
  1280. * @default 0
  1281. *
  1282. * @param Mode 11 Ally MP DMG
  1283. * @desc Formula for how much MP is gained for ally MP damage.
  1284. * @default 0
  1285. *
  1286. * @param Mode 11 Deal State
  1287. * @desc Formula MP gained when user inflicts a state on a foe.
  1288. * @default 0
  1289. *
  1290. * @param Mode 11 Gain State
  1291. * @desc Formula MP gained when user gains a state from a foe.
  1292. * @default 0
  1293. *
  1294. * @param Mode 11 Kill Ally
  1295. * @desc Formula for how much MP is gained when an ally is killed.
  1296. * @default 0
  1297. *
  1298. * @param Mode 11 Kill Enemy
  1299. * @desc Formula for how much MP is gained when a foe is killed.
  1300. * @default 0
  1301. *
  1302. * @param Mode 11 Win Battle
  1303. * @desc Formula for how much MP is gained when a battle is won.
  1304. * @default 0
  1305. *
  1306. * @param Mode 11 Flee Battle
  1307. * @desc Formula for how much MP is gained when a battle is fled.
  1308. * @default 0
  1309. *
  1310. * @param Mode 11 Lose Battle
  1311. * @desc Formula for how much MP is gained when a battle is lost.
  1312. * @default 0
  1313. *
  1314. * @param Mode 11 Crisis HP
  1315. * @desc Formula for MP gained during the MP regeneration timing
  1316. * with crisis amounts of HP.
  1317. * @default 16 * user.mmp
  1318. *
  1319. * @param Mode 11 Crisis MP
  1320. * @desc Formula for MP gained during the MP regeneration timing
  1321. * with crisis amounts of MP.
  1322. * @default 0
  1323. *
  1324. * @param Mode 11 Only Member
  1325. * @desc Formula for MP gained during the MP regeneration timing
  1326. * as the only ally alive.
  1327. * @default 0
  1328. *
  1329. * @param Mode 11 Evasion
  1330. * @desc Formula for how much MP is gained when user evades an attack.
  1331. * @default 0
  1332. *
  1333. * @param ---Mode 12 Settings--
  1334. * @default
  1335. *
  1336. * @param Mode 12 Name
  1337. * @desc The name used for this MP mode.
  1338. * @default Caster
  1339. *
  1340. * @param Mode 12 Icon
  1341. * @desc The icon used for this MP mode.
  1342. * @default 49
  1343. *
  1344. * @param Mode 12 Help Line 1
  1345. * @desc The 1st help description line used for this MP mode.
  1346. * @default Raise MP whenever user ends a turn with low MP.
  1347. *
  1348. * @param Mode 12 Help Line 2
  1349. * @desc The 2nd help description line used for this MP mode.
  1350. * @default
  1351. *
  1352. * @param Mode 12 Max MP
  1353. * @desc The formula used to determine the max MP for this mode.
  1354. * @default user.mmp
  1355. *
  1356. * @param Mode 12 Preserve
  1357. * @desc true - Carry MP from one battle to the next.
  1358. * false - Reset the initial MP count each battle.
  1359. * @default true
  1360. *
  1361. * @param Mode 12 Initial MP
  1362. * @desc Formula for much MP is gained at the start of battle.
  1363. * @default 0
  1364. *
  1365. * @param Mode 12 Regen MP
  1366. * @desc Formula for how much MP is gained upon regeneration.
  1367. * @default user.mmp * user.mrg
  1368. *
  1369. * @param Mode 12 Take HP DMG
  1370. * @desc Formula for how much MP is gained taking HP damage.
  1371. * @default 0
  1372. *
  1373. * @param Mode 12 Deal HP DMG
  1374. * @desc Formula for how much MP is gained dealing HP damage.
  1375. * @default 0
  1376. *
  1377. * @param Mode 12 Heal HP DMG
  1378. * @desc Formula for how much MP is gained healing HP damage.
  1379. * @default 0
  1380. *
  1381. * @param Mode 12 Ally HP DMG
  1382. * @desc Formula for how much MP is gained for ally HP damage.
  1383. * @default 0
  1384. *
  1385. * @param Mode 12 Take MP DMG
  1386. * @desc Formula for how much MP is gained taking MP damage.
  1387. * @default 0
  1388. *
  1389. * @param Mode 12 Deal MP DMG
  1390. * @desc Formula for how much MP is gained dealing MP damage.
  1391. * @default 0
  1392. *
  1393. * @param Mode 12 Heal MP DMG
  1394. * @desc Formula for how much MP is gained healing MP damage.
  1395. * @default 0
  1396. *
  1397. * @param Mode 12 Ally MP DMG
  1398. * @desc Formula for how much MP is gained for ally MP damage.
  1399. * @default 0
  1400. *
  1401. * @param Mode 12 Deal State
  1402. * @desc Formula MP gained when user inflicts a state on a foe.
  1403. * @default 0
  1404. *
  1405. * @param Mode 12 Gain State
  1406. * @desc Formula MP gained when user gains a state from a foe.
  1407. * @default 0
  1408. *
  1409. * @param Mode 12 Kill Ally
  1410. * @desc Formula for how much MP is gained when an ally is killed.
  1411. * @default 0
  1412. *
  1413. * @param Mode 12 Kill Enemy
  1414. * @desc Formula for how much MP is gained when a foe is killed.
  1415. * @default 0
  1416. *
  1417. * @param Mode 12 Win Battle
  1418. * @desc Formula for how much MP is gained when a battle is won.
  1419. * @default 0
  1420. *
  1421. * @param Mode 12 Flee Battle
  1422. * @desc Formula for how much MP is gained when a battle is fled.
  1423. * @default 0
  1424. *
  1425. * @param Mode 12 Lose Battle
  1426. * @desc Formula for how much MP is gained when a battle is lost.
  1427. * @default 0
  1428. *
  1429. * @param Mode 12 Crisis HP
  1430. * @desc Formula for MP gained during the MP regeneration timing
  1431. * with crisis amounts of HP.
  1432. * @default 0
  1433. *
  1434. * @param Mode 12 Crisis MP
  1435. * @desc Formula for MP gained during the MP regeneration timing
  1436. * with crisis amounts of MP.
  1437. * @default 16 * user.mmp
  1438. *
  1439. * @param Mode 12 Only Member
  1440. * @desc Formula for MP gained during the MP regeneration timing
  1441. * as the only ally alive.
  1442. * @default 0
  1443. *
  1444. * @param Mode 12 Evasion
  1445. * @desc Formula for how much MP is gained when user evades an attack.
  1446. * @default 0
  1447. *
  1448. * @param ---Mode 13 Settings--
  1449. * @default
  1450. *
  1451. * @param Mode 13 Name
  1452. * @desc The name used for this MP mode.
  1453. * @default Tactician
  1454. *
  1455. * @param Mode 13 Icon
  1456. * @desc The icon used for this MP mode.
  1457. * @default 79
  1458. *
  1459. * @param Mode 13 Help Line 1
  1460. * @desc The 1st help description line used for this MP mode.
  1461. * @default Raise MP whenever user inflicts a status effect on a foe.
  1462. *
  1463. * @param Mode 13 Help Line 2
  1464. * @desc The 2nd help description line used for this MP mode.
  1465. * @default
  1466. *
  1467. * @param Mode 13 Max MP
  1468. * @desc The formula used to determine the max MP for this mode.
  1469. * @default user.mmp
  1470. *
  1471. * @param Mode 13 Preserve
  1472. * @desc true - Carry MP from one battle to the next.
  1473. * false - Reset the initial MP count each battle.
  1474. * @default true
  1475. *
  1476. * @param Mode 13 Initial MP
  1477. * @desc Formula for much MP is gained at the start of battle.
  1478. * @default 0
  1479. *
  1480. * @param Mode 13 Regen MP
  1481. * @desc Formula for how much MP is gained upon regeneration.
  1482. * @default user.mmp * user.mrg
  1483. *
  1484. * @param Mode 13 Take HP DMG
  1485. * @desc Formula for how much MP is gained taking HP damage.
  1486. * @default 0
  1487. *
  1488. * @param Mode 13 Deal HP DMG
  1489. * @desc Formula for how much MP is gained dealing HP damage.
  1490. * @default 0
  1491. *
  1492. * @param Mode 13 Heal HP DMG
  1493. * @desc Formula for how much MP is gained healing HP damage.
  1494. * @default 0
  1495. *
  1496. * @param Mode 13 Ally HP DMG
  1497. * @desc Formula for how much MP is gained for ally HP damage.
  1498. * @default 0
  1499. *
  1500. * @param Mode 13 Take MP DMG
  1501. * @desc Formula for how much MP is gained taking MP damage.
  1502. * @default 0
  1503. *
  1504. * @param Mode 13 Deal MP DMG
  1505. * @desc Formula for how much MP is gained dealing MP damage.
  1506. * @default 0
  1507. *
  1508. * @param Mode 13 Heal MP DMG
  1509. * @desc Formula for how much MP is gained healing MP damage.
  1510. * @default 0
  1511. *
  1512. * @param Mode 13 Ally MP DMG
  1513. * @desc Formula for how much MP is gained for ally MP damage.
  1514. * @default 0
  1515. *
  1516. * @param Mode 13 Deal State
  1517. * @desc Formula MP gained when user inflicts a state on a foe.
  1518. * @default 16 * user.mmp
  1519. *
  1520. * @param Mode 13 Gain State
  1521. * @desc Formula MP gained when user gains a state from a foe.
  1522. * @default 0
  1523. *
  1524. * @param Mode 13 Kill Ally
  1525. * @desc Formula for how much MP is gained when an ally is killed.
  1526. * @default 0
  1527. *
  1528. * @param Mode 13 Kill Enemy
  1529. * @desc Formula for how much MP is gained when a foe is killed.
  1530. * @default 0
  1531. *
  1532. * @param Mode 13 Win Battle
  1533. * @desc Formula for how much MP is gained when a battle is won.
  1534. * @default 0
  1535. *
  1536. * @param Mode 13 Flee Battle
  1537. * @desc Formula for how much MP is gained when a battle is fled.
  1538. * @default 0
  1539. *
  1540. * @param Mode 13 Lose Battle
  1541. * @desc Formula for how much MP is gained when a battle is lost.
  1542. * @default 0
  1543. *
  1544. * @param Mode 13 Crisis HP
  1545. * @desc Formula for MP gained during the MP regeneration timing
  1546. * with crisis amounts of HP.
  1547. * @default 0
  1548. *
  1549. * @param Mode 13 Crisis MP
  1550. * @desc Formula for MP gained during the MP regeneration timing
  1551. * with crisis amounts of MP.
  1552. * @default 0
  1553. *
  1554. * @param Mode 13 Only Member
  1555. * @desc Formula for MP gained during the MP regeneration timing
  1556. * as the only ally alive.
  1557. * @default 0
  1558. *
  1559. * @param Mode 13 Evasion
  1560. * @desc Formula for how much MP is gained when user evades an attack.
  1561. * @default 0
  1562. *
  1563. * @param ---Mode 14 Settings--
  1564. * @default
  1565. *
  1566. * @param Mode 14 Name
  1567. * @desc The name used for this MP mode.
  1568. * @default Sufferer
  1569. *
  1570. * @param Mode 14 Icon
  1571. * @desc The icon used for this MP mode.
  1572. * @default 3
  1573. *
  1574. * @param Mode 14 Help Line 1
  1575. * @desc The 1st help description line used for this MP mode.
  1576. * @default Raise MP whenever user receives a status effect from a foe.
  1577. *
  1578. * @param Mode 14 Help Line 2
  1579. * @desc The 2nd help description line used for this MP mode.
  1580. * @default
  1581. *
  1582. * @param Mode 14 Max MP
  1583. * @desc The formula used to determine the max MP for this mode.
  1584. * @default user.mmp
  1585. *
  1586. * @param Mode 14 Preserve
  1587. * @desc true - Carry MP from one battle to the next.
  1588. * false - Reset the initial MP count each battle.
  1589. * @default true
  1590. *
  1591. * @param Mode 14 Initial MP
  1592. * @desc Formula for much MP is gained at the start of battle.
  1593. * @default 0
  1594. *
  1595. * @param Mode 14 Regen MP
  1596. * @desc Formula for how much MP is gained upon regeneration.
  1597. * @default user.mmp * user.mrg
  1598. *
  1599. * @param Mode 14 Take HP DMG
  1600. * @desc Formula for how much MP is gained taking HP damage.
  1601. * @default 0
  1602. *
  1603. * @param Mode 14 Deal HP DMG
  1604. * @desc Formula for how much MP is gained dealing HP damage.
  1605. * @default 0
  1606. *
  1607. * @param Mode 14 Heal HP DMG
  1608. * @desc Formula for how much MP is gained healing HP damage.
  1609. * @default 0
  1610. *
  1611. * @param Mode 14 Ally HP DMG
  1612. * @desc Formula for how much MP is gained for ally HP damage.
  1613. * @default 0
  1614. *
  1615. * @param Mode 14 Take MP DMG
  1616. * @desc Formula for how much MP is gained taking MP damage.
  1617. * @default 0
  1618. *
  1619. * @param Mode 14 Deal MP DMG
  1620. * @desc Formula for how much MP is gained dealing MP damage.
  1621. * @default 0
  1622. *
  1623. * @param Mode 14 Heal MP DMG
  1624. * @desc Formula for how much MP is gained healing MP damage.
  1625. * @default 0
  1626. *
  1627. * @param Mode 14 Ally MP DMG
  1628. * @desc Formula for how much MP is gained for ally MP damage.
  1629. * @default 0
  1630. *
  1631. * @param Mode 14 Deal State
  1632. * @desc Formula MP gained when user inflicts a state on a foe.
  1633. * @default 0
  1634. *
  1635. * @param Mode 14 Gain State
  1636. * @desc Formula MP gained when user gains a state from a foe.
  1637. * @default 16 * user.mmp
  1638. *
  1639. * @param Mode 14 Kill Ally
  1640. * @desc Formula for how much MP is gained when an ally is killed.
  1641. * @default 0
  1642. *
  1643. * @param Mode 14 Kill Enemy
  1644. * @desc Formula for how much MP is gained when a foe is killed.
  1645. * @default 0
  1646. *
  1647. * @param Mode 14 Win Battle
  1648. * @desc Formula for how much MP is gained when a battle is won.
  1649. * @default 0
  1650. *
  1651. * @param Mode 14 Flee Battle
  1652. * @desc Formula for how much MP is gained when a battle is fled.
  1653. * @default 0
  1654. *
  1655. * @param Mode 14 Lose Battle
  1656. * @desc Formula for how much MP is gained when a battle is lost.
  1657. * @default 0
  1658. *
  1659. * @param Mode 14 Crisis HP
  1660. * @desc Formula for MP gained during the MP regeneration timing
  1661. * with crisis amounts of HP.
  1662. * @default 0
  1663. *
  1664. * @param Mode 14 Crisis MP
  1665. * @desc Formula for MP gained during the MP regeneration timing
  1666. * with crisis amounts of MP.
  1667. * @default 0
  1668. *
  1669. * @param Mode 14 Only Member
  1670. * @desc Formula for MP gained during the MP regeneration timing
  1671. * as the only ally alive.
  1672. * @default 0
  1673. *
  1674. * @param Mode 14 Evasion
  1675. * @desc Formula for how much MP is gained when user evades an attack.
  1676. * @default 0
  1677. *
  1678. * @param ---Mode 15 Settings--
  1679. * @default
  1680. *
  1681. * @param Mode 15 Name
  1682. * @desc The name used for this MP mode.
  1683. * @default Dancer
  1684. *
  1685. * @param Mode 15 Icon
  1686. * @desc The icon used for this MP mode.
  1687. * @default 82
  1688. *
  1689. * @param Mode 15 Help Line 1
  1690. * @desc The 1st help description line used for this MP mode.
  1691. * @default Raise MP whenever user successfully evades an attack.
  1692. *
  1693. * @param Mode 15 Help Line 2
  1694. * @desc The 2nd help description line used for this MP mode.
  1695. * @default
  1696. *
  1697. * @param Mode 15 Max MP
  1698. * @desc The formula used to determine the max MP for this mode.
  1699. * @default user.mmp
  1700. *
  1701. * @param Mode 15 Preserve
  1702. * @desc true - Carry MP from one battle to the next.
  1703. * false - Reset the initial MP count each battle.
  1704. * @default true
  1705. *
  1706. * @param Mode 15 Initial MP
  1707. * @desc Formula for much MP is gained at the start of battle.
  1708. * @default 0
  1709. *
  1710. * @param Mode 15 Regen MP
  1711. * @desc Formula for how much MP is gained upon regeneration.
  1712. * @default user.mmp * user.mrg
  1713. *
  1714. * @param Mode 15 Take HP DMG
  1715. * @desc Formula for how much MP is gained taking HP damage.
  1716. * @default 0
  1717. *
  1718. * @param Mode 15 Deal HP DMG
  1719. * @desc Formula for how much MP is gained dealing HP damage.
  1720. * @default 0
  1721. *
  1722. * @param Mode 15 Heal HP DMG
  1723. * @desc Formula for how much MP is gained healing HP damage.
  1724. * @default 0
  1725. *
  1726. * @param Mode 15 Ally HP DMG
  1727. * @desc Formula for how much MP is gained for ally HP damage.
  1728. * @default 0
  1729. *
  1730. * @param Mode 15 Take MP DMG
  1731. * @desc Formula for how much MP is gained taking MP damage.
  1732. * @default 0
  1733. *
  1734. * @param Mode 15 Deal MP DMG
  1735. * @desc Formula for how much MP is gained dealing MP damage.
  1736. * @default 0
  1737. *
  1738. * @param Mode 15 Heal MP DMG
  1739. * @desc Formula for how much MP is gained healing MP damage.
  1740. * @default 0
  1741. *
  1742. * @param Mode 15 Ally MP DMG
  1743. * @desc Formula for how much MP is gained for ally MP damage.
  1744. * @default 0
  1745. *
  1746. * @param Mode 15 Deal State
  1747. * @desc Formula MP gained when user inflicts a state on a foe.
  1748. * @default 0
  1749. *
  1750. * @param Mode 15 Gain State
  1751. * @desc Formula MP gained when user gains a state from a foe.
  1752. * @default 0
  1753. *
  1754. * @param Mode 15 Kill Ally
  1755. * @desc Formula for how much MP is gained when an ally is killed.
  1756. * @default 0
  1757. *
  1758. * @param Mode 15 Kill Enemy
  1759. * @desc Formula for how much MP is gained when a foe is killed.
  1760. * @default 0
  1761. *
  1762. * @param Mode 15 Win Battle
  1763. * @desc Formula for how much MP is gained when a battle is won.
  1764. * @default 0
  1765. *
  1766. * @param Mode 15 Flee Battle
  1767. * @desc Formula for how much MP is gained when a battle is fled.
  1768. * @default 0
  1769. *
  1770. * @param Mode 15 Lose Battle
  1771. * @desc Formula for how much MP is gained when a battle is lost.
  1772. * @default 0
  1773. *
  1774. * @param Mode 15 Crisis HP
  1775. * @desc Formula for MP gained during the MP regeneration timing
  1776. * with crisis amounts of HP.
  1777. * @default 0
  1778. *
  1779. * @param Mode 15 Crisis MP
  1780. * @desc Formula for MP gained during the MP regeneration timing
  1781. * with crisis amounts of MP.
  1782. * @default 0
  1783. *
  1784. * @param Mode 15 Only Member
  1785. * @desc Formula for MP gained during the MP regeneration timing
  1786. * as the only ally alive.
  1787. * @default 0
  1788. *
  1789. * @param Mode 15 Evasion
  1790. * @desc Formula for how much MP is gained when user evades an attack.
  1791. * @default 16 * user.mmp
  1792. *
  1793. * @param ---Mode 16 Settings--
  1794. * @default
  1795. *
  1796. * @param Mode 16 Name
  1797. * @desc The name used for this MP mode.
  1798. * @default Loner
  1799. *
  1800. * @param Mode 16 Icon
  1801. * @desc The icon used for this MP mode.
  1802. * @default 13
  1803. *
  1804. * @param Mode 16 Help Line 1
  1805. * @desc The 1st help description line used for this MP mode.
  1806. * @default Raise MP every turn end when the user is the last
  1807. *
  1808. * @param Mode 16 Help Line 2
  1809. * @desc The 2nd help description line used for this MP mode.
  1810. * @default remaining alive member.
  1811. *
  1812. * @param Mode 16 Max MP
  1813. * @desc The formula used to determine the max MP for this mode.
  1814. * @default user.mmp
  1815. *
  1816. * @param Mode 16 Preserve
  1817. * @desc true - Carry MP from one battle to the next.
  1818. * false - Reset the initial MP count each battle.
  1819. * @default true
  1820. *
  1821. * @param Mode 16 Initial MP
  1822. * @desc Formula for much MP is gained at the start of battle.
  1823. * @default 0
  1824. *
  1825. * @param Mode 16 Regen MP
  1826. * @desc Formula for how much MP is gained upon regeneration.
  1827. * @default user.mmp * user.mrg
  1828. *
  1829. * @param Mode 16 Take HP DMG
  1830. * @desc Formula for how much MP is gained taking HP damage.
  1831. * @default 0
  1832. *
  1833. * @param Mode 16 Deal HP DMG
  1834. * @desc Formula for how much MP is gained dealing HP damage.
  1835. * @default 0
  1836. *
  1837. * @param Mode 16 Heal HP DMG
  1838. * @desc Formula for how much MP is gained healing HP damage.
  1839. * @default 0
  1840. *
  1841. * @param Mode 16 Ally HP DMG
  1842. * @desc Formula for how much MP is gained for ally HP damage.
  1843. * @default 0
  1844. *
  1845. * @param Mode 16 Take MP DMG
  1846. * @desc Formula for how much MP is gained taking MP damage.
  1847. * @default 0
  1848. *
  1849. * @param Mode 16 Deal MP DMG
  1850. * @desc Formula for how much MP is gained dealing MP damage.
  1851. * @default 0
  1852. *
  1853. * @param Mode 16 Heal MP DMG
  1854. * @desc Formula for how much MP is gained healing MP damage.
  1855. * @default 0
  1856. *
  1857. * @param Mode 16 Ally MP DMG
  1858. * @desc Formula for how much MP is gained for ally MP damage.
  1859. * @default 0
  1860. *
  1861. * @param Mode 16 Deal State
  1862. * @desc Formula MP gained when user inflicts a state on a foe.
  1863. * @default 0
  1864. *
  1865. * @param Mode 16 Gain State
  1866. * @desc Formula MP gained when user gains a state from a foe.
  1867. * @default 0
  1868. *
  1869. * @param Mode 16 Kill Ally
  1870. * @desc Formula for how much MP is gained when an ally is killed.
  1871. * @default 0
  1872. *
  1873. * @param Mode 16 Kill Enemy
  1874. * @desc Formula for how much MP is gained when a foe is killed.
  1875. * @default 0
  1876. *
  1877. * @param Mode 16 Win Battle
  1878. * @desc Formula for how much MP is gained when a battle is won.
  1879. * @default 0
  1880. *
  1881. * @param Mode 16 Flee Battle
  1882. * @desc Formula for how much MP is gained when a battle is fled.
  1883. * @default 0
  1884. *
  1885. * @param Mode 16 Lose Battle
  1886. * @desc Formula for how much MP is gained when a battle is lost.
  1887. * @default 0
  1888. *
  1889. * @param Mode 16 Crisis HP
  1890. * @desc Formula for MP gained during the MP regeneration timing
  1891. * with crisis amounts of HP.
  1892. * @default 0
  1893. *
  1894. * @param Mode 16 Crisis MP
  1895. * @desc Formula for MP gained during the MP regeneration timing
  1896. * with crisis amounts of MP.
  1897. * @default 0
  1898. *
  1899. * @param Mode 16 Only Member
  1900. * @desc Formula for MP gained during the MP regeneration timing
  1901. * as the only ally alive.
  1902. * @default 16 * user.mmp
  1903. *
  1904. * @param Mode 16 Evasion
  1905. * @desc Formula for how much MP is gained when user evades an attack.
  1906. * @default 0
  1907. *
  1908. * @param ---Mode 17 Settings--
  1909. * @default
  1910. *
  1911. * @param Mode 17 Name
  1912. * @desc The name used for this MP mode.
  1913. * @default Undefined
  1914. *
  1915. * @param Mode 17 Icon
  1916. * @desc The icon used for this MP mode.
  1917. * @default 0
  1918. *
  1919. * @param Mode 17 Help Line 1
  1920. * @desc The 1st help description line used for this MP mode.
  1921. * @default -
  1922. *
  1923. * @param Mode 17 Help Line 2
  1924. * @desc The 2nd help description line used for this MP mode.
  1925. * @default -
  1926. *
  1927. * @param Mode 17 Max MP
  1928. * @desc The formula used to determine the max MP for this mode.
  1929. * @default user.mmp
  1930. *
  1931. * @param Mode 17 Preserve
  1932. * @desc true - Carry MP from one battle to the next.
  1933. * false - Reset the initial MP count each battle.
  1934. * @default true
  1935. *
  1936. * @param Mode 17 Initial MP
  1937. * @desc Formula for much MP is gained at the start of battle.
  1938. * @default 0
  1939. *
  1940. * @param Mode 17 Regen MP
  1941. * @desc Formula for how much MP is gained upon regeneration.
  1942. * @default user.mmp * user.mrg
  1943. *
  1944. * @param Mode 17 Take HP DMG
  1945. * @desc Formula for how much MP is gained taking HP damage.
  1946. * @default 0
  1947. *
  1948. * @param Mode 17 Deal HP DMG
  1949. * @desc Formula for how much MP is gained dealing HP damage.
  1950. * @default 0
  1951. *
  1952. * @param Mode 17 Heal HP DMG
  1953. * @desc Formula for how much MP is gained healing HP damage.
  1954. * @default 0
  1955. *
  1956. * @param Mode 17 Ally HP DMG
  1957. * @desc Formula for how much MP is gained for ally HP damage.
  1958. * @default 0
  1959. *
  1960. * @param Mode 17 Take MP DMG
  1961. * @desc Formula for how much MP is gained taking MP damage.
  1962. * @default 0
  1963. *
  1964. * @param Mode 17 Deal MP DMG
  1965. * @desc Formula for how much MP is gained dealing MP damage.
  1966. * @default 0
  1967. *
  1968. * @param Mode 17 Heal MP DMG
  1969. * @desc Formula for how much MP is gained healing MP damage.
  1970. * @default 0
  1971. *
  1972. * @param Mode 17 Ally MP DMG
  1973. * @desc Formula for how much MP is gained for ally MP damage.
  1974. * @default 0
  1975. *
  1976. * @param Mode 17 Deal State
  1977. * @desc Formula MP gained when user inflicts a state on a foe.
  1978. * @default 0
  1979. *
  1980. * @param Mode 17 Gain State
  1981. * @desc Formula MP gained when user gains a state from a foe.
  1982. * @default 0
  1983. *
  1984. * @param Mode 17 Kill Ally
  1985. * @desc Formula for how much MP is gained when an ally is killed.
  1986. * @default 0
  1987. *
  1988. * @param Mode 17 Kill Enemy
  1989. * @desc Formula for how much MP is gained when a foe is killed.
  1990. * @default 0
  1991. *
  1992. * @param Mode 17 Win Battle
  1993. * @desc Formula for how much MP is gained when a battle is won.
  1994. * @default 0
  1995. *
  1996. * @param Mode 17 Flee Battle
  1997. * @desc Formula for how much MP is gained when a battle is fled.
  1998. * @default 0
  1999. *
  2000. * @param Mode 17 Lose Battle
  2001. * @desc Formula for how much MP is gained when a battle is lost.
  2002. * @default 0
  2003. *
  2004. * @param Mode 17 Crisis HP
  2005. * @desc Formula for MP gained during the MP regeneration timing
  2006. * with crisis amounts of HP.
  2007. * @default 0
  2008. *
  2009. * @param Mode 17 Crisis MP
  2010. * @desc Formula for MP gained during the MP regeneration timing
  2011. * with crisis amounts of MP.
  2012. * @default 0
  2013. *
  2014. * @param Mode 17 Only Member
  2015. * @desc Formula for MP gained during the MP regeneration timing
  2016. * as the only ally alive.
  2017. * @default 0
  2018. *
  2019. * @param Mode 17 Evasion
  2020. * @desc Formula for how much MP is gained when user evades an attack.
  2021. * @default 0
  2022. *
  2023. * @param ---Mode 18 Settings--
  2024. * @default
  2025. *
  2026. * @param Mode 18 Name
  2027. * @desc The name used for this MP mode.
  2028. * @default Undefined
  2029. *
  2030. * @param Mode 18 Icon
  2031. * @desc The icon used for this MP mode.
  2032. * @default 0
  2033. *
  2034. * @param Mode 18 Help Line 1
  2035. * @desc The 1st help description line used for this MP mode.
  2036. * @default -
  2037. *
  2038. * @param Mode 18 Help Line 2
  2039. * @desc The 2nd help description line used for this MP mode.
  2040. * @default -
  2041. *
  2042. * @param Mode 18 Max MP
  2043. * @desc The formula used to determine the max MP for this mode.
  2044. * @default user.mmp
  2045. *
  2046. * @param Mode 18 Preserve
  2047. * @desc true - Carry MP from one battle to the next.
  2048. * false - Reset the initial MP count each battle.
  2049. * @default true
  2050. *
  2051. * @param Mode 18 Initial MP
  2052. * @desc Formula for much MP is gained at the start of battle.
  2053. * @default 0
  2054. *
  2055. * @param Mode 18 Regen MP
  2056. * @desc Formula for how much MP is gained upon regeneration.
  2057. * @default user.mmp * user.mrg
  2058. *
  2059. * @param Mode 18 Take HP DMG
  2060. * @desc Formula for how much MP is gained taking HP damage.
  2061. * @default 0
  2062. *
  2063. * @param Mode 18 Deal HP DMG
  2064. * @desc Formula for how much MP is gained dealing HP damage.
  2065. * @default 0
  2066. *
  2067. * @param Mode 18 Heal HP DMG
  2068. * @desc Formula for how much MP is gained healing HP damage.
  2069. * @default 0
  2070. *
  2071. * @param Mode 18 Ally HP DMG
  2072. * @desc Formula for how much MP is gained for ally HP damage.
  2073. * @default 0
  2074. *
  2075. * @param Mode 18 Take MP DMG
  2076. * @desc Formula for how much MP is gained taking MP damage.
  2077. * @default 0
  2078. *
  2079. * @param Mode 18 Deal MP DMG
  2080. * @desc Formula for how much MP is gained dealing MP damage.
  2081. * @default 0
  2082. *
  2083. * @param Mode 18 Heal MP DMG
  2084. * @desc Formula for how much MP is gained healing MP damage.
  2085. * @default 0
  2086. *
  2087. * @param Mode 18 Ally MP DMG
  2088. * @desc Formula for how much MP is gained for ally MP damage.
  2089. * @default 0
  2090. *
  2091. * @param Mode 18 Deal State
  2092. * @desc Formula MP gained when user inflicts a state on a foe.
  2093. * @default 0
  2094. *
  2095. * @param Mode 18 Gain State
  2096. * @desc Formula MP gained when user gains a state from a foe.
  2097. * @default 0
  2098. *
  2099. * @param Mode 18 Kill Ally
  2100. * @desc Formula for how much MP is gained when an ally is killed.
  2101. * @default 0
  2102. *
  2103. * @param Mode 18 Kill Enemy
  2104. * @desc Formula for how much MP is gained when a foe is killed.
  2105. * @default 0
  2106. *
  2107. * @param Mode 18 Win Battle
  2108. * @desc Formula for how much MP is gained when a battle is won.
  2109. * @default 0
  2110. *
  2111. * @param Mode 18 Flee Battle
  2112. * @desc Formula for how much MP is gained when a battle is fled.
  2113. * @default 0
  2114. *
  2115. * @param Mode 18 Lose Battle
  2116. * @desc Formula for how much MP is gained when a battle is lost.
  2117. * @default 0
  2118. *
  2119. * @param Mode 18 Crisis HP
  2120. * @desc Formula for MP gained during the MP regeneration timing
  2121. * with crisis amounts of HP.
  2122. * @default 0
  2123. *
  2124. * @param Mode 18 Crisis MP
  2125. * @desc Formula for MP gained during the MP regeneration timing
  2126. * with crisis amounts of MP.
  2127. * @default 0
  2128. *
  2129. * @param Mode 18 Only Member
  2130. * @desc Formula for MP gained during the MP regeneration timing
  2131. * as the only ally alive.
  2132. * @default 0
  2133. *
  2134. * @param Mode 18 Evasion
  2135. * @desc Formula for how much MP is gained when user evades an attack.
  2136. * @default 0
  2137. *
  2138. * @param ---Mode 19 Settings--
  2139. * @default
  2140. *
  2141. * @param Mode 19 Name
  2142. * @desc The name used for this MP mode.
  2143. * @default Undefined
  2144. *
  2145. * @param Mode 19 Icon
  2146. * @desc The icon used for this MP mode.
  2147. * @default 0
  2148. *
  2149. * @param Mode 19 Help Line 1
  2150. * @desc The 1st help description line used for this MP mode.
  2151. * @default -
  2152. *
  2153. * @param Mode 19 Help Line 2
  2154. * @desc The 2nd help description line used for this MP mode.
  2155. * @default -
  2156. *
  2157. * @param Mode 19 Max MP
  2158. * @desc The formula used to determine the max MP for this mode.
  2159. * @default user.mmp
  2160. *
  2161. * @param Mode 19 Preserve
  2162. * @desc true - Carry MP from one battle to the next.
  2163. * false - Reset the initial MP count each battle.
  2164. * @default true
  2165. *
  2166. * @param Mode 19 Initial MP
  2167. * @desc Formula for much MP is gained at the start of battle.
  2168. * @default 0
  2169. *
  2170. * @param Mode 19 Regen MP
  2171. * @desc Formula for how much MP is gained upon regeneration.
  2172. * @default user.mmp * user.mrg
  2173. *
  2174. * @param Mode 19 Take HP DMG
  2175. * @desc Formula for how much MP is gained taking HP damage.
  2176. * @default 0
  2177. *
  2178. * @param Mode 19 Deal HP DMG
  2179. * @desc Formula for how much MP is gained dealing HP damage.
  2180. * @default 0
  2181. *
  2182. * @param Mode 19 Heal HP DMG
  2183. * @desc Formula for how much MP is gained healing HP damage.
  2184. * @default 0
  2185. *
  2186. * @param Mode 19 Ally HP DMG
  2187. * @desc Formula for how much MP is gained for ally HP damage.
  2188. * @default 0
  2189. *
  2190. * @param Mode 19 Take MP DMG
  2191. * @desc Formula for how much MP is gained taking MP damage.
  2192. * @default 0
  2193. *
  2194. * @param Mode 19 Deal MP DMG
  2195. * @desc Formula for how much MP is gained dealing MP damage.
  2196. * @default 0
  2197. *
  2198. * @param Mode 19 Heal MP DMG
  2199. * @desc Formula for how much MP is gained healing MP damage.
  2200. * @default 0
  2201. *
  2202. * @param Mode 19 Ally MP DMG
  2203. * @desc Formula for how much MP is gained for ally MP damage.
  2204. * @default 0
  2205. *
  2206. * @param Mode 19 Deal State
  2207. * @desc Formula MP gained when user inflicts a state on a foe.
  2208. * @default 0
  2209. *
  2210. * @param Mode 19 Gain State
  2211. * @desc Formula MP gained when user gains a state from a foe.
  2212. * @default 0
  2213. *
  2214. * @param Mode 19 Kill Ally
  2215. * @desc Formula for how much MP is gained when an ally is killed.
  2216. * @default 0
  2217. *
  2218. * @param Mode 19 Kill Enemy
  2219. * @desc Formula for how much MP is gained when a foe is killed.
  2220. * @default 0
  2221. *
  2222. * @param Mode 19 Win Battle
  2223. * @desc Formula for how much MP is gained when a battle is won.
  2224. * @default 0
  2225. *
  2226. * @param Mode 19 Flee Battle
  2227. * @desc Formula for how much MP is gained when a battle is fled.
  2228. * @default 0
  2229. *
  2230. * @param Mode 19 Lose Battle
  2231. * @desc Formula for how much MP is gained when a battle is lost.
  2232. * @default 0
  2233. *
  2234. * @param Mode 19 Crisis HP
  2235. * @desc Formula for MP gained during the MP regeneration timing
  2236. * with crisis amounts of HP.
  2237. * @default 0
  2238. *
  2239. * @param Mode 19 Crisis MP
  2240. * @desc Formula for MP gained during the MP regeneration timing
  2241. * with crisis amounts of MP.
  2242. * @default 0
  2243. *
  2244. * @param Mode 19 Only Member
  2245. * @desc Formula for MP gained during the MP regeneration timing
  2246. * as the only ally alive.
  2247. * @default 0
  2248. *
  2249. * @param Mode 19 Evasion
  2250. * @desc Formula for how much MP is gained when user evades an attack.
  2251. * @default 0
  2252. *
  2253. * @param ---Mode 20 Settings--
  2254. * @default
  2255. *
  2256. * @param Mode 20 Name
  2257. * @desc The name used for this MP mode.
  2258. * @default Undefined
  2259. *
  2260. * @param Mode 20 Icon
  2261. * @desc The icon used for this MP mode.
  2262. * @default 0
  2263. *
  2264. * @param Mode 20 Help Line 1
  2265. * @desc The 1st help description line used for this MP mode.
  2266. * @default -
  2267. *
  2268. * @param Mode 20 Help Line 2
  2269. * @desc The 2nd help description line used for this MP mode.
  2270. * @default -
  2271. *
  2272. * @param Mode 20 Max MP
  2273. * @desc The formula used to determine the max MP for this mode.
  2274. * @default user.mmp
  2275. *
  2276. * @param Mode 20 Preserve
  2277. * @desc true - Carry MP from one battle to the next.
  2278. * false - Reset the initial MP count each battle.
  2279. * @default true
  2280. *
  2281. * @param Mode 20 Initial MP
  2282. * @desc Formula for much MP is gained at the start of battle.
  2283. * @default 0
  2284. *
  2285. * @param Mode 20 Regen MP
  2286. * @desc Formula for how much MP is gained upon regeneration.
  2287. * @default user.mmp * user.mrg
  2288. *
  2289. * @param Mode 20 Take HP DMG
  2290. * @desc Formula for how much MP is gained taking HP damage.
  2291. * @default 0
  2292. *
  2293. * @param Mode 20 Deal HP DMG
  2294. * @desc Formula for how much MP is gained dealing HP damage.
  2295. * @default 0
  2296. *
  2297. * @param Mode 20 Heal HP DMG
  2298. * @desc Formula for how much MP is gained healing HP damage.
  2299. * @default 0
  2300. *
  2301. * @param Mode 20 Ally HP DMG
  2302. * @desc Formula for how much MP is gained for ally HP damage.
  2303. * @default 0
  2304. *
  2305. * @param Mode 20 Take MP DMG
  2306. * @desc Formula for how much MP is gained taking MP damage.
  2307. * @default 0
  2308. *
  2309. * @param Mode 20 Deal MP DMG
  2310. * @desc Formula for how much MP is gained dealing MP damage.
  2311. * @default 0
  2312. *
  2313. * @param Mode 20 Heal MP DMG
  2314. * @desc Formula for how much MP is gained healing MP damage.
  2315. * @default 0
  2316. *
  2317. * @param Mode 20 Ally MP DMG
  2318. * @desc Formula for how much MP is gained for ally MP damage.
  2319. * @default 0
  2320. *
  2321. * @param Mode 20 Deal State
  2322. * @desc Formula MP gained when user inflicts a state on a foe.
  2323. * @default 0
  2324. *
  2325. * @param Mode 20 Gain State
  2326. * @desc Formula MP gained when user gains a state from a foe.
  2327. * @default 0
  2328. *
  2329. * @param Mode 20 Kill Ally
  2330. * @desc Formula for how much MP is gained when an ally is killed.
  2331. * @default 0
  2332. *
  2333. * @param Mode 20 Kill Enemy
  2334. * @desc Formula for how much MP is gained when a foe is killed.
  2335. * @default 0
  2336. *
  2337. * @param Mode 20 Win Battle
  2338. * @desc Formula for how much MP is gained when a battle is won.
  2339. * @default 0
  2340. *
  2341. * @param Mode 20 Flee Battle
  2342. * @desc Formula for how much MP is gained when a battle is fled.
  2343. * @default 0
  2344. *
  2345. * @param Mode 20 Lose Battle
  2346. * @desc Formula for how much MP is gained when a battle is lost.
  2347. * @default 0
  2348. *
  2349. * @param Mode 20 Crisis HP
  2350. * @desc Formula for MP gained during the MP regeneration timing
  2351. * with crisis amounts of HP.
  2352. * @default 0
  2353. *
  2354. * @param Mode 20 Crisis MP
  2355. * @desc Formula for MP gained during the MP regeneration timing
  2356. * with crisis amounts of MP.
  2357. * @default 0
  2358. *
  2359. * @param Mode 20 Only Member
  2360. * @desc Formula for MP gained during the MP regeneration timing
  2361. * as the only ally alive.
  2362. * @default 0
  2363. *
  2364. * @param Mode 20 Evasion
  2365. * @desc Formula for how much MP is gained when user evades an attack.
  2366. * @default 0
  2367. *
  2368. * @help
  2369. * ============================================================================
  2370. * Introduction
  2371. * ============================================================================
  2372. * A message from Zarsla:
  2373. * This is litteraly a re-copy of Enhanced TP Mode by Yanfly
  2374. * I just change all the TP stuff to MP and that's it. No you don't have to credit me,
  2375. * just remember to credit Yanfly.
  2376. *
  2377. * Also place this plugin in the same area, that Enchaned TP is in if you have it.
  2378. * If not check Yanfly.Moe and place this plugin where Enchanced TP would be.
  2379. *==============================================================================
  2380. * The MP system in RPG Maker MV is rather limiting. A lot of the MP system is
  2381. * hardcoded in giving RPG Maker MV users very little control over how much MP
  2382. * gain a battler can receive from particular actions and situations. This
  2383. * plugin gives you the ability to adjust how much MP battlers will acquire
  2384. * various actions, different MP modes, and letting players selecting and pick
  2385. * what MP mode they want for each actor.
  2386. *
  2387. * ============================================================================
  2388. * Instructions - MP Mode Parameters
  2389. * ============================================================================
  2390. *
  2391. * MP Modes are given to your actors for them to decide how they want to gain
  2392. * MP over the course of battle. You can decide the rulings for each MP Mode.
  2393. *
  2394. * Here is an overview of what each MP Mode Parameter does:
  2395. *
  2396. * Name
  2397. * - This is the name of the MP Mode. This is what appears in the MP Mode
  2398. * selection menu in the Skill Menu (if you have it enabled).
  2399. *
  2400. * Icon
  2401. * - This is the icon used for the MP Mode in the MP Mode selection menu in
  2402. * the Skill Menu (if you have it enabled).
  2403. *
  2404. * Help Line 1
  2405. * Help Line 2
  2406. * - This is the help description used for the MP Mode in the MP Mode
  2407. * selection menu in the Skill Menu (if you have it enabled).
  2408. *
  2409. * Preserve
  2410. * - If set to true, then the user carries any earned MP from on battle to
  2411. * the next battle. If set to false, the at the start and each of each battle
  2412. * the user's MP value is cleared.
  2413. *
  2414. * Initial MP
  2415. * - This is the formula to determine how much MP is gained at the start of
  2416. * battle. Previously, this was reserved for non-preserved MP values. Now, it
  2417. * can be used regardless.
  2418. *
  2419. * Regen MP
  2420. * - This is how much MP is regenerated during the regeneration phase for the
  2421. * user. Typically, the regeneration phase occurs at the end of each turn.
  2422. *
  2423. * Take HP DMG
  2424. * - This is how much MP is generated from the user taking HP damage. The
  2425. * amount of damage taken can be retrieved from the 'value' variable.
  2426. *
  2427. * Deal HP DMG
  2428. * - This is how much MP is generated from the user dealing HP damage. The
  2429. * amount of damage taken can be retrieved from the 'value' variable.
  2430. *
  2431. * Heal HP DMG
  2432. * - This is how much MP is generated from the user healing HP damage. The
  2433. * amount of damage taken can be retrieved from the 'value' variable.
  2434. *
  2435. * Ally HP DMG
  2436. * - This is how much MP is generated from an ally taking HP damage. The
  2437. * amount of damage taken can be retrieved from the 'value' variable.
  2438. *
  2439. * Take MP DMG
  2440. * - This is how much MP is generated from the user taking MP damage. The
  2441. * amount of damage taken can be retrieved from the 'value' variable.
  2442. *
  2443. * Deal MP DMG
  2444. * - This is how much MP is generated from the user dealing MP damage. The
  2445. * amount of damage taken can be retrieved from the 'value' variable.
  2446. *
  2447. * Heal MP DMG
  2448. * - This is how much MP is generated from the user healing MP damage. The
  2449. * amount of damage taken can be retrieved from the 'value' variable.
  2450. *
  2451. * Ally MP DMG
  2452. * - This is how much MP is generated from an ally taking MP damage. The
  2453. * amount of damage taken can be retrieved from the 'value' variable.
  2454. *
  2455. * Deal State
  2456. * - This is how much MP is generated from the user issuing a state on a foe.
  2457. * If the user and target are on the same team, ignore this.
  2458. *
  2459. * Gain State
  2460. * - This is how much MP is generated from the user gaining a state from a
  2461. * foe. If the user and origin are on the same team, ignore this.
  2462. *
  2463. * Kill Ally
  2464. * - This is how much MP is generated if an allied member dies. It does not
  2465. * matter who the killer is.
  2466. *
  2467. * Kill Enemy
  2468. * - This is how much MP is generated if an enemy member dies. It does not
  2469. * matter who the killer is.
  2470. *
  2471. * Win Battle
  2472. * - This is how much MP is generated from the player winning a battle.
  2473. *
  2474. * Flee Battle
  2475. * - This is how much MP is generated from the player escaping a battle.
  2476. *
  2477. * Lose Battle
  2478. * - This is how much MP is generated from the player losing a battle.
  2479. *
  2480. * Crisis HP
  2481. * - This is how much MP is generated during the Regen MP timing if the user
  2482. * is in a critical HP state.
  2483. *
  2484. * Crisis MP
  2485. * - This is how much MP is generated during the Regen MP timing if the user
  2486. * is in a critical MP state.
  2487. *
  2488. * Only Member
  2489. * - This is how much MP is generated during the Regen MP timing if the user
  2490. * is the only alive member left.
  2491. *
  2492. * Evasion
  2493. * - This is how much MP is generated whenever the user manages to evade an
  2494. * action performed by another battler.
  2495. *
  2496. * ============================================================================
  2497. * Notetags
  2498. * ============================================================================
  2499. *
  2500. * You can use the following notetags to adjust the various settings for MP.
  2501. *
  2502. * Actor and Enemy Notetags:
  2503. *
  2504. * <MP Mode: x>
  2505. * This will set the actor's default MP mode to x. If this notetag isn't used
  2506. * then the actor will default to the mode within the plugin's parameters.
  2507. *
  2508. * <Unlock MP Mode: x>
  2509. * <Unlock MP Mode: x, x, x>
  2510. * <Unlock MP Mode: x to y>
  2511. * This unlocks what MP modes the actor can use by default. This tag will add
  2512. * upon the default unlocks already preset in the plugin's parameters.
  2513. *
  2514. * Skill and Item Notetags:
  2515. *
  2516. * <Unlock MP Mode: x>
  2517. * <Unlock MP Mode: x, x, x>
  2518. * <Unlock MP Mode: x to y>
  2519. * This will cause the target to unlock MP mode x (to y). This will make the
  2520. * MP mode available in the MP menu.
  2521. *
  2522. * Skill Notetags:
  2523. *
  2524. * <Learn Unlock MP Mode: x>
  2525. * <Learn Unlock MP Mode: x, x, x>
  2526. * <Learn Unlock MP Mode: x to y>
  2527. * When this skill is learned, unlock MP mode x (to y) in the process of also
  2528. * learning it. This will make the MP mode available in the MP menu.
  2529. *
  2530. * ============================================================================
  2531. * Plugin Commands
  2532. * ============================================================================
  2533. *
  2534. * You can use the following Plugin Commands to alter Enhanced MP.
  2535. *
  2536. * Plugin Command:
  2537. *
  2538. * ShowMpMode
  2539. * HideMpMode
  2540. * This will show/hide the MP Mode from the Skill Menu.
  2541. *
  2542. * EnableMpMode
  2543. * DisableMpMode
  2544. * This will enable/disable the MP Mode in the Skill Menu.
  2545. *
  2546. * ChangeMpMode Actor 1 to 5
  2547. * This will change the MP mode of Actor 1 to MP Mode 5.
  2548. *
  2549. * ChangeMpMode Party 2 to 6
  2550. * This will change the MP mode of Party Member 2 to MP Mode 6.
  2551. *
  2552. * UnlockMpMode Actor 3 Mode 7
  2553. * This will make Actor 3 unlock MP Mode 7.
  2554. *
  2555. * UnlockMpMode Party 4 Mode 8
  2556. * This will make Party Member 4 unlock MP Mode 8.
  2557. *
  2558. * RemoveMpMode Actor 1 Mode 9
  2559. * This will make Actor 1 remove MP Mode 9.
  2560. *
  2561. * RemoveMpMode Party 2 Mode 10
  2562. * This will make Party Member 2 remove MP Mode 10.
  2563. *
  2564. * UnlockAllMpModes Actor 1
  2565. * This will make Actor 1 unlock all MP modes.
  2566. *
  2567. * UnlockAllMpModes Party 2
  2568. * This will make Party member 2 unlock all MP modes.
  2569. *
  2570. * RemoveAllMpModes Actor 1
  2571. * This will make Actor 1 remove all MP modes.
  2572. *
  2573. * RemoveAllMpModes Party 2
  2574. * This will make Party member 2 remove all MP modes.
  2575. *
  2576. * ============================================================================
  2577. * Lunatic Mode - New JavaScript Functions
  2578. * ============================================================================
  2579. *
  2580. * For those experienced with JavaScript, you can use these new functions to
  2581. * call upon and change various aspects related to MP Modes.
  2582. *
  2583. * battler.mpMode()
  2584. * This will return the current MP mode the battler is using.
  2585. *
  2586. * battler.mpModeId()
  2587. * This will return the current MP mode's ID the battler is using.
  2588. *
  2589. * battler.setMpMode(x)
  2590. * This will set the battler's MP mode to x.
  2591. *
  2592. * battler.unlockMpMode(x)
  2593. * This will unlock MP Mode x for the battler.
  2594. *
  2595. * battler.removeMpMode(x)
  2596. * This will remove MP Mode x for the battler unless the battler is currently
  2597. * using MP Mode x.
  2598. *
  2599. * battler.unlockAllMpModes()
  2600. * This will unlock all MP Modes for the battler.
  2601. *
  2602. * battler.removeAllMpModes()
  2603. * This will remove all MP Modes for the battler except for the MP Mode that
  2604. * the battler is currently using.
  2605. *
  2606. * ============================================================================
  2607. * Changelog
  2608. * ============================================================================
  2609. *
  2610. * Version 1.00:
  2611. * - Lunatic Mode fail safes added.
  2612. *
  2613. * Version 1.05:
  2614. * - Added 'Dead MP Gain' plugin parameter. Enabling this will allow dead
  2615. * actors to gain MP from MP modes while in battle. Disabling this will prevent
  2616. * dead actors from doing so.
  2617. *
  2618. * Version 1.04:
  2619. * - Calculations for MP Gauge increasing for HP and MP values are now
  2620. * calculated based on the actual HP and MP damage taken as per the results
  2621. * rather than based off of the raw incoming value (in the event that raw value
  2622. * gets modified as per the effects of other plugins).
  2623. *
  2624. * Version 1.03:
  2625. * - Fixed the plugin commands that pertain to party members to prevent them
  2626. * from crashing the game.
  2627. *
  2628. * Version 1.02a:
  2629. * - Updated for RPG Maker MV version 1.1.0.
  2630. * - Fixed a documentation issue. <MP Mode: x> can work with enemies.
  2631. *
  2632. * Version 1.01a:
  2633. * - Fixed a bug with some notetags not working properly.
  2634. * - Fixed a bug with 'EnableMpMode' plugin command not working properly.
  2635. *
  2636. * Version 1.00:
  2637. * - Finished Plugin!
  2638. */
  2639. //=============================================================================
  2640.  
  2641. //=============================================================================
  2642. // Parameter Variables
  2643. //=============================================================================
  2644.  
  2645. Yanfly.Parameters = PluginManager.parameters('YEP_EnhancedMP');
  2646. Yanfly.Param = Yanfly.Param || {};
  2647.  
  2648. Yanfly.Param.EMPCmdName = String(Yanfly.Parameters['Command Name']);
  2649. Yanfly.Param.EMPShowCmd = eval(String(Yanfly.Parameters['Show Command']));
  2650. Yanfly.Param.EMPEnableCmd = eval(String(Yanfly.Parameters['Enable Command']));
  2651. Yanfly.Param.EMPChangeReset = eval(String(Yanfly.Parameters['Change Reset']));
  2652. Yanfly.Param.EMPEquipColor = Number(Yanfly.Parameters['Equipped Color']);
  2653. Yanfly.Param.EMPDefaultModeActor = Number(Yanfly.Parameters['Default Actor Mode']);
  2654. Yanfly.Param.EMPDefaultModeEnemy = Number(Yanfly.Parameters['Default Enemy Mode']);
  2655. Yanfly.Param.EMPDefaultMode = Number(Yanfly.Parameters['Default Mode']);
  2656. Yanfly.Param.EMPUnlocks = String(Yanfly.Parameters['Default Unlocks']);
  2657. Yanfly.Param.EMPUnlocks = Yanfly.Param.EMPUnlocks.split(' ');
  2658. if (Yanfly.Param.EMPUnlocks === '') Yanfly.Param.EMPUnlocks = [];
  2659. for (Yanfly.i = 0; Yanfly.i < Yanfly.Param.EMPUnlocks.length; ++Yanfly.i) {
  2660. Yanfly.Param.EMPUnlocks[Yanfly.i] =
  2661. parseInt(Yanfly.Param.EMPUnlocks[Yanfly.i]);
  2662. };
  2663. Yanfly.Param.EMPCrisisHP = Number(Yanfly.Parameters['Crisis HP']);
  2664. Yanfly.Param.EMPCrisisMP = Number(Yanfly.Parameters['Crisis MP']);
  2665. Yanfly.Param.EMPDeadTpGain = eval(String(Yanfly.Parameters['Dead MP Gain']));
  2666.  
  2667. Yanfly.Param.EMPMax = 20;
  2668. var $dataMpModes = [null];
  2669. for (Yanfly.i = 1; Yanfly.i < Yanfly.Param.EMPMax + 1; ++Yanfly.i) {
  2670. $dataMpModes[Yanfly.i] = {
  2671. id: Yanfly.i,
  2672. name: String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Name']),
  2673. iconIndex: Number(Yanfly.Parameters['Mode ' + Yanfly.i + ' Icon']),
  2674. description:
  2675. String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Help Line 1']) + '\n' +
  2676. String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Help Line 2']),
  2677. maxMp: String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Max MP']),
  2678. preserve: eval(String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Preserve'])),
  2679. initialTp: String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Initial MP']),
  2680. regenTp: String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Regen MP']),
  2681. takeHpDmg: String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Take HP DMG']),
  2682. dealHpDmg: String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Deal HP DMG']),
  2683. healHpDmg: String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Heal HP DMG']),
  2684. allyHpDmg: String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Ally HP DMG']),
  2685. takeMpDmg: String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Take MP DMG']),
  2686. dealMpDmg: String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Deal MP DMG']),
  2687. healMpDmg: String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Heal MP DMG']),
  2688. allyMpDmg: String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Ally MP DMG']),
  2689. allyMpDmg: String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Ally MP DMG']),
  2690. dealState: String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Deal State']),
  2691. gainState: String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Gain State']),
  2692. killAlly: String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Kill Ally']),
  2693. killEnemy: String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Kill Enemy']),
  2694. winBattle: String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Win Battle']),
  2695. fleeBattle: String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Flee Battle']),
  2696. loseBattle: String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Lose Battle']),
  2697. crisisHp: String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Crisis HP']),
  2698. crisisMp: String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Crisis MP']),
  2699. onlyMember: String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Only Member']),
  2700. evasion: String(Yanfly.Parameters['Mode ' + Yanfly.i + ' Evasion'])
  2701. }
  2702. };
  2703.  
  2704. //=============================================================================
  2705. // DataManager
  2706. //=============================================================================
  2707.  
  2708. Yanfly.EMP.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
  2709. DataManager.isDatabaseLoaded = function() {
  2710. if (!Yanfly.EMP.DataManager_isDatabaseLoaded.call(this)) return false;
  2711. if (!Yanfly._loaded_YEP_EnhancedMP) {
  2712. this.processEMPNotetags1($dataActors);
  2713. this.processEMPNotetags1($dataEnemies);
  2714. this.processEMPNotetags2($dataSkills);
  2715. this.processEMPNotetags2($dataItems);
  2716. this.processEMPNotetags3($dataSkills);
  2717. Yanfly._loaded_YEP_EnhancedMP = true;
  2718. }
  2719. return true;
  2720. };
  2721.  
  2722. DataManager.processEMPNotetags1 = function(group) {
  2723. var noteU1 = /<(?:UNLOCK MP MODE):[ ]*(\d+(?:\s*,\s*\d+)*)>/i;
  2724. var noteU2 = /<(?:UNLOCK MP MODE):[ ](\d+)[ ](?:THROUGH|to)[ ](\d+)>/i;
  2725. for (var n = 1; n < group.length; n++) {
  2726. var obj = group[n];
  2727. var notedata = obj.note.split(/[\r\n]+/);
  2728.  
  2729. obj.mpMode = Yanfly.Param.EMPDefaultMode;
  2730. obj.unlockedMpModes = [obj.mpMode];
  2731. obj.unlockedMpModes = obj.unlockedMpModes.concat(Yanfly.Param.EMPUnlocks);
  2732.  
  2733. for (var i = 0; i < notedata.length; i++) {
  2734. var line = notedata[i];
  2735. if (line.match(/<(?:MP MODE):[ ](\d+)>/i)) {
  2736. obj.mpMode = parseInt(RegExp.$1);
  2737. } else if (line.match(noteU1)) {
  2738. var array = JSON.parse('[' + RegExp.$1.match(/\d+/g) + ']');
  2739. obj.unlockedMpModes = obj.unlockedMpModes.concat(array);
  2740. } else if (line.match(noteU2)) {
  2741. var range = Yanfly.Util.getRange(parseInt(RegExp.$1),
  2742. parseInt(RegExp.$2));
  2743. obj.unlockedMpModes = obj.unlockedMpModes.concat(range);
  2744. }
  2745. }
  2746. }
  2747. };
  2748.  
  2749. DataManager.processEMPNotetags2 = function(group) {
  2750. var noteU1 = /<(?:UNLOCK MP MODE):[ ]*(\d+(?:\s*,\s*\d+)*)>/i;
  2751. var noteU2 = /<(?:UNLOCK MP MODE):[ ](\d+)[ ](?:THROUGH|to)[ ](\d+)>/i;
  2752. for (var n = 1; n < group.length; n++) {
  2753. var obj = group[n];
  2754. var notedata = obj.note.split(/[\r\n]+/);
  2755.  
  2756. obj.unlockedMpModes = [];
  2757.  
  2758. for (var i = 0; i < notedata.length; i++) {
  2759. var line = notedata[i];
  2760. if (line.match(noteU1)) {
  2761. var array = JSON.parse('[' + RegExp.$1.match(/\d+/g) + ']');
  2762. obj.unlockedMpModes = obj.unlockedMpModes.concat(array);
  2763. } else if (line.match(noteU2)) {
  2764. var range = Yanfly.Util.getRange(parseInt(RegExp.$1),
  2765. parseInt(RegExp.$2));
  2766. obj.unlockedMpModes = obj.unlockedMpModes.concat(range);
  2767. }
  2768. }
  2769. }
  2770. };
  2771.  
  2772. DataManager.processEMPNotetags3 = function(group) {
  2773. var noteU1 = /<(?:LEARN UNLOCK MP MODE):[ ]*(\d+(?:\s*,\s*\d+)*)>/i;
  2774. var noteU2 = /<(?:LEARN UNLOCK MP MODE):[ ](\d+)[ ](?:THROUGH|to)[ ](\d+)>/i;
  2775. for (var n = 1; n < group.length; n++) {
  2776. var obj = group[n];
  2777. var notedata = obj.note.split(/[\r\n]+/);
  2778.  
  2779. obj.learnUnlockedMpModes = [];
  2780.  
  2781. for (var i = 0; i < notedata.length; i++) {
  2782. var line = notedata[i];
  2783. if (line.match(noteU1)) {
  2784. var array = JSON.parse('[' + RegExp.$1.match(/\d+/g) + ']');
  2785. obj.learnUnlockedMpModes = obj.learnUnlockedMpModes.concat(array);
  2786. } else if (line.match(noteU2)) {
  2787. var range = Yanfly.Util.getRange(parseInt(RegExp.$1),
  2788. parseInt(RegExp.$2));
  2789. obj.learnUnlockedMpModes = obj.learnUnlockedMpModes.concat(range);
  2790. }
  2791. }
  2792. }
  2793. };
  2794.  
  2795. //=============================================================================
  2796. // BattleManager
  2797. //=============================================================================
  2798.  
  2799. Yanfly.EMP.BattleManager_endBattle = BattleManager.endBattle;
  2800. BattleManager.endBattle = function(result) {
  2801. if (result === 0) {
  2802. $gameParty.allMembersGainTp('winBattle');
  2803. } else if (result === 1) {
  2804. $gameParty.allMembersGainTp('fleeBattle');
  2805. } else if (result === 2) {
  2806. $gameParty.allMembersGainTp('loseBattle');
  2807. }
  2808. Yanfly.EMP.BattleManager_endBattle.call(this, result);
  2809. };
  2810.  
  2811. //=============================================================================
  2812. // Game_System
  2813. //=============================================================================
  2814.  
  2815. Yanfly.EMP.Game_System_initialize = Game_System.prototype.initialize;
  2816. Game_System.prototype.initialize = function() {
  2817. Yanfly.EMP.Game_System_initialize.call(this);
  2818. this.initEMPSettings();
  2819. };
  2820.  
  2821. Game_System.prototype.initEMPSettings = function() {
  2822. this._showMpMode = Yanfly.Param.EMPShowCmd;
  2823. this._enableMpMode = Yanfly.Param.EMPEnableCmd;
  2824. };
  2825.  
  2826. Game_System.prototype.isShowMpMode = function() {
  2827. if (this._showMpMode === undefined) this.initEMPSettings();
  2828. return this._showMpMode;
  2829. };
  2830.  
  2831. Game_System.prototype.setShowMpMode = function(value) {
  2832. if (this._showMpMode === undefined) this.initEMPSettings();
  2833. this._showMpMode = value;
  2834. };
  2835.  
  2836. Game_System.prototype.isEnableMpMode = function() {
  2837. if (this._enableMpMode === undefined) this.initEMPSettings();
  2838. return this._enableMpMode;
  2839. };
  2840.  
  2841. Game_System.prototype.setEnableMpMode = function(value) {
  2842. if (this._enableMpMode === undefined) this.initEMPSettings();
  2843. this._enableMpMode = value;
  2844. };
  2845.  
  2846. //=============================================================================
  2847. // Game_BattlerBase
  2848. //=============================================================================
  2849.  
  2850. Yanfly.EMP.Game_BattlerBase_refresh = Game_BattlerBase.prototype.refresh;
  2851. Game_BattlerBase.prototype.refresh = function() {
  2852. this._maxMpCache = undefined;
  2853. Yanfly.EMP.Game_BattlerBase_refresh.call(this);
  2854. };
  2855.  
  2856. Game_BattlerBase.prototype.initMpMode = function() {
  2857. if(this.isActor() && !(Yanfly.Param.EMPDefaultModeActor == "")){
  2858. this._mpMode = Yanfly.Param.EMPDefaultMode;
  2859. }else if(this.isEnemy() && !(Yanfly.Param.EMPDefaultModeEnemy == "")){
  2860. this._mpMode = Yanfly.Param.EMPDefaultMode;
  2861. }else {
  2862. this._mpMode = Yanfly.Param.EMPDefaultMode;
  2863. }
  2864.  
  2865. this._unlockedMpModes = [];
  2866. if (this.isActor()) {
  2867. this._mpMode = this.actor().mpMode;
  2868. this._unlockedMpModes = this.actor().unlockedMpModes.slice();
  2869. } else if (this.isEnemy()) {
  2870. this._mpMode = this.enemy().mpMode;
  2871. this._unlockedMpModes = this.enemy().unlockedMpModes.slice();
  2872. }
  2873. this._unlockedMpModes = this._unlockedMpModes.filter(Yanfly.Util.onlyUnique);
  2874. this._unlockedMpModes.sort(function(a, b) { return a - b; });
  2875. };
  2876.  
  2877. Game_BattlerBase.prototype.mpMode = function() {
  2878. if (!this._mpMode) this.initMpMode();
  2879. return $dataMpModes[this._mpMode];
  2880. };
  2881.  
  2882. Game_BattlerBase.prototype.mpModeId = function() {
  2883. if (!this._mpMode) this.initMpMode();
  2884. return this._mpMode;
  2885. };
  2886.  
  2887. Game_BattlerBase.prototype.setMpMode = function(value) {
  2888. if (!this._mpMode) this.initMpMode();
  2889. if ($dataMpModes.contains(value)) value = value.id;
  2890. this.configureNewMpMode(value);
  2891. if (this._unlockedMpModes.contains(value)) return;
  2892. this._unlockedMpModes.push(value);
  2893. this._unlockedMpModes.sort(function(a, b) { return a - b; });
  2894. };
  2895.  
  2896. Game_BattlerBase.prototype.configureNewMpMode = function(mpModeId) {
  2897. this._mpMode = mpModeId;
  2898. if (Yanfly.Param.EMPChangeReset) this._mp = 0;
  2899. this.refresh();
  2900. this._mp = this._mp.clamp(0, this.mmp);
  2901. };
  2902.  
  2903. Game_BattlerBase.prototype.mpRate = function() {
  2904. return this.mp / this.mmp;
  2905. };
  2906.  
  2907. Game_BattlerBase.prototype.unlockMpMode = function(mpModeId) {
  2908. if (!this._unlockedMpModes) this.initMpMode();
  2909. this._unlockedMpModes.push(mpModeId);
  2910. this._unlockedMpModes = this._unlockedMpModes.filter(Yanfly.Util.onlyUnique);
  2911. this._unlockedMpModes.sort(function(a, b) { return a - b; });
  2912. this.refresh();
  2913. };
  2914.  
  2915. Game_BattlerBase.prototype.removeMpMode = function(mpModeId) {
  2916. if (this.mpMode() && this.mpMode().id === mpModeId) return;
  2917. var index = this._unlockedMpModes.indexOf(mpModeId);
  2918. if (index >= 0) this._unlockedMpModes.splice(index, 1);
  2919. this.refresh();
  2920. };
  2921.  
  2922. Game_BattlerBase.prototype.forgetMpMode = function(mpModeId) {
  2923. this.removeMpMode(mpModeId);
  2924. };
  2925.  
  2926. Game_BattlerBase.prototype.unlockAllMpModes = function() {
  2927. var length = $dataMpModes.length;
  2928. for (var i = 0; i < length; ++i) {
  2929. var mpMode = $dataMpModes[i];
  2930. if (mpMode) this.unlockMpMode(mpMode.id);
  2931. }
  2932. };
  2933.  
  2934. Game_BattlerBase.prototype.removeAllMpModes = function() {
  2935. var length = $dataMpModes.length;
  2936. for (var i = 0; i < length; ++i) {
  2937. var mpMode = $dataMpModes[i];
  2938. if (!mpMode) continue;
  2939. if (this.mpMode() === mpMode) continue;
  2940. this.removeMpMode(mpMode.id);
  2941. }
  2942. };
  2943.  
  2944. Game_BattlerBase.prototype.unlockedMpModes = function() {
  2945. if (!this._unlockedMpModes) this.initMpMode();
  2946. var arr = [];
  2947. var length = this._unlockedMpModes.length;
  2948. for (var i = 0; i < length; ++i) {
  2949. var modeId = this._unlockedMpModes[i];
  2950. if (!$dataMpModes[modeId]) continue;
  2951. if ($dataMpModes[modeId].name === '') continue;
  2952. if ($dataMpModes[modeId].name.toUpperCase() === 'UNDEFINED') continue;
  2953. arr.push($dataMpModes[modeId]);
  2954. }
  2955. return arr;
  2956. };
  2957.  
  2958. Game_BattlerBase.prototype.getTpEval = function(evalMode, user, target, value) {
  2959. var value = value || 0;
  2960. var a = this;
  2961. var target = target || this;
  2962. var attacker = target || this;
  2963. var subject = this;
  2964. var s = $gameSwitches._data;
  2965. var v = $gameVariables._data;
  2966. var formula = this.mpMode()[evalMode];
  2967. try {
  2968. var mpGain = eval(formula);
  2969. } catch (e) {
  2970. var mpGain = 0;
  2971. Yanfly.Util.displayError(e, formula, 'CUSTOM MP MODE GAIN FORMUAL ERROR');
  2972. }
  2973. return Math.floor(parseInt(mpGain));
  2974. };
  2975.  
  2976. Yanfly.EMP.Game_BattlerBase_maxMp = Game_BattlerBase.prototype.maxMp;
  2977. Game_BattlerBase.prototype.maxMp = function() {
  2978. if (this._maxMpCache !== undefined) return this._maxMpCache;
  2979. if (!this.mpMode()) {
  2980. this._maxMpCache = Yanfly.EMP.Game_BattlerBase_maxMp.call(this);
  2981. return this._maxMpCache;
  2982. }
  2983. var a = this;
  2984. var user = this;
  2985. var target = this;
  2986. var subject = this;
  2987. var s = $gameSwitches._data;
  2988. var v = $gameVariables._data;
  2989. this._maxMpCache = this.getTpEval('maxMp', this, this, 0);
  2990. return this._maxMpCache;
  2991. };
  2992.  
  2993. Yanfly.EMP.Game_BattlerBase_isPreserveMp =
  2994. Game_BattlerBase.prototype.isPreserveMp;
  2995. Game_BattlerBase.prototype.isPreserveMp = function() {
  2996. if (this.mpMode()) return this.mpMode().preserve;
  2997. return Yanfly.EMP.Game_BattlerBase_isPreserveMp.call(this);
  2998. };
  2999.  
  3000. //=============================================================================
  3001. // Game_Battler
  3002. //=============================================================================
  3003.  
  3004. Yanfly.EMP.Game_Battler_initMp = Game_Battler.prototype.initMp;
  3005. Game_Battler.prototype.initMp = function() {
  3006. if (this.mpMode()) {
  3007. this.setMp(0);
  3008. } else {
  3009. Yanfly.EMP.Game_Battler_initMp.call(this);
  3010. }
  3011. };
  3012.  
  3013. Yanfly.EMP.Game_Battler_onBattleStart = Game_Battler.prototype.onBattleStart;
  3014. Game_Battler.prototype.onBattleStart = function() {
  3015. Yanfly.EMP.Game_Battler_onBattleStart.call(this);
  3016. if (this.mpMode()) this.gainBattleStartMp();
  3017. };
  3018.  
  3019. Yanfly.EMP.Game_Battler_onBattleEnd = Game_Battler.prototype.onBattleEnd;
  3020. Game_Battler.prototype.onBattleEnd = function() {
  3021. Yanfly.EMP.Game_Battler_onBattleEnd.call(this);
  3022. if (this.isPreserveMp()) return;
  3023. this.clearTp();
  3024. };
  3025.  
  3026. Game_Battler.prototype.gainMpmodeMp = function(value) {
  3027. if (this.canGainMpModeTp()) this.gainMp(value);
  3028. };
  3029.  
  3030. Game_Battler.prototype.canGainMpModeTp = function() {
  3031. if (!Yanfly.Param.EMPDeadTpGain) {
  3032. if (this.isDead()) return false;
  3033. }
  3034. return true;
  3035. };
  3036.  
  3037. Game_Battler.prototype.gainBattleStartMp = function() {
  3038. var value = this.getTpEval('initialTp', this, this, 0);
  3039. this.gainMpmodeMp(value);
  3040. };
  3041.  
  3042. Yanfly.EMP.Game_Battler_regenerateTp = Game_Battler.prototype.regenerateTp;
  3043. Game_Battler.prototype.regenerateTp = function() {
  3044. if (this.mpMode()) {
  3045. this.regularRegenTp();
  3046. this.crisisRegenTp();
  3047. this.onlyMemberRegenTp();
  3048. } else {
  3049. Yanfly.EMP.Game_Battler_regenerateTp.call(this);
  3050. }
  3051. };
  3052.  
  3053. Game_Battler.prototype.regularRegenTp = function() {
  3054. var value = this.getTpEval('regenTp', this, this, 0);
  3055. this.gainMpmodeMp(value);
  3056. };
  3057.  
  3058. Game_Battler.prototype.crisisRegenTp = function() {
  3059. if (this.hpRate() <= Yanfly.Param.EMPCrisisHP) {
  3060. var value = this.getTpEval('crisisHp', this, this, 0);
  3061. this.gainMpmodeMp(value);
  3062. }
  3063. if (this.mpRate() <= Yanfly.Param.EMPCrisisMP) {
  3064. var value = this.getTpEval('crisisMp', this, this, 0);
  3065. this.gainMpmodeMp(value);
  3066. }
  3067. };
  3068.  
  3069. Game_Battler.prototype.onlyMemberRegenTp = function() {
  3070. if (this.isDead()) return;
  3071. if (this.friendsUnit().aliveMembers().length > 1) return;
  3072. var value = this.getTpEval('onlyMember', this, this, 0);
  3073. this.gainMpmodeMp(value);
  3074. };
  3075.  
  3076. Yanfly.EMP.Game_Battler_chargeTpByDamage =
  3077. Game_Battler.prototype.chargeTpByDamage;
  3078. Game_Battler.prototype.chargeTpByDamage = function(damageRate) {
  3079. if (!this.mpMode()) {
  3080. Yanfly.EMP.Game_Battler_chargeTpByDamage.call(this, damageRate);
  3081. }
  3082. };
  3083.  
  3084. Game_Battler.prototype.chargeTpByDamageType = function(target, damage, type) {
  3085. if (!this.mpMode()) return
  3086. var value = this.getTpEval(type, this, target, damage);
  3087. this.gainMpmodeMp(value);
  3088. };
  3089.  
  3090. Yanfly.EMP.Game_Battler_addState = Game_Battler.prototype.addState;
  3091. Game_Battler.prototype.addState = function(stateId) {
  3092. if ($gameParty.inBattle() && this.mpMode()) {
  3093. var deathState = (stateId === this.deathStateId());
  3094. var lifeState = this.isAlive();
  3095. var affected = this.isStateAffected(stateId);
  3096. }
  3097. Yanfly.EMP.Game_Battler_addState.call(this, stateId);
  3098. if ($gameParty.inBattle() && this.mpMode()) {
  3099. var landed = this.isStateAffected(stateId);
  3100. if (!deathState && !affected && landed) this.chargeTpByAddState();
  3101. if (deathState && lifeState !== this.isAlive()) this.chargeTpByDeath();
  3102. }
  3103. };
  3104.  
  3105. Game_Battler.prototype.chargeTpByAddState = function() {
  3106. var user = BattleManager._subject;
  3107. var target = this;
  3108. if (user && target && user.isActor() && target.isActor()) return;
  3109. if (user && target && user.isEnemy() && target.isEnemy()) return;
  3110. if (user) {
  3111. var value = user.getTpEval('dealState', user, this, 0);
  3112. user.gainMpmodeMp(value);
  3113. }
  3114. var value = this.getTpEval('gainState', this, user, 0);
  3115. this.gainMpmodeMp(value);
  3116. };
  3117.  
  3118. Game_Battler.prototype.chargeTpByDeath = function() {
  3119. var length = this.friendsUnit().members().length;
  3120. for (var i = 0; i < length; ++i) {
  3121. var ally = this.friendsUnit().members()[i];
  3122. if (!ally) continue;
  3123. if (ally === this) continue;
  3124. var value = ally.getTpEval('killAlly', ally, this, 0);
  3125. ally.gainMpmodeMp(value);
  3126. }
  3127. var length = this.opponentsUnit().members().length;
  3128. for (var i = 0; i < length; ++i) {
  3129. var foe = this.opponentsUnit().members()[i];
  3130. if (!foe) continue;
  3131. var value = foe.getTpEval('killEnemy', foe, this, 0);
  3132. foe.gainMpmodeMp(value);
  3133. }
  3134. };
  3135.  
  3136. //=============================================================================
  3137. // Game_Actor
  3138. //=============================================================================
  3139.  
  3140. Yanfly.EMP.Game_Actor_setup = Game_Actor.prototype.setup;
  3141. Game_Actor.prototype.setup = function(actorId) {
  3142. Yanfly.EMP.Game_Actor_setup.call(this, actorId);
  3143. this.initMpMode();
  3144. };
  3145.  
  3146. Yanfly.EMP.Game_Actor_learnSkill = Game_Actor.prototype.learnSkill;
  3147. Game_Actor.prototype.learnSkill = function(skillId) {
  3148. Yanfly.EMP.Game_Actor_learnSkill.call(this, skillId);
  3149. var skill = $dataSkills[skillId];
  3150. if (skill) this.learnSkillMpMode(skill);
  3151. };
  3152.  
  3153. Game_Actor.prototype.learnSkillMpMode = function(skill) {
  3154. var length = skill.learnUnlockedMpModes.length;
  3155. for (var i = 0; i < length; ++i) {
  3156. var mpMode = skill.learnUnlockedMpModes[mpMode]
  3157. if ($dataMpModes[mpMode]) this.unlockMpMode(mpMode);
  3158. }
  3159. };
  3160.  
  3161. //=============================================================================
  3162. // Game_Enemy
  3163. //=============================================================================
  3164.  
  3165. Yanfly.EMP.Game_Enemy_setup = Game_Enemy.prototype.setup;
  3166. Game_Enemy.prototype.setup = function(enemyId, x, y) {
  3167. Yanfly.EMP.Game_Enemy_setup.call(this, enemyId, x, y);
  3168. this.initMpMode();
  3169. };
  3170.  
  3171. //=============================================================================
  3172. // Game_Party
  3173. //=============================================================================
  3174.  
  3175. Game_Party.prototype.allMembersGainTp = function(type) {
  3176. var length = this.members().length;
  3177. for (var i = 0; i < length; ++i) {
  3178. var member = this.members()[i];
  3179. if (member) {
  3180. var value = member.getTpEval(type, member, member, 0);
  3181. member.gainMpmodeMp(value);
  3182. }
  3183. }
  3184. };
  3185.  
  3186. //=============================================================================
  3187. // Game_Action
  3188. //=============================================================================
  3189.  
  3190. Yanfly.EMP.Game_Action_apply = Game_Action.prototype.apply;
  3191. Game_Action.prototype.apply = function(target) {
  3192. Yanfly.EMP.Game_Action_apply.call(this, target);
  3193. if (!target) return;
  3194. var result = target.result();
  3195. if (!result) return;
  3196. if (!target.mpMode()) return;
  3197. if (result.missed || result.evaded) {
  3198. var value = target.getTpEval('evasion', this.subject(), target, 0);
  3199. target.gainMpmodeMp(value);
  3200. }
  3201. };
  3202.  
  3203. Yanfly.EMP.Game_Action_executeHpDamage = Game_Action.prototype.executeHpDamage;
  3204. Game_Action.prototype.executeHpDamage = function(target, value) {
  3205. Yanfly.EMP.Game_Action_executeHpDamage.call(this, target, value);
  3206. var user = this.subject();
  3207. var dmg = target.result().hpDamage;
  3208. if (dmg > 0) {
  3209. if (target) target.chargeTpByDamageType(user, dmg, 'takeHpDmg');
  3210. if (target) this.allyTpGain(target, dmg, 'allyHpDmg');
  3211. if (user) user.chargeTpByDamageType(target, dmg, 'dealHpDmg');
  3212. } else if (dmg < 0) {
  3213. if (user) user.chargeTpByDamageType(target, dmg, 'healHpDmg');
  3214. }
  3215. };
  3216.  
  3217. Yanfly.EMP.Game_Action_executeMpDamage = Game_Action.prototype.executeMpDamage;
  3218. Game_Action.prototype.executeMpDamage = function(target, value) {
  3219. Yanfly.EMP.Game_Action_executeMpDamage.call(this, target, value);
  3220. var user = this.subject();
  3221. var dmg = target.result().mpDamage;
  3222. if (dmg > 0) {
  3223. if (target) target.chargeTpByDamageType(user, dmg, 'takeMpDmg');
  3224. if (target) this.allyTpGain(target, dmg, 'allyMpDmg');
  3225. if (user) user.chargeTpByDamageType(target, dmg, 'dealMpDmg');
  3226. } else if (dmg < 0) {
  3227. if (user) user.chargeTpByDamageType(target, dmg, 'healMpDmg');
  3228. }
  3229. };
  3230.  
  3231. Game_Action.prototype.allyTpGain = function(target, value, type) {
  3232. var length = target.friendsUnit().members().length;
  3233. for (var i = 0; i < length; ++i) {
  3234. var ally = target.friendsUnit().members()[i];
  3235. if (!ally) continue;
  3236. if (ally === target) continue;
  3237. ally.chargeTpByDamageType(target, value, type);
  3238. }
  3239. };
  3240.  
  3241. Yanfly.EMP.Game_Action_applyItemUserEffect =
  3242. Game_Action.prototype.applyItemUserEffect;
  3243. Game_Action.prototype.applyItemUserEffect = function(target) {
  3244. Yanfly.EMP.Game_Action_applyItemUserEffect.call(this, target);
  3245. if (target && this.item()) this.applyItemUnlockMpModes(target);
  3246. };
  3247.  
  3248. Game_Action.prototype.applyItemUnlockMpModes = function(target) {
  3249. var item = this.item();
  3250. var length = item.unlockedMpModes.length;
  3251. for (var i = 0; i < length; ++i) {
  3252. var mpMode = item.unlockedMpModes[i];
  3253. if ($dataMpModes[mpMode]) target.unlockMpMode(mpMode);
  3254. }
  3255. };
  3256.  
  3257. //=============================================================================
  3258. // Game_Interpreter
  3259. //=============================================================================
  3260.  
  3261. Yanfly.EMP.Game_Interpreter_pluginCommand =
  3262. Game_Interpreter.prototype.pluginCommand;
  3263. Game_Interpreter.prototype.pluginCommand = function(command, args) {
  3264. Yanfly.EMP.Game_Interpreter_pluginCommand.call(this, command, args);
  3265. if (command === 'ShowMpMode') $gameSystem.setShowMpMode(true);
  3266. if (command === 'HideMpMode') $gameSystem.setShowMpMode(false);
  3267. if (command === 'EnableMpMode') $gameSystem.setEnableMpMode(true);
  3268. if (command === 'DisableMpMode') $gameSystem.setEnableMpMode(false);
  3269. if (command === 'ChangeMpMode') this.changeMpMode(args);
  3270. if (command === 'UnlockMpMode') this.unlockMpMode(args);
  3271. if (command === 'RemoveMpMode') this.removeMpMode(args);
  3272. if (command === 'UnlockAllMpModes') this.unlockAllMpModes(args);
  3273. if (command === 'RemoveAllMpModes') this.removeAllMpModes(args);
  3274. };
  3275.  
  3276. Game_Interpreter.prototype.changeMpMode = function(args) {
  3277. if (!args) return;
  3278. if (args[0].toUpperCase() === 'ACTOR') {
  3279. var actor = $gameActors.actor(parseInt(args[1]));
  3280. } else if (args[0].toUpperCase() === 'PARTY') {
  3281. var actor = $gameParty.members()[parseInt(args[1]) - 1];
  3282. } else {
  3283. return;
  3284. }
  3285. if (!actor) return;
  3286. var mpModeId = parseInt(args[3]);
  3287. actor.setMpMode(mpModeId);
  3288. };
  3289.  
  3290. Game_Interpreter.prototype.unlockMpMode = function(args) {
  3291. if (!args) return;
  3292. if (args[0].toUpperCase() === 'ACTOR') {
  3293. var actor = $gameActors.actor(parseInt(args[1]));
  3294. } else if (args[0].toUpperCase() === 'PARTY') {
  3295. var actor = $gameParty.members()[parseInt(args[1]) - 1];
  3296. } else {
  3297. return;
  3298. }
  3299. if (!actor) return;
  3300. var mpModeId = parseInt(args[3]);
  3301. actor.unlockMpMode(mpModeId);
  3302. };
  3303.  
  3304. Game_Interpreter.prototype.removeMpMode = function(args) {
  3305. if (!args) return;
  3306. if (args[0].toUpperCase() === 'ACTOR') {
  3307. var actor = $gameActors.actor(parseInt(args[1]));
  3308. } else if (args[0].toUpperCase() === 'PARTY') {
  3309. var actor = $gameParty.members()[parseInt(args[1]) - 1];
  3310. } else {
  3311. return;
  3312. }
  3313. if (!actor) return;
  3314. var mpModeId = parseInt(args[3]);
  3315. actor.removeMpMode(mpModeId);
  3316. };
  3317.  
  3318. Game_Interpreter.prototype.unlockAllMpModes = function(args) {
  3319. if (!args) return;
  3320. if (args[0].toUpperCase() === 'ACTOR') {
  3321. var actor = $gameActors.actor(parseInt(args[1]));
  3322. } else if (args[0].toUpperCase() === 'PARTY') {
  3323. var actor = $gameParty.members()[parseInt(args[1]) - 1];
  3324. } else {
  3325. return;
  3326. }
  3327. if (!actor) return;
  3328. actor.unlockAllMpModes();
  3329. };
  3330.  
  3331. Game_Interpreter.prototype.removeAllMpModes = function(args) {
  3332. if (!args) return;
  3333. if (args[0].toUpperCase() === 'ACTOR') {
  3334. var actor = $gameActors.actor(parseInt(args[1]));
  3335. } else if (args[0].toUpperCase() === 'PARTY') {
  3336. var actor = $gameParty.members()[parseInt(args[1]) - 1];
  3337. } else {
  3338. return;
  3339. }
  3340. if (!actor) return;
  3341. actor.removeAllMpModes();
  3342. };
  3343.  
  3344. //=============================================================================
  3345. // Window_Base
  3346. //=============================================================================
  3347.  
  3348. Window_Base.prototype.drawMpMode = function(mode, actor, wx, wy, ww) {
  3349. ww = ww || 312;
  3350. if (!mode) return;
  3351. var iconBoxWidth = Window_Base._iconWidth + 4;
  3352. this.drawIcon(mode.iconIndex, wx + 2, wy + 2);
  3353. if (actor && actor.mpMode() === mode) {
  3354. this.changeTextColor(this.textColor(Yanfly.Param.EMPEquipColor));
  3355. } else {
  3356. this.resetTextColor();
  3357. }
  3358. this.drawText(mode.name, wx + iconBoxWidth, wy, ww - iconBoxWidth);
  3359. };
  3360.  
  3361. //=============================================================================
  3362. // Window_Selectable
  3363. //=============================================================================
  3364.  
  3365. Yanfly.EMP.Window_Selectable_playOkSound =
  3366. Window_Selectable.prototype.playOkSound;
  3367. Window_Selectable.prototype.playOkSound = function() {
  3368. if (SceneManager._scene instanceof Scene_Skill &&
  3369. this._stypeId === 'mpMode') return;
  3370. Yanfly.EMP.Window_Selectable_playOkSound.call(this);
  3371. };
  3372.  
  3373. //=============================================================================
  3374. // Window_SkillType
  3375. //=============================================================================
  3376.  
  3377. Yanfly.EMP.Window_SkillType_makeCommandList =
  3378. Window_SkillType.prototype.makeCommandList;
  3379. Window_SkillType.prototype.makeCommandList = function() {
  3380. Yanfly.EMP.Window_SkillType_makeCommandList.call(this);
  3381. if ($gameSystem.isShowMpMode()) this.addMpModeCommand();
  3382. };
  3383.  
  3384. Yanfly.EMP.Window_SkillList_isEnabled = Window_SkillList.prototype.isEnabled;
  3385. Window_SkillList.prototype.isEnabled = function(item) {
  3386. if (item && this._stypeId === 'mpMode') return true;
  3387. return Yanfly.EMP.Window_SkillList_isEnabled.call(this, item);
  3388. };
  3389.  
  3390. Window_SkillType.prototype.addMpModeCommand = function() {
  3391. var text = Yanfly.Param.EMPCmdName;
  3392. var enabled = $gameSystem.isEnableMpMode();
  3393. this.addCommand(text, 'skill', enabled, 'mpMode');
  3394. };
  3395.  
  3396. //=============================================================================
  3397. // Window_SkillList
  3398. //=============================================================================
  3399.  
  3400. Yanfly.EMP.Window_SkillList_makeItemList =
  3401. Window_SkillList.prototype.makeItemList;
  3402. Window_SkillList.prototype.makeItemList = function() {
  3403. if (this._actor && this._stypeId === 'mpMode') {
  3404. this._data = this._actor.unlockedMpModes();
  3405. } else {
  3406. Yanfly.EMP.Window_SkillList_makeItemList.call(this);
  3407. }
  3408. };
  3409.  
  3410. Yanfly.EMP.Window_SkillList_drawItem = Window_SkillList.prototype.drawItem;
  3411. Window_SkillList.prototype.drawItem = function(index) {
  3412. if (this._stypeId === 'mpMode') {
  3413. this.drawTpItem(index);
  3414. } else {
  3415. Yanfly.EMP.Window_SkillList_drawItem.call(this, index);
  3416. }
  3417. };
  3418.  
  3419. Window_SkillList.prototype.drawTpItem = function(index) {
  3420. var mode = this._data[index];
  3421. if (!mode) return;
  3422. var rect = this.itemRect(index);
  3423. rect.width -= this.textPadding();
  3424. this.changePaintOpacity(this.isEnabled(mode));
  3425. this.drawMpMode(mode, this._actor, rect.x, rect.y, rect.width);
  3426. };
  3427.  
  3428. //=============================================================================
  3429. // Scene_Skill
  3430. //=============================================================================
  3431.  
  3432. Yanfly.EMP.Scene_Skill_onItemOk = Scene_Skill.prototype.onItemOk;
  3433. Scene_Skill.prototype.onItemOk = function() {
  3434. if (this._skillTypeWindow.currentExt() === 'mpMode') {
  3435. this.changeMpMode();
  3436. } else {
  3437. Yanfly.EMP.Scene_Skill_onItemOk.call(this);
  3438. }
  3439. };
  3440.  
  3441. Scene_Skill.prototype.changeMpMode = function() {
  3442. SoundManager.playEquip();
  3443. var mpMode = this._itemWindow.item();
  3444. this.actor().setMpMode(mpMode);
  3445. this._itemWindow.activate();
  3446. this._itemWindow.refresh();
  3447. this._statusWindow.refresh();
  3448. };
  3449.  
  3450. //=============================================================================
  3451. // Utilities
  3452. //=============================================================================
  3453.  
  3454. Yanfly.Util = Yanfly.Util || {};
  3455.  
  3456. if (!Yanfly.Util.toGroup) {
  3457. Yanfly.Util.toGroup = function(inVal) {
  3458. return inVal;
  3459. }
  3460. };
  3461.  
  3462. Yanfly.Util.getRange = function(n, m) {
  3463. var result = [];
  3464. for (var i = n; i <= m; ++i) result.push(i);
  3465. return result;
  3466. };
  3467.  
  3468. Yanfly.Util.onlyUnique = function(value, index, self) {
  3469. return self.indexOf(value) === index;
  3470. };
  3471.  
  3472. Yanfly.Util.displayError = function(e, code, message) {
  3473. console.log(message);
  3474. console.log(code || 'NON-EXISTENT');
  3475. console.error(e);
  3476. if (Utils.isNwjs() && Utils.isOptionValid('test')) {
  3477. if (!require('nw.gui').Window.get().isDevToolsOpen()) {
  3478. require('nw.gui').Window.get().showDevTools();
  3479. }
  3480. }
  3481. };
  3482.  
  3483. //=============================================================================
  3484. // End of File
  3485. //=============================================================================
RAW Paste Data