Advertisement
ICF-Soft

ICF-Soft Formula Shortcut 1.03 RPG Maker MV

Jan 13th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // ICF-Soft Plugins - Formula Shortcut
  3. // ICFSoft_FormulaShortcut.js
  4. //=============================================================================
  5.  
  6. var Imported = Imported || {};
  7. Imported.ICFSoft_FormulaShortcut = true;
  8.  
  9. var ICF = ICF || {};
  10. ICF.FormulaShortcut = ICF.FormulaShortcut || {};
  11.  
  12. ICF.FormulaShortcut.Version = 103; // 1.03
  13.  
  14. //=============================================================================
  15.  /*:
  16.  * @plugindesc v1.03b This plugin adds a lot of usefull shortcuts to use in
  17.  * formulas.
  18.  * @author ICF-Soft [http://icfsoft.blogspot.com.es/]
  19.  *
  20.  * @help
  21.  * ============================================================================
  22.  * Introduction
  23.  * ============================================================================
  24.  *
  25.  * In skills and items there are fields to place a formula to determine damage
  26.  * and heal.
  27.  * Also is known that some plugins enables more places to put formulas like in
  28.  * notes, comments, plugin params, etc...
  29.  * Sometimes there isn't enough space or formulas become too complicated.
  30.  *
  31.  * With this plugin you can use some shortcuts and simplify formulas to make
  32.  * the effect you want.
  33.  *
  34.  * ============================================================================
  35.  * How to use
  36.  * ============================================================================
  37.  *
  38.  * You can use shortcuts same way as other params inside formulas:
  39.  *
  40.  * highparam() lowparam()
  41.  *
  42.  *  - To check best or worst param.
  43.  *
  44.  * hprate() hppercent()
  45.  *
  46.  *  - You can check how much is hp filled in rate (0-1) or percent (0-100).
  47.  *    Same is aplicable for mp and tp.
  48.  *
  49.  * wound() mpl() etp()
  50.  *
  51.  *  - You can also check how much hp/mp are losed or tp empty.
  52.  *    Can also check rate or percent.
  53.  *
  54.  * teamhp() teamwound() allteamwound()
  55.  *
  56.  *  - You can check entire team hp remain, hp loss (alive members) and all hp
  57.  *    loss (alive and defeated ones). Also for mp and tp.
  58.  *
  59.  * teamatk() avgatk() entireatk()
  60.  *
  61.  *  - You can use the attack of the entire alive team, the average attack and
  62.  *    the attack of the entire team (alive and defeated ones).
  63.  *    Aplicable for def, mat, mdf, agi, luk, params created from ICFSoft
  64.  *    Params Core and x/sparams.
  65.  *
  66.  * ============================================================================
  67.  * Incompatibilities
  68.  * ============================================================================
  69.  *
  70.  * There's no known incompatible plugins yet.
  71.  *
  72.  * ============================================================================
  73.  * Known isues
  74.  * ============================================================================
  75.  *
  76.  * Not yet.
  77.  *
  78.  * ============================================================================
  79.  * Changelog
  80.  * ============================================================================
  81.  *
  82.  * Version 1.03:
  83.  * - Added support for 30 nparams and 30 pparams.
  84.  * - 1.03b support for all nparams and pparams propertly.
  85.  *
  86.  * Version 1.02:
  87.  * - Added support for overriden basic params from ICFSoft Params Core.
  88.  *
  89.  * Version 1.01:
  90.  * - Added use of ICFSoft Params Core nparams and pparams.
  91.  * - Added team sparams and xparams.
  92.  *
  93.  * Version 1.00:
  94.  * - Finished plugin!
  95.  *
  96.  * ============================================================================
  97.  *
  98.  * For commercial and non-commercial games.
  99.  * Credit to ICF-Soft.
  100.  * This entire header must be included with plugin.
  101.  *
  102.  * ============================================================================
  103. */
  104. //=============================================================================
  105.  /*:es
  106.  * @plugindesc v1.03b Este complemento añade atajos útiles para simplificar las
  107.  * fórmulas.
  108.  * @author ICF-Soft [http://icfsoft.blogspot.com.es/]
  109.  *
  110.  * @help
  111.  * ============================================================================
  112.  * Introducción
  113.  * ============================================================================
  114.  *
  115.  * En las habilidades y objetos hay campos en donde poner una fórmula para
  116.  * calcular el daño y la curación.
  117.  * Además se sabe que hay plugins que permiten poner fórmulas en las notas,
  118.  * comentarios, parámetros en el plugin, etc...
  119.  * Varias veces no hay espacio suficiente o las fórmulas se complican.
  120.  *
  121.  * Con este plugin puedes usar atajos y simplificar fórmulas consiguiendo el
  122.  * efecto deseado.
  123.  *
  124.  * ============================================================================
  125.  * Uso
  126.  * ============================================================================
  127.  *
  128.  * Puedes usar los atajos del mismo modo que otros parámetros en las fórmulas:
  129.  *
  130.  * highparam() lowparam()
  131.  *
  132.  *  - Para usar el mejor o el peor parámetro.
  133.  *
  134.  * hprate() hppercent()
  135.  *
  136.  *  - Comprobar cuanta vida queda en proporción (0-1) o porcentaje (0-100).
  137.  *    También se aplica a mp y tp.
  138.  *
  139.  * wound() mpl() etp()
  140.  *
  141.  *  - Además puedes comprobar cuanto hp/mp se ha perdido o tp vacío.
  142.  *    Incluso en proporción o porcentaje.
  143.  *
  144.  * teamhp() teamwound() allteamwound()
  145.  *
  146.  *  - Para comprobar cuanta hp queda a todo el equipo, el hp perdido de los que
  147.  *    siguen en pie o el hp perdido de todos (en pie y caidos).
  148.  *    También para mp y tp.
  149.  *
  150.  * teamatk() avgatk() entireatk()
  151.  *
  152.  *  - Puedes usar el ataque de todo el equipo en pie, ya media de sus ataques
  153.  *    y el ataque de todos (en pie y caidos).
  154.  *    También para def, mat, mdf, agi, luk, los parámetros creados con el
  155.  *    complemento ICFSoft Params Core y los x/sparams.
  156.  *
  157.  * ============================================================================
  158.  * Incompatibilidades
  159.  * ============================================================================
  160.  *
  161.  * No se conocen complementos que sean incompatibles hasta la fecha.
  162.  *
  163.  * ============================================================================
  164.  * Problemas conocidos
  165.  * ============================================================================
  166.  *
  167.  * Por el momento ninguno.
  168.  *
  169.  * ============================================================================
  170.  * Historial de versiones
  171.  * ============================================================================
  172.  *
  173.  * Versión 1.03:
  174.  * - Se ha añadido soporte para los 30 parámetros de cada tipo que ya utiliza
  175.  *   el ICFSoft Params Core.
  176.  * - 1.03b Mejorado el soporte para todos los parámetros de cada tipo que pueden
  177.  *   crearse actualmente.
  178.  *
  179.  * Versión 1.02:
  180.  * - Se ha añadido soporte para los parámetros sobreescritos en ICFSoft Params Core.
  181.  *
  182.  * Versión 1.01:
  183.  * - Se ha añadido el uso de los nparams y pparams del ICFSoft Params Core.
  184.  * - Se ha añadido el uso de sparams y xparams.
  185.  *
  186.  * Versión 1.00:
  187.  * - Complemento terminado.
  188.  *
  189.  * ============================================================================
  190.  *
  191.  * Para juegos comerciales y no comerciales.
  192.  * Se debe incluir a ICF-Soft en los créditos.
  193.  * Esta cabecera debe incluirse íntegramente con el plugin.
  194.  *
  195.  * ============================================================================
  196. */
  197. //=============================================================================
  198.  
  199. //=============================================================================
  200. // Game_BattlerBase
  201. //=============================================================================
  202.  
  203. Game_BattlerBase.prototype.highparam = function() {
  204.     return Math.max(this.param(2),this.param(3),this.param(4),this.param(5),this.param(6),this.param(7));
  205. };
  206.  
  207. Game_BattlerBase.prototype.lowparam = function() {
  208.     return Math.min(this.param(2),this.param(3),this.param(4),this.param(5),this.param(6),this.param(7));
  209. };
  210.  
  211. Game_BattlerBase.prototype.hprate = function() {
  212.     return this.hp / this.mhp;
  213. };
  214.  
  215. Game_BattlerBase.prototype.hppercent = function() {
  216.     return Math.floor(100 * this.hp / this.mhp);
  217. };
  218.  
  219. Game_BattlerBase.prototype.wound = function() {
  220.     return this.mhp - this.hp;
  221. };
  222.  
  223. Game_BattlerBase.prototype.woundrate = function() {
  224.     return 1 - (this.hp / this.mhp);
  225. };
  226.  
  227. Game_BattlerBase.prototype.woundpercent = function() {
  228.     return 100 - Math.floor(100 * this.hp / this.mhp);
  229. };
  230.  
  231. Game_BattlerBase.prototype.mprate = function() {
  232.     return this.mp / this.mmp;
  233. };
  234.  
  235. Game_BattlerBase.prototype.mppercent = function() {
  236.     return Math.floor(100 * this.mp / this.mmp);
  237. };
  238.  
  239. Game_BattlerBase.prototype.mpl = function() {
  240.     return this.mmp - this.mp;
  241. };
  242.  
  243. Game_BattlerBase.prototype.mplrate = function() {
  244.     return 1 - (this.mp / this.mmp);
  245. };
  246.  
  247. Game_BattlerBase.prototype.mplpercent = function() {
  248.     return 100 - Math.floor(100 * this.mp / this.mmp);
  249. };
  250.  
  251. Game_BattlerBase.prototype.tprate = function() {
  252.     return this.tp / this.maxTp();
  253. };
  254.  
  255. Game_BattlerBase.prototype.tppercent = function() {
  256.     return Math.floor(100 * this.tp / this.maxTp());
  257. };
  258.  
  259. Game_BattlerBase.prototype.etp = function() {
  260.     return this.maxTp() - this.tp;
  261. };
  262.  
  263. Game_BattlerBase.prototype.etprate = function() {
  264.     return 1 - (this.tp / this.maxTp());
  265. };
  266.  
  267. Game_BattlerBase.prototype.etppercent = function() {
  268.     return 100 - Math.floor(100 * this.tp / this.maxTp());
  269. };
  270.  
  271. Game_BattlerBase.prototype.teamparam = function(paramid) {
  272.     return this.friendsUnit().aliveMembers().reduce(function(r, battler) {
  273.         return r + battler.param(paramid);
  274.     }, 0);
  275. };
  276.  
  277. Game_BattlerBase.prototype.avgparam = function(paramid) {
  278.     var ary = this.friendsUnit().aliveMembers();
  279.     return ary.reduce(function(r, battler) {
  280.         return r + battler.param(paramid);
  281.     }, 0) / ary.length;
  282. };
  283.  
  284. Game_BattlerBase.prototype.entireparam = function(paramid) {
  285.     return this.friendsUnit().members().reduce(function(r, battler) {
  286.         return r + battler.param(paramid);
  287.     }, 0);
  288. };
  289.  
  290. Game_BattlerBase.prototype.teamhp = function() {
  291.     return this.friendsUnit().aliveMembers().reduce(function(r, battler) {
  292.         return r + battler.hp;
  293.     }, 0);
  294. };
  295.  
  296. Game_BattlerBase.prototype.teamwound = function() {
  297.     return this.friendsUnit().aliveMembers().reduce(function(r, battler) {
  298.         return r + battler.mhp - battler.hp;
  299.     }, 0);
  300. };
  301.  
  302. Game_BattlerBase.prototype.allteamwound = function() {
  303.     return this.friendsUnit().members().reduce(function(r, battler) {
  304.         return r + battler.mhp - battler.hp;
  305.     }, 0);
  306. };
  307.  
  308. Game_BattlerBase.prototype.teammp = function() {
  309.     return this.friendsUnit().aliveMembers().reduce(function(r, battler) {
  310.         return r + battler.mp;
  311.     }, 0);
  312. };
  313.  
  314. Game_BattlerBase.prototype.teammpl = function() {
  315.     return this.friendsUnit().aliveMembers().reduce(function(r, battler) {
  316.         return r + battler.mmp - battler.mp;
  317.     }, 0);
  318. };
  319.  
  320. Game_BattlerBase.prototype.allteammpl = function() {
  321.     return this.friendsUnit().members().reduce(function(r, battler) {
  322.         return r + battler.mmp - battler.mp;
  323.     }, 0);
  324. };
  325.  
  326. Game_BattlerBase.prototype.teamtp = function() {
  327.     return this.friendsUnit().aliveMembers().reduce(function(r, battler) {
  328.         return r + battler.tp;
  329.     }, 0);
  330. };
  331.  
  332. Game_BattlerBase.prototype.teametp = function() {
  333.     return this.friendsUnit().aliveMembers().reduce(function(r, battler) {
  334.         return r + battler.maxTp() - battler.tp;
  335.     }, 0);
  336. };
  337.  
  338. Game_BattlerBase.prototype.allteametp = function() {
  339.     return this.friendsUnit().members().reduce(function(r, battler) {
  340.         return r + battler.maxTp() - battler.tp;
  341.     }, 0);
  342. };
  343.  
  344. Game_BattlerBase.prototype.teammhp = function() {
  345.     return this.teamparam(0);
  346. };
  347.  
  348. Game_BattlerBase.prototype.teammmp = function() {
  349.     return this.teamparam(1);
  350. };
  351. Game_BattlerBase.prototype.teamatk = function() {
  352.     return this.teamparam(2);
  353. };
  354.  
  355. Game_BattlerBase.prototype.teamdef = function() {
  356.     return this.teamparam(3);
  357. };
  358.  
  359. Game_BattlerBase.prototype.teammat = function() {
  360.     return this.teamparam(4);
  361. };
  362.  
  363. Game_BattlerBase.prototype.teammdf = function() {
  364.     return this.teamparam(5);
  365. };
  366.  
  367. Game_BattlerBase.prototype.teamagi = function() {
  368.     return this.teamparam(6);
  369. };
  370.  
  371. Game_BattlerBase.prototype.teamluk = function() {
  372.     return this.teamparam(7);
  373. };
  374.  
  375. Game_BattlerBase.prototype.avgmhp = function() {
  376.     return this.avgparam(0);
  377. };
  378.  
  379. Game_BattlerBase.prototype.avgmmp = function() {
  380.     return this.avgparam(1);
  381. };
  382.  
  383. Game_BattlerBase.prototype.avgatk = function() {
  384.     return this.avgparam(2);
  385. };
  386.  
  387. Game_BattlerBase.prototype.avgdef = function() {
  388.     return this.avgparam(3);
  389. };
  390.  
  391. Game_BattlerBase.prototype.avgmat = function() {
  392.     return this.avgparam(4);
  393. };
  394.  
  395. Game_BattlerBase.prototype.avgmdf = function() {
  396.     return this.avgparam(5);
  397. };
  398.  
  399. Game_BattlerBase.prototype.avgagi = function() {
  400.     return this.avgparam(6);
  401. };
  402.  
  403. Game_BattlerBase.prototype.avgluk = function() {
  404.     return this.avgparam(7);
  405. };
  406.  
  407. Game_BattlerBase.prototype.entiremhp = function() {
  408.     return this.entireparam(0);
  409. };
  410.  
  411. Game_BattlerBase.prototype.entiremmp = function() {
  412.     return this.entireparam(1);
  413. };
  414.  
  415. Game_BattlerBase.prototype.entireatk = function() {
  416.     return this.entireparam(2);
  417. };
  418.  
  419. Game_BattlerBase.prototype.entiredef = function() {
  420.     return this.entireparam(3);
  421. };
  422.  
  423. Game_BattlerBase.prototype.entiremat = function() {
  424.     return this.entireparam(4);
  425. };
  426.  
  427. Game_BattlerBase.prototype.entiremdf = function() {
  428.     return this.entireparam(5);
  429. };
  430.  
  431. Game_BattlerBase.prototype.entireagi = function() {
  432.     return this.entireparam(6);
  433. };
  434.  
  435. Game_BattlerBase.prototype.entireluk = function() {
  436.     return this.entireparam(7);
  437. };
  438.  
  439. Game_BattlerBase.prototype.teamxparam = function(paramid) {
  440.     return this.friendsUnit().aliveMembers().reduce(function(r, battler) {
  441.         return r + battler.xparam(paramid);
  442.     }, 0);
  443. };
  444.  
  445. Game_BattlerBase.prototype.avgxparam = function(paramid) {
  446.     var ary = this.friendsUnit().aliveMembers();
  447.     return ary.reduce(function(r, battler) {
  448.         return r + battler.xparam(paramid);
  449.     }, 0) / ary.length;
  450. };
  451.  
  452. Game_BattlerBase.prototype.entirexparam = function(paramid) {
  453.     return this.friendsUnit().members().reduce(function(r, battler) {
  454.         return r + battler.xparam(paramid);
  455.     }, 0);
  456. };
  457.  
  458. Game_BattlerBase.prototype.teamhit = function() {
  459.     return this.teamxparam(0);
  460. };
  461.  
  462. Game_BattlerBase.prototype.teameva = function() {
  463.     return this.teamxparam(1);
  464. };
  465.  
  466. Game_BattlerBase.prototype.teamcri = function() {
  467.     return this.teamxparam(2);
  468. };
  469.  
  470. Game_BattlerBase.prototype.teamcev = function() {
  471.     return this.teamxparam(3);
  472. };
  473.  
  474. Game_BattlerBase.prototype.teammev = function() {
  475.     return this.teamxparam(4);
  476. };
  477.  
  478. Game_BattlerBase.prototype.teammrf = function() {
  479.     return this.teamxparam(5);
  480. };
  481.  
  482. Game_BattlerBase.prototype.teamcnt = function() {
  483.     return this.teamxparam(6);
  484. };
  485.  
  486. Game_BattlerBase.prototype.teamhrg = function() {
  487.     return this.teamxparam(7);
  488. };
  489.  
  490. Game_BattlerBase.prototype.teammrg = function() {
  491.     return this.teamxparam(8);
  492. };
  493.  
  494. Game_BattlerBase.prototype.teamtrg = function() {
  495.     return this.teamxparam(9);
  496. };
  497.  
  498. Game_BattlerBase.prototype.avghit = function() {
  499.     return this.avgxparam(0);
  500. };
  501.  
  502. Game_BattlerBase.prototype.avgeva = function() {
  503.     return this.avgxparam(1);
  504. };
  505.  
  506. Game_BattlerBase.prototype.avgcri = function() {
  507.     return this.avgxparam(2);
  508. };
  509.  
  510. Game_BattlerBase.prototype.avgcev = function() {
  511.     return this.avgxparam(3);
  512. };
  513.  
  514. Game_BattlerBase.prototype.avgmev = function() {
  515.     return this.avgxparam(4);
  516. };
  517.  
  518. Game_BattlerBase.prototype.avgmrf = function() {
  519.     return this.avgxparam(5);
  520. };
  521.  
  522. Game_BattlerBase.prototype.avgcnt = function() {
  523.     return this.avgxparam(6);
  524. };
  525.  
  526. Game_BattlerBase.prototype.avghrg = function() {
  527.     return this.avgxparam(7);
  528. };
  529.  
  530. Game_BattlerBase.prototype.avgmrg = function() {
  531.     return this.avgxparam(8);
  532. };
  533.  
  534. Game_BattlerBase.prototype.avgtrg = function() {
  535.     return this.avgxparam(9);
  536. };
  537.  
  538. Game_BattlerBase.prototype.entirehit = function() {
  539.     return this.entirexparam(0);
  540. };
  541.  
  542. Game_BattlerBase.prototype.entireeva = function() {
  543.     return this.entirexparam(1);
  544. };
  545.  
  546. Game_BattlerBase.prototype.entirecri = function() {
  547.     return this.entirexparam(2);
  548. };
  549.  
  550. Game_BattlerBase.prototype.entirecev = function() {
  551.     return this.entirexparam(3);
  552. };
  553.  
  554. Game_BattlerBase.prototype.entiremev = function() {
  555.     return this.entirexparam(4);
  556. };
  557.  
  558. Game_BattlerBase.prototype.entiremrf = function() {
  559.     return this.entirexparam(5);
  560. };
  561.  
  562. Game_BattlerBase.prototype.entirecnt = function() {
  563.     return this.entirexparam(6);
  564. };
  565.  
  566. Game_BattlerBase.prototype.entirehrg = function() {
  567.     return this.entirexparam(7);
  568. };
  569.  
  570. Game_BattlerBase.prototype.entiremrg = function() {
  571.     return this.entirexparam(8);
  572. };
  573.  
  574. Game_BattlerBase.prototype.entiretrg = function() {
  575.     return this.entirexparam(9);
  576. };
  577.  
  578. Game_BattlerBase.prototype.teamsparam = function(paramid) {
  579.     return this.friendsUnit().aliveMembers().reduce(function(r, battler) {
  580.         return r + battler.sparam(paramid) - 1;
  581.     }, 1);
  582. };
  583.  
  584. Game_BattlerBase.prototype.avgsparam = function(paramid) {
  585.     return this.friendsUnit().aliveMembers().reduce(function(r, battler) {
  586.         return r * battler.sparam(paramid);
  587.     }, 1);
  588. };
  589.  
  590. Game_BattlerBase.prototype.entiresparam = function(paramid) {
  591.     return this.friendsUnit().members().reduce(function(r, battler) {
  592.         return r + battler.sparam(paramid) - 1;
  593.     }, 1);
  594. };
  595.  
  596. Game_BattlerBase.prototype.teamtgr = function() {
  597.     return this.teamsparam(0);
  598. };
  599.  
  600. Game_BattlerBase.prototype.teamgrd = function() {
  601.     return this.teamsparam(1);
  602. };
  603.  
  604. Game_BattlerBase.prototype.teamrec = function() {
  605.     return this.teamsparam(2);
  606. };
  607.  
  608. Game_BattlerBase.prototype.teampha = function() {
  609.     return this.teamsparam(3);
  610. };
  611.  
  612. Game_BattlerBase.prototype.teammcr = function() {
  613.     return this.teamsparam(4);
  614. };
  615.  
  616. Game_BattlerBase.prototype.teamtcr = function() {
  617.     return this.teamsparam(5);
  618. };
  619.  
  620. Game_BattlerBase.prototype.teampdr = function() {
  621.     return this.teamsparam(6);
  622. };
  623.  
  624. Game_BattlerBase.prototype.teammdr = function() {
  625.     return this.teamsparam(7);
  626. };
  627.  
  628. Game_BattlerBase.prototype.teamfdr = function() {
  629.     return this.teamsparam(8);
  630. };
  631.  
  632. Game_BattlerBase.prototype.teamexr = function() {
  633.     return this.teamsparam(9);
  634. };
  635.  
  636. Game_BattlerBase.prototype.avgtgr = function() {
  637.     return this.avgsparam(0);
  638. };
  639.  
  640. Game_BattlerBase.prototype.avggrd = function() {
  641.     return this.avgsparam(1);
  642. };
  643.  
  644. Game_BattlerBase.prototype.avgrec = function() {
  645.     return this.avgsparam(2);
  646. };
  647.  
  648. Game_BattlerBase.prototype.avgpha = function() {
  649.     return this.avgsparam(3);
  650. };
  651.  
  652. Game_BattlerBase.prototype.avgmcr = function() {
  653.     return this.avgsparam(4);
  654. };
  655.  
  656. Game_BattlerBase.prototype.avgtcr = function() {
  657.     return this.avgsparam(5);
  658. };
  659.  
  660. Game_BattlerBase.prototype.avgpdr = function() {
  661.     return this.avgsparam(6);
  662. };
  663.  
  664. Game_BattlerBase.prototype.avgmdr = function() {
  665.     return this.avgsparam(7);
  666. };
  667.  
  668. Game_BattlerBase.prototype.avgfdr = function() {
  669.     return this.avgsparam(8);
  670. };
  671.  
  672. Game_BattlerBase.prototype.avgexr = function() {
  673.     return this.avgsparam(9);
  674. };
  675.  
  676. Game_BattlerBase.prototype.entiretgr = function() {
  677.     return this.entiresparam(0);
  678. };
  679.  
  680. Game_BattlerBase.prototype.entiregrd = function() {
  681.     return this.entiresparam(1);
  682. };
  683.  
  684. Game_BattlerBase.prototype.entirerec = function() {
  685.     return this.entiresparam(2);
  686. };
  687.  
  688. Game_BattlerBase.prototype.entirepha = function() {
  689.     return this.entiresparam(3);
  690. };
  691.  
  692. Game_BattlerBase.prototype.entiremcr = function() {
  693.     return this.entiresparam(4);
  694. };
  695.  
  696. Game_BattlerBase.prototype.entiretcr = function() {
  697.     return this.entiresparam(5);
  698. };
  699.  
  700. Game_BattlerBase.prototype.entirepdr = function() {
  701.     return this.entiresparam(6);
  702. };
  703.  
  704. Game_BattlerBase.prototype.entiremdr = function() {
  705.     return this.entiresparam(7);
  706. };
  707.  
  708. Game_BattlerBase.prototype.entirefdr = function() {
  709.     return this.entiresparam(8);
  710. };
  711.  
  712. Game_BattlerBase.prototype.entireexr = function() {
  713.     return this.entiresparam(9);
  714. };
  715.  
  716. if (Imported.ICFSoft_ParamCore) {
  717.  
  718.     Game_BattlerBase.prototype.teamnparam = function(paramid) {
  719.     return this.friendsUnit().aliveMembers().reduce(function(r, battler) {
  720.         return r + battler.NParam(paramid);
  721.     }, 0);
  722.     };
  723.  
  724.     Game_BattlerBase.prototype.avgnparam = function(paramid) {
  725.     var ary = this.friendsUnit().aliveMembers();
  726.     return ary.reduce(function(r, battler) {
  727.         return r + battler.NParam(paramid);
  728.     }, 0) / ary.length;
  729.     };
  730.  
  731.     Game_BattlerBase.prototype.entirenparam = function(paramid) {
  732.     return this.friendsUnit().members().reduce(function(r, battler) {
  733.         return r + battler.NParam(paramid);
  734.     }, 0);
  735.     };
  736.  
  737.     Game_BattlerBase.prototype.teampparam = function(paramid) {
  738.     return this.friendsUnit().aliveMembers().reduce(function(r, battler) {
  739.         return r + battler.PParam(paramid);
  740.     }, 0);
  741.     };
  742.  
  743.     Game_BattlerBase.prototype.avgpparam = function(paramid) {
  744.     var ary = this.friendsUnit().aliveMembers();
  745.     return ary.reduce(function(r, battler) {
  746.         return r + battler.PParam(paramid);
  747.     }, 0) / ary.length;
  748.     };
  749.  
  750.     Game_BattlerBase.prototype.entirepparam = function(paramid) {
  751.     return this.friendsUnit().members().reduce(function(r, battler) {
  752.         return r + battler.PParam(paramid);
  753.     }, 0);
  754.     };
  755.  
  756.     for (var i = 0; i < ICF.Param.NParams.length; i++) {
  757.     if (ICF.Param.NParams[i].length > 0) {
  758.         eval("Game_BattlerBase.prototype.team" + ICF.Param.NParams[i] + " = function() { return this.teamnparam(" + i + ");};");
  759.         eval("Game_BattlerBase.prototype.avg" + ICF.Param.NParams[i] + " = function() { return this.avgnparam(" + i + ");};");
  760.         eval("Game_BattlerBase.prototype.entire" + ICF.Param.NParams[i] + " = function() { return this.entirenparam(" + i + ");};");
  761.     }
  762.     }
  763.  
  764.     for (var i = 0; i < ICF.Param.PParams.length; i++) {
  765.     if (ICF.Param.PParams[i].length > 0) {
  766.         eval("Game_BattlerBase.prototype.team" + ICF.Param.PParams[i] + " = function() { return this.teampparam(" + i + ");};");
  767.         eval("Game_BattlerBase.prototype.avg" + ICF.Param.PParams[i] + " = function() { return this.avgpparam(" + i + ");};");
  768.         eval("Game_BattlerBase.prototype.entire" + ICF.Param.PParams[i] + " = function() { return this.entirepparam(" + i + ");};");
  769.     }
  770.     }
  771.  
  772.     for (var i = 0; i < 8; i++) {
  773.     if (ICF.Param.BParams[i].length > 0) {
  774.         eval("Game_BattlerBase.prototype.team" + ICF.Param.BParams[i] + " = function() { return this.teamparam(" + i + ");};");
  775.         eval("Game_BattlerBase.prototype.avg" + ICF.Param.BParams[i] + " = function() { return this.avgparam(" + i + ");};");
  776.         eval("Game_BattlerBase.prototype.entire" + ICF.Param.BParams[i] + " = function() { return this.entireparam(" + i + ");};");
  777.     }
  778.     }
  779. }
  780.  
  781. //=============================================================================
  782. // End of File
  783. //=============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement