Advertisement
ICF-Soft

ICF-Soft Params Core 1.06 RPG Maker MV

Oct 21st, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // ICF-Soft Plugins - Params Core
  3. // ICFSoft_ParamsCore.js
  4. //=============================================================================
  5.  
  6. var Imported = Imported || {};
  7. Imported.ICFSoft_ParamCore = true;
  8.  
  9. var ICF = ICF || {};
  10. ICF.ParamCore = ICF.ParamCore || {};
  11. ICF.NotetagsProcessor = ICF.NotetagsProcessor || {};
  12.  
  13. ICF.ParamCore.Version = 106; // 1.06
  14.  
  15. //=============================================================================
  16.  /*:
  17.  * @plugindesc v1.06c This plugin allow to add new full custom params and
  18.  * more basic and x/sparam control.
  19.  * @author ICF-Soft [http://icfsoft.blogspot.com.es/]
  20.  *
  21.  * @param NParams
  22.  * @desc New way to add NParams.
  23.  * @type struct<NormalParams>[]
  24.  * @default ["{\"Name\":\"\",\"Full Name\":\"\",\"Base\":\"30 15\",\"Base Eval\":\"\",\"Limits\":\"(this.isActor())? [0, 999, 1200] : [0, 999, 1200]\",\"Buff Icons\":\"\",\"Debuff Icons\":\"\"}"]
  25.  *
  26.  * @param PParams
  27.  * @desc New way to add PParams.
  28.  * @type struct<PlainParams>[]
  29.  * @default ["{\"Name\":\"\",\"Full Name\":\"\",\"Base\":\"0\",\"Limits\":\"(this.isActor())? [0, 999] : [0, 999]\"}"]
  30.  *
  31.  * @param CParams
  32.  * @desc New way to add CParams.
  33.  * @type struct<CountingParams>[]
  34.  * @default ["{\"Name Basic\":\"\",\"Full Name Basic\":\"\",\"Name Counter\":\"\",\"Full Name Counter\":\"\",\"Base\":\"30 15\",\"Base Eval\":\"\",\"Limits\":\"(this.isActor())? [0, 999, 1200] : [0, 999, 1200]\",\"Buff Icons\":\"\",\"Debuff Icons\":\"\"}"]
  35.  *
  36.  * @param BParam0 Name
  37.  * @desc Alias for this basic param. You can to redefine it.
  38.  * @default mhp
  39.  *
  40.  * @param BParam0 Base Eval
  41.  * @desc A formula to use instead of default base given in MV.
  42.  * Empty to use default.
  43.  * @default
  44.  *
  45.  * @param BParam0 Limits
  46.  * @desc Formula for min and max value for this param. See help.
  47.  * Hit points
  48.  * @default (this.isActor())? [1, 9999, 12000] : [1, 999999, 1200000]
  49.  *
  50.  * @param BParam1 Name
  51.  * @desc Alias for this basic param. You can to redefine it.
  52.  * @default mmp
  53.  *
  54.  * @param BParam1 Base Eval
  55.  * @desc A formula to use instead of default base given in MV.
  56.  * Empty to use default.
  57.  * @default
  58.  *
  59.  * @param BParam1 Limits
  60.  * @desc Formula for min and max value for this param. See help.
  61.  * Magic points
  62.  * @default (this.isActor())? [0, 9999, 12000] : [0, 9999, 12000]
  63.  *
  64.  * @param BParam2 Name
  65.  * @desc Alias for this basic param. You can to redefine it.
  66.  * @default atk
  67.  *
  68.  * @param BParam2 Base Eval
  69.  * @desc A formula to use instead of default base given in MV.
  70.  * Empty to use default.
  71.  * @default
  72.  *
  73.  * @param BParam2 Limits
  74.  * @desc Formula for min and max value for this param. See help.
  75.  * Attack
  76.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  77.  *
  78.  * @param BParam3 Name
  79.  * @desc Alias for this basic param. You can to redefine it.
  80.  * @default def
  81.  *
  82.  * @param BParam3 Base Eval
  83.  * @desc A formula to use instead of default base given in MV.
  84.  * Empty to use default.
  85.  * @default
  86.  *
  87.  * @param BParam3 Limits
  88.  * @desc Formula for min and max value for this param. See help.
  89.  * Defense
  90.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  91.  *
  92.  * @param BParam4 Name
  93.  * @desc Alias for this basic param. You can to redefine it.
  94.  * @default mat
  95.  *
  96.  * @param BParam4 Base Eval
  97.  * @desc A formula to use instead of default base given in MV.
  98.  * Empty to use default.
  99.  * @default
  100.  *
  101.  * @param BParam4 Limits
  102.  * @desc Formula for min and max value for this param. See help.
  103.  * Magic attack
  104.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  105.  *
  106.  * @param BParam5 Name
  107.  * @desc Alias for this basic param. You can to redefine it.
  108.  * @default mdf
  109.  *
  110.  * @param BParam5 Base Eval
  111.  * @desc A formula to use instead of default base given in MV.
  112.  * Empty to use default.
  113.  * @default
  114.  *
  115.  * @param BParam5 Limits
  116.  * @desc Formula for min and max value for this param. See help.
  117.  * Magic defense
  118.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  119.  *
  120.  * @param BParam6 Name
  121.  * @desc Alias for this basic param. You can to redefine it.
  122.  * @default agi
  123.  *
  124.  * @param BParam6 Base Eval
  125.  * @desc A formula to use instead of default base given in MV.
  126.  * Empty to use default.
  127.  * @default
  128.  *
  129.  * @param BParam6 Limits
  130.  * @desc Formula for min and max value for this param. See help.
  131.  * Agility
  132.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  133.  *
  134.  * @param BParam7 Name
  135.  * @desc Alias for this basic param. You can to redefine it.
  136.  * @default luk
  137.  *
  138.  * @param BParam7 Base Eval
  139.  * @desc A formula to use instead of default base given in MV.
  140.  * Empty to use default.
  141.  * @default
  142.  *
  143.  * @param BParam7 Limits
  144.  * @desc Formula for min and max value for this param. See help.
  145.  * Luck
  146.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  147.  *
  148.  * @param XParam0 Full Name
  149.  * @desc Name that will be shown for this extra param.
  150.  * @default Hit rate
  151.  *
  152.  * @param XParam0 Base
  153.  * @desc Formula for base value for x param hit (HIT rate).
  154.  * @default 0
  155.  *
  156.  * @param XParam1 Full Name
  157.  * @desc Name that will be shown for this extra param.
  158.  * @default Evasion rate
  159.  *
  160.  * @param XParam1 Base
  161.  * @desc Formula for base value for x param eva (EVAsion rate).
  162.  * @default 0
  163.  *
  164.  * @param XParam2 Full Name
  165.  * @desc Name that will be shown for this extra param.
  166.  * @default Critical rate
  167.  *
  168.  * @param XParam2 Base
  169.  * @desc Formula for base value for x param cri (CRItical rate).
  170.  * @default 0
  171.  *
  172.  * @param XParam3 Full Name
  173.  * @desc Name that will be shown for this extra param.
  174.  * @default Critical evasion rate
  175.  *
  176.  * @param XParam3 Base
  177.  * @desc Formula for base value for x param cev (Critical Evasion Rate).
  178.  * @default 0
  179.  *
  180.  * @param XParam4 Full Name
  181.  * @desc Name that will be shown for this extra param.
  182.  * @default Magic evasion rate
  183.  *
  184.  * @param XParam4 Base
  185.  * @desc Formula for base value for x param mev (Magic EVasion rate).
  186.  * @default 0
  187.  *
  188.  * @param XParam5 Full Name
  189.  * @desc Name that will be shown for this extra param.
  190.  * @default Magic reflection rate
  191.  *
  192.  * @param XParam5 Base
  193.  * @desc Formula for base value for x param mrf (Magic ReFlection rate).
  194.  * @default 0
  195.  *
  196.  * @param XParam6 Full Name
  197.  * @desc Name that will be shown for this extra param.
  198.  * @default Counter-attack rate
  199.  *
  200.  * @param XParam6 Base
  201.  * @desc Formula for base value for x param cnt (CouNTer attack rate).
  202.  * @default 0
  203.  *
  204.  * @param XParam7 Full Name
  205.  * @desc Name that will be shown for this extra param.
  206.  * @default Hp-regen rate
  207.  *
  208.  * @param XParam7 Base
  209.  * @desc Formula for base value for x param hrg (Hp ReGeneration rate).
  210.  * @default 0
  211.  *
  212.  * @param XParam8 Full Name
  213.  * @desc Name that will be shown for this extra param.
  214.  * @default Mp-regen rate
  215.  *
  216.  * @param XParam8 Base
  217.  * @desc Formula for base value for x param mrg (Mp ReGeneration rate).
  218.  * @default 0
  219.  *
  220.  * @param XParam9 Full Name
  221.  * @desc Name that will be shown for this extra param.
  222.  * @default Tp-regen rate
  223.  *
  224.  * @param XParam9 Base
  225.  * @desc Formula for base value for x param trg (Tp ReGeneration rate).
  226.  * @default 0
  227.  *
  228.  * @param SParam0 Full Name
  229.  * @desc Name that will be shown for this special param.
  230.  * @default Targeted rate
  231.  *
  232.  * @param SParam0 Base
  233.  * @desc Formula for base value for x param tgr (TarGet Rate).
  234.  * @default 1
  235.  *
  236.  * @param SParam1 Full Name
  237.  * @desc Name that will be shown for this special param.
  238.  * @default Guard rate
  239.  *
  240.  * @param SParam1 Base
  241.  * @desc Formula for base value for s param grd (GuaRD effect rate).
  242.  * @default 1
  243.  *
  244.  * @param SParam2 Full Name
  245.  * @desc Name that will be shown for this special param.
  246.  * @default Recovery rate
  247.  *
  248.  * @param SParam2 Base
  249.  * @desc Formula for base value for s param rec (RECovery effect rate).
  250.  * @default 1
  251.  *
  252.  * @param SParam3 Full Name
  253.  * @desc Name that will be shown for this special param.
  254.  * @default Pharmacology
  255.  *
  256.  * @param SParam3 Base
  257.  * @desc Formula for base value for s param pha (PHArmacology).
  258.  * @default 1
  259.  *
  260.  * @param SParam4 Full Name
  261.  * @desc Name that will be shown for this special param.
  262.  * @default Mp cost rate
  263.  *
  264.  * @param SParam4 Base
  265.  * @desc Formula for base value for s param mcr (Mp Cost Rate).
  266.  * @default 1
  267.  *
  268.  * @param SParam5 Full Name
  269.  * @desc Name that will be shown for this special param.
  270.  * @default Tp cost rate
  271.  *
  272.  * @param SParam5 Base
  273.  * @desc Formula for base value for s param tcr (Tp Cost Rate).
  274.  * @default 1
  275.  *
  276.  * @param SParam6 Full Name
  277.  * @desc Name that will be shown for this special param.
  278.  * @default Phisical damage rate
  279.  *
  280.  * @param SParam6 Base
  281.  * @desc Formula for base value for s param pdr (Physical Damage Rate).
  282.  * @default 1
  283.  *
  284.  * @param SParam7 Full Name
  285.  * @desc Name that will be shown for this special param.
  286.  * @default Magical damage rate
  287.  *
  288.  * @param SParam7 Base
  289.  * @desc Formula for base value for s param mdr (Magical Damage Rate).
  290.  * @default 1
  291.  *
  292.  * @param SParam8 Full Name
  293.  * @desc Name that will be shown for this special param.
  294.  * @default Floor damage rate
  295.  *
  296.  * @param SParam8 Base
  297.  * @desc Formula for base value for s param fdr (Floor Damage Rate).
  298.  * @default 1
  299.  *
  300.  * @param SParam9 Full Name
  301.  * @desc Name that will be shown for this special param.
  302.  * @default Experience rate
  303.  *
  304.  * @param SParam9 Base
  305.  * @desc Formula for base value for s param exr (EXperience Rate).
  306.  * @default 1
  307.  *
  308.  * @param Developer HaltJS
  309.  * @desc When true it throws an error if a custom class param/nparam
  310.  * javascript doesn't work.   NO - false     YES - true
  311.  * @default false
  312.  *
  313.  * @help
  314.  * ============================================================================
  315.  * Introduction
  316.  *
  317.  * By default there are some fixed types of params, there are usefull but
  318.  * have specified purposes and limits the way you can use them.
  319.  *
  320.  * With this plugin you can add new params that can be used in your formulas
  321.  * and every use you can imagine.
  322.  *
  323.  * There are 3 new param types:
  324.  *  -New/Normal Params: Level based params like the default ones,
  325.  *   with buff/debuff effects and trait modifiers.
  326.  *   Plus an option that can be used in some enemy levels plugins.
  327.  *
  328.  *  -Plain Params: Non level based params, these work as x/sparams
  329.  *   with trait modifiers.
  330.  *
  331.  *  -Counting Params: similar to nparams, these work as counters like hp, mp
  332.  *   and tp. There are a name for current value and a name for max value.
  333.  *
  334.  * Now there are more customization and control for basic, x and s params.
  335.  * And a new double cap feature.
  336.  *
  337.  * ============================================================================
  338.  * How to use
  339.  * ============================================================================
  340.  *
  341.  * NParams, CParams and PParams are calculated with their respective formulas:
  342.  *
  343.  * NParam = (Base + Plus) * Rate * XRate * Buff + Flat + XFlat
  344.  * CParam = (Base + Plus) * Rate * XRate * Buff + Flat + XFlat
  345.  * PParam = (Base + Plus) * Rate + Flat
  346.  *
  347.  *   -Base is different for n and pparams. For NParams is a level based value.
  348.  *    For PParam is a fixed value used to emulate x/sparams (0 and 1).
  349.  *   -Plus is the sum of all plus traits attached to a battler. In case of
  350.  *    NParam there is an extra added by script calls and item effects.
  351.  *   -Rate is the product of all trait multipliers attached to a battler.
  352.  *   -XRate is the product of all trait x-multipliers attached to a battler.
  353.  *   -Buff is de effect of buff/debuff.
  354.  *   -Flat is the sum of all flat trais attached to a battler. It isn't affected
  355.  *    by any rate.
  356.  *   -XFlat is the sum of all x-flat trais attached to a battler. It isn't affected
  357.  *    by any rate.
  358.  *
  359.  * XRate, XFlat and Buff can make param to pass througth first max cap.
  360.  *
  361.  * To make XParams and SParams more customizable I've changed a little
  362.  * their formulas:
  363.  *
  364.  * Param  = (Base + Plus) * Rate * XRate * Buff + Flat + XFlat
  365.  * XParam = (Base + Plus) * Rate + Flat
  366.  * SParam = (Base + Plus) * Rate + Flat
  367.  *
  368.  * They still work as usual but now you can add traits to have more control.
  369.  *
  370.  * To add traits you can use notetags inside data.
  371.  *
  372.  * Actors, classes and enemies only:
  373.  *
  374.  * <NPARAM: NParam Base Grow HGrow Cap>
  375.  * <CPARAM: CParam Base Grow HGrow Cap>
  376.  *    -Overrides default NParam/CParam for specified actor/class/enemy.
  377.  *     NParam can be referenced by it's name or index.
  378.  *     Base is the initial value in level 1.
  379.  *     Grow is how much is increased per level. If empty it will be fixed.
  380.  *     HGrow is similar to Grow but in an exponential way.
  381.  *     Cap is the level at wich NParam stops growing.
  382.  *     You can use decimal numbers.
  383.  *    
  384.  *
  385.  * Weapons and armors only:
  386.  *
  387.  * <NPARAM: NParam Value>
  388.  * <CPARAM: CParam Value>
  389.  * <PPARAM: PParam Value>
  390.  *    -Set default N/C/PParam given for specified weapon/armor.
  391.  *     NParam can be referenced by it's name or index.
  392.  *    
  393.  *
  394.  * Actors, classes, enemies, weapons, armors and states:
  395.  *
  396.  * <NDEBUFFRATE: NParam Rate>
  397.  * <CDEBUFFRATE: CParam Rate>
  398.  *    -This is used for nparam/cparam debuff resistance, it's the chance of
  399.  *     succes debuff.
  400.  *     0.5 means 50% debuff succes, 0.2 is 20% and so on.
  401.  *
  402.  *
  403.  * <NPARAMPLUS: NParam Plus>
  404.  * <NPARAMRATE: NParam Rate>
  405.  * <NPARAMXRATE: NParam XRate>
  406.  * <NPARAMFLAT: NParam Flat>
  407.  * <NPARAMXFLAT: NParam Flat>
  408.  *    -There are plus, rate, xrate and flat modifiers for nparam.
  409.  *
  410.  * <CPARAMPLUS: CParam Plus>
  411.  * <CPARAMRATE: CParam Rate>
  412.  * <CPARAMXRATE: CParam XRate>
  413.  * <CPARAMFLAT: CParam Flat>
  414.  * <CPARAMXFLAT: CParam Flat>
  415.  *    -There are plus, rate, xrate and flat modifiers for cparam.
  416.  *
  417.  * <PPARAMPLUS: PParam Plus>
  418.  * <PPARAMRATE: PParam Rate>
  419.  * <PPARAMFLAT: PParam Flat>
  420.  *    -There are plus, rate and flat modifiers for pparam.
  421.  *
  422.  * <PARAMPLUS: Param Plus>
  423.  * <PARAMRATE: Param Rate>
  424.  * <PARAMXRATE: Param XRate>
  425.  * <PARAMFLAT: Param Flat>
  426.  * <PARAMXFLAT: Param Flat>
  427.  * <xPARAMPLUS: XParam Plus>
  428.  * <XPARAMRATE: XParam Rate>
  429.  * <XPARAMFLAT: XParam Flat>
  430.  * <SPARAMPLUS: SParam Plus>
  431.  * <SPARAMRATE: SParam Rate>
  432.  * <SPARAMFLAT: SParam Flat>
  433.  *    -There are plus, rate, xrate and flat modifiers for x and sparam.
  434.  *     I have included these to give more control.
  435.  *
  436.  *
  437.  * Skills and items only:
  438.  *
  439.  * <NBUFF: NParam turns>
  440.  * <NDEBUFF: NParam turns>
  441.  * <REMOVE NBUFF: NParam>
  442.  * <REMOVE NDEBUFF: NParam>
  443.  * <CBUFF: CParam turns>
  444.  * <CDEBUFF: CParam turns>
  445.  * <REMOVE CBUFF: CParam>
  446.  * <REMOVE CDEBUFF: CParam>
  447.  *    -There are buff/debuff effects to attach to skills and items.
  448.  *
  449.  * <NPARAM GROW: NParam amount>
  450.  *    -Allow to increase/decrease nparam by a specified amount.
  451.  *
  452.  * <PPARAM GROW: PParam amount>
  453.  *    -Allow to increase/decrease pparam by a specified amount.
  454.  *
  455.  * <CPARAM GROW: CParam amount>
  456.  *    -Allow to increase/decrease cparam by a specified amount.
  457.  *
  458.  * ============================================================================
  459.  * CParam Commands
  460.  * ============================================================================
  461.  *
  462.  * Some commands have been added to control gain/spend/lose quantities of
  463.  * specified cparams. There are javascript functions similar to hp, mp and tp.
  464.  *
  465.  * gain[cparam](amount)
  466.  *    -Gain (or negative to lose) a specified amount of cparam.
  467.  *     Substitute [cparam] with name of counter param with first letter in
  468.  *     uppercase.
  469.  *
  470.  * set[cparam](amount)
  471.  *    -Set specified cparam to a value.
  472.  *     Substitute [cparam] with name of counter param with first letter in
  473.  *     uppercase.
  474.  *
  475.  * [cparam]rate()
  476.  *    -Get rate of specified cparam.
  477.  *     Substitute [cparam] with name of counter param in lowercase.
  478.  *
  479.  * ============================================================================
  480.  * Lunatic Mode
  481.  * ============================================================================
  482.  *
  483.  * Knowing javascript you can redefine specific base value for params, nparams
  484.  * and cparams for actors, classes and enemies through lunatic mode.
  485.  *
  486.  * It also work in notetags:
  487.  *
  488.  * <CUSTOM NPARAM BASE NPARAM>
  489.  * value = 2;
  490.  * value += 25;
  491.  * </CUSTOM NPARAM BASE>
  492.  *
  493.  * <CUSTOM CPARAM BASE CPARAM>
  494.  * value = 2;
  495.  * value += 25;
  496.  * </CUSTOM CPARAM BASE>
  497.  *
  498.  * <CUSTOM PARAM BASE PARAM>
  499.  * value = base;
  500.  * value += 25;
  501.  * </CUSTOM PARAM BASE>
  502.  *
  503.  * Those params defined will use their formula instead of normal base
  504.  * value calculation. You can use javascript between these tags to alter
  505.  * the final result.
  506.  * Base params also allow to use word 'base' inside formula. It takes the
  507.  * value it could have at level 1.
  508.  *
  509.  * value - This is the value you want to alter with your own formula.
  510.  *         It starts at 0.
  511.  *
  512.  * Equipment notetags:
  513.  *
  514.  * <CUSTOM NPARAMS>
  515.  * javascript
  516.  * javascript
  517.  * 0 = $gameVariables.value(35)
  518.  * int = $gameSwitches.value(12)? 50 : 1
  519.  * </CUSTOM NPARAMS>
  520.  *
  521.  * <CUSTOM PPARAMS>
  522.  * javascript
  523.  * javascript
  524.  * 0 = $gameVariables.value(35)
  525.  * int = $gameSwitches.value(12)? 50 : 1
  526.  * </CUSTOM PPARAMS>
  527.  *
  528.  * <CUSTOM CPARAMS>
  529.  * javascript
  530.  * javascript
  531.  * 0 = $gameVariables.value(35)
  532.  * mbul = $gameSwitches.value(12)? 50 : 1
  533.  * </CUSTOM CPARAMS>
  534.  *
  535.  * <CUSTOM PARAMS>
  536.  * javascript
  537.  * javascript
  538.  * 0 = $gameVariables.value(35)
  539.  * mhp = $gameSwitches.value(12)? 50 : 1
  540.  * </CUSTOM PARAMS>
  541.  *
  542.  * Add evaluate values for nparams, pparams, cparams and basic params to weapons
  543.  * and armors.
  544.  * First you use the javascript code that can affect all params. Then you
  545.  * Use an identifier that can be a number or param name, an equal and the
  546.  * formula that should be evaluated for this equipment piece.
  547.  *
  548.  * Example:
  549.  * <CUSTOM PARAMS>
  550.  * var bonus = this.level;
  551.  * var restrict = 5;
  552.  * mhp = $gameVariables.value(35) + bonus * 5 - restrict
  553.  * mmp = ($gameSwitches.value(12)? 50 : 1) + bonus / restrict
  554.  * </CUSTOM PARAMS>
  555.  *
  556.  * ============================================================================
  557.  * Parameters
  558.  * ============================================================================
  559.  *
  560.  * You can create up to 100 of each type with indexes from 0 to 99.
  561.  *
  562.  * NParam/PParam/Bparam Name: internal name you give to specified nparam,
  563.  * pparam and basic param. It will be used in formulas and can be used to
  564.  * reference a notetag. Leave empty to skip.
  565.  *
  566.  * - Note: Bparams already exist and this param allow to alias or redefine them.
  567.  *
  568.  * NParam/PParam/XParam/SParam Full Name: the name you give to specified nparam.
  569.  * There are not used here but are usefull for plugins that need this.
  570.  *
  571.  * CParam Name / Full Name Basic: name and full name for the parameter that
  572.  * represents max value. There are not used here but are usefull for plugins
  573.  * that need this.
  574.  *
  575.  * CParam Name / Full Name Counter: name and full name for the parameter that
  576.  * represents current value. There are not used here but are usefull for plugins
  577.  * that need this.
  578.  *
  579.  * NParam/PParam Color: a color to represent nparam and pparam for plugins that,
  580.  * need it. It can be a number or a html color.
  581.  *
  582.  * CParam ColorX: colors for cparam gauge. It can be a number or a html color.
  583.  *
  584.  * NParam/CParam Base: the default formula for classes/enemies if they haven't.
  585.  * First number is the value at level 1. Second is the amount gained
  586.  * each level. Third is a level exponential grow and fourth is the level at
  587.  * wich will stop growing.
  588.  *
  589.  * PParam/XParam/SParam Base: is a base value that allow pparams to emulate
  590.  * x/sparams, and give more control for x/sparams. 0 is used for a xparam and 1
  591.  * for a sparam. It works as a formula so you can do it param based.
  592.  *
  593.  * NParam/CParam/BParam Base Eval: allow to use nparams and bparams as formulas
  594.  * like p/x/sparams. If defined this formula will be used instead of default
  595.  * mode given in MV for BParams and the default traditional mode for NParams I
  596.  * made. It works as a formula so you can do it param based.
  597.  * Base params also allow to use word 'base' inside formula. It takes the
  598.  * value it could have at level 1.
  599.  *
  600.  * NParam/CParam/BParam Limits: the min and max value a param can be. It's used
  601.  * now as a formula and needs 3 values.
  602.  * First is min, second is normal max and third is X-max.
  603.  * By default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  604.  *
  605.  * PParam Limits: same as previous but only uses 2 values (min and max).
  606.  * By default (this.isActor())? [0, 999] : [0, 999]
  607.  *
  608.  * NParam/CParam Buff Icons:
  609.  * This is an array of icons separated by spaces. When specified param is
  610.  * affected by a positive buff will be shown. Is starts with first and
  611.  * use next for each buff stack. If you don't want to use it leave Empty.
  612.  *
  613.  * NParam/CParam Debuff Icons:
  614.  * Same as previous but with debuff stack. Empty to don't use.
  615.  *
  616.  * Developer HaltJS: This is a development variable usefull to check if there
  617.  * is a wrong javascript nparam or basic param.
  618.  * When true will throw an error when it found a wrong javascript in lunatic
  619.  * mode and tell specified param.
  620.  * When false it will be ignored and game continues.
  621.  *
  622.  * ============================================================================
  623.  * Incompatibilities
  624.  * ============================================================================
  625.  *
  626.  * There's no known incompatible plugins yet.
  627.  *
  628.  * ============================================================================
  629.  * Known isues
  630.  * ============================================================================
  631.  *
  632.  * Not yet.
  633.  *
  634.  * ============================================================================
  635.  * Changelog
  636.  * ============================================================================
  637.  *
  638.  * Version 1.06:
  639.  * - Added new CParams.
  640.  * - Removed obsolete plugin parameters and functions.
  641.  * - Minor extra improvements.
  642.  *
  643.  * Version 1.05:
  644.  * - Evaluable params for equipment.
  645.  * - Set nparams for equipment.
  646.  * - Expanded lunatic mode to include enemy classes and actors.
  647.  * - Allow to grow pparams.
  648.  * - Allow default formulas for base params and nparams.
  649.  * - Use of 1.5.0 new plugin parameters.
  650.  *
  651.  * Version 1.04:
  652.  * - Allow ICF-Soft Main Core.
  653.  * - Expanded lunatic mode to include enemies.
  654.  * - More nparam control.
  655.  *
  656.  * Version 1.03:
  657.  * - Added XFlat for the double cap.
  658.  * - Increased n/pparams to 30.
  659.  * - Allow names for x/sparams.
  660.  *
  661.  * Version 1.02:
  662.  * - Allow to aliasing or redefining MV basic params.
  663.  *
  664.  * Version 1.01:
  665.  * - Use of ICF-Soft Main Utility.
  666.  * - Added lunatic mode for custom params and nparams.
  667.  * - Changed how min and max limits work.
  668.  * - Added double cap.
  669.  * - Added more traits.
  670.  * - Use of base params.
  671.  *
  672.  * Version 1.00:
  673.  * - Finished plugin!
  674.  *
  675.  * ============================================================================
  676.  *
  677.  * For commercial and non-commercial games.
  678.  * Credit to ICF-Soft.
  679.  * This entire header must be included with plugin.
  680.  *
  681.  * ============================================================================
  682. */
  683. //=============================================================================
  684.  /*:es
  685.  * @plugindesc v1.06c Este complemento permite añadir nuevos parámetros
  686.  * personalizables y mayor control sobre los parámetros del MV.
  687.  * @author ICF-Soft [http://icfsoft.blogspot.com.es/]
  688.  *
  689.  * @param NParams
  690.  * @desc Nuevo modo de añadir NParams.
  691.  * @type struct<NormalParams>[]
  692.  * @default ["{\"Name\":\"\",\"Full Name\":\"\",\"Base\":\"30 15\",\"Base Eval\":\"\",\"Limits\":\"(this.isActor())? [0, 999, 1200] : [0, 999, 1200]\",\"Buff Icons\":\"\",\"Debuff Icons\":\"\"}"]
  693.  *
  694.  * @param PParams
  695.  * @desc Nuevo modo de añadir PParams.
  696.  * @type struct<PlainParams>[]
  697.  * @default ["{\"Name\":\"\",\"Full Name\":\"\",\"Base\":\"0\",\"Limits\":\"(this.isActor())? [0, 999] : [0, 999]\"}"]
  698.  *
  699.  * @param CParams
  700.  * @desc New way to add CParams.
  701.  * @type struct<CountingParams>[]
  702.  * @default ["{\"Name Basic\":\"\",\"Full Name Basic\":\"\",\"Name Counter\":\"\",\"Full Name Counter\":\"\",\"Base\":\"30 15\",\"Base Eval\":\"\",\"Limits\":\"(this.isActor())? [0, 999, 1200] : [0, 999, 1200]\",\"Buff Icons\":\"\",\"Debuff Icons\":\"\"}"]
  703.  *
  704.  * @param BParam0 Name
  705.  * @desc Alias para este parámetro. Puedes redefirlo.
  706.  * @default mhp
  707.  *
  708.  * @param BParam0 Base Eval
  709.  * @desc Una fórmula para usar en lugar del modo predeterminado del MV.
  710.  * En blanco para usar el modo predeterminado.
  711.  * @default
  712.  *
  713.  * @param BParam0 Limits
  714.  * @desc Una fórmula para los valores mínimo y máximos. Ver ayuda.
  715.  * Vida
  716.  * @default (this.isActor())? [1, 9999, 12000] : [1, 999999, 1200000]
  717.  *
  718.  * @param BParam1 Name
  719.  * @desc Alias para este parámetro. Puedes redefirlo.
  720.  * @default mmp
  721.  *
  722.  * @param BParam1 Base Eval
  723.  * @desc Una fórmula para usar en lugar del modo predeterminado del MV.
  724.  * En blanco para usar el modo predeterminado.
  725.  * @default
  726.  *
  727.  * @param BParam1 Limits
  728.  * @desc Una fórmula para los valores mínimo y máximos. Ver ayuda.
  729.  * Magia
  730.  * @default (this.isActor())? [0, 9999, 12000] : [0, 9999, 12000]
  731.  *
  732.  * @param BParam2 Name
  733.  * @desc Alias para este parámetro. Puedes redefirlo.
  734.  * @default atk
  735.  *
  736.  * @param BParam2 Base Eval
  737.  * @desc Una fórmula para usar en lugar del modo predeterminado del MV.
  738.  * En blanco para usar el modo predeterminado.
  739.  * @default
  740.  *
  741.  * @param BParam2 Limits
  742.  * @desc Una fórmula para los valores mínimo y máximos. Ver ayuda.
  743.  * Ataque
  744.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  745.  *
  746.  * @param BParam3 Name
  747.  * @desc Alias para este parámetro. Puedes redefirlo.
  748.  * @default def
  749.  *
  750.  * @param BParam3 Base Eval
  751.  * @desc Una fórmula para usar en lugar del modo predeterminado del MV.
  752.  * En blanco para usar el modo predeterminado.
  753.  * @default
  754.  *
  755.  * @param BParam3 Limits
  756.  * @desc Una fórmula para los valores mínimo y máximos. Ver ayuda.
  757.  * Defensa
  758.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  759.  *
  760.  * @param BParam4 Name
  761.  * @desc Alias para este parámetro. Puedes redefirlo.
  762.  * @default mat
  763.  *
  764.  * @param BParam4 Base Eval
  765.  * @desc Una fórmula para usar en lugar del modo predeterminado del MV.
  766.  * En blanco para usar el modo predeterminado.
  767.  * @default
  768.  *
  769.  * @param BParam4 Limits
  770.  * @desc Una fórmula para los valores mínimo y máximos. Ver ayuda.
  771.  * Ataque mágico
  772.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  773.  *
  774.  * @param BParam5 Name
  775.  * @desc Alias para este parámetro. Puedes redefirlo.
  776.  * @default mdf
  777.  *
  778.  * @param BParam5 Base Eval
  779.  * @desc Una fórmula para usar en lugar del modo predeterminado del MV.
  780.  * En blanco para usar el modo predeterminado.
  781.  * @default
  782.  *
  783.  * @param BParam5 Limits
  784.  * @desc Una fórmula para los valores mínimo y máximos. Ver ayuda.
  785.  * Defensa mágica
  786.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  787.  *
  788.  * @param BParam6 Name
  789.  * @desc Alias para este parámetro. Puedes redefirlo.
  790.  * @default agi
  791.  *
  792.  * @param BParam6 Base Eval
  793.  * @desc Una fórmula para usar en lugar del modo predeterminado del MV.
  794.  * En blanco para usar el modo predeterminado.
  795.  * @default
  796.  *
  797.  * @param BParam6 Limits
  798.  * @desc Una fórmula para los valores mínimo y máximos. Ver ayuda.
  799.  * Agilidad
  800.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  801.  *
  802.  * @param BParam7 Name
  803.  * @desc Alias para este parámetro. Puedes redefirlo.
  804.  * @default luk
  805.  *
  806.  * @param BParam7 Base Eval
  807.  * @desc Una fórmula para usar en lugar del modo predeterminado del MV.
  808.  * En blanco para usar el modo predeterminado.
  809.  * @default
  810.  *
  811.  * @param BParam7 Limits
  812.  * @desc Una fórmula para los valores mínimo y máximos. Ver ayuda.
  813.  * Suerte
  814.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  815.  *
  816.  * @param XParam0 Full Name
  817.  * @desc Nombre mostrado para este parámetro extra.
  818.  * @default Puntería
  819.  *
  820.  * @param XParam0 Base
  821.  * @desc Fórmula para el parámetro-x hit (Puntería).
  822.  * @default 0
  823.  *
  824.  * @param XParam1 Full Name
  825.  * @desc Nombre mostrado para este parámetro extra.
  826.  * @default Evasión
  827.  *
  828.  * @param XParam1 Base
  829.  * @desc Fórmula para el parámetro-x eva (EVAsión).
  830.  * @default 0
  831.  *
  832.  * @param XParam2 Full Name
  833.  * @desc Nombre mostrado para este parámetro extra.
  834.  * @default Probabilidad de crítico
  835.  *
  836.  * @param XParam2 Base
  837.  * @desc Fórmula para el parámetro-x cri (probabilidad de CRÍtico).
  838.  * @default 0
  839.  *
  840.  * @param XParam3 Full Name
  841.  * @desc Nombre mostrado para este parámetro extra.
  842.  * @default Evadir crítico
  843.  *
  844.  * @param XParam3 Base
  845.  * @desc Fórmula para el parámetro-x cev (evadir Crítico).
  846.  * @default 0
  847.  *
  848.  * @param XParam4 Full Name
  849.  * @desc Nombre mostrado para este parámetro extra.
  850.  * @default Evasión mágica
  851.  *
  852.  * @param XParam4 Base
  853.  * @desc Fórmula para el parámetro-x param mev (evasión Mágica).
  854.  * @default 0
  855.  *
  856.  * @param XParam5 Full Name
  857.  * @desc Nombre mostrado para este parámetro extra.
  858.  * @default Reflejo mágico
  859.  *
  860.  * @param XParam5 Base
  861.  * @desc Fórmula para el parámetro-x mrf (reflejar Magia).
  862.  * @default 0
  863.  *
  864.  * @param XParam6 Full Name
  865.  * @desc Nombre mostrado para este parámetro extra.
  866.  * @default Contraataque
  867.  *
  868.  * @param XParam6 Base
  869.  * @desc Fórmula para el parámetro-x cnt (CoNTraataque).
  870.  * @default 0
  871.  *
  872.  * @param XParam7 Full Name
  873.  * @desc Nombre mostrado para este parámetro extra.
  874.  * @default Regenerar vida
  875.  *
  876.  * @param XParam7 Base
  877.  * @desc Fórmula para el parámetro-x hrg (regeneración de vida).
  878.  * @default 0
  879.  *
  880.  * @param XParam8 Full Name
  881.  * @desc Nombre mostrado para este parámetro extra.
  882.  * @default Regenerar magia
  883.  *
  884.  * @param XParam8 Base
  885.  * @desc Fórmula para el parámetro-x mrg (regeneración de magia).
  886.  * @default 0
  887.  *
  888.  * @param XParam9 Full Name
  889.  * @desc Nombre mostrado para este parámetro extra.
  890.  * @default Regenerar turbo
  891.  *
  892.  * @param XParam9 Base
  893.  * @desc Fórmula para el parámetro-x trg (regeneración de tp).
  894.  * @default 0
  895.  *
  896.  * @param SParam0 Full Name
  897.  * @desc Nombre mostrado para este parámetro especial.
  898.  * @default Ser el objetivo
  899.  *
  900.  * @param SParam0 Base
  901.  * @desc Fórmula para el parámetro-s tgr (ser el objetivo).
  902.  * @default 1
  903.  *
  904.  * @param SParam1 Full Name
  905.  * @desc Nombre mostrado para este parámetro especial.
  906.  * @default Efecto defensivo
  907.  *
  908.  * @param SParam1 Base
  909.  * @desc Fórmula para el parámetro-s grd (efecto de defensa).
  910.  * @default 1
  911.  *
  912.  * @param SParam2 Full Name
  913.  * @desc Nombre mostrado para este parámetro especial.
  914.  * @default Efecto de recuperación
  915.  *
  916.  * @param SParam2 Base
  917.  * @desc Fórmula para el parámetro-s rec (efecto de RECuperación).
  918.  * @default 1
  919.  *
  920.  * @param SParam3 Full Name
  921.  * @desc Nombre mostrado para este parámetro especial.
  922.  * @default Farmacología
  923.  *
  924.  * @param SParam3 Base
  925.  * @desc Fórmula para el parámetro-s pha (PHArmacología).
  926.  * @default 1
  927.  *
  928.  * @param SParam4 Full Name
  929.  * @desc Nombre mostrado para este parámetro especial.
  930.  * @default Coste de mp
  931.  *
  932.  * @param SParam4 Base
  933.  * @desc Fórmula para el parámetro-s mcr (coste de Mp).
  934.  * @default 1
  935.  *
  936.  * @param SParam5 Full Name
  937.  * @desc Nombre mostrado para este parámetro especial.
  938.  * @default Coste de tp
  939.  *
  940.  * @param SParam5 Base
  941.  * @desc Fórmula para el parámetro-s tcr (coste de Tp).
  942.  * @default 1
  943.  *
  944.  * @param SParam6 Full Name
  945.  * @desc Nombre mostrado para este parámetro especial.
  946.  * @default Daño físico recibido
  947.  *
  948.  * @param SParam6 Base
  949.  * @desc Fórmula para el parámetro-s pdr (daño físico recibido).
  950.  * @default 1
  951.  *
  952.  * @param SParam7 Full Name
  953.  * @desc Nombre mostrado para este parámetro especial.
  954.  * @default Daño mágico recibido
  955.  *
  956.  * @param SParam7 Base
  957.  * @desc Fórmula para el parámetro-s mdr (daño Mágico recibido).
  958.  * @default 1
  959.  *
  960.  * @param SParam8 Full Name
  961.  * @desc Nombre mostrado para este parámetro especial.
  962.  * @default Daño por el terreno
  963.  *
  964.  * @param SParam8 Base
  965.  * @desc Fórmula para el parámetro-s fdr (daño por el suelo).
  966.  * @default 1
  967.  *
  968.  * @param SParam9 Full Name
  969.  * @desc Nombre mostrado para este parámetro especial.
  970.  * @default Experiencia obtenible
  971.  *
  972.  * @param SParam9 Base
  973.  * @desc Fórmula para el parámetro-s exr (EXperiencia obtenida).
  974.  * @default 1
  975.  *
  976.  * @param Developer HaltJS
  977.  * @desc Si está activado salta cuando una función personalizada
  978.  * da error.   No - false   Si - true
  979.  * @default false
  980.  *
  981.  * @help
  982.  * ============================================================================
  983.  * Introducción
  984.  * ============================================================================
  985.  *
  986.  * El RPG Maker MV viene con unos tipos fijos de parámetros, son útiles pero
  987.  * tienen sus propósitos específicos y limita el modo en que los puedes usar.
  988.  *
  989.  * Coneste complemento puedes añadir nuevos para usarlos en tus fórmulas
  990.  * y cualquier uso que puedas imaginar.
  991.  *
  992.  * Existen 3 nuevos tipos de parámetros:
  993.  *  -Nuevo/Normal Params: Basados en el nivel igual que los que vienen por
  994.  *   defecto, con los efectos de fortalecer/debilitar y modificadores.
  995.  *   Además de una opción que puede servir en distintos complementos
  996.  *   de niveles de enemigos.
  997.  *
  998.  *  -Planos Params: No basados en nivel, funcionan como los x/sparams
  999.  *   con modificadores.
  1000.  *
  1001.  *  -Contador Params: similares a los nparams, funcionan como contadores como
  1002.  *   son hp, mp y tp. Usan nombre para valor actual y valor máximo.
  1003.  *
  1004.  * Además se ha añadido personalización para los x/sparams que permite mayor
  1005.  * control.
  1006.  * Y una nueva característica que permite 2 topes para los params y nparams.
  1007.  *
  1008.  * ============================================================================
  1009.  * Uso
  1010.  * ============================================================================
  1011.  *
  1012.  * Los NParams, CParams y PParams son calculados mediante sus respectivas
  1013.  * fórmulas:
  1014.  *
  1015.  * NParam = (Base + Plus) * Rate * XRate * Buff + Flat + XFlat
  1016.  * CParam = (Base + Plus) * Rate * XRate * Buff + Flat + XFlat
  1017.  * PParam = (Base + Plus) * Rate + Flat
  1018.  *
  1019.  *   -Base es distinto entre ambas. Para los NParams está basado en el nivel.
  1020.  *    Para los PParam el valor es fijo emulando los x/sparams (0 y 1).
  1021.  *   -Plus es la suma de todas las características plus que atañen al personaje.
  1022.  *    En el caso de NParam existe un extra añadido mediante llamadas a script
  1023.  *    y efectos de los objetos.
  1024.  *   -Rate es el producto de todos los multiplicadores que atañen al personaje.
  1025.  *   -XRate es el producto de todos los multiplicadores especiales que atañen
  1026.  *    al personaje.
  1027.  *   -Buff es el efecto de fortalecer/debilitar.
  1028.  *   -Flat es la suma de todas las características flat que atañen al personaje.
  1029.  *    No se ve afectado por los multiplicadores.
  1030.  *   -XFlat es la suma de todas las características flat especiales que atañen
  1031.  *    al personaje. No se ve afectado por los multiplicadores.
  1032.  *
  1033.  *
  1034.  * XRate, XFlat y Buff permiten ir más allá del primer límite.
  1035.  *
  1036.  * Para hacer los XParams y SParams más personalizables he cambiado un poco
  1037.  * sus fórmulas:
  1038.  *
  1039.  * Param  = (Base + Plus) * Rate * XRate * Buff + Flat + XFlat
  1040.  * XParam = (Base + Plus) * Rate + Flat
  1041.  * SParam = (Base + Plus) * Rate + Flat
  1042.  *
  1043.  * Siguen funcionando como de costumbre pero ahora puedes añadir más
  1044.  * características para tener un mayor control.
  1045.  *
  1046.  * Para añadir características basta con añadir etiquetas en los cuadros de notas
  1047.  * respectivos.
  1048.  *
  1049.  * Héroes, clases y enemigos solo:
  1050.  *
  1051.  * <NPARAM: NParam Base Grow HGrow Cap>
  1052.  * <CPARAM: CParam Base Grow HGrow Cap>
  1053.  *    -Cambia la base predeterminada del NParam por una específica.
  1054.  *     NParam se puede referenciar por su nombre o índice.
  1055.  *     Base es el valor inicial en el nivel 1.
  1056.  *     Grow es cuanto se incrementa por nivel. Si está vacío cuenta como 0.
  1057.  *     HGrow es similar a Grow pero de crecimiento exponencial.
  1058.  *     Cap es el nivel en el cual el NParam deja de subir.
  1059.  *     Puedes usar números decimales.
  1060.  *    
  1061.  *
  1062.  * Armas y armaduras solo:
  1063.  *
  1064.  * <NPARAM: NParam Value>
  1065.  * <CPARAM: CParam Value>
  1066.  * <PPARAM: PParam Value>
  1067.  *    -Fija un valor determinado de N/P/CParam para el arma o armadura.
  1068.  *     Se puede hacer referncia por el nombre o índice.
  1069.  *    
  1070.  *
  1071.  * Héroes, clases, enemigos, armas, armaduras y estados alterados:
  1072.  *
  1073.  * <NDEBUFFRATE: NParam Rate>
  1074.  * <CDEBUFFRATE: CParam Rate>
  1075.  *    -Se usa para la resistencia al debilitamiento en dicho nparam
  1076.  *     o cparam, básicamente es la probabilidad de acierto.
  1077.  *     0.5 significa 50% acierto, 0.2 es 20%, etc.
  1078.  *
  1079.  *
  1080.  * <NPARAMPLUS: NParam Plus>
  1081.  * <NPARAMRATE: NParam Rate>
  1082.  * <NPARAMXRATE: NParam XRate>
  1083.  * <NPARAMFLAT: NParam Flat>
  1084.  * <NPARAMXFLAT: NParam XFlat>
  1085.  *    -Modificadores para el nparam.
  1086.  *
  1087.  * <PPARAMPLUS: PParam Plus>
  1088.  * <PPARAMRATE: PParam Rate>
  1089.  * <PPARAMFLAT: PParam Flat>
  1090.  *    -Modificadores para el pparam.
  1091.  *
  1092.  * <CPARAMPLUS: CParam Plus>
  1093.  * <CPARAMRATE: CParam Rate>
  1094.  * <CPARAMXRATE: CParam XRate>
  1095.  * <CPARAMFLAT: CParam Flat>
  1096.  * <CPARAMXFLAT: CParam Flat>
  1097.  *    -Modificadores para el cparam.
  1098.  *
  1099.  * <PARAMPLUS: Param Plus>
  1100.  * <PARAMRATE: Param Rate>
  1101.  * <PARAMXRATE: Param XRate>
  1102.  * <PARAMFLAT: Param Flat>
  1103.  * <PARAMXFLAT: Param XFlat>
  1104.  * <xPARAMPLUS: XParam Plus>
  1105.  * <XPARAMRATE: XParam Rate>
  1106.  * <XPARAMFLAT: XParam Flat>
  1107.  * <SPARAMPLUS: SParam Plus>
  1108.  * <SPARAMRATE: SParam Rate>
  1109.  * <SPARAMFLAT: SParam Flat>
  1110.  *    -Modificadores para los parámetros básicos, x e y.
  1111.  *     Los he incluido para dar más control.
  1112.  *
  1113.  *
  1114.  * Habilidades y objetos solo:
  1115.  *
  1116.  * <NBUFF: NParam turnos>
  1117.  * <NDEBUFF: NParam turnos>
  1118.  * <REMOVE NBUFF: NParam>
  1119.  * <REMOVE NDEBUFF: NParam>
  1120.  * <CBUFF: CParam turnos>
  1121.  * <CDEBUFF: CParam turnos>
  1122.  * <REMOVE CBUFF: CParam>
  1123.  * <REMOVE CDEBUFF: CParam>
  1124.  *    -Efectos de añadir y quitar fortalecimiento/debilitamiento.
  1125.  *
  1126.  * <NPARAM GROW: NParam amount>
  1127.  *    -Permite incrementar/decrementar el nparam una cantidad específica.
  1128.  *
  1129.  * <PPARAM GROW: PParam amount>
  1130.  *    -Permite incrementar/decrementar el pparam una cantidad específica.
  1131.  *
  1132.  * <CPARAM GROW: CParam amount>
  1133.  *    -Permite incrementar/decrementar el cparam una cantidad específica.
  1134.  *
  1135.  * ============================================================================
  1136.  * Comandos de CParam
  1137.  * ============================================================================
  1138.  *
  1139.  * Se han añadido controles para el uso/gasto/pérdida de cantidades de un
  1140.  * cparam específico. Se trata de funciones en javascript similares a las de
  1141.  * hp, mp y tp.
  1142.  *
  1143.  * gain[cparam](amount)
  1144.  *    -Incrementar (o gastar si es negativo) una cantidad específica del cparam.
  1145.  *     Sustituir [cparam] con el nombre del contador con la primera letra en
  1146.  *     mayúsculas.
  1147.  *
  1148.  * set[cparam](amount)
  1149.  *    -Fija el valor de un cparam.
  1150.  *     Sustituir [cparam] con el nombre del contador con la primera letra en
  1151.  *     mayúsculas.
  1152.  *
  1153.  * [cparam]rate()
  1154.  *    -Obtener el ratio (desde 0 para 0% hasta 1 para 100%) del cparam.
  1155.  *     Sustituir [cparam] con el nombre del contador en minúsculas.
  1156.  *
  1157.  * ============================================================================
  1158.  * Lunatic Mode
  1159.  * ============================================================================
  1160.  *
  1161.  * Para aquellos que quieren utilizar un modo personalizado para calcular
  1162.  * los parámetros he añadido el modo lunático.
  1163.  * El modo lunático permite utilizar código javascript diréctamente.
  1164.  *
  1165.  * Usa las siguientes etiquetas en las clases y enemigos:
  1166.  *
  1167.  * <CUSTOM NPARAM BASE NPARAM>
  1168.  * value = 2;
  1169.  * value += 25;
  1170.  * </CUSTOM NPARAM BASE>
  1171.  *
  1172.  * <CUSTOM CPARAM BASE CPARAM>
  1173.  * value = 2;
  1174.  * value += 25;
  1175.  * </CUSTOM CPARAM BASE>
  1176.  *
  1177.  * <CUSTOM PARAM BASE PARAM>
  1178.  * value = base;
  1179.  * value += 25;
  1180.  * </CUSTOM PARAM BASE>
  1181.  *
  1182.  * Dicho código se ejecutará en lugar de la fórmula predeterminada.
  1183.  * Los parámetros básicos además permiten usar la variable 'base' dentro de su
  1184.  * fórmula. Equivale al valor que tendría en el nivel 1.
  1185.  *
  1186.  * value - Esta es la variable donde se almacena el resultado.
  1187.  *         Si no se especifica será 0.
  1188.  *
  1189.  * Etiquetas para equipamiento:
  1190.  *
  1191.  * <CUSTOM NPARAMS>
  1192.  * javascript
  1193.  * javascript
  1194.  * 0 = $gameVariables.value(35)
  1195.  * int = $gameSwitches.value(12)? 50 : 1
  1196.  * </CUSTOM NPARAMS>
  1197.  *
  1198.  * <CUSTOM PPARAMS>
  1199.  * javascript
  1200.  * javascript
  1201.  * 0 = $gameVariables.value(35)
  1202.  * int = $gameSwitches.value(12)? 50 : 1
  1203.  * </CUSTOM PPARAMS>
  1204.  *
  1205.  * <CUSTOM CPARAMS>
  1206.  * javascript
  1207.  * javascript
  1208.  * 0 = $gameVariables.value(35)
  1209.  * mbul = $gameSwitches.value(12)? 50 : 1
  1210.  * </CUSTOM CPARAMS>
  1211.  *
  1212.  * <CUSTOM PARAMS>
  1213.  * javascript
  1214.  * javascript
  1215.  * 0 = $gameVariables.value(35)
  1216.  * mhp = $gameSwitches.value(12)? 50 : 1
  1217.  * </CUSTOM PARAMS>
  1218.  *
  1219.  * Añade valores evaluables para nparams, pparams, cparams y params básicos
  1220.  * a armas y armaduras.
  1221.  * Primero se añade código javascript que afecta todos los parámetros de su
  1222.  * tipo. Después se utiliza un identificador que puede ser un número o el
  1223.  * nombre del parámetro, un igual y la fórmula que se va a evaluar.
  1224.  *
  1225.  * Ejemplo:
  1226.  * <CUSTOM PARAMS>
  1227.  * var bonus = this.level;
  1228.  * var restrict = 5;
  1229.  * mhp = $gameVariables.value(35) + bonus * 5 - restrict
  1230.  * mmp = ($gameSwitches.value(12)? 50 : 1) + bonus / restrict
  1231.  * </CUSTOM PARAMS>
  1232.  *
  1233.  * ============================================================================
  1234.  * Parámetros
  1235.  * ============================================================================
  1236.  *
  1237.  * Puedes crear hasta 100 parámetros de cada tipo con índices del 0 al 99.
  1238.  *
  1239.  * NParam/PParam/Bparam Name: el nombre interno que le vas a dar al parámetro.
  1240.  * Se utilizará en fórmulas y se puede usar como referencia en las etiquetas en
  1241.  * las notas. Dejar vacío si no se quiere usar.
  1242.  *
  1243.  * - Nota: Los bparams existen de por sí pero se pueden redefinir.
  1244.  *
  1245.  * NParam/PParam/XParam/SParam Full Name: el nombre que quieres dar al nparam.
  1246.  * Por el momento no se usa aquí pero sirve para los plugins que usen este.
  1247.  *
  1248.  * CParam Name / Full Name Basic: nombre y nombre a mostrar para el parámetro
  1249.  * que representa el valor máximo. Por el momento no se usa aquí pero sirve para
  1250.  * los plugins que usen este.
  1251.  *
  1252.  * CParam Name / Full Name Counter: nombre y nombre a mostrar para el parámetro
  1253.  * que representa el valor actual. Por el momento no se usa aquí pero sirve para
  1254.  * los plugins que usen este.
  1255.  *
  1256.  * NParam/PParam Color: un color para representar nparam y pparam para plugins
  1257.  * que lo necesiten. Puede ser un número o un color html.
  1258.  *
  1259.  * CParam ColorX: colores para la barra de medición del cparam. Puede ser un
  1260.  * número o un color html.
  1261.  *
  1262.  * NParam/CParam Base: la fórmula predeterminada para clases y enemigos que no
  1263.  * tengan. El primer númber es el valor en el nivel 1. El segundo es cuanto sube
  1264.  * cada nivel. El tercero es de crecimiento exponencial y el cuarto es el nivel
  1265.  * en el cual va a dejar de subir.
  1266.  *
  1267.  * PParam/XParam/SParam Base: es un valor básico con el que los pparam pueden
  1268.  * emular los x/sparams, y dar más control a los x/sparams mediante fórmulas.
  1269.  * 0 suele ser el valor de un xparam y 1 el de un sparam.
  1270.  *
  1271.  * NParam/CParam/BParam Base Eval: permite el uso de formulas para los nparams y
  1272.  * bparams, al igual que los p/x/sparams. Si se define una fórmula se utilizará
  1273.  * en lugar del modo predeterminado del MV para los BParams o del modo
  1274.  * tradicional de los NParams.
  1275.  * Los parámetros básicos además permiten usar la variable 'base' dentro de su
  1276.  * fórmula. Equivale al valor que tendría en el nivel 1.
  1277.  *
  1278.  * NParam/CParam/BParam Limits: los valores mínimo y máximo que puede tener el
  1279.  * nparam, cparam o param. Ahora se utiliza como fórmula que da 3 valores.
  1280.  * El primero es el mínimo, el segundo es máximo normal y el tercero es
  1281.  * el extra máximo.
  1282.  * (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  1283.  *
  1284.  * PParam Limits: igual que el anterior pero solo usa 2 valores (mínimo y máximo).
  1285.  * (this.isActor())? [0, 999] : [0, 999]
  1286.  *
  1287.  * NParam/CParam Buff Icons: conjunto de iconos separados por espacios.
  1288.  * Cuando dicho parámetro se vea afectado por un fortalecimiento se mostrará
  1289.  * el icono correspondiente al fortalecimiento acumulado.
  1290.  * Si se deja en blanco no se usará.
  1291.  *
  1292.  * NParam/CParam Debuff Icons: igual que el anterior pero para los
  1293.  * debilitamientos del parámetro.
  1294.  *
  1295.  * Developer HaltJS: Esta es una variable de uso durante el desarrollo del juego
  1296.  * útil cuando quieres comprobar si hay alguna función personalizada incorrecta.
  1297.  * Cuando está activado al encontrar un error el juego se para y muestra
  1298.  * en qué parámetro se encuentra el error.
  1299.  * Cuando está desactivado ignora el error y el juego continúa.
  1300.  *
  1301.  * ============================================================================
  1302.  * Incompatibilidades
  1303.  * ============================================================================
  1304.  *
  1305.  * No se conocen complementos que sean incompatibles hasta la fecha.
  1306.  *
  1307.  * ============================================================================
  1308.  * Problemas conocidos
  1309.  * ============================================================================
  1310.  *
  1311.  * Por el momento ninguno.
  1312.  *
  1313.  * ============================================================================
  1314.  * Historial de versiones
  1315.  * ============================================================================
  1316.  *
  1317.  * Versión 1.06:
  1318.  * - Se han añadido los CParams.
  1319.  * - Se han eliminado funciones y parámetros obsoletos.
  1320.  * - Pequeñas mejoras.
  1321.  *
  1322.  * Versión 1.05:
  1323.  * - Se han añadido parámetros evaluables para el equipamiento.
  1324.  * - Se ha añadido el uso de nparams en el equipamiento.
  1325.  * - Se ha expandido el modo lunático para incluir a los personajes y classes
  1326.  *   para enemigos.
  1327.  * - Permite el crecimiento de los pparams.
  1328.  * - Permite fórmulas personalizadas para los parámetros básicos y los nparams.
  1329.  * - Uso del sistema de parámetros del 1.5.0.
  1330.  *
  1331.  * Versión 1.04:
  1332.  * - Permite el ICF-Soft Main Core.
  1333.  * - Se ha expandido el modo lunático para afectar enemigos.
  1334.  * - Mayor control para los nparams.
  1335.  *
  1336.  * Versión 1.03:
  1337.  * - Se ha añadido el modificador XFlat para el doble máximo.
  1338.  * - Se ha subido la cantidad de n/pparams a 30.
  1339.  * - Permite nombrar los parámetros especiales y extra.
  1340.  *
  1341.  * Versión 1.02:
  1342.  * - Permite añadir alias o redefinir los parámetros básicos.
  1343.  *
  1344.  * Versión 1.01:
  1345.  * - Se empieza a utilizar el ICF-Soft Main Utility.
  1346.  * - Se ha añadido el modo lunático para params y nparams.
  1347.  * - Se ha cambiado el cómo funcionan los límites mínimo y máximo.
  1348.  * - Se ha añadido el doble máximo.
  1349.  * - Se han añadido más características.
  1350.  * - Se pueden usar los base params.
  1351.  *
  1352.  * Versión 1.00:
  1353.  * - Complemento terminado.
  1354.  *
  1355.  * ============================================================================
  1356.  *
  1357.  * Para juegos comerciales y no comerciales.
  1358.  * Se debe incluir a ICF-Soft en los créditos.
  1359.  * Esta cabecera debe incluirse íntegramente con el plugin.
  1360.  *
  1361.  * ============================================================================
  1362. */
  1363. /*~struct~NormalParams:
  1364.  * @param Name
  1365.  * @desc Name for this new param in lowercase without spaces. Empty to skip.
  1366.  * @default
  1367.  *
  1368.  * @param Full Name
  1369.  * @desc Name that will be shown for this new param.
  1370.  * @default
  1371.  *
  1372.  * @param Base
  1373.  * @desc How this new param is configured by default. See help.
  1374.  * @default 30 15
  1375.  *
  1376.  * @param Base Eval
  1377.  * @desc A formula to use instead of base.
  1378.  * @default
  1379.  *
  1380.  * @param Color
  1381.  * @desc A color for param. Can be a html code or a number.
  1382.  * @default
  1383.  *
  1384.  * @param Limits
  1385.  * @desc Formula for min and max value for this new param. See help.
  1386.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  1387.  *
  1388.  * @param Buff Icons
  1389.  * @desc Icons for each buff stack. Empty to don't use. See help.
  1390.  * @default
  1391.  *
  1392.  * @param Debuff Icons
  1393.  * @desc Icons for each debuff stack. Empty to don't use. See help.
  1394.  * @default
  1395.  *
  1396.  */
  1397. /*~struct~PlainParams:
  1398.  * @param Name
  1399.  * @desc Name for this plain param in lowercase without spaces. Empty to skip.
  1400.  * @default
  1401.  *
  1402.  * @param Full Name
  1403.  * @desc Name that will be shown for this plain param.
  1404.  * @default
  1405.  *
  1406.  * @param Base
  1407.  * @desc How this plain param is configured by default. See help.
  1408.  * @default 0
  1409.  *
  1410.  * @param Is Percentage
  1411.  * @desc Tell if this plain param is a percentage.
  1412.  * @default false
  1413.  *
  1414.  * @param Color
  1415.  * @desc A color for param. Can be a html code or a number.
  1416.  * @default
  1417.  *
  1418.  * @param Limits
  1419.  * @desc Formula for min and max value for this plain param. See help.
  1420.  * @default (this.isActor())? [0, 999] : [0, 999]
  1421.  *
  1422.  */
  1423. /*~struct~CountingParams:
  1424.  * @param Name Basic
  1425.  * @desc Name for this count param in lowercase without spaces. Empty to skip.
  1426.  * @default
  1427.  *
  1428.  * @param Full Name Basic
  1429.  * @desc Name that will be shown for this count param.
  1430.  * @default
  1431.  *
  1432.  * @param Name Counter
  1433.  * @desc Name for current value param in lowercase without spaces. Empty to skip.
  1434.  * @default
  1435.  *
  1436.  * @param Full Name Counter
  1437.  * @desc Name that will be shown for current value param.
  1438.  * @default
  1439.  *
  1440.  * @param Base
  1441.  * @desc How this count param max value is configured by default. See help.
  1442.  * @default 30 15
  1443.  *
  1444.  * @param Base Eval
  1445.  * @desc A formula to use instead of base.
  1446.  * @default
  1447.  *
  1448.  * @param Color1
  1449.  * @desc First color for gauge. Can be a html code or a number.
  1450.  * @default
  1451.  *
  1452.  * @param Color2
  1453.  * @desc Second color for gauge. Can be a html code or a number.
  1454.  * @default
  1455.  *
  1456.  * @param Limits
  1457.  * @desc Formula for min and max value for this count param. See help.
  1458.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  1459.  *
  1460.  * @param Buff Icons
  1461.  * @desc Icons for each buff stack. Empty to don't use. See help.
  1462.  * @default
  1463.  *
  1464.  * @param Debuff Icons
  1465.  * @desc Icons for each debuff stack. Empty to don't use. See help.
  1466.  * @default
  1467.  *
  1468.  */
  1469. /*~struct~NormalParams:es
  1470.  * @param Name
  1471.  * @desc Nombre para este nuevo parámetro en minúsculas. Vacío para saltar.
  1472.  * @default
  1473.  *
  1474.  * @param Full Name
  1475.  * @desc Nombre mostrado para este nuevo parámetro.
  1476.  * @default
  1477.  *
  1478.  * @param Base
  1479.  * @desc Modo predeterminado de configuración. Ver ayuda.
  1480.  * @default 30 15
  1481.  *
  1482.  * @param Base Eval
  1483.  * @desc Una fórmula para usar en lugar del modo predeterminado.
  1484.  * @default
  1485.  *
  1486.  * @param Color
  1487.  * @desc Un color para representar el parámetro. Se puede usar un color html o un número.
  1488.  * @default
  1489.  *
  1490.  * @param Limits
  1491.  * @desc Una fórmula para los valores mínimo y máximos para este
  1492.  * nuevo parámetro. Ver ayuda.
  1493.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  1494.  *
  1495.  * @param Buff Icons
  1496.  * @desc Iconos a mostrar para cada valor de fortalecimiento.
  1497.  * Vacío no usar ninguno. Ver ayuda.
  1498.  * @default
  1499.  *
  1500.  * @param Debuff Icons
  1501.  * @desc Iconos a mostrar para cada valor de debilitamiento.
  1502.  * Vacío no usar ninguno. Ver ayuda.
  1503.  * @default
  1504.  *
  1505.  */
  1506. /*~struct~PlainParams:es
  1507.  * @param Name
  1508.  * @desc Nombre para este parámetro plano en minúsculas. Vacío para saltar.
  1509.  * @default
  1510.  *
  1511.  * @param Full Name
  1512.  * @desc Nombre para mostrar para este parámetro plano.
  1513.  * @default
  1514.  *
  1515.  * @param Base
  1516.  * @desc Fórmula para calcular el Valor básico de este parámetro plano.
  1517.  * @default 0
  1518.  *
  1519.  * @param Is Percentage
  1520.  * @desc Indica si este parámetro plano es un porcentage.
  1521.  * @default false
  1522.  *
  1523.  * @param Color
  1524.  * @desc Un color para representar el parámetro. Se puede usar un color html o un número.
  1525.  * @default
  1526.  *
  1527.  * @param Limits
  1528.  * @desc Una fórmula para los valores mínimo y máximos para este
  1529.  * parámetro plano. Ver ayuda.
  1530.  * @default (this.isActor())? [0, 999] : [0, 999]
  1531.  *
  1532.  */
  1533. /*~struct~CountingParams:es
  1534.  * @param Name Basic
  1535.  * @desc Nombre para este parámetro máximo en minúsculas. Vacío para saltar.
  1536.  * @default
  1537.  *
  1538.  * @param Full Name Basic
  1539.  * @desc Nombre para mostrar para este parámetro máximo.
  1540.  * @default
  1541.  *
  1542.  * @param Name Counter
  1543.  * @desc Nombre para este parámetro contador en minúsculas. Vacío para saltar.
  1544.  * @default
  1545.  *
  1546.  * @param Full Name Counter
  1547.  * @desc Nombre para mostrar para este parámetro contador.
  1548.  * @default
  1549.  *
  1550.  * @param Base
  1551.  * @desc Modo predeterminado de configuración. Ver ayuda.
  1552.  * @default 30 15
  1553.  *
  1554.  * @param Base Eval
  1555.  * @desc Una fórmula para usar en lugar del modo predeterminado.
  1556.  * @default
  1557.  *
  1558.  * @param Color1
  1559.  * @desc Primer color de la barra. Se puede usar un color html o un número.
  1560.  * @default
  1561.  *
  1562.  * @param Color2
  1563.  * @desc Segundo color de la barra. Se puede usar un color html o un número.
  1564.  * @default
  1565.  *
  1566.  * @param Limits
  1567.  * @desc Una fórmula para los valores mínimo y máximos para este
  1568.  * nuevo parámetro. Ver ayuda.
  1569.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  1570.  *
  1571.  * @param Buff Icons
  1572.  * @desc Iconos a mostrar para cada valor de fortalecimiento.
  1573.  * Vacío no usar ninguno. Ver ayuda.
  1574.  * @default
  1575.  *
  1576.  * @param Debuff Icons
  1577.  * @desc Iconos a mostrar para cada valor de debilitamiento.
  1578.  * Vacío no usar ninguno. Ver ayuda.
  1579.  * @default
  1580.  *
  1581.  */
  1582. //=============================================================================
  1583.  
  1584. //=============================================================================
  1585. // Parameter Variables
  1586. //=============================================================================
  1587.  
  1588. ICF.Parameters = PluginManager.parameters('ICFSoft_ParamsCore');
  1589. ICF.Param = ICF.Param || {};
  1590.  
  1591. ICF.Param.NParams = [];
  1592. ICF.Param.NParamsFullName = [];
  1593. ICF.Param.NParamBase = [];
  1594. ICF.Param.NParamLimit = [];
  1595. ICF.Param.NParamBuffIcons = [];
  1596. ICF.Param.NParamDebuffIcons = [];
  1597. ICF.Param.NParamColor1 = [];
  1598. ICF.Param.PParams = [];
  1599. ICF.Param.PParamsFullName = [];
  1600. ICF.Param.PParamBase = [];
  1601. ICF.Param.PParamLimit = [];
  1602. ICF.Param.PParamColor1 = [];
  1603. ICF.Param.PParamIsPercent = [];
  1604. ICF.Param.CParams = [];
  1605. ICF.Param.CParamsFullName = [];
  1606. ICF.Param.CParamsMax = [];
  1607. ICF.Param.CParamsMaxFullName = [];
  1608. ICF.Param.CParamBase = [];
  1609. ICF.Param.CParamLimit = [];
  1610. ICF.Param.CParamBuffIcons = [];
  1611. ICF.Param.CParamDebuffIcons = [];
  1612. ICF.Param.CParamColor1 = [];
  1613. ICF.Param.CParamColor2 = [];
  1614. ICF.Param.BParamLimit = [];
  1615. ICF.Param.BParamBase = [];
  1616. ICF.Param.XParamsFullName = [];
  1617. ICF.Param.XParamBase = [];
  1618. ICF.Param.SParamsFullName = [];
  1619. ICF.Param.SParamBase = [];
  1620.  
  1621. ICF.Param.BParams = ["mhp", "mmp", "atk", "def", "mat", "mdf", "agi", "luk"];
  1622. ICF.Param.XParams = ["hit", "eva", "cri", "cev", "mev", "mrf", "cnt", "hrg", "mrg", "trg"];
  1623. ICF.Param.SParams = ["tgr", "grd", "rec", "pha", "mcr", "tcr", "pdr", "mdr", "fdr", "exr"];
  1624.  
  1625. ICF.MainUtility.validateColor = function(color) {
  1626.     if (!isNaN(Number(color))) return Number(color);
  1627.     try {
  1628.         var btm = new Bitmap(2,2);
  1629.         var gra = btm._context.createLinearGradient(1,1,1,2);
  1630.         gra.addColorStop(1,color);
  1631.             return color;
  1632.     } catch (e) {
  1633.         return "rgba(0,0,0,0)";
  1634.     }
  1635.     return "rgba(0,0,0,0)";
  1636. }
  1637.  
  1638. ICF.temp = JSON.parse(ICF.Parameters['NParams']);
  1639. for (var i = 0; i < ICF.temp.length; i++) {
  1640.     ICF.temp[i] = JSON.parse(ICF.temp[i]);
  1641.     ICF.Param.NParams[i] = ICF.temp[i]['Name'];
  1642.     ICF.Param.NParamsFullName[i] = ICF.temp[i]['Full Name'];
  1643.     ICF.Param.NParamBase[i] = ICF.temp[i]['Base'].split(/\s+/).leaveNumbers();
  1644.     if (ICF.temp[i]['Base Eval'].trim().length > 0) ICF.Param.NParamBase[i] = ICF.temp[i]['Base Eval'];
  1645.     ICF.Param.NParamLimit[i] = ICF.temp[i]['Limits'];
  1646.     ICF.Param.NParamBuffIcons[i] = ICF.temp[i]['Buff Icons'].split(/\s+/).leaveNumbers();
  1647.     ICF.Param.NParamDebuffIcons[i] = ICF.temp[i]['Debuff Icons'].split(/\s+/).leaveNumbers();
  1648.     ICF.Param.NParamColor1[i] = ICF.MainUtility.validateColor(ICF.temp[i]['Color']);
  1649. }
  1650. ICF.temp = JSON.parse(ICF.Parameters['PParams']);
  1651. for (var i = 0; i < ICF.temp.length; i++) {
  1652.     ICF.temp[i] = JSON.parse(ICF.temp[i]);
  1653.     ICF.Param.PParams[i] = ICF.temp[i]['Name'];
  1654.     ICF.Param.PParamsFullName[i] = ICF.temp[i]['Full Name'];
  1655.     ICF.Param.PParamIsPercent[i] = ICF.temp[i]['Is Percentage'] && ICF.temp[i]['Is Percentage'].toLowerCase() == "true";
  1656.     ICF.Param.PParamBase[i] = ICF.temp[i]['Base'];
  1657.     ICF.Param.PParamLimit[i] = ICF.temp[i]['Limits'];
  1658.     ICF.Param.PParamColor1[i] = ICF.MainUtility.validateColor(ICF.temp[i]['Color']);
  1659. }
  1660.  
  1661. ICF.temp = JSON.parse(ICF.Parameters['CParams']);
  1662. for (var i = 0; i < ICF.temp.length; i++) {
  1663.     ICF.temp[i] = JSON.parse(ICF.temp[i]);
  1664.     ICF.Param.CParamsMax[i] = ICF.temp[i]['Name Basic'];
  1665.     ICF.Param.CParamsMaxFullName[i] = ICF.temp[i]['Full Name Basic'];
  1666.     ICF.Param.CParams[i] = ICF.temp[i]['Name Counter'];
  1667.     ICF.Param.CParamsFullName[i] = ICF.temp[i]['Full Name Counter'];
  1668.     ICF.Param.CParamBase[i] = ICF.temp[i]['Base'].split(/\s+/).leaveNumbers();
  1669.     if (ICF.temp[i]['Base Eval'].trim().length > 0) ICF.Param.CParamBase[i] = ICF.temp[i]['Base Eval'];
  1670.     ICF.Param.CParamLimit[i] = ICF.temp[i]['Limits'];
  1671.     ICF.Param.CParamBuffIcons[i] = ICF.temp[i]['Buff Icons'].split(/\s+/).leaveNumbers();
  1672.     ICF.Param.CParamDebuffIcons[i] = ICF.temp[i]['Debuff Icons'].split(/\s+/).leaveNumbers();
  1673.     ICF.Param.CParamColor1[i] = ICF.MainUtility.validateColor(ICF.temp[i]['Color1']);
  1674.     ICF.Param.CParamColor2[i] = ICF.MainUtility.validateColor(ICF.temp[i]['Color2']);
  1675. }
  1676.  
  1677. for (var i = 0; i < 10; i++) {
  1678.     ICF.Param.XParamsFullName[i] = String(ICF.Parameters['XParam' + i + ' Full Name']);
  1679.     ICF.Param.XParamBase[i] = String(ICF.Parameters['XParam' + i + ' Base']);
  1680.     ICF.Param.SParamsFullName[i] = String(ICF.Parameters['SParam' + i + ' Full Name']);
  1681.     ICF.Param.SParamBase[i] = String(ICF.Parameters['SParam' + i + ' Base']);
  1682. }
  1683.  
  1684. for (var i = 0; i < 8; i++) {
  1685.     ICF.Param.BParams[i] = String(ICF.Parameters['BParam' + i + ' Name']);
  1686.     ICF.Param.BParamBase[i] = String(ICF.Parameters['BParam' + i + ' Base Eval']).trim();
  1687.     ICF.Param.BParamLimit[i] = String(ICF.Parameters['BParam' + i + ' Limits']);
  1688. }
  1689.  
  1690. ICF.Param.ParamCoreHalt = ICF.Parameters['Developer HaltJS'].toLowerCase() === "true";
  1691.  
  1692. if (!Imported.ICFSoft_MainUtility) {throw new Error('This plugin requires ICF-Soft Main Utility plugin version 1.01 to work.\nYou can download it at icfsoft.blogspot.com inside plugins section.');}
  1693. if (ICF.MainUtility.Version < 101) {throw new Error('This plugin requires ICF-Soft Main Utility plugin version 1.01 to work.\nYou can download it at icfsoft.blogspot.com inside plugins section.');}
  1694.  
  1695. //=============================================================================
  1696. // Constants
  1697. //=============================================================================
  1698.  
  1699. Game_BattlerBase.TRAIT_NPARAM          = 24;
  1700. Game_BattlerBase.TRAIT_PPARAM          = 25;
  1701. Game_BattlerBase.TRAIT_CPARAM          = 26;
  1702. Game_BattlerBase.TRAIT_TPPARAM         = 27;
  1703. Game_Action.EFFECT_ADD_NBUFF           = 35;
  1704. Game_Action.EFFECT_ADD_NDEBUFF         = 36;
  1705. Game_Action.EFFECT_REMOVE_NBUFF        = 37;
  1706. Game_Action.EFFECT_REMOVE_NDEBUFF      = 38;
  1707. Game_Action.EFFECT_NGROW               = 45;
  1708. Game_Action.EFFECT_PGROW               = 46;
  1709. Game_Action.EFFECT_CGROW               = 47;
  1710.  
  1711. //=============================================================================
  1712. // TextManager
  1713. //=============================================================================
  1714.  
  1715. ICF.ParamCore.TextManager_param = TextManager.param;
  1716. TextManager.param = function (paramId) {
  1717.     if (ICF.Param.NParams.indexOf(paramId) > -1) {
  1718.     var parId = ICF.Param.NParams.indexOf(paramId);
  1719.     return ICF.Param.NParamsFullName[parId];
  1720.     } else if (ICF.Param.PParams.indexOf(paramId) > -1) {
  1721.     var parId = ICF.Param.PParams.indexOf(paramId);
  1722.     return ICF.Param.PParamsFullName[parId];
  1723.     } else if (ICF.Param.CParams.indexOf(paramId) > -1) {
  1724.     var parId = ICF.Param.CParams.indexOf(paramId);
  1725.     return ICF.Param.CParamsFullName[parId];
  1726.     } else if (ICF.Param.CParamsMax.indexOf(paramId) > -1) {
  1727.     var parId = ICF.Param.CParamsMax.indexOf(paramId);
  1728.     return ICF.Param.CParamsMaxFullName[parId];
  1729.     } else if (ICF.Param.BParams.indexOf(paramId) > -1) {
  1730.     var parId = ICF.Param.BParams.indexOf(paramId);
  1731.     return ICF.ParamCore.TextManager_param.call(this, parId);
  1732.     } else if (ICF.Param.XParams.indexOf(paramId) > -1) {
  1733.     var parId = ICF.Param.XParams.indexOf(paramId);
  1734.     return ICF.Param.XParamsFullName[parId];
  1735.     } else if (ICF.Param.SParams.indexOf(paramId) > -1) {
  1736.     var parId = ICF.Param.SParams.indexOf(paramId);
  1737.     return ICF.Param.SParamsFullName[parId];
  1738.     } else {
  1739.     return ICF.ParamCore.TextManager_param.call(this, paramId);
  1740.     }
  1741. };
  1742.  
  1743. //=============================================================================
  1744. // DataManager
  1745. //=============================================================================
  1746.  
  1747. ICF.ParamCore.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
  1748. DataManager.isDatabaseLoaded = function() {
  1749.     if (!ICF.ParamCore.DataManager_isDatabaseLoaded.call(this)) return false;
  1750.     if (!ICF.ParamCore.Procesed) {
  1751.     ICF.NotetagsProcessor.ParamCoreB($dataActors);
  1752.     ICF.NotetagsProcessor.ParamCoreB($dataClasses);
  1753.     ICF.NotetagsProcessor.ParamCoreB($dataEnemies);
  1754.     ICF.NotetagsProcessor.ParamCoreC($dataWeapons);
  1755.     ICF.NotetagsProcessor.ParamCoreC($dataArmors);
  1756.     ICF.NotetagsProcessor.ParamCore($dataStates);
  1757.     ICF.NotetagsProcessor.ParamCoreD($dataSkills);
  1758.     ICF.NotetagsProcessor.ParamCoreD($dataItems);
  1759.     ICF.ParamCore.Procesed = true;
  1760.     }
  1761.     return true;
  1762. };
  1763.  
  1764. ICF.NotetagsProcessor.ParamCore = function(group) {
  1765.     var note1 = /<(?:NPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1766.     var note1b = /<(?:NPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1767.     var note1c = /<(?:NPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1768.     var note1d = /<(?:NPARAMXRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1769.     var note1e = /<(?:NPARAMXFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1770.     var note2 = /<(?:PPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1771.     var note2b = /<(?:PPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1772.     var note2c = /<(?:PPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1773.     var note3 = /<(?:xPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1774.     var note3b = /<(?:XPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1775.     var note3c = /<(?:XPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1776.     var note4 = /<(?:SPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1777.     var note4b = /<(?:SPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1778.     var note4c = /<(?:SPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1779.     var note5 = /<(?:PARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1780.     var note5b = /<(?:PARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1781.     var note5c = /<(?:PARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1782.     var note5d = /<(?:PARAMXRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1783.     var note5e = /<(?:PARAMXFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1784.     var note6 = /<(?:CPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1785.     var note6b = /<(?:CPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1786.     var note6c = /<(?:CPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1787.     var note6d = /<(?:CPARAMXRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1788.     var note6e = /<(?:CPARAMXFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1789.     var note7 = /<(?:NDEBUFFRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1790.     var note7b = /<(?:CDEBUFFRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1791.  
  1792.     for (var n = 1; n < group.length; n++) {
  1793.     var obj = group[n];
  1794.     var notedata = obj.note.split(/[\r\n]+/);
  1795.  
  1796.     for (var i = 0; i < notedata.length; i++) {
  1797.         var line = notedata[i];
  1798.         if (line.match(note1)) {
  1799.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1800.             if (indx > -1) obj.traits.push({code:24, dataId:indx, value:Number(RegExp.$2)});
  1801.             }
  1802.         else if (line.match(note1b)) {
  1803.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1804.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 100, value:Number(RegExp.$2)});
  1805.             }
  1806.         else if (line.match(note1c)) {
  1807.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1808.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 200, value:Number(RegExp.$2)});
  1809.             }
  1810.         else if (line.match(note1d)) {
  1811.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1812.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 300, value:Number(RegExp.$2)});
  1813.             }
  1814.         else if (line.match(note1e)) {
  1815.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1816.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 400, value:Number(RegExp.$2)});
  1817.             }
  1818.         else if (line.match(note2)) {
  1819.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1820.             if (indx > -1) obj.traits.push({code:25, dataId:indx, value:Number(RegExp.$2)});
  1821.             }
  1822.         else if (line.match(note2b)) {
  1823.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1824.             if (indx > -1) obj.traits.push({code:25, dataId:indx + 100, value:Number(RegExp.$2)});
  1825.             }
  1826.         else if (line.match(note2c)) {
  1827.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1828.             if (indx > -1) obj.traits.push({code:25, dataId:indx + 200, value:Number(RegExp.$2)});
  1829.             }
  1830.         else if (line.match(note3)) {
  1831.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1832.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx, value:Number(RegExp.$2)});
  1833.             }
  1834.         else if (line.match(note3b)) {
  1835.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1836.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx + 10, value:Number(RegExp.$2)});
  1837.             }
  1838.         else if (line.match(note3c)) {
  1839.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1840.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx + 20, value:Number(RegExp.$2)});
  1841.             }
  1842.         else if (line.match(note4)) {
  1843.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1844.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx + 10, value:Number(RegExp.$2)});
  1845.             }
  1846.         else if (line.match(note4b)) {
  1847.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1848.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx, value:Number(RegExp.$2)});
  1849.             }
  1850.         else if (line.match(note4c)) {
  1851.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1852.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx + 20, value:Number(RegExp.$2)});
  1853.             }
  1854.         else if (line.match(note5)) {
  1855.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1856.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 10, value:Number(RegExp.$2)});
  1857.             }
  1858.         else if (line.match(note5b)) {
  1859.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1860.             if (indx > -1) obj.traits.push({code:21, dataId:indx, value:Number(RegExp.$2)});
  1861.             }
  1862.         else if (line.match(note5c)) {
  1863.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1864.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 20, value:Number(RegExp.$2)});
  1865.             }
  1866.         else if (line.match(note5d)) {
  1867.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1868.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 30, value:Number(RegExp.$2)});
  1869.             }
  1870.         else if (line.match(note5e)) {
  1871.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1872.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 40, value:Number(RegExp.$2)});
  1873.             }
  1874.         else if (line.match(note6)) {
  1875.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1876.             if (indx > -1) obj.traits.push({code:26, dataId:indx, value:Number(RegExp.$2)});
  1877.             }
  1878.         else if (line.match(note6b)) {
  1879.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1880.             if (indx > -1) obj.traits.push({code:26, dataId:indx + 100, value:Number(RegExp.$2)});
  1881.             }
  1882.         else if (line.match(note6c)) {
  1883.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1884.             if (indx > -1) obj.traits.push({code:26, dataId:indx + 200, value:Number(RegExp.$2)});
  1885.             }
  1886.         else if (line.match(note6d)) {
  1887.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1888.             if (indx > -1) obj.traits.push({code:26, dataId:indx + 300, value:Number(RegExp.$2)});
  1889.             }
  1890.         else if (line.match(note6e)) {
  1891.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1892.             if (indx > -1) obj.traits.push({code:26, dataId:indx + 400, value:Number(RegExp.$2)});
  1893.             }
  1894.         else if (line.match(note7)) {
  1895.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1896.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_DEBUFF_RATE, dataId:indx + 10, value:Number(RegExp.$2)});
  1897.             }
  1898.         else if (line.match(note7b)) {
  1899.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1900.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_DEBUFF_RATE, dataId:indx + 200, value:Number(RegExp.$2)});
  1901.             }
  1902.     }
  1903.     }
  1904. };
  1905.  
  1906. ICF.NotetagsProcessor.ParamCoreB = function(group) {
  1907.     var grouparray = [];
  1908.     var note1 = /<(?:NPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1909.     var note1b = /<(?:NPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1910.     var note1c = /<(?:NPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1911.     var note1d = /<(?:NPARAMXRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1912.     var note1e = /<(?:NPARAMXFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1913.     var note1x = /<(?:NPARAM):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)(?:[ ]+(\d+(?:\.\d+)?))?(?:[ ]+(\d+(?:\.\d+)?))?(?:[ ]+(\d+(?:\.\d+)?))?>/i;
  1914.     var note1y = /<(?:CUSTOM NPARAM BASE)[ ]+(\w+)>/i;
  1915.     var note1z = /<\/(?:CUSTOM NPARAM BASE)>/i;
  1916.     var note2 = /<(?:PPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1917.     var note2b = /<(?:PPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1918.     var note2c = /<(?:PPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1919.     var note3 = /<(?:xPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1920.     var note3b = /<(?:XPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1921.     var note3c = /<(?:XPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1922.     var note4 = /<(?:SPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1923.     var note4b = /<(?:SPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1924.     var note4c = /<(?:SPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1925.     var note5 = /<(?:PARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1926.     var note5b = /<(?:PARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1927.     var note5c = /<(?:PARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1928.     var note5d = /<(?:PARAMXRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1929.     var note5e = /<(?:PARAMXFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1930.     var note5y = /<(?:CUSTOM PARAM BASE)[ ]+(\w+)>/i;
  1931.     var note5z = /<\/(?:CUSTOM PARAM BASE)>/i;
  1932.     var note6 = /<(?:CPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1933.     var note6b = /<(?:CPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1934.     var note6c = /<(?:CPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1935.     var note6d = /<(?:CPARAMXRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1936.     var note6e = /<(?:CPARAMXFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1937.     var note6x = /<(?:CPARAM):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)(?:[ ]+(\d+(?:\.\d+)?))?(?:[ ]+(\d+(?:\.\d+)?))?(?:[ ]+(\d+(?:\.\d+)?))?>/i;
  1938.     var note6y = /<(?:CUSTOM CPARAM BASE)[ ]+(\w+)>/i;
  1939.     var note6z = /<\/(?:CUSTOM CPARAM BASE)>/i;
  1940.     var note7 = /<(?:NDEBUFFRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1941.     var note7b = /<(?:CDEBUFFRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1942.  
  1943.     for (var n = 1; n < group.length; n++) {
  1944.     var obj = group[n];
  1945.     var notedata = obj.note.split(/[\r\n]+/);
  1946.  
  1947.     obj.basicNParam = [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]];
  1948.     obj.basicCParam = [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]];
  1949.     obj.customNParam = ['','','','','','','','','','','','','','','','','','','','','','','','','','','','','',''];
  1950.     obj.customCParam = ['','','','','','','','','','','','','','','','','','','','','','','','','','','','','',''];
  1951.     obj.customBParam = ['','','','','','','','','',''];
  1952.  
  1953.     var nFlag = false;
  1954.     var bFlag = false;
  1955.     var cFlag = false;
  1956.     var nIndex = -1;
  1957.     var bIndex = -1;
  1958.     var cIndex = -1;
  1959.  
  1960.     for (var i = 0; i < notedata.length; i++) {
  1961.         var line = notedata[i];
  1962.         if (line.match(note1)) {
  1963.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1964.             if (indx > -1) obj.traits.push({code:24, dataId:indx, value:Number(RegExp.$2)});
  1965.             }
  1966.         else if (line.match(note1b)) {
  1967.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1968.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 100, value:Number(RegExp.$2)});
  1969.             }
  1970.         else if (line.match(note1c)) {
  1971.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1972.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 200, value:Number(RegExp.$2)});
  1973.             }
  1974.         else if (line.match(note1d)) {
  1975.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1976.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 300, value:Number(RegExp.$2)});
  1977.             }
  1978.         else if (line.match(note1e)) {
  1979.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1980.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 400, value:Number(RegExp.$2)});
  1981.             }
  1982.         else if (line.match(note1x)) {
  1983.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1984.             obj.basicNParam[indx] = [Number(RegExp.$2)];
  1985.             if (!isNaN(Number(RegExp.$3))) obj.basicNParam[indx] = obj.basicNParam[indx].concat([Number(RegExp.$3)]);
  1986.             if (!isNaN(Number(RegExp.$4))) obj.basicNParam[indx] = obj.basicNParam[indx].concat([Number(RegExp.$4)]);
  1987.             if (!isNaN(Number(RegExp.$5))) obj.basicNParam[indx] = obj.basicNParam[indx].concat([Number(RegExp.$5)]);
  1988.             }
  1989.         else if (line.match(note1y)) {
  1990.             nFlag = true;
  1991.             nIndex = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1992.             }
  1993.         else if (line.match(note1z)) {
  1994.             nFlag = false;
  1995.             }
  1996.         else if (line.match(note2)) {
  1997.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1998.             if (indx > -1) obj.traits.push({code:25, dataId:indx, value:Number(RegExp.$2)});
  1999.             }
  2000.         else if (line.match(note2b)) {
  2001.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2002.             if (indx > -1) obj.traits.push({code:25, dataId:indx + 100, value:Number(RegExp.$2)});
  2003.             }
  2004.         else if (line.match(note2c)) {
  2005.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2006.             if (indx > -1) obj.traits.push({code:25, dataId:indx + 200, value:Number(RegExp.$2)});
  2007.             }
  2008.         else if (line.match(note3)) {
  2009.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2010.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx, value:Number(RegExp.$2)});
  2011.             }
  2012.         else if (line.match(note3b)) {
  2013.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2014.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx + 10, value:Number(RegExp.$2)});
  2015.             }
  2016.         else if (line.match(note3c)) {
  2017.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2018.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx + 20, value:Number(RegExp.$2)});
  2019.             }
  2020.         else if (line.match(note4)) {
  2021.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2022.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx + 10, value:Number(RegExp.$2)});
  2023.             }
  2024.         else if (line.match(note4b)) {
  2025.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2026.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx, value:Number(RegExp.$2)});
  2027.             }
  2028.         else if (line.match(note4c)) {
  2029.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2030.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx + 20, value:Number(RegExp.$2)});
  2031.             }
  2032.         else if (line.match(note5)) {
  2033.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2034.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 10, value:Number(RegExp.$2)});
  2035.             }
  2036.         else if (line.match(note5b)) {
  2037.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2038.             if (indx > -1) obj.traits.push({code:21, dataId:indx, value:Number(RegExp.$2)});
  2039.             }
  2040.         else if (line.match(note5c)) {
  2041.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2042.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 20, value:Number(RegExp.$2)});
  2043.             }
  2044.         else if (line.match(note5d)) {
  2045.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2046.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 30, value:Number(RegExp.$2)});
  2047.             }
  2048.         else if (line.match(note5e)) {
  2049.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2050.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 40, value:Number(RegExp.$2)});
  2051.             }
  2052.         else if (line.match(note5y)) {
  2053.             bFlag = true;
  2054.             bIndex = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2055.             }
  2056.         else if (line.match(note5z)) {
  2057.             bFlag = false;
  2058.             }
  2059.         else if (line.match(note6)) {
  2060.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2061.             if (indx > -1) obj.traits.push({code:26, dataId:indx, value:Number(RegExp.$2)});
  2062.             }
  2063.         else if (line.match(note6b)) {
  2064.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2065.             if (indx > -1) obj.traits.push({code:26, dataId:indx + 100, value:Number(RegExp.$2)});
  2066.             }
  2067.         else if (line.match(note6c)) {
  2068.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2069.             if (indx > -1) obj.traits.push({code:26, dataId:indx + 200, value:Number(RegExp.$2)});
  2070.             }
  2071.         else if (line.match(note6d)) {
  2072.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2073.             if (indx > -1) obj.traits.push({code:26, dataId:indx + 300, value:Number(RegExp.$2)});
  2074.             }
  2075.         else if (line.match(note6e)) {
  2076.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2077.             if (indx > -1) obj.traits.push({code:26, dataId:indx + 400, value:Number(RegExp.$2)});
  2078.             }
  2079.         else if (line.match(note6x)) {
  2080.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2081.             obj.basicCParam[indx] = [Number(RegExp.$2)];
  2082.             if (!isNaN(Number(RegExp.$3))) obj.basicCParam[indx] = obj.basicCParam[indx].concat([Number(RegExp.$3)]);
  2083.             if (!isNaN(Number(RegExp.$4))) obj.basicCParam[indx] = obj.basicCParam[indx].concat([Number(RegExp.$4)]);
  2084.             if (!isNaN(Number(RegExp.$5))) obj.basicCParam[indx] = obj.basicCParam[indx].concat([Number(RegExp.$5)]);
  2085.             }
  2086.         else if (line.match(note6y)) {
  2087.             cFlag = true;
  2088.             cIndex = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2089.             }
  2090.         else if (line.match(note6z)) {
  2091.             cFlag = false;
  2092.             }
  2093.         else if (line.match(note7)) {
  2094.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2095.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_DEBUFF_RATE, dataId:indx + 10, value:Number(RegExp.$2)});
  2096.             }
  2097.         else if (line.match(note7b)) {
  2098.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2099.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_DEBUFF_RATE, dataId:indx + 200, value:Number(RegExp.$2)});
  2100.             }
  2101.         else if (nFlag && nIndex > -1) {
  2102.             obj.customNParam[nIndex] = obj.customNParam[nIndex] + line + '\n';
  2103.             }
  2104.         else if (bFlag && bIndex > -1) {
  2105.             obj.customBParam[bIndex] = obj.customBParam[bIndex] + line + '\n';
  2106.             }
  2107.         else if (cFlag && cIndex > -1) {
  2108.             obj.customCParam[cIndex] = obj.customCParam[cIndex] + line + '\n';
  2109.             }
  2110.     }
  2111.     }
  2112. };
  2113.  
  2114. ICF.NotetagsProcessor.ParamCoreC = function(group) {
  2115.     var grouparray = [];
  2116.     var note1 = /<(?:NPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2117.     var note1b = /<(?:NPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2118.     var note1c = /<(?:NPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2119.     var note1d = /<(?:NPARAMXRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2120.     var note1e = /<(?:NPARAMXFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2121.     var note1x = /<(?:NPARAM):[ ]*(\w+)[ ]+(\d+)>/i;
  2122.     var note1y = /<(?:CUSTOM NPARAMS)>/i;
  2123.     var note1z = /<\/(?:CUSTOM NPARAMS)>/i;
  2124.     var note2 = /<(?:PPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2125.     var note2b = /<(?:PPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2126.     var note2c = /<(?:PPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2127.     var note2x = /<(?:PPARAM):[ ]*(\w+)[ ]+(\d+)>/i;
  2128.     var note2y = /<(?:CUSTOM PPARAMS)>/i;
  2129.     var note2z = /<\/(?:CUSTOM PPARAMS)>/i;
  2130.     var note3 = /<(?:xPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2131.     var note3b = /<(?:XPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2132.     var note3c = /<(?:XPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2133.     var note4 = /<(?:SPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2134.     var note4b = /<(?:SPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2135.     var note4c = /<(?:SPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2136.     var note5 = /<(?:PARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2137.     var note5b = /<(?:PARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2138.     var note5c = /<(?:PARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2139.     var note5d = /<(?:PARAMXRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2140.     var note5e = /<(?:PARAMXFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2141.     var note5y = /<(?:CUSTOM PARAMS)>/i;
  2142.     var note5z = /<\/(?:CUSTOM PARAMS)>/i;
  2143.     var note6 = /<(?:CPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2144.     var note6b = /<(?:CPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2145.     var note6c = /<(?:CPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2146.     var note6d = /<(?:CPARAMXRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2147.     var note6e = /<(?:CPARAMXFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2148.     var note6x = /<(?:CPARAM):[ ]*(\w+)[ ]+(\d+)>/i;
  2149.     var note6y = /<(?:CUSTOM CPARAMS)>/i;
  2150.     var note6z = /<\/(?:CUSTOM CPARAMS)>/i;
  2151.     var note7 = /<(?:NDEBUFFRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2152.     var note7b = /<(?:CDEBUFFRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2153.  
  2154.     for (var n = 1; n < group.length; n++) {
  2155.     var obj = group[n];
  2156.     var notedata = obj.note.split(/[\r\n]+/);
  2157.  
  2158.     obj.NParams = [];
  2159.     obj.PParams = [];
  2160.     obj.CParams = [];
  2161.  
  2162.     obj.NParamEval = [];
  2163.     obj.PParamEval = [];
  2164.     obj.CParamEval = [];
  2165.     obj.BParamEval = [];
  2166.  
  2167.     obj.NParamEvalAll = '';
  2168.     obj.PParamEvalAll = '';
  2169.     obj.CParamEvalAll = '';
  2170.     obj.BParamEvalAll = '';
  2171.  
  2172.     var nFlag = false;
  2173.     var pFlag = false;
  2174.     var cFlag = false;
  2175.     var bFlag = false;
  2176.  
  2177.     for (var i = 0; i < notedata.length; i++) {
  2178.         var line = notedata[i];
  2179.         if (line.match(note1)) {
  2180.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2181.             if (indx > -1) obj.traits.push({code:24, dataId:indx, value:Number(RegExp.$2)});
  2182.             }
  2183.         else if (line.match(note1b)) {
  2184.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2185.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 100, value:Number(RegExp.$2)});
  2186.             }
  2187.         else if (line.match(note1c)) {
  2188.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2189.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 200, value:Number(RegExp.$2)});
  2190.             }
  2191.         else if (line.match(note1d)) {
  2192.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2193.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 300, value:Number(RegExp.$2)});
  2194.             }
  2195.         else if (line.match(note1e)) {
  2196.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2197.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 400, value:Number(RegExp.$2)});
  2198.             }
  2199.         else if (line.match(note1x)) {
  2200.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2201.             if (indx > -1) obj.NParams[indx] = Number(RegExp.$2);
  2202.             }
  2203.         else if (line.match(note1y)) {
  2204.             nFlag = true;
  2205.             }
  2206.         else if (line.match(note1z)) {
  2207.             nFlag = false;
  2208.             }
  2209.         else if (line.match(note2)) {
  2210.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2211.             if (indx > -1) obj.traits.push({code:25, dataId:indx, value:Number(RegExp.$2)});
  2212.             }
  2213.         else if (line.match(note2b)) {
  2214.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2215.             if (indx > -1) obj.traits.push({code:25, dataId:indx + 100, value:Number(RegExp.$2)});
  2216.             }
  2217.         else if (line.match(note2c)) {
  2218.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2219.             if (indx > -1) obj.traits.push({code:25, dataId:indx + 200, value:Number(RegExp.$2)});
  2220.             }
  2221.         else if (line.match(note2x)) {
  2222.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2223.             if (indx > -1) obj.PParams[indx] = Number(RegExp.$2);
  2224.             }
  2225.         else if (line.match(note2y)) {
  2226.             pFlag = true;
  2227.             }
  2228.         else if (line.match(note2z)) {
  2229.             pFlag = false;
  2230.             }
  2231.         else if (line.match(note3)) {
  2232.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2233.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx, value:Number(RegExp.$2)});
  2234.             }
  2235.         else if (line.match(note3b)) {
  2236.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2237.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx + 10, value:Number(RegExp.$2)});
  2238.             }
  2239.         else if (line.match(note3c)) {
  2240.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2241.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx + 20, value:Number(RegExp.$2)});
  2242.             }
  2243.         else if (line.match(note4)) {
  2244.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2245.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx + 10, value:Number(RegExp.$2)});
  2246.             }
  2247.         else if (line.match(note4b)) {
  2248.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2249.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx, value:Number(RegExp.$2)});
  2250.             }
  2251.         else if (line.match(note4c)) {
  2252.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2253.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx + 20, value:Number(RegExp.$2)});
  2254.             }
  2255.         else if (line.match(note5)) {
  2256.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2257.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 10, value:Number(RegExp.$2)});
  2258.             }
  2259.         else if (line.match(note5b)) {
  2260.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2261.             if (indx > -1) obj.traits.push({code:21, dataId:indx, value:Number(RegExp.$2)});
  2262.             }
  2263.         else if (line.match(note5c)) {
  2264.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2265.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 20, value:Number(RegExp.$2)});
  2266.             }
  2267.         else if (line.match(note5d)) {
  2268.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2269.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 30, value:Number(RegExp.$2)});
  2270.             }
  2271.         else if (line.match(note5e)) {
  2272.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2273.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 40, value:Number(RegExp.$2)});
  2274.             }
  2275.         else if (line.match(note5y)) {
  2276.             bFlag = true;
  2277.             }
  2278.         else if (line.match(note5z)) {
  2279.             bFlag = false;
  2280.             }
  2281.         else if (line.match(note6)) {
  2282.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2283.             if (indx > -1) obj.traits.push({code:26, dataId:indx, value:Number(RegExp.$2)});
  2284.             }
  2285.         else if (line.match(note6b)) {
  2286.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2287.             if (indx > -1) obj.traits.push({code:26, dataId:indx + 100, value:Number(RegExp.$2)});
  2288.             }
  2289.         else if (line.match(note6c)) {
  2290.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2291.             if (indx > -1) obj.traits.push({code:26, dataId:indx + 200, value:Number(RegExp.$2)});
  2292.             }
  2293.         else if (line.match(note6d)) {
  2294.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2295.             if (indx > -1) obj.traits.push({code:26, dataId:indx + 300, value:Number(RegExp.$2)});
  2296.             }
  2297.         else if (line.match(note6e)) {
  2298.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2299.             if (indx > -1) obj.traits.push({code:26, dataId:indx + 400, value:Number(RegExp.$2)});
  2300.             }
  2301.         else if (line.match(note6x)) {
  2302.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2303.             if (indx > -1) obj.CParams[indx] = Number(RegExp.$2);
  2304.             }
  2305.         else if (line.match(note6y)) {
  2306.             cFlag = true;
  2307.             }
  2308.         else if (line.match(note6z)) {
  2309.             cFlag = false;
  2310.             }
  2311.         else if (line.match(note7)) {
  2312.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2313.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_DEBUFF_RATE, dataId:indx + 10, value:Number(RegExp.$2)});
  2314.             }
  2315.         else if (line.match(note7b)) {
  2316.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2317.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_DEBUFF_RATE, dataId:indx + 200, value:Number(RegExp.$2)});
  2318.             }
  2319.         else if (nFlag) {
  2320.             if (line.match(/(\w+) = (.*)/i)) {
  2321.                 var indx = RegExp.$1;
  2322.                 if (isNaN(Number(indx))) indx = ICF.Param.NParams.indexOf(indx.toLowerCase());
  2323.                 indx = (Number(indx));
  2324.                 if (Number(indx) > -1) obj.NParamEval[indx] = RegExp.$2;
  2325.                 else obj.NParamEvalAll = obj.NParamEvalAll + line + '\n';
  2326.             } else obj.NParamEvalAll = obj.NParamEvalAll + line + '\n';
  2327.             }
  2328.         else if (pFlag) {
  2329.             if (line.match(/(\w+) = (.*)/i)) {
  2330.                 var indx = RegExp.$1;
  2331.                 if (isNaN(Number(indx))) indx = ICF.Param.PParams.indexOf(indx.toLowerCase());
  2332.                 indx = (Number(indx));
  2333.                 if (Number(indx) > -1) obj.PParamEval[indx] = RegExp.$2;
  2334.                 else obj.PParamEvalAll = obj.PParamEvalAll + line + '\n';
  2335.             } else obj.PParamEvalAll = obj.PParamEvalAll + line + '\n';
  2336.             }
  2337.         else if (cFlag) {
  2338.             if (line.match(/(\w+) = (.*)/i)) {
  2339.                 var indx = RegExp.$1;
  2340.                 if (isNaN(Number(indx))) indx = ICF.Param.CParamsMax.indexOf(indx.toLowerCase());
  2341.                 indx = (Number(indx));
  2342.                 if (Number(indx) > -1) obj.CParamEval[indx] = RegExp.$2;
  2343.                 else obj.CParamEvalAll = obj.CParamEvalAll + line + '\n';
  2344.             } else obj.CParamEvalAll = obj.CParamEvalAll + line + '\n';
  2345.             }
  2346.         else if (bFlag) {
  2347.             if (line.match(/(\w+) = (.*)/i)) {
  2348.                 var indx = RegExp.$1;
  2349.                 if (isNaN(Number(indx))) indx = ICF.Param.BParams.indexOf(indx.toLowerCase());
  2350.                 indx = (Number(indx));
  2351.                 if (Number(indx) > -1) obj.BParamEval[indx] = RegExp.$2;
  2352.                 else obj.NParamEvalAll = obj.BParamEvalAll + line + '\n';
  2353.             } else obj.NParamEvalAll = obj.BParamEvalAll + line + '\n';
  2354.             }
  2355.     }
  2356.     }
  2357. };
  2358.  
  2359. ICF.NotetagsProcessor.ParamCoreD = function(group) {
  2360.     var note1 = /<(?:NBUFF):[ ]*(\w+)[ ]+(\d+)>/i;
  2361.     var note1b = /<(?:NDEBUFF):[ ]*(\w+)[ ]+(\d+)>/i;
  2362.     var note1c = /<(?:REMOVE NBUFF):[ ]*(\w+)[ ]+>/i;
  2363.     var note1d = /<(?:REMOVE NDEBUFF):[ ]*(\w+)[ ]+>/i;
  2364.     var note2 = /<(?:CBUFF):[ ]*(\w+)[ ]+(\d+)>/i;
  2365.     var note2b = /<(?:CDEBUFF):[ ]*(\w+)[ ]+(\d+)>/i;
  2366.     var note2c = /<(?:REMOVE CBUFF):[ ]*(\w+)[ ]+>/i;
  2367.     var note2d = /<(?:REMOVE CDEBUFF):[ ]*(\w+)[ ]+>/i;
  2368.     var note3 = /<(?:NPARAM GROW):[ ]*(\w+)[ ]+((?:\-)?\d+)>/i;
  2369.     var note3b = /<(?:PPARAM GROW):[ ]*(\w+)[ ]+((?:\-)?\d+)>/i;
  2370.     var note3c = /<(?:CPARAM GROW):[ ]*(\w+)[ ]+((?:\-)?\d+)>/i;
  2371.  
  2372.     for (var n = 1; n < group.length; n++) {
  2373.     var obj = group[n];
  2374.     var notedata = obj.note.split(/[\r\n]+/);
  2375.  
  2376.     for (var i = 0; i < notedata.length; i++) {
  2377.         var line = notedata[i];
  2378.         if (line.match(note1)) {
  2379.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2380.             if (indx > -1) obj.effects.push({code:35, dataId:indx, value1:Number(RegExp.$2)});
  2381.             }
  2382.         else if (line.match(note1b)) {
  2383.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2384.             if (indx > -1) obj.effects.push({code:36, dataId:indx, value1:Number(RegExp.$2)});
  2385.             }
  2386.         else if (line.match(note1c)) {
  2387.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2388.             if (indx > -1) obj.effects.push({code:37, dataId:indx, value1:0});
  2389.             }
  2390.         else if (line.match(note1d)) {
  2391.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2392.             if (indx > -1) obj.effects.push({code:38, dataId:indx, value1:0});
  2393.             }
  2394.         else if (line.match(note2)) {
  2395.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2396.             if (indx > -1) obj.effects.push({code:35, dataId:indx + 100, value1:Number(RegExp.$2)});
  2397.             }
  2398.         else if (line.match(note2b)) {
  2399.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2400.             if (indx > -1) obj.effects.push({code:36, dataId:indx + 100, value1:Number(RegExp.$2)});
  2401.             }
  2402.         else if (line.match(note2c)) {
  2403.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2404.             if (indx > -1) obj.effects.push({code:37, dataId:indx + 100, value1:0});
  2405.             }
  2406.         else if (line.match(note2d)) {
  2407.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2408.             if (indx > -1) obj.effects.push({code:38, dataId:indx + 100, value1:0});
  2409.             }
  2410.         else if (line.match(note3)) {
  2411.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2412.             if (indx > -1) obj.effects.push({code:45, dataId:indx, value1:Number(RegExp.$2)});
  2413.             }
  2414.         else if (line.match(note3b)) {
  2415.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2416.             if (indx > -1) obj.effects.push({code:46, dataId:indx, value1:Number(RegExp.$2)});
  2417.             }
  2418.         else if (line.match(note3c)) {
  2419.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2420.             if (indx > -1) obj.effects.push({code:47, dataId:indx, value1:Number(RegExp.$2)});
  2421.             }
  2422.     }
  2423.     }
  2424. };
  2425.  
  2426. //=============================================================================
  2427. // Game_BattlerBase
  2428. //=============================================================================
  2429.  
  2430. if (ICF.Param.BParams[0].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.BParams[0], { get: function() { return this.param(0); }, configurable: true });
  2431. if (ICF.Param.BParams[1].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.BParams[1], { get: function() { return this.param(1); }, configurable: true });
  2432. if (ICF.Param.BParams[2].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.BParams[2], { get: function() { return this.param(2); }, configurable: true });
  2433. if (ICF.Param.BParams[3].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.BParams[3], { get: function() { return this.param(3); }, configurable: true });
  2434. if (ICF.Param.BParams[4].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.BParams[4], { get: function() { return this.param(4); }, configurable: true });
  2435. if (ICF.Param.BParams[5].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.BParams[5], { get: function() { return this.param(5); }, configurable: true });
  2436. if (ICF.Param.BParams[6].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.BParams[6], { get: function() { return this.param(6); }, configurable: true });
  2437. if (ICF.Param.BParams[7].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.BParams[7], { get: function() { return this.param(7); }, configurable: true });
  2438.  
  2439. for (var i = 0; i < ICF.Param.NParams.length; i++) {
  2440.     if (ICF.Param.NParams[i].length > 0) {
  2441.         eval("Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.NParams[" + i + "], { get: function() { return this.NParam(" + i + "); }, configurable: true });");
  2442.     }
  2443. }
  2444. for (var i = 0; i < ICF.Param.PParams.length; i++) {
  2445.     if (ICF.Param.PParams[i].length > 0) {
  2446.         eval("Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.PParams[" + i + "], { get: function() { return this.PParam(" + i + "); }, configurable: true });");
  2447.     }
  2448. }
  2449. for (var i = 0; i < ICF.Param.CParamsMax.length; i++) {
  2450.     if (ICF.Param.CParamsMax[i].length > 0) {
  2451.         eval("Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.CParamsMax[" + i + "], { get: function() { return this.CParam(" + i + "); }, configurable: true });");
  2452.     }
  2453.     if (ICF.Param.CParams[i].length > 0) {
  2454.         eval("Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.CParams[" + i + "], { get: function() { return this.CParamValue(" + i + "); }, configurable: true });");
  2455.     }
  2456. }
  2457.  
  2458. Object.defineProperty(Game_BattlerBase.prototype, 'level', { value: 1, configurable: true});
  2459.  
  2460. if (!Game_BattlerBase.prototype.equips) Game_BattlerBase.prototype.equips = function() { return []; };
  2461. if (!Game_BattlerBase.prototype.currentClass) Game_BattlerBase.prototype.currentClass = function() { return null; };
  2462.  
  2463. ICF.ParamCore.clearParamPlus = Game_BattlerBase.prototype.clearParamPlus;
  2464. Game_BattlerBase.prototype.clearParamPlus = function() {
  2465.     ICF.ParamCore.clearParamPlus.call(this);
  2466.     this._NParamPlus = [];
  2467.     this._PParamPlus = [];
  2468.     this._CParamPlus = [];
  2469. };
  2470.  
  2471. ICF.ParamCore.clearBuffs = Game_BattlerBase.prototype.clearBuffs;
  2472. Game_BattlerBase.prototype.clearBuffs = function() {
  2473.     ICF.ParamCore.clearBuffs.call(this);
  2474.     this._NBuffs = [];
  2475.     this._NBuffTurns = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
  2476.     this._CBuffs = [];
  2477.     this._CBuffTurns = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
  2478. };
  2479.  
  2480. ICF.ParamCore.battlerRefresh = Game_BattlerBase.prototype.refresh;
  2481. Game_BattlerBase.prototype.refresh = function() {
  2482.     ICF.ParamCore.battlerRefresh.call(this);
  2483.     if (!this._CParamValues) this._CParamValues = [];
  2484.     for (var i = 0; i < ICF.Param.CParamsMax.length; i++) {
  2485.         if (this._CParamValues[i] === undefined) this._CParamValues[i] = this.CParam(i);
  2486.         this._CParamValues[i] = this._CParamValues[i].clamp(0, this.CParam(i));
  2487.     }
  2488. };
  2489.  
  2490. ICF.ParamCore.battlerRecoverAll = Game_BattlerBase.prototype.recoverAll;
  2491. Game_BattlerBase.prototype.recoverAll = function() {
  2492.     ICF.ParamCore.battlerRecoverAll.call(this);
  2493.     if (!this._CParamValues) this._CParamValues = [];
  2494.     for (var i = 0; i < ICF.Param.CParamsMax.length; i++) {
  2495.         if (this._CParamValues[i] === undefined) this._CParamValues[i] = this.CParam(i);
  2496.         this._CParamValues[i] = this.CParam(i);
  2497.     }
  2498. };
  2499.  
  2500. Game_BattlerBase.prototype.eraseNBuff = function(paramId) {
  2501.     this._NBuffs[paramId] = 0;
  2502.     this._NBuffTurns[paramId] = 0;
  2503. };
  2504.  
  2505. Game_BattlerBase.prototype.NBuffLength = function() {
  2506.     return this._NBuffs.length;
  2507. };
  2508.  
  2509. Game_BattlerBase.prototype.NBuff = function(paramId) {
  2510.     if (!this._NBuffs[paramId]) this._NBuffs[paramId] = 0;
  2511.     return this._NBuffs[paramId];
  2512. };
  2513.  
  2514. Game_BattlerBase.prototype.isNBuffAffected = function(paramId) {
  2515.     if (!this._NBuffs[paramId]) this._NBuffs[paramId] = 0;
  2516.     return this._NBuffs[paramId] > 0;
  2517. };
  2518.  
  2519. Game_BattlerBase.prototype.isNDebuffAffected = function(paramId) {
  2520.     if (!this._NBuffs[paramId]) this._NBuffs[paramId] = 0;
  2521.     return this._NBuffs[paramId] < 0;
  2522. };
  2523.  
  2524. Game_BattlerBase.prototype.isNBuffOrDebuffAffected = function(paramId) {
  2525.     if (!this._NBuffs[paramId]) this._NBuffs[paramId] = 0;
  2526.     return this._NBuffs[paramId] !== 0;
  2527. };
  2528.  
  2529. Game_BattlerBase.prototype.isMaxNBuffAffected = function(paramId) {
  2530.     if (!this._NBuffs[paramId]) this._NBuffs[paramId] = 0;
  2531.     return this._NBuffs[paramId] >= 2;
  2532. };
  2533.  
  2534. Game_BattlerBase.prototype.isMaxNDebuffAffected = function(paramId) {
  2535.     if (!this._NBuffs[paramId]) this._NBuffs[paramId] = 0;
  2536.     return this._NBuffs[paramId] <= -2;
  2537. };
  2538.  
  2539. Game_BattlerBase.prototype.increaseNBuff = function(paramId) {
  2540.     if (!this._NBuffs[paramId]) this._NBuffs[paramId] = 0;
  2541.     if (!this.isMaxNBuffAffected(paramId)) {
  2542.         this._NBuffs[paramId]++;
  2543.     }
  2544. };
  2545.  
  2546. Game_BattlerBase.prototype.decreaseNBuff = function(paramId) {
  2547.     if (!this._NBuffs[paramId]) this._NBuffs[paramId] = 0;
  2548.     if (!this.isMaxNDebuffAffected(paramId)) {
  2549.         this._NBuffs[paramId]--;
  2550.     }
  2551. };
  2552.  
  2553. Game_BattlerBase.prototype.overwriteNBuffTurns = function(paramId, turns) {
  2554.     if (!this._NBuffTurns[paramId]) this._NBuffTurns[paramId] = 0;
  2555.     if (this._NBuffTurns[paramId] < turns) {
  2556.         this._NBuffTurns[paramId] = turns;
  2557.     }
  2558. };
  2559.  
  2560. Game_BattlerBase.prototype.isNBuffExpired = function(paramId) {
  2561.     if (!this._NBuffTurns[paramId]) this._NBuffTurns[paramId] = 0;
  2562.     return this._NBuffTurns[paramId] === 0;
  2563. };
  2564.  
  2565. Game_BattlerBase.prototype.eraseCBuff = function(paramId) {
  2566.     this._CBuffs[paramId] = 0;
  2567.     this._CBuffTurns[paramId] = 0;
  2568. };
  2569.  
  2570. Game_BattlerBase.prototype.CBuffLength = function() {
  2571.     return this._CBuffs.length;
  2572. };
  2573.  
  2574. Game_BattlerBase.prototype.CBuff = function(paramId) {
  2575.     if (!this._CBuffs[paramId]) this._CBuffs[paramId] = 0;
  2576.     return this._CBuffs[paramId];
  2577. };
  2578.  
  2579. Game_BattlerBase.prototype.isCBuffAffected = function(paramId) {
  2580.     if (!this._CBuffs[paramId]) this._CBuffs[paramId] = 0;
  2581.     return this._CBuffs[paramId] > 0;
  2582. };
  2583.  
  2584. Game_BattlerBase.prototype.isCDebuffAffected = function(paramId) {
  2585.     if (!this._CBuffs[paramId]) this._CBuffs[paramId] = 0;
  2586.     return this._CBuffs[paramId] < 0;
  2587. };
  2588.  
  2589. Game_BattlerBase.prototype.isCBuffOrDebuffAffected = function(paramId) {
  2590.     if (!this._CBuffs[paramId]) this._CBuffs[paramId] = 0;
  2591.     return this._CBuffs[paramId] !== 0;
  2592. };
  2593.  
  2594. Game_BattlerBase.prototype.isMaxCBuffAffected = function(paramId) {
  2595.     if (!this._CBuffs[paramId]) this._CBuffs[paramId] = 0;
  2596.     return this._CBuffs[paramId] >= 2;
  2597. };
  2598.  
  2599. Game_BattlerBase.prototype.isMaxCDebuffAffected = function(paramId) {
  2600.     if (!this._CBuffs[paramId]) this._CBuffs[paramId] = 0;
  2601.     return this._CBuffs[paramId] <= -2;
  2602. };
  2603.  
  2604. Game_BattlerBase.prototype.increaseCBuff = function(paramId) {
  2605.     if (!this._CBuffs[paramId]) this._CBuffs[paramId] = 0;
  2606.     if (!this.isMaxCBuffAffected(paramId)) {
  2607.         this._CBuffs[paramId]++;
  2608.     }
  2609. };
  2610.  
  2611. Game_BattlerBase.prototype.decreaseCBuff = function(paramId) {
  2612.     if (!this._CBuffs[paramId]) this._CBuffs[paramId] = 0;
  2613.     if (!this.isMaxCDebuffAffected(paramId)) {
  2614.         this._CBuffs[paramId]--;
  2615.     }
  2616. };
  2617.  
  2618. Game_BattlerBase.prototype.overwriteCBuffTurns = function(paramId, turns) {
  2619.     if (!this._CBuffTurns[paramId]) this._CBuffTurns[paramId] = 0;
  2620.     if (this._CBuffTurns[paramId] < turns) {
  2621.         this._CBuffTurns[paramId] = turns;
  2622.     }
  2623. };
  2624.  
  2625. Game_BattlerBase.prototype.isCBuffExpired = function(paramId) {
  2626.     if (!this._CBuffTurns[paramId]) this._CBuffTurns[paramId] = 0;
  2627.     return this._CBuffTurns[paramId] === 0;
  2628. };
  2629.  
  2630. ICF.ParamCore.updateBuffTurns = Game_BattlerBase.prototype.updateBuffTurns;
  2631. Game_BattlerBase.prototype.updateBuffTurns = function() {
  2632.     ICF.ParamCore.updateBuffTurns.call(this);
  2633.     for (var i = 0; i < this._NBuffTurns.length; i++) {
  2634.         if (this._NBuffTurns[i] > 0) {
  2635.             this._NBuffTurns[i]--;
  2636.         }
  2637.     }
  2638.     for (var i = 0; i < this._CBuffTurns.length; i++) {
  2639.         if (this._CBuffTurns[i] > 0) {
  2640.             this._CBuffTurns[i]--;
  2641.         }
  2642.     }
  2643. };
  2644.  
  2645. ICF.ParamCore.buffIcons = Game_BattlerBase.prototype.buffIcons;
  2646. Game_BattlerBase.prototype.buffIcons = function() {
  2647.     var icons = ICF.ParamCore.buffIcons.call(this);
  2648.     for (var i = 0; i < this._NBuffs.length; i++) {
  2649.         if ((this._NBuffs[i] > 0)&&(ICF.Param.NParamBuffIcons[i].length > 0)) {
  2650.             icons.push(ICF.Param.NParamBuffIcons[i][Math.min(ICF.Param.NParamBuffIcons[i].length, this._NBuffs[i]) - 1]);
  2651.         } else if ((this._NBuffs[i] < 0)&&(ICF.Param.NParamDebuffIcons[i].length > 0)) {
  2652.             icons.push(ICF.Param.NParamDebuffIcons[i][Math.min(ICF.Param.NParamDebuffIcons[i].length, Math.abs(this._NBuffs[i])) - 1]);
  2653.         }
  2654.     }
  2655.     for (var i = 0; i < this._CBuffs.length; i++) {
  2656.         if ((this._CBuffs[i] > 0)&&(ICF.Param.CParamBuffIcons[i].length > 0)) {
  2657.             icons.push(ICF.Param.CParamBuffIcons[i][Math.min(ICF.Param.CParamBuffIcons[i].length, this._CBuffs[i]) - 1]);
  2658.         } else if ((this._CBuffs[i] < 0)&&(ICF.Param.CParamDebuffIcons[i].length > 0)) {
  2659.             icons.push(ICF.Param.CParamDebuffIcons[i][Math.min(ICF.Param.CParamDebuffIcons[i].length, Math.abs(this._CBuffs[i])) - 1]);
  2660.         }
  2661.     }
  2662.     return icons;
  2663. };
  2664.  
  2665. Game_BattlerBase.prototype.NParamBasic = function(array, level) {
  2666.     if (array.length == 1) {
  2667.         return Number(array[0]);
  2668.     } else if (array.length == 2) {
  2669.         return Number(array[0]) + Number(array[1] * (level - 1));
  2670.     } else if (array.length == 3 || array[3] > level) {
  2671.         return Number(array[0]) + Number(array[1] * (level - 1)) + Number(array[2] * Math.pow(level - 1, 1.2));
  2672.     } else if (array.length > 3) {
  2673.         return Number(array[0]) + Number(array[1] * (array[3] - 1)) + Number(array[2] * Math.pow(array[3] - 1, 1.2));
  2674.     } else {
  2675.         return 0;
  2676.     }
  2677. };
  2678.  
  2679. Game_BattlerBase.prototype.NParamBase = function(paramId) {
  2680.     var array = ICF.Param.NParamBase[paramId];
  2681.     if (!Array.isArray(array)) return (array != '')? eval(array) : 0;
  2682.     if (array.length < 1) {
  2683.         return 0;
  2684.     } else {
  2685.         return this.NParamBasic(array, this.level);
  2686.     }
  2687. };
  2688.  
  2689. Game_BattlerBase.prototype.NParamPlus = function(paramId) {
  2690.     if (!this._NParamPlus[paramId]) this._NParamPlus[paramId] = 0;
  2691.     return this._NParamPlus[paramId] + this.traitsSum(Game_BattlerBase.TRAIT_NPARAM, paramId) + this.NParamEquips(paramId);
  2692. };
  2693.  
  2694. Game_BattlerBase.prototype.NParamEquips = function(paramId) {
  2695.     var value = 0;
  2696.     var equips = this.equips();
  2697.     for (var i = 0; i < equips.length; i++) {
  2698.         var item = equips[i];
  2699.         if (item && item.NParams[paramId]) value += item.NParams[paramId];
  2700.         if (item && item.NParamEval[paramId]) {
  2701.         try {
  2702.         value += eval(item.NParamEvalAll + ';' + item.NParamEval[paramId]);
  2703.             }
  2704.         catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom NParam Base #' + paramId + ($dataWeapons[item.id] == item?' in weapon #':' in equip #') + item.id);}}
  2705.         }
  2706.     }
  2707.     return value;
  2708. };
  2709.  
  2710. Game_BattlerBase.prototype.NParamEval = function(paramId) {
  2711.     return 0;
  2712. };
  2713.  
  2714. Game_BattlerBase.prototype.NParamLimits = function(paramId) {
  2715.     var array = eval(ICF.Param.NParamLimit[paramId]);
  2716.     if (!Array.isArray(array)) return (!isNaN(Number(array)))? [array] : [];
  2717.     return array;
  2718. };
  2719.  
  2720. Game_BattlerBase.prototype.NParamRate = function(paramId) {
  2721.     return this.traitsPi(Game_BattlerBase.TRAIT_NPARAM, paramId + 100);
  2722. };
  2723.  
  2724. Game_BattlerBase.prototype.NParamXRate = function(paramId) {
  2725.     return this.traitsPi(Game_BattlerBase.TRAIT_NPARAM, paramId + 300);
  2726. };
  2727.  
  2728. Game_BattlerBase.prototype.NParamBuffRate = function(paramId) {
  2729.     if (!this._NBuffs[paramId]) this._NBuffs[paramId] = 0;
  2730.     return this._NBuffs[paramId] * 0.25 + 1.0;
  2731. };
  2732.  
  2733. Game_BattlerBase.prototype.NParamFlat = function(paramId) {
  2734.     return this.traitsSum(Game_BattlerBase.TRAIT_NPARAM, paramId + 200);
  2735. };
  2736.  
  2737. Game_BattlerBase.prototype.NParamXFlat = function(paramId) {
  2738.     return this.traitsSum(Game_BattlerBase.TRAIT_NPARAM, paramId + 400);
  2739. };
  2740.  
  2741. Game_BattlerBase.prototype.NParam = function(paramId) {
  2742.     var value = this.NParamBase(paramId) + this.NParamEval(paramId) + this.NParamPlus(paramId);
  2743.     value *= this.NParamRate(paramId);
  2744.     var limits = this.NParamLimits(paramId);
  2745.     var buff = this.NParamXRate(paramId) * this.NParamBuffRate(paramId);
  2746.     if (limits.length > 1) value = Math.min(value, limits[1]);
  2747.     var flat = 0;
  2748.     if (limits.length > 1) flat = (buff > 1)? Math.min(this.NParamFlat(paramId), limits[1] - value) : Math.min(this.NParamFlat(paramId), limits[1] - value * buff);
  2749.     else flat = this.NParamFlat(paramId);
  2750.     value *= buff;
  2751.     value += flat + this.NParamXFlat(paramId);
  2752.     if (limits.length < 1) return Math.round(value);
  2753.     if (limits.length < 3) return Math.round(Math.max(value,limits[0]));
  2754.     return Math.round(value.clamp(limits[0], limits[2]));
  2755. };
  2756.  
  2757. Game_BattlerBase.prototype.CParamBase = function(paramId) {
  2758.     var array = ICF.Param.CParamBase[paramId];
  2759.     if (!Array.isArray(array)) return (array != '')? eval(array) : 0;
  2760.     if (array.length < 1) {
  2761.         return 0;
  2762.     } else {
  2763.         return this.NParamBasic(array, this.level);
  2764.     }
  2765. };
  2766.  
  2767. Game_BattlerBase.prototype.CParamPlus = function(paramId) {
  2768.     if (!this._CParamPlus[paramId]) this._CParamPlus[paramId] = 0;
  2769.     return this._CParamPlus[paramId] + this.traitsSum(Game_BattlerBase.TRAIT_CPARAM, paramId) + this.CParamEquips(paramId);
  2770. };
  2771.  
  2772. Game_BattlerBase.prototype.CParamEquips = function(paramId) {
  2773.     var value = 0;
  2774.     var equips = this.equips();
  2775.     for (var i = 0; i < equips.length; i++) {
  2776.         var item = equips[i];
  2777.         if (item && item.CParams[paramId]) value += item.CParams[paramId];
  2778.         if (item && item.CParamEval[paramId]) {
  2779.         try {
  2780.         value += eval(item.CParamEvalAll + ';' + item.CParamEval[paramId]);
  2781.             }
  2782.         catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom CParam Base #' + paramId + ($dataWeapons[item.id] == item?' in weapon #':' in equip #') + item.id);}}
  2783.         }
  2784.     }
  2785.     return value;
  2786. };
  2787.  
  2788. Game_BattlerBase.prototype.CParamEval = function(paramId) {
  2789.     return 0;
  2790. };
  2791.  
  2792. Game_BattlerBase.prototype.CParamLimits = function(paramId) {
  2793.     var array = eval(ICF.Param.CParamLimit[paramId]);
  2794.     if (!Array.isArray(array)) return (!isNaN(Number(array)))? [array] : [];
  2795.     return array;
  2796. };
  2797.  
  2798. Game_BattlerBase.prototype.CParamRate = function(paramId) {
  2799.     return this.traitsPi(Game_BattlerBase.TRAIT_CPARAM, paramId + 100);
  2800. };
  2801.  
  2802. Game_BattlerBase.prototype.CParamXRate = function(paramId) {
  2803.     return this.traitsPi(Game_BattlerBase.TRAIT_CPARAM, paramId + 300);
  2804. };
  2805.  
  2806. Game_BattlerBase.prototype.CParamBuffRate = function(paramId) {
  2807.     if (!this._CBuffs[paramId]) this._CBuffs[paramId] = 0;
  2808.     return this._CBuffs[paramId] * 0.25 + 1.0;
  2809. };
  2810.  
  2811. Game_BattlerBase.prototype.CParamFlat = function(paramId) {
  2812.     return this.traitsSum(Game_BattlerBase.TRAIT_CPARAM, paramId + 200);
  2813. };
  2814.  
  2815. Game_BattlerBase.prototype.CParamXFlat = function(paramId) {
  2816.     return this.traitsSum(Game_BattlerBase.TRAIT_CPARAM, paramId + 400);
  2817. };
  2818.  
  2819. Game_BattlerBase.prototype.CParam = function(paramId) {
  2820.     var value = this.CParamBase(paramId) + this.CParamEval(paramId) + this.CParamPlus(paramId);
  2821.     value *= this.CParamRate(paramId);
  2822.     var limits = this.CParamLimits(paramId);
  2823.     var buff = this.CParamXRate(paramId) * this.CParamBuffRate(paramId);
  2824.     if (limits.length > 1) value = Math.min(value, limits[1]);
  2825.     var flat = 0;
  2826.     if (limits.length > 1) flat = (buff > 1)? Math.min(this.CParamFlat(paramId), limits[1] - value) : Math.min(this.CParamFlat(paramId), limits[1] - value * buff);
  2827.     else flat = this.CParamFlat(paramId);
  2828.     value *= buff;
  2829.     value += flat + this.CParamXFlat(paramId);
  2830.     if (limits.length < 1) return Math.round(value);
  2831.     if (limits.length < 3) return Math.round(Math.max(value,limits[0]));
  2832.     return Math.round(value.clamp(limits[0], limits[2]));
  2833. };
  2834.  
  2835. Game_BattlerBase.prototype.CParamValue = function(paramId) {
  2836.     if (!this._CParamValues) this._CParamValues = [];
  2837.     if (this._CParamValues[paramId] === undefined) this._CParamValues[paramId] = this.CParam(paramId);
  2838.     return this._CParamValues[paramId];
  2839. };
  2840.  
  2841. Game_BattlerBase.prototype.setCParamValue = function(paramId, amount) {
  2842.     if (!this._CParamValues) this._CParamValues = [];
  2843.     this._CParamValues[paramId] = amount;
  2844.     this._CParamValues[paramId] = this._CParamValues[paramId].clamp(0, this.CParam(paramId));
  2845. };
  2846.  
  2847. Game_BattlerBase.prototype.gainCParamValue = function(paramId, amount) {
  2848.     if (!this._CParamValues) this._CParamValues = [];
  2849.     if (this._CParamValues[paramId] === undefined) this._CParamValues[paramId] = this.CParam(paramId);
  2850.     this._CParamValues[paramId] += amount;
  2851.     this._CParamValues[paramId] = this._CParamValues[paramId].clamp(0, this.CParam(paramId));
  2852. };
  2853.  
  2854. for (var i = 0; i < ICF.Param.CParams.length; i++) {
  2855.     if (ICF.Param.CParams[i].length > 0) {
  2856.         var param = "gain" + ICF.Param.CParams[i].substr(0,1).toUpperCase() + (ICF.Param.CParams[i].substr(1).toLowerCase());
  2857.         eval('Game_BattlerBase.prototype.' + param + ' = function(amount) { this.gainCParamValue(' + i + ', amount); };')
  2858.         param = "set" + ICF.Param.CParams[i].substr(0,1).toUpperCase() + (ICF.Param.CParams[i].substr(1).toLowerCase());
  2859.         eval('Game_BattlerBase.prototype.' + param + ' = function(amount) { this.setCParamValue(' + i + ', amount); };')
  2860.         eval('Game_BattlerBase.prototype.' + ICF.Param.CParams[i] + 'Rate = function(amount) { return (this.CParamValue(' + i + ') / this.CParam(' + i + ')).clamp(0, 1); };')
  2861.     }
  2862. }
  2863.  
  2864. Game_BattlerBase.prototype.PParamBase = function(pparamId) {
  2865.     return eval(ICF.Param.PParamBase[pparamId]) || 0;
  2866. }
  2867.  
  2868. Game_BattlerBase.prototype.PParamEquips = function(paramId) {
  2869.     var value = 0;
  2870.     var equips = this.equips();
  2871.     for (var i = 0; i < equips.length; i++) {
  2872.         var item = equips[i];
  2873.         if (item && item.PParams[paramId]) value += item.PParams[paramId];
  2874.         if (item && item.PParamEval[paramId]) {
  2875.         try {
  2876.         value += eval(item.PParamEvalAll + ';' + item.PParamEval[paramId]);
  2877.             }
  2878.         catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom PParam Base #' + paramId + ($dataWeapons[item.id] == item?' in weapon #':' in equip #') + item.id);}}
  2879.         }
  2880.     }
  2881.     return value;
  2882. };
  2883.  
  2884. Game_BattlerBase.prototype.PParamLimits = function(paramId) {
  2885.     var array = eval(ICF.Param.PParamLimit[paramId]);
  2886.     if (!Array.isArray(array)) return (!isNaN(Number(array)))? [array] : [];
  2887.     return array;
  2888. };
  2889.  
  2890. Game_BattlerBase.prototype.PParamPlus = function(pparamId) {
  2891.     if (!this._PParamPlus) this._PParamPlus = [];
  2892.     if (isNaN(this._PParamPlus[pparamId])) this._PParamPlus[pparamId] = 0;
  2893.     return this._PParamPlus[pparamId];
  2894. };
  2895.  
  2896. Game_BattlerBase.prototype.PParam = function(pparamId) {
  2897.     var value = this.PParamBase(pparamId) + this.traitsSum(Game_BattlerBase.TRAIT_PPARAM, pparamId);
  2898.     var limits = this.PParamLimits(pparamId);
  2899.     value += this.PParamEquips(pparamId) + this.PParamPlus(pparamId);
  2900.     value *= this.traitsPi(Game_BattlerBase.TRAIT_PPARAM, pparamId + 100);
  2901.     value += this.traitsSum(Game_BattlerBase.TRAIT_PPARAM, pparamId + 200);
  2902.     if (limits.length > 1) return value.clamp(limits[0], limits[1]);
  2903.     if (limits.length > 0) return Math.max(value, limits[0]);
  2904.     return value;
  2905. };
  2906.  
  2907. ICF.ParamCore.paramplus = Game_BattlerBase.prototype.paramPlus;
  2908. Game_BattlerBase.prototype.paramPlus = function(paramId) {
  2909.     return ICF.ParamCore.paramplus.call(this, paramId) + this.traitsSum(Game_BattlerBase.TRAIT_PARAM, paramId + 10);
  2910. };
  2911.  
  2912. Game_BattlerBase.prototype.paramFlat = function(paramId) {
  2913.     return this.traitsSum(Game_BattlerBase.TRAIT_PARAM, paramId + 20);
  2914. };
  2915.  
  2916. Game_BattlerBase.prototype.paramXFlat = function(paramId) {
  2917.     return this.traitsSum(Game_BattlerBase.TRAIT_PARAM, paramId + 40);
  2918. };
  2919.  
  2920. Game_BattlerBase.prototype.paramXRate = function(paramId) {
  2921.     return this.traitsPi(Game_BattlerBase.TRAIT_PARAM, paramId + 30);
  2922. };
  2923.  
  2924. Game_BattlerBase.prototype.paramLimits = function(paramId) {
  2925.     var array = eval(ICF.Param.BParamLimit[paramId]);
  2926.     if (!Array.isArray(array)) return (!isNaN(Number(array)))? [array] : [];
  2927.     return array;
  2928. };
  2929.  
  2930. Game_BattlerBase.prototype.paramEquips = function(paramId) {
  2931.     var value = 0;
  2932.     var equips = this.equips();
  2933.     for (var i = 0; i < equips.length; i++) {
  2934.         var item = equips[i];
  2935.         if (item && item.BParamEval[paramId]) {
  2936.         try {
  2937.         value += eval(item.BParamEval[paramId]);
  2938.             }
  2939.         catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom param Base #' + paramId + ($dataWeapons[item.id] == item?' in weapon #':' in equip #') + item.id);}}
  2940.         }
  2941.     }
  2942.     return value;
  2943. };
  2944.  
  2945. Game_BattlerBase.prototype.paramEval = function(paramId) {
  2946.     return 0;
  2947. };
  2948.  
  2949. Game_BattlerBase.prototype.param = function(paramId) {
  2950.     var value = this.paramBase(paramId) + this.paramPlus(paramId) + this.paramEquips(paramId) + this.paramEval(paramId);
  2951.     value *= this.paramRate(paramId);
  2952.     var limits = this.paramLimits(paramId);
  2953.     var buff = this.paramXRate(paramId) * this.paramBuffRate(paramId);
  2954.     if (limits.length > 1) value = Math.min(value, limits[1]);
  2955.     var flat = 0;
  2956.     if (limits.length > 1) flat = (buff > 1)? Math.min(this.paramFlat(paramId), limits[1] - value) : Math.min(this.paramFlat(paramId), limits[1] - value * buff);
  2957.     else flat = this.paramFlat(paramId);
  2958.     value *= buff;
  2959.     value += flat + this.paramXFlat(paramId);
  2960.     if (limits.length < 1) return Math.round(value);
  2961.     if (limits.length < 3) return Math.round(Math.max(value,limits[0]));
  2962.     return Math.round(value.clamp(limits[0], limits[2]));
  2963. };
  2964.  
  2965. Game_BattlerBase.prototype.xparamBase = function(xparamId) {
  2966.     return eval(ICF.Param.XParamBase[xparamId]) || 0;
  2967. }
  2968.  
  2969. Game_BattlerBase.prototype.xparam = function(xparamId) {
  2970.     return (this.xparamBase(xparamId) + this.traitsSum(Game_BattlerBase.TRAIT_XPARAM, xparamId)) * this.traitsPi(Game_BattlerBase.TRAIT_XPARAM, xparamId + 10) + this.traitsSum(Game_BattlerBase.TRAIT_XPARAM, xparamId + 20);
  2971. };
  2972.  
  2973. Game_BattlerBase.prototype.sparamBase = function(sparamId) {
  2974.     return eval(ICF.Param.SParamBase[sparamId]) || 1;
  2975. }
  2976.  
  2977. Game_BattlerBase.prototype.sparam = function(sparamId) {
  2978.     return (this.sparamBase(sparamId) + this.traitsSum(Game_BattlerBase.TRAIT_SPARAM, sparamId + 10)) * this.traitsPi(Game_BattlerBase.TRAIT_SPARAM, sparamId) + this.traitsSum(Game_BattlerBase.TRAIT_SPARAM, sparamId + 20);
  2979. };
  2980.  
  2981. Game_BattlerBase.prototype.NDebuffRate = function(paramId) {
  2982.     return this.traitsPi(Game_BattlerBase.TRAIT_DEBUFF_RATE, paramId + 10);
  2983. };
  2984.  
  2985. Game_BattlerBase.prototype.CDebuffRate = function(paramId) {
  2986.     return this.traitsPi(Game_BattlerBase.TRAIT_DEBUFF_RATE, paramId + 200);
  2987. };
  2988.  
  2989. Game_BattlerBase.prototype.addNParam = function(paramId, value) {
  2990.     if (!this._NParamPlus) this._NParamPlus = [];
  2991.     if (!this._NParamPlus[paramId]) this._NParamPlus[paramId] = 0;
  2992.     this._NParamPlus[paramId] += value;
  2993.     this.refresh();
  2994. };
  2995.  
  2996. Game_BattlerBase.prototype.addPParam = function(paramId, value) {
  2997.     if (!this._PParamPlus) this._PParamPlus = [];
  2998.     if (!this._PParamPlus[paramId]) this._PParamPlus[paramId] = 0;
  2999.     this._PParamPlus[paramId] += value;
  3000.     this.refresh();
  3001. };
  3002.  
  3003. Game_BattlerBase.prototype.addCParam = function(paramId, value) {
  3004.     if (!this._CParamPlus) this._CParamPlus = [];
  3005.     if (!this._CParamPlus[paramId]) this._CParamPlus[paramId] = 0;
  3006.     this._CParamPlus[paramId] += value;
  3007.     this.refresh();
  3008. };
  3009.  
  3010. //=============================================================================
  3011. // Game_Battler
  3012. //=============================================================================
  3013.  
  3014. Game_Battler.prototype.addNBuff = function(paramId, turns) {
  3015.     if (this.isAlive()) {
  3016.         this.increaseNBuff(paramId);
  3017.         if (this.isNBuffAffected(paramId)) {
  3018.             this.overwriteNBuffTurns(paramId, turns);
  3019.         }
  3020.         this._result.pushAddedNBuff(paramId);
  3021.         this.refresh();
  3022.     }
  3023. };
  3024.  
  3025. Game_Battler.prototype.addNDebuff = function(paramId, turns) {
  3026.     if (this.isAlive()) {
  3027.         this.decreaseNBuff(paramId);
  3028.         if (this.isNDebuffAffected(paramId)) {
  3029.             this.overwriteNBuffTurns(paramId, turns);
  3030.         }
  3031.         this._result.pushAddedNDebuff(paramId);
  3032.         this.refresh();
  3033.     }
  3034. };
  3035.  
  3036. Game_Battler.prototype.removeNBuff = function(paramId) {
  3037.     if (this.isAlive() && this.isNBuffOrDebuffAffected(paramId)) {
  3038.         this.eraseNBuff(paramId);
  3039.         this._result.pushRemovedNBuff(paramId);
  3040.         this.refresh();
  3041.     }
  3042. };
  3043.  
  3044. Game_Battler.prototype.addCBuff = function(paramId, turns) {
  3045.     if (this.isAlive()) {
  3046.         this.increaseCBuff(paramId);
  3047.         if (this.isCBuffAffected(paramId)) {
  3048.             this.overwriteCBuffTurns(paramId, turns);
  3049.         }
  3050.         this._result.pushAddedCBuff(paramId);
  3051.         this.refresh();
  3052.     }
  3053. };
  3054.  
  3055. Game_Battler.prototype.addCDebuff = function(paramId, turns) {
  3056.     if (this.isAlive()) {
  3057.         this.decreaseCBuff(paramId);
  3058.         if (this.isCDebuffAffected(paramId)) {
  3059.             this.overwriteCBuffTurns(paramId, turns);
  3060.         }
  3061.         this._result.pushAddedCDebuff(paramId);
  3062.         this.refresh();
  3063.     }
  3064. };
  3065.  
  3066. Game_Battler.prototype.removeCBuff = function(paramId) {
  3067.     if (this.isAlive() && this.isCBuffOrDebuffAffected(paramId)) {
  3068.         this.eraseCBuff(paramId);
  3069.         this._result.pushRemovedCBuff(paramId);
  3070.         this.refresh();
  3071.     }
  3072. };
  3073.  
  3074. ICF.ParamCore.removeAllBuffs = Game_Battler.prototype.removeAllBuffs;
  3075. Game_Battler.prototype.removeAllBuffs = function() {
  3076.     ICF.ParamCore.removeAllBuffs.call(this);
  3077.     for (var i = 0; i < this.NBuffLength(); i++) {
  3078.         this.removeNBuff(i);
  3079.     }
  3080.     for (var i = 0; i < this.CBuffLength(); i++) {
  3081.         this.removeCBuff(i);
  3082.     }
  3083. };
  3084.  
  3085. ICF.ParamCore.removeBuffsAuto = Game_Battler.prototype.removeBuffsAuto;
  3086. Game_Battler.prototype.removeBuffsAuto = function() {
  3087.     ICF.ParamCore.removeBuffsAuto.call(this);
  3088.     for (var i = 0; i < this.NBuffLength(); i++) {
  3089.         if (this.isNBuffExpired(i)) {
  3090.             this.removeNBuff(i);
  3091.         }
  3092.     }
  3093.     for (var i = 0; i < this.CBuffLength(); i++) {
  3094.         if (this.isCBuffExpired(i)) {
  3095.             this.removeCBuff(i);
  3096.         }
  3097.     }
  3098. };
  3099.  
  3100. //=============================================================================
  3101. // Game_Actor
  3102. //=============================================================================
  3103.  
  3104. Game_Actor.prototype.NParamBase = function(paramId) {
  3105.     if ($dataActors[this._actorId].customNParam[paramId] != '') {
  3106.     try {   var value = 0;
  3107.         eval($dataActors[this._actorId].customNParam[paramId]);
  3108.         return value;
  3109.         }
  3110.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom NParam Base #' + paramId + ' in actor #' + this._actorId);}}
  3111.     }
  3112.     if ($dataClasses[this._classId].customNParam[paramId] != '') {
  3113.     try {   var value = 0;
  3114.         eval($dataClasses[this._classId].customNParam[paramId]);
  3115.         return value;
  3116.         }
  3117.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom NParam Base #' + paramId + ' in actor class #' + this._classId);}}
  3118.     }
  3119.  
  3120.     var array = $dataActors[this._actorId].basicNParam[paramId];
  3121.     if (!array || array.length < 1) array = $dataClasses[this._classId].basicNParam[paramId];
  3122.  
  3123.     if (!array || array.length < 1) return Game_BattlerBase.prototype.NParamBase.call(this, paramId);
  3124.     return this.NParamBasic(array, this.level);
  3125. };
  3126.  
  3127. Game_Actor.prototype.CParamBase = function(paramId) {
  3128.     if ($dataActors[this._actorId].customCParam[paramId] != '') {
  3129.     try {   var value = 0;
  3130.         eval($dataActors[this._actorId].customCParam[paramId]);
  3131.         return value;
  3132.         }
  3133.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom CParam Base #' + paramId + ' in actor #' + this._actorId);}}
  3134.     }
  3135.     if ($dataClasses[this._classId].customCParam[paramId] != '') {
  3136.     try {   var value = 0;
  3137.         eval($dataClasses[this._classId].customCParam[paramId]);
  3138.         return value;
  3139.         }
  3140.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom CParam Base #' + paramId + ' in actor class #' + this._classId);}}
  3141.     }
  3142.  
  3143.     var array = $dataActors[this._actorId].basicCParam[paramId];
  3144.     if (!array || array.length < 1) array = $dataClasses[this._classId].basicCParam[paramId];
  3145.  
  3146.     if (!array || array.length < 1) return Game_BattlerBase.prototype.CParamBase.call(this, paramId);
  3147.     return this.NParamBasic(array, this.level);
  3148. };
  3149.  
  3150. ICF.ParamCore.actorparambase = Game_Actor.prototype.paramBase;
  3151. Game_Actor.prototype.paramBase = function(paramId) {
  3152.     if ($dataActors[this._actorId].customBParam[paramId] != '') {
  3153.     try {   var value = 0;
  3154.         var base = this.currentClass().params[paramId][1];
  3155.         eval($dataActors[this._actorId].customBParam[paramId]);
  3156.         return value;
  3157.         }
  3158.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom Param Base #' + paramId + ' in actor #' + this._actorId);}}
  3159.     }
  3160.     if ($dataClasses[this._classId].customBParam[paramId] != '') {
  3161.     try {   var value = 0;
  3162.         var base = this.currentClass().params[paramId][1];
  3163.         eval($dataClasses[this._classId].customBParam[paramId]);
  3164.         return value;
  3165.         }
  3166.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom Param Base #' + paramId + ' in actor class #' + this._classId);}}
  3167.     }
  3168.  
  3169.     if (ICF.Param.BParamBase[paramId].length > 0) {
  3170.     try {   var base = this.currentClass().params[paramId][1];
  3171.         return eval(ICF.Param.BParamBase[paramId]);
  3172.         }
  3173.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in default Param Base #' + paramId);}}
  3174.     }
  3175.     return ICF.ParamCore.actorparambase.call(this, paramId);
  3176. };
  3177.  
  3178. //=============================================================================
  3179. // Game_Enemy
  3180. //=============================================================================
  3181.  
  3182. Game_Enemy.prototype.NParamBase = function(paramId) {
  3183.     if ($dataEnemies[this._enemyId].customNParam[paramId] != '') {
  3184.     try {   var value = 0;
  3185.         eval($dataEnemies[this._enemyId].customNParam[paramId]);
  3186.         return value;
  3187.         }
  3188.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom NParam Base #' + paramId + ' in enemy #' + this._enemyId);}}
  3189.     }
  3190.     var currentClass = this.currentClass();
  3191.     if (currentClass && currentClass.customNParam[paramId] != '') {
  3192.     try {   var value = 0;
  3193.         eval(currentClass.customNParam[paramId]);
  3194.         return value;
  3195.         }
  3196.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom NParam Base #' + paramId + ' in enemy class #' + this._classId);}}
  3197.     }
  3198.  
  3199.  
  3200.     var array = $dataEnemies[this._enemyId].basicNParam[paramId];
  3201.     if ((!array || array.length < 1) && currentClass) array = currentClass.basicNParam[paramId];
  3202.  
  3203.     if (!array || array.length < 1) return Game_BattlerBase.prototype.NParamBase.call(this, paramId);
  3204.     return this.NParamBasic(array, this.level);
  3205. };
  3206.  
  3207. Game_Enemy.prototype.CParamBase = function(paramId) {
  3208.     if ($dataEnemies[this._enemyId].customCParam[paramId] != '') {
  3209.     try {   var value = 0;
  3210.         eval($dataEnemies[this._enemyId].customCParam[paramId]);
  3211.         return value;
  3212.         }
  3213.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom CParam Base #' + paramId + ' in enemy #' + this._enemyId);}}
  3214.     }
  3215.     var currentClass = this.currentClass();
  3216.     if (currentClass && currentClass.customCParam[paramId] != '') {
  3217.     try {   var value = 0;
  3218.         eval(currentClass.customCParam[paramId]);
  3219.         return value;
  3220.         }
  3221.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom CParam Base #' + paramId + ' in enemy class #' + this._classId);}}
  3222.     }
  3223.  
  3224.  
  3225.     var array = $dataEnemies[this._enemyId].basicCParam[paramId];
  3226.     if ((!array || array.length < 1) && currentClass) array = currentClass.basicCParam[paramId];
  3227.  
  3228.     if (!array || array.length < 1) return Game_BattlerBase.prototype.CParamBase.call(this, paramId);
  3229.     return this.NParamBasic(array, this.level);
  3230. };
  3231.  
  3232. ICF.ParamCore.enemyparambase = Game_Enemy.prototype.paramBase;
  3233. Game_Enemy.prototype.paramBase = function(paramId) {
  3234.     if ($dataEnemies[this._enemyId].customBParam[paramId] != '') {
  3235.     try {   var value = 0;
  3236.         var base = (this.currentClass())? this.currentClass().params[paramId][1] : this.enemy().params[paramId];
  3237.         eval($dataEnemies[this._enemyId].customBParam[paramId]);
  3238.         return value;
  3239.         }
  3240.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom Param Base #' + paramId + ' in enemy #' + this._enemyId);}}
  3241.     }
  3242.     var currentClass = this.currentClass();
  3243.     if (currentClass && currentClass.customBParam[paramId] != '') {
  3244.     try {   var value = 0;
  3245.         var base = (this.currentClass())? this.currentClass().params[paramId][1] : this.enemy().params[paramId];
  3246.         eval(currentClass.customBParam[paramId]);
  3247.         return value;
  3248.         }
  3249.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom Param Base #' + paramId + ' in enemy class #' + this._classId);}}
  3250.     }
  3251.  
  3252.     if (ICF.Param.BParamBase[paramId].length > 0) {
  3253.     try {   var base = (this.currentClass())? this.currentClass().params[paramId][1] : this.enemy().params[paramId];
  3254.         return eval(ICF.Param.BParamBase[paramId]);
  3255.         }
  3256.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in default Param Base #' + paramId);}}
  3257.     }
  3258.     return ICF.ParamCore.enemyparambase.call(this, paramId);
  3259. };
  3260.  
  3261. //=============================================================================
  3262. // Game_Action
  3263. //=============================================================================
  3264.  
  3265. ICF.ParamCore.testItemEffect = Game_Action.prototype.testItemEffect;
  3266. Game_Action.prototype.testItemEffect = function(target, effect) {
  3267.     switch (effect.code) {
  3268.     case Game_Action.EFFECT_ADD_NBUFF :
  3269.     if (effect.dataId >= 100) return !target.isMaxCBuffAffected(effect.dataId - 100);
  3270.         return !target.isMaxNBuffAffected(effect.dataId);
  3271.     case Game_Action.EFFECT_ADD_NDEBUFF :
  3272.     if (effect.dataId >= 100) return !target.isMaxCDebuffAffected(effect.dataId - 100);
  3273.         return !target.isMaxNDebuffAffected(effect.dataId);
  3274.     case Game_Action.REMOVE_NBUFF:
  3275.     if (effect.dataId >= 100) return !target.isCBuffAffected(effect.dataId - 100);
  3276.         return target.isNBuffAffected(effect.dataId);
  3277.     case Game_Action.REMOVE_NDEBUFF:
  3278.     if (effect.dataId >= 100) return !target.isCDebuffAffected(effect.dataId - 100);
  3279.         return target.isNDebuffAffected(effect.dataId);
  3280.     default:
  3281.         return ICF.ParamCore.testItemEffect.call(this, target, effect);
  3282.     }
  3283. };
  3284.  
  3285. ICF.ParamCore.applyItemEffect = Game_Action.prototype.applyItemEffect;
  3286. Game_Action.prototype.applyItemEffect = function(target, effect) {
  3287.     switch (effect.code) {
  3288.     case Game_Action.EFFECT_ADD_NBUFF:
  3289.     if (effect.dataId >= 100) {
  3290.         effect.dataId -= 100;
  3291.         this.itemEffectAddCBuff(target, effect);
  3292.         effect.dataId += 100;
  3293.         } else this.itemEffectAddNBuff(target, effect);
  3294.         break;
  3295.     case Game_Action.EFFECT_ADD_NDEBUFF:
  3296.         if (effect.dataId >= 100) {
  3297.         effect.dataId -= 100;
  3298.         this.itemEffectAddCDebuff(target, effect);
  3299.         effect.dataId += 100;
  3300.         } else this.itemEffectAddNDebuff(target, effect);
  3301.         break;
  3302.     case Game_Action.EFFECT_REMOVE_NBUFF:
  3303.         if (effect.dataId >= 100) {
  3304.         effect.dataId -= 100;
  3305.         this.itemEffectRemoveCBuff(target, effect);
  3306.         effect.dataId += 100;
  3307.         } else this.itemEffectRemoveNBuff(target, effect);
  3308.         break;
  3309.     case Game_Action.EFFECT_REMOVE_NDEBUFF:
  3310.         if (effect.dataId >= 100) {
  3311.         effect.dataId -= 100;
  3312.         this.itemEffectRemoveCDebuff(target, effect);
  3313.         effect.dataId += 100;
  3314.         } else this.itemEffectRemoveNDebuff(target, effect);
  3315.         break;
  3316.     case Game_Action.EFFECT_NGROW:
  3317.         this.itemEffectGrowNParam(target, effect);
  3318.         break;
  3319.     case Game_Action.EFFECT_PGROW:
  3320.         this.itemEffectGrowPParam(target, effect);
  3321.         break;
  3322.     case Game_Action.EFFECT_CGROW:
  3323.         this.itemEffectGrowCParam(target, effect);
  3324.         break;
  3325.     default:
  3326.         ICF.ParamCore.applyItemEffect.call(this, target, effect);
  3327.     }
  3328. };
  3329.  
  3330. Game_Action.prototype.itemEffectAddNBuff = function(target, effect) {
  3331.     target.addNBuff(effect.dataId, effect.value1);
  3332.     this.makeSuccess(target);
  3333. };
  3334.  
  3335. Game_Action.prototype.itemEffectAddNDebuff = function(target, effect) {
  3336.     var chance = target.NDebuffRate(effect.dataId) * this.lukEffectRate(target);
  3337.     if (Math.random() < chance) {
  3338.         target.addNDebuff(effect.dataId, effect.value1);
  3339.         this.makeSuccess(target);
  3340.     }
  3341. };
  3342.  
  3343. Game_Action.prototype.itemEffectRemoveNBuff = function(target, effect) {
  3344.     if (target.isNBuffAffected(effect.dataId)) {
  3345.         target.removeNBuff(effect.dataId);
  3346.         this.makeSuccess(target);
  3347.     }
  3348. };
  3349.  
  3350. Game_Action.prototype.itemEffectRemoveNDebuff = function(target, effect) {
  3351.     if (target.isNDebuffAffected(effect.dataId)) {
  3352.         target.removeNBuff(effect.dataId);
  3353.         this.makeSuccess(target);
  3354.     }
  3355. };
  3356.  
  3357. Game_Action.prototype.itemEffectAddCBuff = function(target, effect) {
  3358.     target.addCBuff(effect.dataId, effect.value1);
  3359.     this.makeSuccess(target);
  3360. };
  3361.  
  3362. Game_Action.prototype.itemEffectAddCDebuff = function(target, effect) {
  3363.     var chance = target.CDebuffRate(effect.dataId) * this.lukEffectRate(target);
  3364.     if (Math.random() < chance) {
  3365.         target.addCDebuff(effect.dataId, effect.value1);
  3366.         this.makeSuccess(target);
  3367.     }
  3368. };
  3369.  
  3370. Game_Action.prototype.itemEffectRemoveCBuff = function(target, effect) {
  3371.     if (target.isCBuffAffected(effect.dataId)) {
  3372.         target.removeCBuff(effect.dataId);
  3373.         this.makeSuccess(target);
  3374.     }
  3375. };
  3376.  
  3377. Game_Action.prototype.itemEffectRemoveCDebuff = function(target, effect) {
  3378.     if (target.isCDebuffAffected(effect.dataId)) {
  3379.         target.removeCBuff(effect.dataId);
  3380.         this.makeSuccess(target);
  3381.     }
  3382. };
  3383.  
  3384. Game_Action.prototype.itemEffectGrowNParam = function(target, effect) {
  3385.     target.addNParam(effect.dataId, Math.floor(effect.value1));
  3386.     this.makeSuccess(target);
  3387. };
  3388.  
  3389. Game_Action.prototype.itemEffectGrowPParam = function(target, effect) {
  3390.     target.addPParam(effect.dataId, Math.floor(effect.value1));
  3391.     this.makeSuccess(target);
  3392. };
  3393.  
  3394. Game_Action.prototype.itemEffectGrowCParam = function(target, effect) {
  3395.     target.addCParam(effect.dataId, Math.floor(effect.value1));
  3396.     this.makeSuccess(target);
  3397. };
  3398.  
  3399. //=============================================================================
  3400. // Game_ActionResult
  3401. //=============================================================================
  3402.  
  3403. ICF.ParamCore.GARClear = Game_ActionResult.prototype.clear;
  3404. Game_ActionResult.prototype.clear = function() {
  3405.     ICF.ParamCore.GARClear.call(this);
  3406.     this.addedNBuffs = [];
  3407.     this.addedNDebuffs = [];
  3408.     this.removedNBuffs = [];
  3409. };
  3410.  
  3411. Game_ActionResult.prototype.isNBuffAdded = function(paramId) {
  3412.     return this.addedNBuffs.contains(paramId);
  3413. };
  3414.  
  3415. Game_ActionResult.prototype.pushAddedNBuff = function(paramId) {
  3416.     if (!this.isNBuffAdded(paramId)) {
  3417.         this.addedNBuffs.push(paramId);
  3418.     }
  3419. };
  3420.  
  3421. Game_ActionResult.prototype.isNDebuffAdded = function(paramId) {
  3422.     return this.addedNDebuffs.contains(paramId);
  3423. };
  3424.  
  3425. Game_ActionResult.prototype.pushAddedNDebuff = function(paramId) {
  3426.     if (!this.isNDebuffAdded(paramId)) {
  3427.         this.addedNDebuffs.push(paramId);
  3428.     }
  3429. };
  3430.  
  3431. Game_ActionResult.prototype.isNBuffRemoved = function(paramId) {
  3432.     return this.removedNBuffs.contains(paramId);
  3433. };
  3434.  
  3435. Game_ActionResult.prototype.pushnRemovedBuff = function(paramId) {
  3436.     if (!this.isNBuffRemoved(paramId)) {
  3437.         this.removedNBuffs.push(paramId);
  3438.     }
  3439. };
  3440.  
  3441. //=============================================================================
  3442. // Game_Item
  3443. //=============================================================================
  3444.  
  3445. Game_Item.prototype.nparamTypes = function() {
  3446.     return this.traitDataTypesMod(24, 100);
  3447. };
  3448.  
  3449. Game_Item.prototype.pparamTypes = function() {
  3450.     return this.traitDataTypesMod(25, 100);
  3451. };
  3452.  
  3453. Game_Item.prototype.cparamTypes = function() {
  3454.     return this.traitDataTypesMod(26, 100);
  3455. };
  3456.  
  3457. Game_Item.prototype.paramTypes = function() {
  3458.     return this.traitDataTypesMod(21, 10);
  3459. };
  3460.  
  3461. Game_Item.prototype.xparamTypes = function() {
  3462.     return this.traitDataTypesMod(22, 10);
  3463. };
  3464.  
  3465. Game_Item.prototype.sparamTypes = function() {
  3466.     return this.traitDataTypesMod(23, 10);
  3467. };
  3468.  
  3469. //=============================================================================
  3470. // End of File
  3471. //=============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement