Advertisement
ICF-Soft

ICF-Soft Formula Shortcut 1.02 RPG Maker MV

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