Advertisement
ICF-Soft

ICF-Soft Params Core 1.08 RPG Maker MV

Mar 24th, 2019
215
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 = 108; // 1.08
  14.  
  15. //=============================================================================
  16.  /*:
  17.  * @plugindesc v1.08 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 Create NParams here.
  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 Create PParams here.
  28.  * @type struct<PlainParams>[]
  29.  * @default ["{\"Name\":\"\",\"Full Name\":\"\",\"Base\":\"0\",\"Limits\":\"(this.isActor())? [0, 999] : [0, 999]\"}"]
  30.  *
  31.  * @param CParams
  32.  * @desc Create CParams here.
  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 Default Valid CParams
  37.  * @desc Determine what cparam results can be visible in battle by default separated by spaces. See help.
  38.  * @default none
  39.  *
  40.  * @param Default Main CParams
  41.  * @desc Determine what cparam results are important in battle by default separated by spaces. See help.
  42.  * @default none
  43.  *
  44.  * @param Use Damage Icons
  45.  * @desc Use icons in damage popups for hp, mp and tp. Icons for cparams are used anyway.
  46.  * @default true
  47.  *
  48.  * @param BParam0 Name
  49.  * @desc Alias for this basic param. You can redefine it.
  50.  * @default mhp
  51.  *
  52.  * @param BParam0 Icon
  53.  * @desc An icon for this parameter.
  54.  * @default 0
  55.  *
  56.  * @param BParam0 Base Eval
  57.  * @desc A formula to use instead of default base given in MV.
  58.  * Empty to use default.
  59.  * @default
  60.  *
  61.  * @param BParam0 Limits
  62.  * @desc Formula for min and max value for this param. See help.
  63.  * Hit points
  64.  * @default (this.isActor())? [1, 9999, 12000] : [1, 999999, 1200000]
  65.  *
  66.  * @param BParam1 Name
  67.  * @desc Alias for this basic param. You can redefine it.
  68.  * @default mmp
  69.  *
  70.  * @param BParam1 Icon
  71.  * @desc An icon for this parameter.
  72.  * @default 0
  73.  *
  74.  * @param BParam1 Base Eval
  75.  * @desc A formula to use instead of default base given in MV.
  76.  * Empty to use default.
  77.  * @default
  78.  *
  79.  * @param BParam1 Limits
  80.  * @desc Formula for min and max value for this param. See help.
  81.  * Magic points
  82.  * @default (this.isActor())? [0, 9999, 12000] : [0, 9999, 12000]
  83.  *
  84.  * @param BParam2 Name
  85.  * @desc Alias for this basic param. You can redefine it.
  86.  * @default atk
  87.  *
  88.  * @param BParam2 Icon
  89.  * @desc An icon for this parameter.
  90.  * @default 0
  91.  *
  92.  * @param BParam2 Base Eval
  93.  * @desc A formula to use instead of default base given in MV.
  94.  * Empty to use default.
  95.  * @default
  96.  *
  97.  * @param BParam2 Limits
  98.  * @desc Formula for min and max value for this param. See help.
  99.  * Attack
  100.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  101.  *
  102.  * @param BParam3 Name
  103.  * @desc Alias for this basic param. You can redefine it.
  104.  * @default def
  105.  *
  106.  * @param BParam3 Icon
  107.  * @desc An icon for this parameter.
  108.  * @default 0
  109.  *
  110.  * @param BParam3 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 BParam3 Limits
  116.  * @desc Formula for min and max value for this param. See help.
  117.  * Defense
  118.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  119.  *
  120.  * @param BParam4 Name
  121.  * @desc Alias for this basic param. You can redefine it.
  122.  * @default mat
  123.  *
  124.  * @param BParam4 Icon
  125.  * @desc An icon for this parameter.
  126.  * @default 0
  127.  *
  128.  * @param BParam4 Base Eval
  129.  * @desc A formula to use instead of default base given in MV.
  130.  * Empty to use default.
  131.  * @default
  132.  *
  133.  * @param BParam4 Limits
  134.  * @desc Formula for min and max value for this param. See help.
  135.  * Magic attack
  136.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  137.  *
  138.  * @param BParam5 Name
  139.  * @desc Alias for this basic param. You can redefine it.
  140.  * @default mdf
  141.  *
  142.  * @param BParam5 Icon
  143.  * @desc An icon for this parameter.
  144.  * @default 0
  145.  *
  146.  * @param BParam5 Base Eval
  147.  * @desc A formula to use instead of default base given in MV.
  148.  * Empty to use default.
  149.  * @default
  150.  *
  151.  * @param BParam5 Limits
  152.  * @desc Formula for min and max value for this param. See help.
  153.  * Magic defense
  154.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  155.  *
  156.  * @param BParam6 Name
  157.  * @desc Alias for this basic param. You can redefine it.
  158.  * @default agi
  159.  *
  160.  * @param BParam6 Icon
  161.  * @desc An icon for this parameter.
  162.  * @default 0
  163.  *
  164.  * @param BParam6 Base Eval
  165.  * @desc A formula to use instead of default base given in MV.
  166.  * Empty to use default.
  167.  * @default
  168.  *
  169.  * @param BParam6 Limits
  170.  * @desc Formula for min and max value for this param. See help.
  171.  * Agility
  172.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  173.  *
  174.  * @param BParam7 Name
  175.  * @desc Alias for this basic param. You can redefine it.
  176.  * @default luk
  177.  *
  178.  * @param BParam7 Icon
  179.  * @desc An icon for this parameter.
  180.  * @default 0
  181.  *
  182.  * @param BParam7 Base Eval
  183.  * @desc A formula to use instead of default base given in MV.
  184.  * Empty to use default.
  185.  * @default
  186.  *
  187.  * @param BParam7 Limits
  188.  * @desc Formula for min and max value for this param. See help.
  189.  * Luck
  190.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  191.  *
  192.  * @param TP Base
  193.  * @desc Formula for tp base value.
  194.  * @default 100
  195.  *
  196.  * @param TP Limits
  197.  * @desc Formula for min and max tp values. See help.
  198.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  199.  *
  200.  * @param TP Icon
  201.  * @desc An icon for TP.
  202.  * @default 0
  203.  *
  204.  * @param XParam0 Full Name
  205.  * @desc Name that will be shown for this extra param.
  206.  * @default Hit rate
  207.  *
  208.  * @param XParam0 Icon
  209.  * @desc An icon for this parameter.
  210.  * @default 0
  211.  *
  212.  * @param XParam0 Base
  213.  * @desc Formula for base value for x param hit (HIT rate).
  214.  * @default 0
  215.  *
  216.  * @param XParam1 Full Name
  217.  * @desc Name that will be shown for this extra param.
  218.  * @default Evasion rate
  219.  *
  220.  * @param XParam1 Icon
  221.  * @desc An icon for this parameter.
  222.  * @default 0
  223.  *
  224.  * @param XParam1 Base
  225.  * @desc Formula for base value for x param eva (EVAsion rate).
  226.  * @default 0
  227.  *
  228.  * @param XParam2 Full Name
  229.  * @desc Name that will be shown for this extra param.
  230.  * @default Critical rate
  231.  *
  232.  * @param XParam2 Icon
  233.  * @desc An icon for this parameter.
  234.  * @default 0
  235.  *
  236.  * @param XParam2 Base
  237.  * @desc Formula for base value for x param cri (CRItical rate).
  238.  * @default 0
  239.  *
  240.  * @param XParam3 Full Name
  241.  * @desc Name that will be shown for this extra param.
  242.  * @default Critical evasion rate
  243.  *
  244.  * @param XParam3 Icon
  245.  * @desc An icon for this parameter.
  246.  * @default 0
  247.  *
  248.  * @param XParam3 Base
  249.  * @desc Formula for base value for x param cev (Critical Evasion Rate).
  250.  * @default 0
  251.  *
  252.  * @param XParam4 Full Name
  253.  * @desc Name that will be shown for this extra param.
  254.  * @default Magic evasion rate
  255.  *
  256.  * @param XParam4 Icon
  257.  * @desc An icon for this parameter.
  258.  * @default 0
  259.  *
  260.  * @param XParam4 Base
  261.  * @desc Formula for base value for x param mev (Magic EVasion rate).
  262.  * @default 0
  263.  *
  264.  * @param XParam5 Full Name
  265.  * @desc Name that will be shown for this extra param.
  266.  * @default Magic reflection rate
  267.  *
  268.  * @param XParam5 Icon
  269.  * @desc An icon for this parameter.
  270.  * @default 0
  271.  *
  272.  * @param XParam5 Base
  273.  * @desc Formula for base value for x param mrf (Magic ReFlection rate).
  274.  * @default 0
  275.  *
  276.  * @param XParam6 Full Name
  277.  * @desc Name that will be shown for this extra param.
  278.  * @default Counter-attack rate
  279.  *
  280.  * @param XParam6 Icon
  281.  * @desc An icon for this parameter.
  282.  * @default 0
  283.  *
  284.  * @param XParam6 Base
  285.  * @desc Formula for base value for x param cnt (CouNTer attack rate).
  286.  * @default 0
  287.  *
  288.  * @param XParam7 Full Name
  289.  * @desc Name that will be shown for this extra param.
  290.  * @default Hp-regen rate
  291.  *
  292.  * @param XParam7 Icon
  293.  * @desc An icon for this parameter.
  294.  * @default 0
  295.  *
  296.  * @param XParam7 Base
  297.  * @desc Formula for base value for x param hrg (Hp ReGeneration rate).
  298.  * @default 0
  299.  *
  300.  * @param XParam8 Full Name
  301.  * @desc Name that will be shown for this extra param.
  302.  * @default Mp-regen rate
  303.  *
  304.  * @param XParam8 Icon
  305.  * @desc An icon for this parameter.
  306.  * @default 0
  307.  *
  308.  * @param XParam8 Base
  309.  * @desc Formula for base value for x param mrg (Mp ReGeneration rate).
  310.  * @default 0
  311.  *
  312.  * @param XParam9 Full Name
  313.  * @desc Name that will be shown for this extra param.
  314.  * @default Tp-regen rate
  315.  *
  316.  * @param XParam9 Icon
  317.  * @desc An icon for this parameter.
  318.  * @default 0
  319.  *
  320.  * @param XParam9 Base
  321.  * @desc Formula for base value for x param trg (Tp ReGeneration rate).
  322.  * @default 0
  323.  *
  324.  * @param SParam0 Full Name
  325.  * @desc Name that will be shown for this special param.
  326.  * @default Targeted rate
  327.  *
  328.  * @param SParam0 Icon
  329.  * @desc An icon for this parameter.
  330.  * @default 0
  331.  *
  332.  * @param SParam0 Base
  333.  * @desc Formula for base value for x param tgr (TarGet Rate).
  334.  * @default 1
  335.  *
  336.  * @param SParam1 Full Name
  337.  * @desc Name that will be shown for this special param.
  338.  * @default Guard rate
  339.  *
  340.  * @param SParam1 Icon
  341.  * @desc An icon for this parameter.
  342.  * @default 0
  343.  *
  344.  * @param SParam1 Base
  345.  * @desc Formula for base value for s param grd (GuaRD effect rate).
  346.  * @default 1
  347.  *
  348.  * @param SParam2 Full Name
  349.  * @desc Name that will be shown for this special param.
  350.  * @default Recovery rate
  351.  *
  352.  * @param SParam2 Icon
  353.  * @desc An icon for this parameter.
  354.  * @default 0
  355.  *
  356.  * @param SParam2 Base
  357.  * @desc Formula for base value for s param rec (RECovery effect rate).
  358.  * @default 1
  359.  *
  360.  * @param SParam3 Full Name
  361.  * @desc Name that will be shown for this special param.
  362.  * @default Pharmacology
  363.  *
  364.  * @param SParam3 Icon
  365.  * @desc An icon for this parameter.
  366.  * @default 0
  367.  *
  368.  * @param SParam3 Base
  369.  * @desc Formula for base value for s param pha (PHArmacology).
  370.  * @default 1
  371.  *
  372.  * @param SParam4 Full Name
  373.  * @desc Name that will be shown for this special param.
  374.  * @default Mp cost rate
  375.  *
  376.  * @param SParam4 Icon
  377.  * @desc An icon for this parameter.
  378.  * @default 0
  379.  *
  380.  * @param SParam4 Base
  381.  * @desc Formula for base value for s param mcr (Mp Cost Rate).
  382.  * @default 1
  383.  *
  384.  * @param SParam5 Full Name
  385.  * @desc Name that will be shown for this special param.
  386.  * @default Tp cost rate
  387.  *
  388.  * @param SParam5 Icon
  389.  * @desc An icon for this parameter.
  390.  * @default 0
  391.  *
  392.  * @param SParam5 Base
  393.  * @desc Formula for base value for s param tcr (Tp Cost Rate).
  394.  * @default 1
  395.  *
  396.  * @param SParam6 Full Name
  397.  * @desc Name that will be shown for this special param.
  398.  * @default Phisical damage rate
  399.  *
  400.  * @param SParam6 Icon
  401.  * @desc An icon for this parameter.
  402.  * @default 0
  403.  *
  404.  * @param SParam6 Base
  405.  * @desc Formula for base value for s param pdr (Physical Damage Rate).
  406.  * @default 1
  407.  *
  408.  * @param SParam7 Full Name
  409.  * @desc Name that will be shown for this special param.
  410.  * @default Magical damage rate
  411.  *
  412.  * @param SParam7 Icon
  413.  * @desc An icon for this parameter.
  414.  * @default 0
  415.  *
  416.  * @param SParam7 Base
  417.  * @desc Formula for base value for s param mdr (Magical Damage Rate).
  418.  * @default 1
  419.  *
  420.  * @param SParam8 Full Name
  421.  * @desc Name that will be shown for this special param.
  422.  * @default Floor damage rate
  423.  *
  424.  * @param SParam8 Icon
  425.  * @desc An icon for this parameter.
  426.  * @default 0
  427.  *
  428.  * @param SParam8 Base
  429.  * @desc Formula for base value for s param fdr (Floor Damage Rate).
  430.  * @default 1
  431.  *
  432.  * @param SParam9 Full Name
  433.  * @desc Name that will be shown for this special param.
  434.  * @default Experience rate
  435.  *
  436.  * @param SParam9 Icon
  437.  * @desc An icon for this parameter.
  438.  * @default 0
  439.  *
  440.  * @param SParam9 Base
  441.  * @desc Formula for base value for s param exr (EXperience Rate).
  442.  * @default 1
  443.  *
  444.  * @param Developer HaltJS
  445.  * @desc When true it throws an error if a custom class param/nparam
  446.  * javascript doesn't work.   NO - false     YES - true
  447.  * @default false
  448.  *
  449.  * @help
  450.  * ============================================================================
  451.  * Introduction
  452.  *
  453.  * By default there are some fixed types of params, there are usefull but
  454.  * have specified purposes and limits the way you can use them.
  455.  *
  456.  * With this plugin you can add new params that can be used in your formulas
  457.  * and every use you can imagine.
  458.  *
  459.  * There are 3 new param types:
  460.  *  -New/Normal Params: Level based params like the default ones,
  461.  *   with buff/debuff effects and trait modifiers.
  462.  *   Plus an option that can be used in some enemy levels plugins.
  463.  *
  464.  *  -Plain Params: Non level based params, these work as x/sparams
  465.  *   with trait modifiers.
  466.  *
  467.  *  -Counting Params: similar to nparams, these work as counters like hp, mp
  468.  *   and tp. There are a name for current value and a name for max value.
  469.  *
  470.  * Now there are more customization and control for basic, tp, x and s params.
  471.  * And a new double cap feature.
  472.  *
  473.  * ============================================================================
  474.  * How to use
  475.  * ============================================================================
  476.  *
  477.  * NParams, CParams and PParams are calculated with their respective formulas:
  478.  *
  479.  * NParam = (Base + Plus) * Rate * XRate * Buff + Flat + XFlat
  480.  * CParam = (Base + Plus) * Rate * XRate * Buff + Flat + XFlat
  481.  * PParam = (Base + Plus) * Rate + Flat
  482.  *
  483.  *   -Base is different for n and pparams. For NParams is a level based value.
  484.  *    For PParam is a fixed value used to emulate x/sparams (0 and 1).
  485.  *   -Plus is the sum of all plus traits attached to a battler. In case of
  486.  *    NParam there is an extra added by script calls and item effects.
  487.  *   -Rate is the product of all trait multipliers attached to a battler.
  488.  *   -XRate is the product of all trait x-multipliers attached to a battler.
  489.  *   -Buff is de effect of buff/debuff.
  490.  *   -Flat is the sum of all flat trais attached to a battler. It isn't affected
  491.  *    by any rate.
  492.  *   -XFlat is the sum of all x-flat trais attached to a battler. It isn't affected
  493.  *    by any rate.
  494.  *
  495.  * XRate, XFlat and Buff can make param to pass througth first max cap.
  496.  *
  497.  * To make default params more customizable I've changed a little
  498.  * their formulas:
  499.  *
  500.  * Param  = (Base + Plus) * Rate * XRate * Buff + Flat + XFlat
  501.  * TP     = (Base + Plus) * Rate * XRate + Flat + XFlat
  502.  * XParam = (Base + Plus) * Rate + Flat
  503.  * SParam = (Base + Plus) * Rate + Flat
  504.  *
  505.  * They still work as usual but now you can add traits to have more control.
  506.  *
  507.  * To add traits you can use notetags inside data.
  508.  *
  509.  * Actors, classes and enemies only:
  510.  *
  511.  * <NPARAM: NParam Base Grow HGrow Cap>
  512.  * <CPARAM: CParam Base Grow HGrow Cap>
  513.  *    -Overrides default NParam/CParam for specified actor/class/enemy.
  514.  *     NParam can be referenced by it's name or index.
  515.  *     Base is the initial value in level 1.
  516.  *     Grow is how much is increased per level. If empty it will be fixed.
  517.  *     HGrow is similar to Grow but in an exponential way.
  518.  *     Cap is the level at wich NParam stops growing.
  519.  *     You can use decimal numbers.
  520.  *    
  521.  * <VALID CPARAMS: cparam cparam cparam>
  522.  * <MAIN CPARAMS: cparam cparam cparam>
  523.  *    -Overrides default valid/main CParams for specified actor/class/enemy.
  524.  *     You can place all you'll need in a single line.
  525.  *
  526.  * Weapons, armors and states only:
  527.  *
  528.  * <NPARAM: NParam Value>
  529.  * <CPARAM: CParam Value>
  530.  * <PPARAM: PParam Value>
  531.  *    -Set default N/C/PParam given for specified weapon/armor.
  532.  *     NParam can be referenced by it's name or index.
  533.  *    
  534.  *
  535.  * Actors, classes, enemies, weapons, armors and states:
  536.  *
  537.  * <NDEBUFFRATE: NParam Rate>
  538.  * <CDEBUFFRATE: CParam Rate>
  539.  *    -This is used for nparam/cparam debuff resistance, it's the chance of
  540.  *     succes debuff.
  541.  *     0.5 means 50% debuff succes, 0.2 is 20% and so on.
  542.  *
  543.  *
  544.  * <NPARAMPLUS: NParam Plus>
  545.  * <NPARAMRATE: NParam Rate>
  546.  * <NPARAMXRATE: NParam XRate>
  547.  * <NPARAMFLAT: NParam Flat>
  548.  * <NPARAMXFLAT: NParam Flat>
  549.  *    -There are plus, rate, xrate, flat and xflat modifiers for nparam.
  550.  *
  551.  * <CPARAMPLUS: CParam Plus>
  552.  * <CPARAMRATE: CParam Rate>
  553.  * <CPARAMXRATE: CParam XRate>
  554.  * <CPARAMFLAT: CParam Flat>
  555.  * <CPARAMXFLAT: CParam Flat>
  556.  *    -There are plus, rate, xrate, flat and xflat modifiers for cparam.
  557.  *
  558.  * <PPARAMPLUS: PParam Plus>
  559.  * <PPARAMRATE: PParam Rate>
  560.  * <PPARAMFLAT: PParam Flat>
  561.  *    -There are plus, rate and flat modifiers for pparam.
  562.  *
  563.  * <PARAMPLUS: Param Plus>
  564.  * <PARAMRATE: Param Rate>
  565.  * <PARAMXRATE: Param XRate>
  566.  * <PARAMFLAT: Param Flat>
  567.  * <PARAMXFLAT: Param XFlat>
  568.  * <xPARAMPLUS: XParam Plus>
  569.  * <XPARAMRATE: XParam Rate>
  570.  * <XPARAMFLAT: XParam Flat>
  571.  * <SPARAMPLUS: SParam Plus>
  572.  * <SPARAMRATE: SParam Rate>
  573.  * <SPARAMFLAT: SParam Flat>
  574.  * <TP PLUS: Plus>
  575.  * <TP RATE: Rate>
  576.  * <TP FLAT: Flat>
  577.  * <TP XRATE: XRate>
  578.  * <TP XFLAT: XFlat>
  579.  *    -There are all modifiers for base, tp, x and sparam.
  580.  *     I have included these to give more control.
  581.  *
  582.  *
  583.  * Skills and items only:
  584.  *
  585.  * <NBUFF: NParam turns>
  586.  * <NDEBUFF: NParam turns>
  587.  * <REMOVE NBUFF: NParam>
  588.  * <REMOVE NDEBUFF: NParam>
  589.  * <CBUFF: CParam turns>
  590.  * <CDEBUFF: CParam turns>
  591.  * <REMOVE CBUFF: CParam>
  592.  * <REMOVE CDEBUFF: CParam>
  593.  *    -There are buff/debuff effects to attach to skills and items.
  594.  *
  595.  * <NPARAM GROW: NParam amount>
  596.  *    -Allow to increase/decrease nparam by a specified amount.
  597.  *
  598.  * <PPARAM GROW: PParam amount>
  599.  *    -Allow to increase/decrease pparam by a specified amount.
  600.  *
  601.  * <CPARAM GROW: CParam amount>
  602.  *    -Allow to increase/decrease cparam by a specified amount.
  603.  *
  604.  * <XPARAM GROW: XParam amount>
  605.  *    -Allow to increase/decrease xparam by a specified amount.
  606.  *
  607.  * <SPARAM GROW: SParam amount>
  608.  *    -Allow to increase/decrease sparam by a specified amount.
  609.  *
  610.  * <DAMAGE TYPE: CParam>
  611.  *    -Changes damage type to affect specified cparam instead of hp or mp.
  612.  *     hp/mp damage becomes cparam damage.
  613.  *     hp/mp recover becomes cparam recover.
  614.  *     hp/mp drain becomes cparam drain.
  615.  *
  616.  * <RECOVER CPARAM: CParam amount>
  617.  * <RECOVER CPARAM: CParam RATE amount>
  618.  * <RECOVER CPARAM: CParam amount RATE amount>
  619.  *    -Allow to recover cparam by a specified amount, a specified percent from
  620.  *     max value or both like hp/mp.
  621.  *
  622.  * ============================================================================
  623.  * CParam Commands
  624.  * ============================================================================
  625.  *
  626.  * Some commands have been added to control gain/spend/lose quantities of
  627.  * specified cparams. There are javascript functions similar to hp, mp and tp.
  628.  *
  629.  * gain[cparam](amount)
  630.  *    -Gain (or negative to lose) a specified amount of cparam.
  631.  *     The amount will be used for damage popups.
  632.  *     Substitute [cparam] with name of counter param with first letter in
  633.  *     uppercase.
  634.  *
  635.  * gainSilent[cparam](amount)
  636.  *    -Gain (or negative to lose) a specified amount of cparam without being
  637.  *     noticed in a damage popup.
  638.  *     Substitute [cparam] with name of counter param with first letter in
  639.  *     uppercase.
  640.  *
  641.  * set[cparam](amount)
  642.  *    -Set specified cparam amount to a value.
  643.  *     Substitute [cparam] with name of counter param with first letter in
  644.  *     uppercase.
  645.  *
  646.  * [cparam]Rate()
  647.  *    -Get rate of specified cparam.
  648.  *     Substitute [cparam] with name of counter param in lowercase.
  649.  *
  650.  * ============================================================================
  651.  * More Param Script Commands
  652.  * ============================================================================
  653.  *
  654.  * Some commands have been added to edit values of parameters.
  655.  * Values are divided between base and plus. Base value is the complete value
  656.  * while plus is an additive value.
  657.  * Change base value if you want to change it drastically or plus value if you
  658.  * want to edit the value that is added to the level based one.
  659.  *
  660.  * set[param]Base(amount)
  661.  * set[param]Plus(amount)
  662.  *    -Set the base or plus value of a parameter.
  663.  *     Substitute [param] with name of param with first letter in uppercase.
  664.  *     When editing cparam use the max param name instead of counter.
  665.  *
  666.  *
  667.  * ============================================================================
  668.  * Lunatic Mode
  669.  * ============================================================================
  670.  *
  671.  * Knowing javascript you can redefine specific base value for params, nparams
  672.  * and cparams for actors, classes and enemies through lunatic mode.
  673.  *
  674.  * It also work in notetags:
  675.  *
  676.  * <CUSTOM NPARAM BASE NPARAM>
  677.  * value = 2;
  678.  * value += 25;
  679.  * </CUSTOM NPARAM BASE>
  680.  *
  681.  * <CUSTOM CPARAM BASE CPARAM>
  682.  * value = 2;
  683.  * value += 25;
  684.  * </CUSTOM CPARAM BASE>
  685.  *
  686.  * <CUSTOM PARAM BASE PARAM>
  687.  * value = base;
  688.  * value += 25;
  689.  * </CUSTOM PARAM BASE>
  690.  *
  691.  * <CUSTOM TP BASE>
  692.  * value = 100;
  693.  * value += 25;
  694.  * </CUSTOM TP BASE>
  695.  *
  696.  * Those params defined will use their formula instead of normal base
  697.  * value calculation. You can use javascript between these tags to alter
  698.  * the final result.
  699.  * Base params also allow to use word 'base' inside formula. It takes the
  700.  * value it could have at level 1.
  701.  *
  702.  * value - This is the value you want to alter with your own formula.
  703.  *         It starts at 0.
  704.  *
  705.  * Equipment and states notetags:
  706.  *
  707.  * <CUSTOM NPARAMS>
  708.  * javascript
  709.  * javascript
  710.  * 0 = $gameVariables.value(35)
  711.  * int = $gameSwitches.value(12)? 50 : 1
  712.  * </CUSTOM NPARAMS>
  713.  *
  714.  * <CUSTOM PPARAMS>
  715.  * javascript
  716.  * javascript
  717.  * 0 = $gameVariables.value(35)
  718.  * int = $gameSwitches.value(12)? 50 : 1
  719.  * </CUSTOM PPARAMS>
  720.  *
  721.  * <CUSTOM CPARAMS>
  722.  * javascript
  723.  * javascript
  724.  * 0 = $gameVariables.value(35)
  725.  * mbul = $gameSwitches.value(12)? 50 : 1
  726.  * </CUSTOM CPARAMS>
  727.  *
  728.  * <CUSTOM PARAMS>
  729.  * javascript
  730.  * javascript
  731.  * 0 = $gameVariables.value(35)
  732.  * mhp = $gameSwitches.value(12)? 50 : 1
  733.  * </CUSTOM PARAMS>
  734.  *
  735.  * Add evaluate values for nparams, pparams, cparams and basic params to weapons
  736.  * and armors.
  737.  * First you use the javascript code that can affect all params. Then you
  738.  * Use an identifier that can be a number or param name, an equal and the
  739.  * formula that should be evaluated for this equipment piece.
  740.  *
  741.  * Example:
  742.  * <CUSTOM PARAMS>
  743.  * var bonus = this.level;
  744.  * var restrict = 5;
  745.  * mhp = $gameVariables.value(35) + bonus * 5 - restrict
  746.  * mmp = ($gameSwitches.value(12)? 50 : 1) + bonus / restrict
  747.  * </CUSTOM PARAMS>
  748.  *
  749.  * ============================================================================
  750.  * Parameters
  751.  * ============================================================================
  752.  *
  753.  * You can create up to 100 of each type with indexes from 0 to 99.
  754.  *
  755.  * NParam/PParam/Bparam Name: internal name you give to specified nparam,
  756.  * pparam and basic param. It will be used in formulas and can be used to
  757.  * reference a notetag. Leave empty to skip.
  758.  *
  759.  * - Note: Bparams already exist and this param allow to alias or redefine them.
  760.  *
  761.  * NParam/PParam/XParam/SParam Full Name: the name you give to specified nparam.
  762.  * There are not used here but are usefull for plugins that need this.
  763.  *
  764.  * CParam Name / Full Name Basic: name and full name for the parameter that
  765.  * represents max value. There are not used here but are usefull for plugins
  766.  * that need this.
  767.  *
  768.  * CParam Name / Full Name Counter: name and full name for the parameter that
  769.  * represents current value. There are not used here but are usefull for plugins
  770.  * that need this.
  771.  *
  772.  * CParam Abreviation: a short name for the parameter that represents current
  773.  * value if needed. Left blank to use the counter name. There are not used here
  774.  * but are usefull for plugins that need this.
  775.  *
  776.  * NParam/PParam/CParam/Bparam/XParam/SParam/TP Icon: allows to give icons to
  777.  * params. There are not used here but are usefull for plugins that need this.
  778.  *
  779.  * NParam/PParam Color: a color to represent nparam and pparam for plugins that,
  780.  * need it. It can be a number or a html color.
  781.  *
  782.  * CParam ColorX: colors for cparam gauge. It can be a number or a html color.
  783.  *
  784.  * NParam/CParam Base: the default formula for classes/enemies if they haven't.
  785.  * First number is the value at level 1. Second is the amount gained
  786.  * each level. Third is a level exponential grow and fourth is the level at
  787.  * wich will stop growing.
  788.  *
  789.  * PParam/XParam/SParam/TP Base: is a base value that allow pparams to emulate
  790.  * x/sparams, and give more control for x/sparams. 0 is used for a xparam and 1
  791.  * for a sparam. It works as a formula so you can do it param based.
  792.  *
  793.  * NParam/CParam/BParam Base Eval: allow to use nparams and bparams as formulas
  794.  * like p/x/sparams. If defined this formula will be used instead of default
  795.  * mode given in MV for BParams and the default traditional mode for NParams I
  796.  * made. It works as a formula so you can do it param based.
  797.  * Base params also allow to use word 'base' inside formula. It takes the
  798.  * value it could have at level 1.
  799.  *
  800.  * NParam/CParam/BParam/TP Limits: the min and max value a param can be. It's
  801.  * used now as a formula and needs 3 values.
  802.  * First is min, second is normal max and third is X-max.
  803.  * By default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  804.  *
  805.  * PParam Limits: same as previous but only uses 2 values (min and max).
  806.  * By default (this.isActor())? [0, 999] : [0, 999]
  807.  *
  808.  * NParam/CParam Buff Icons:
  809.  * This is an array of icons separated by spaces. When specified param is
  810.  * affected by a positive buff will be shown. Is starts with first and
  811.  * use next for each buff stack. If you don't want to use it leave Empty.
  812.  *
  813.  * NParam/CParam Debuff Icons:
  814.  * Same as previous but with debuff stack. Empty to don't use.
  815.  *
  816.  * CParam Reset Type:
  817.  * Determines when the count value is reseted.
  818.  *     0 - no reset  - count value will never be reseted after initialize.
  819.  *     1 - on inn    - reseted when using the heal all/ rest comand.
  820.  *     2 - on ko     - reseted when a battler is defeated.
  821.  *     3 - on battle - reseted at start and end of a battle.
  822.  *
  823.  * CParam Reset Value:
  824.  * Determines the count value that a cparam will have when initialized/reseted.
  825.  * It's a rate so you can use 0 to empy, 1 to fill, 0.5 to set halve, etc.
  826.  *
  827.  * Default Valid CParams:
  828.  * Determine what cparam results can be visible in battle by default separated
  829.  * by spaces. Valid cparams are those that are visible througth damage popups.
  830.  * To make all valid by default you can empty it and to make all invalid by
  831.  * default you can place an invalid name.
  832.  *
  833.  * Default Main CParams:
  834.  * Determine what cparam results are important in battle by default separated
  835.  * by spaces. Main cparams damage popups are displayed before hp damage popups
  836.  * while non-main are latest displayed. To make all main by default you can
  837.  * empty it and to make all non-main by default you can place an invalid name.
  838.  * Anyway when an action affect a valid cparam direcly it will be treaten as
  839.  * a main one.
  840.  *
  841.  * To check what valid/main arrays a battler uses it will check if have one for
  842.  * actor/enemy, if not will check in it's class, if none found will use default.
  843.  *
  844.  * Use Damage Icons:
  845.  * There are icons avaiable for params. This option allows tu use them inside
  846.  * damage popups for hp, mp and tp to make them more understandable.
  847.  * CParam damage popups will use icons anyway to avoid the needing of a lot of
  848.  * system damage graphics.
  849.  *
  850.  * Developer HaltJS: This is a development variable usefull to check if there
  851.  * is a wrong javascript nparam or basic param.
  852.  * When true will throw an error when it found a wrong javascript in lunatic
  853.  * mode and tell specified param.
  854.  * When false it will be ignored and game continues.
  855.  *
  856.  * ============================================================================
  857.  * Incompatibilities
  858.  * ============================================================================
  859.  *
  860.  * There's no known incompatible plugins yet.
  861.  *
  862.  * ============================================================================
  863.  * Known isues
  864.  * ============================================================================
  865.  *
  866.  * Not yet.
  867.  *
  868.  * ============================================================================
  869.  * Changelog
  870.  * ============================================================================
  871.  *
  872.  * Version 1.08:
  873.  * - Allow tp.
  874.  * - More CParam controls.
  875.  * - Added CParam damage popups.
  876.  *
  877.  * Version 1.07:
  878.  * - Allow items and skills to alter CParams.
  879.  * - Allow to grow x/sparams.
  880.  * - Allow to set param values.
  881.  * - Evaluable params for states.
  882.  *
  883.  * Version 1.06:
  884.  * - Added new CParams.
  885.  * - Removed obsolete plugin parameters and functions.
  886.  * - Minor extra improvements.
  887.  *
  888.  * Version 1.05:
  889.  * - Evaluable params for equipment.
  890.  * - Set n/pparams for equipment.
  891.  * - Expanded lunatic mode to include enemy classes and actors.
  892.  * - Allow to grow pparams.
  893.  * - Allow default formulas for base params and nparams.
  894.  * - Use of 1.5.0 new plugin parameters.
  895.  *
  896.  * Version 1.04:
  897.  * - Allow ICF-Soft Main Core.
  898.  * - Expanded lunatic mode to include enemies.
  899.  * - More nparam control.
  900.  *
  901.  * Version 1.03:
  902.  * - Added XFlat for the double cap.
  903.  * - Increased n/pparams to 30.
  904.  * - Allow names for x/sparams.
  905.  *
  906.  * Version 1.02:
  907.  * - Allow to aliasing or redefining MV basic params.
  908.  *
  909.  * Version 1.01:
  910.  * - Use of ICF-Soft Main Utility.
  911.  * - Added lunatic mode for custom params and nparams.
  912.  * - Changed how min and max limits work.
  913.  * - Added double cap.
  914.  * - Added more traits.
  915.  * - Use of base params.
  916.  *
  917.  * Version 1.00:
  918.  * - Finished plugin!
  919.  *
  920.  * ============================================================================
  921.  *
  922.  * For commercial and non-commercial games.
  923.  * Credit to ICF-Soft.
  924.  * This entire header must be included with plugin.
  925.  *
  926.  * ============================================================================
  927. */
  928. //=============================================================================
  929.  /*:es
  930.  * @plugindesc v1.08 Este complemento permite añadir nuevos parámetros
  931.  * personalizables y mayor control sobre los parámetros del MV.
  932.  * @author ICF-Soft [http://icfsoft.blogspot.com.es/]
  933.  *
  934.  * @param NParams
  935.  * @desc Modo de edición de NParams.
  936.  * @type struct<NormalParams>[]
  937.  * @default ["{\"Name\":\"\",\"Full Name\":\"\",\"Base\":\"30 15\",\"Base Eval\":\"\",\"Limits\":\"(this.isActor())? [0, 999, 1200] : [0, 999, 1200]\",\"Buff Icons\":\"\",\"Debuff Icons\":\"\"}"]
  938.  *
  939.  * @param PParams
  940.  * @desc Modo de edición de PParams.
  941.  * @type struct<PlainParams>[]
  942.  * @default ["{\"Name\":\"\",\"Full Name\":\"\",\"Base\":\"0\",\"Limits\":\"(this.isActor())? [0, 999] : [0, 999]\"}"]
  943.  *
  944.  * @param CParams
  945.  * @desc Modo de edición de CParams.
  946.  * @type struct<CountingParams>[]
  947.  * @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\":\"\"}"]
  948.  *
  949.  * @param Default Valid CParams
  950.  * @desc Determina qué cparams van a ser visibles durante el combate separados por espacios. Ver ayuda.
  951.  * @default none
  952.  *
  953.  * @param Default Main CParams
  954.  * @desc Determina qué cparams son importantes durante el combate separados por espacios. Ver ayuda.
  955.  * @default none
  956.  *
  957.  * @param Use Damage Icons
  958.  * @desc Usa iconos en los gráficos de daño para hp, mp y tp. En el caso de los cparams los iconos se usan igualmente.
  959.  * @default true
  960.  *
  961.  * @param BParam0 Name
  962.  * @desc Alias para este parámetro. Puedes redefirlo.
  963.  * @default mhp
  964.  *
  965.  * @param BParam0 Icon
  966.  * @desc Un icono para este parámetro.
  967.  * @default 0
  968.  *
  969.  * @param BParam0 Base Eval
  970.  * @desc Una fórmula para usar en lugar del modo predeterminado del MV.
  971.  * En blanco para usar el modo predeterminado.
  972.  * @default
  973.  *
  974.  * @param BParam0 Limits
  975.  * @desc Una fórmula para los valores mínimo y máximos. Ver ayuda.
  976.  * Vida
  977.  * @default (this.isActor())? [1, 9999, 12000] : [1, 999999, 1200000]
  978.  *
  979.  * @param BParam1 Name
  980.  * @desc Alias para este parámetro. Puedes redefirlo.
  981.  * @default mmp
  982.  *
  983.  * @param BParam1 Icon
  984.  * @desc Un icono para este parámetro.
  985.  * @default 0
  986.  *
  987.  * @param BParam1 Base Eval
  988.  * @desc Una fórmula para usar en lugar del modo predeterminado del MV.
  989.  * En blanco para usar el modo predeterminado.
  990.  * @default
  991.  *
  992.  * @param BParam1 Limits
  993.  * @desc Una fórmula para los valores mínimo y máximos. Ver ayuda.
  994.  * Magia
  995.  * @default (this.isActor())? [0, 9999, 12000] : [0, 9999, 12000]
  996.  *
  997.  * @param BParam2 Name
  998.  * @desc Alias para este parámetro. Puedes redefirlo.
  999.  * @default atk
  1000.  *
  1001.  * @param BParam2 Icon
  1002.  * @desc Un icono para este parámetro.
  1003.  * @default 0
  1004.  *
  1005.  * @param BParam2 Base Eval
  1006.  * @desc Una fórmula para usar en lugar del modo predeterminado del MV.
  1007.  * En blanco para usar el modo predeterminado.
  1008.  * @default
  1009.  *
  1010.  * @param BParam2 Limits
  1011.  * @desc Una fórmula para los valores mínimo y máximos. Ver ayuda.
  1012.  * Ataque
  1013.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  1014.  *
  1015.  * @param BParam3 Name
  1016.  * @desc Alias para este parámetro. Puedes redefirlo.
  1017.  * @default def
  1018.  *
  1019.  * @param BParam3 Icon
  1020.  * @desc Un icono para este parámetro.
  1021.  * @default 0
  1022.  *
  1023.  * @param BParam3 Base Eval
  1024.  * @desc Una fórmula para usar en lugar del modo predeterminado del MV.
  1025.  * En blanco para usar el modo predeterminado.
  1026.  * @default
  1027.  *
  1028.  * @param BParam3 Limits
  1029.  * @desc Una fórmula para los valores mínimo y máximos. Ver ayuda.
  1030.  * Defensa
  1031.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  1032.  *
  1033.  * @param BParam4 Name
  1034.  * @desc Alias para este parámetro. Puedes redefirlo.
  1035.  * @default mat
  1036.  *
  1037.  * @param BParam4 Icon
  1038.  * @desc Un icono para este parámetro.
  1039.  * @default 0
  1040.  *
  1041.  * @param BParam4 Base Eval
  1042.  * @desc Una fórmula para usar en lugar del modo predeterminado del MV.
  1043.  * En blanco para usar el modo predeterminado.
  1044.  * @default
  1045.  *
  1046.  * @param BParam4 Limits
  1047.  * @desc Una fórmula para los valores mínimo y máximos. Ver ayuda.
  1048.  * Ataque mágico
  1049.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  1050.  *
  1051.  * @param BParam5 Name
  1052.  * @desc Alias para este parámetro. Puedes redefirlo.
  1053.  * @default mdf
  1054.  *
  1055.  * @param BParam5 Icon
  1056.  * @desc Un icono para este parámetro.
  1057.  * @default 0
  1058.  *
  1059.  * @param BParam5 Base Eval
  1060.  * @desc Una fórmula para usar en lugar del modo predeterminado del MV.
  1061.  * En blanco para usar el modo predeterminado.
  1062.  * @default
  1063.  *
  1064.  * @param BParam5 Limits
  1065.  * @desc Una fórmula para los valores mínimo y máximos. Ver ayuda.
  1066.  * Defensa mágica
  1067.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  1068.  *
  1069.  * @param BParam6 Name
  1070.  * @desc Alias para este parámetro. Puedes redefirlo.
  1071.  * @default agi
  1072.  *
  1073.  * @param BParam6 Icon
  1074.  * @desc Un icono para este parámetro.
  1075.  * @default 0
  1076.  *
  1077.  * @param BParam6 Base Eval
  1078.  * @desc Una fórmula para usar en lugar del modo predeterminado del MV.
  1079.  * En blanco para usar el modo predeterminado.
  1080.  * @default
  1081.  *
  1082.  * @param BParam6 Limits
  1083.  * @desc Una fórmula para los valores mínimo y máximos. Ver ayuda.
  1084.  * Agilidad
  1085.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  1086.  *
  1087.  * @param BParam7 Name
  1088.  * @desc Alias para este parámetro. Puedes redefirlo.
  1089.  * @default luk
  1090.  *
  1091.  * @param BParam7 Icon
  1092.  * @desc Un icono para este parámetro.
  1093.  * @default 0
  1094.  *
  1095.  * @param BParam7 Base Eval
  1096.  * @desc Una fórmula para usar en lugar del modo predeterminado del MV.
  1097.  * En blanco para usar el modo predeterminado.
  1098.  * @default
  1099.  *
  1100.  * @param BParam7 Limits
  1101.  * @desc Una fórmula para los valores mínimo y máximos. Ver ayuda.
  1102.  * Suerte
  1103.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  1104.  *
  1105.  * @param TP Base
  1106.  * @desc Fórmula para el valor básico del tp.
  1107.  * @default 100
  1108.  *
  1109.  * @param TP Limits
  1110.  * @desc Una fórmula para los valores mínimo y máximos. Ver ayuda.
  1111.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  1112.  *
  1113.  * @param TP Icon
  1114.  * @desc Un icono para TP.
  1115.  * @default 0
  1116.  *
  1117.  * @param XParam0 Full Name
  1118.  * @desc Nombre mostrado para este parámetro extra.
  1119.  * @default Puntería
  1120.  *
  1121.  * @param XParam0 Icon
  1122.  * @desc Un icono para este parámetro.
  1123.  * @default 0
  1124.  *
  1125.  * @param XParam0 Base
  1126.  * @desc Fórmula para el parámetro-x hit (Puntería).
  1127.  * @default 0
  1128.  *
  1129.  * @param XParam1 Full Name
  1130.  * @desc Nombre mostrado para este parámetro extra.
  1131.  * @default Evasión
  1132.  *
  1133.  * @param XParam1 Icon
  1134.  * @desc Un icono para este parámetro.
  1135.  * @default 0
  1136.  *
  1137.  * @param XParam1 Base
  1138.  * @desc Fórmula para el parámetro-x eva (EVAsión).
  1139.  * @default 0
  1140.  *
  1141.  * @param XParam2 Full Name
  1142.  * @desc Nombre mostrado para este parámetro extra.
  1143.  * @default Probabilidad de crítico
  1144.  *
  1145.  * @param XParam2 Icon
  1146.  * @desc Un icono para este parámetro.
  1147.  * @default 0
  1148.  *
  1149.  * @param XParam2 Base
  1150.  * @desc Fórmula para el parámetro-x cri (probabilidad de CRÍtico).
  1151.  * @default 0
  1152.  *
  1153.  * @param XParam3 Full Name
  1154.  * @desc Nombre mostrado para este parámetro extra.
  1155.  * @default Evadir crítico
  1156.  *
  1157.  * @param XParam3 Icon
  1158.  * @desc Un icono para este parámetro.
  1159.  * @default 0
  1160.  *
  1161.  * @param XParam3 Base
  1162.  * @desc Fórmula para el parámetro-x cev (evadir Crítico).
  1163.  * @default 0
  1164.  *
  1165.  * @param XParam4 Full Name
  1166.  * @desc Nombre mostrado para este parámetro extra.
  1167.  * @default Evasión mágica
  1168.  *
  1169.  * @param XParam4 Icon
  1170.  * @desc Un icono para este parámetro.
  1171.  * @default 0
  1172.  *
  1173.  * @param XParam4 Base
  1174.  * @desc Fórmula para el parámetro-x param mev (evasión Mágica).
  1175.  * @default 0
  1176.  *
  1177.  * @param XParam5 Full Name
  1178.  * @desc Nombre mostrado para este parámetro extra.
  1179.  * @default Reflejo mágico
  1180.  *
  1181.  * @param XParam5 Icon
  1182.  * @desc Un icono para este parámetro.
  1183.  * @default 0
  1184.  *
  1185.  * @param XParam5 Base
  1186.  * @desc Fórmula para el parámetro-x mrf (reflejar Magia).
  1187.  * @default 0
  1188.  *
  1189.  * @param XParam6 Full Name
  1190.  * @desc Nombre mostrado para este parámetro extra.
  1191.  * @default Contraataque
  1192.  *
  1193.  * @param XParam6 Icon
  1194.  * @desc Un icono para este parámetro.
  1195.  * @default 0
  1196.  *
  1197.  * @param XParam6 Base
  1198.  * @desc Fórmula para el parámetro-x cnt (CoNTraataque).
  1199.  * @default 0
  1200.  *
  1201.  * @param XParam7 Full Name
  1202.  * @desc Nombre mostrado para este parámetro extra.
  1203.  * @default Regenerar vida
  1204.  *
  1205.  * @param XParam7 Icon
  1206.  * @desc Un icono para este parámetro.
  1207.  * @default 0
  1208.  *
  1209.  * @param XParam7 Base
  1210.  * @desc Fórmula para el parámetro-x hrg (regeneración de vida).
  1211.  * @default 0
  1212.  *
  1213.  * @param XParam8 Full Name
  1214.  * @desc Nombre mostrado para este parámetro extra.
  1215.  * @default Regenerar magia
  1216.  *
  1217.  * @param XParam8 Icon
  1218.  * @desc Un icono para este parámetro.
  1219.  * @default 0
  1220.  *
  1221.  * @param XParam8 Base
  1222.  * @desc Fórmula para el parámetro-x mrg (regeneración de magia).
  1223.  * @default 0
  1224.  *
  1225.  * @param XParam9 Full Name
  1226.  * @desc Nombre mostrado para este parámetro extra.
  1227.  * @default Regenerar turbo
  1228.  *
  1229.  * @param XParam9 Icon
  1230.  * @desc Un icono para este parámetro.
  1231.  * @default 0
  1232.  *
  1233.  * @param XParam9 Base
  1234.  * @desc Fórmula para el parámetro-x trg (regeneración de tp).
  1235.  * @default 0
  1236.  *
  1237.  * @param SParam0 Full Name
  1238.  * @desc Nombre mostrado para este parámetro especial.
  1239.  * @default Ser el objetivo
  1240.  *
  1241.  * @param SParam0 Icon
  1242.  * @desc Un icono para este parámetro.
  1243.  * @default 0
  1244.  *
  1245.  * @param SParam0 Base
  1246.  * @desc Fórmula para el parámetro-s tgr (ser el objetivo).
  1247.  * @default 1
  1248.  *
  1249.  * @param SParam1 Full Name
  1250.  * @desc Nombre mostrado para este parámetro especial.
  1251.  * @default Efecto defensivo
  1252.  *
  1253.  * @param SParam1 Icon
  1254.  * @desc Un icono para este parámetro.
  1255.  * @default 0
  1256.  *
  1257.  * @param SParam1 Base
  1258.  * @desc Fórmula para el parámetro-s grd (efecto de defensa).
  1259.  * @default 1
  1260.  *
  1261.  * @param SParam2 Full Name
  1262.  * @desc Nombre mostrado para este parámetro especial.
  1263.  * @default Efecto de recuperación
  1264.  *
  1265.  * @param SParam2 Icon
  1266.  * @desc Un icono para este parámetro.
  1267.  * @default 0
  1268.  *
  1269.  * @param SParam2 Base
  1270.  * @desc Fórmula para el parámetro-s rec (efecto de RECuperación).
  1271.  * @default 1
  1272.  *
  1273.  * @param SParam3 Full Name
  1274.  * @desc Nombre mostrado para este parámetro especial.
  1275.  * @default Farmacología
  1276.  *
  1277.  * @param SParam3 Icon
  1278.  * @desc Un icono para este parámetro.
  1279.  * @default 0
  1280.  *
  1281.  * @param SParam3 Base
  1282.  * @desc Fórmula para el parámetro-s pha (PHArmacología).
  1283.  * @default 1
  1284.  *
  1285.  * @param SParam4 Full Name
  1286.  * @desc Nombre mostrado para este parámetro especial.
  1287.  * @default Coste de mp
  1288.  *
  1289.  * @param SParam4 Icon
  1290.  * @desc Un icono para este parámetro.
  1291.  * @default 0
  1292.  *
  1293.  * @param SParam4 Base
  1294.  * @desc Fórmula para el parámetro-s mcr (coste de Mp).
  1295.  * @default 1
  1296.  *
  1297.  * @param SParam5 Full Name
  1298.  * @desc Nombre mostrado para este parámetro especial.
  1299.  * @default Coste de tp
  1300.  *
  1301.  * @param SParam5 Icon
  1302.  * @desc Un icono para este parámetro.
  1303.  * @default 0
  1304.  *
  1305.  * @param SParam5 Base
  1306.  * @desc Fórmula para el parámetro-s tcr (coste de Tp).
  1307.  * @default 1
  1308.  *
  1309.  * @param SParam6 Full Name
  1310.  * @desc Nombre mostrado para este parámetro especial.
  1311.  * @default Daño físico recibido
  1312.  *
  1313.  * @param SParam6 Icon
  1314.  * @desc Un icono para este parámetro.
  1315.  * @default 0
  1316.  *
  1317.  * @param SParam6 Base
  1318.  * @desc Fórmula para el parámetro-s pdr (daño físico recibido).
  1319.  * @default 1
  1320.  *
  1321.  * @param SParam7 Full Name
  1322.  * @desc Nombre mostrado para este parámetro especial.
  1323.  * @default Daño mágico recibido
  1324.  *
  1325.  * @param SParam7 Icon
  1326.  * @desc Un icono para este parámetro.
  1327.  * @default 0
  1328.  *
  1329.  * @param SParam7 Base
  1330.  * @desc Fórmula para el parámetro-s mdr (daño Mágico recibido).
  1331.  * @default 1
  1332.  *
  1333.  * @param SParam8 Full Name
  1334.  * @desc Nombre mostrado para este parámetro especial.
  1335.  * @default Daño por el terreno
  1336.  *
  1337.  * @param SParam8 Icon
  1338.  * @desc Un icono para este parámetro.
  1339.  * @default 0
  1340.  *
  1341.  * @param SParam8 Base
  1342.  * @desc Fórmula para el parámetro-s fdr (daño por el suelo).
  1343.  * @default 1
  1344.  *
  1345.  * @param SParam9 Full Name
  1346.  * @desc Nombre mostrado para este parámetro especial.
  1347.  * @default Experiencia obtenible
  1348.  *
  1349.  * @param SParam9 Icon
  1350.  * @desc Un icono para este parámetro.
  1351.  * @default 0
  1352.  *
  1353.  * @param SParam9 Base
  1354.  * @desc Fórmula para el parámetro-s exr (EXperiencia obtenida).
  1355.  * @default 1
  1356.  *
  1357.  * @param Developer HaltJS
  1358.  * @desc Si está activado salta cuando una función personalizada
  1359.  * da error.   No - false   Si - true
  1360.  * @default false
  1361.  *
  1362.  * @help
  1363.  * ============================================================================
  1364.  * Introducción
  1365.  * ============================================================================
  1366.  *
  1367.  * El RPG Maker MV viene con unos tipos fijos de parámetros, son útiles pero
  1368.  * tienen sus propósitos específicos y limita el modo en que los puedes usar.
  1369.  *
  1370.  * Coneste complemento puedes añadir nuevos para usarlos en tus fórmulas
  1371.  * y cualquier uso que puedas imaginar.
  1372.  *
  1373.  * Existen 3 nuevos tipos de parámetros:
  1374.  *  -Nuevo/Normal Params: Basados en el nivel igual que los que vienen por
  1375.  *   defecto, con los efectos de fortalecer/debilitar y modificadores.
  1376.  *   Además de una opción que puede servir en distintos complementos
  1377.  *   de niveles de enemigos.
  1378.  *
  1379.  *  -Planos Params: No basados en nivel, funcionan como los x/sparams
  1380.  *   con modificadores.
  1381.  *
  1382.  *  -Contador Params: similares a los nparams, funcionan como contadores como
  1383.  *   son hp, mp y tp. Usan nombre para valor actual y valor máximo.
  1384.  *
  1385.  * Además se ha añadido personalización para los x/sparams que permite mayor
  1386.  * control.
  1387.  * Y una nueva característica que permite 2 topes para los params y nparams.
  1388.  *
  1389.  * ============================================================================
  1390.  * Uso
  1391.  * ============================================================================
  1392.  *
  1393.  * Los NParams, CParams y PParams son calculados mediante sus respectivas
  1394.  * fórmulas:
  1395.  *
  1396.  * NParam = (Base + Plus) * Rate * XRate * Buff + Flat + XFlat
  1397.  * CParam = (Base + Plus) * Rate * XRate * Buff + Flat + XFlat
  1398.  * PParam = (Base + Plus) * Rate + Flat
  1399.  *
  1400.  *   -Base es distinto entre ambas. Para los NParams está basado en el nivel.
  1401.  *    Para los PParam el valor es fijo emulando los x/sparams (0 y 1).
  1402.  *   -Plus es la suma de todas las características plus que atañen al personaje.
  1403.  *    En el caso de NParam existe un extra añadido mediante llamadas a script
  1404.  *    y efectos de los objetos.
  1405.  *   -Rate es el producto de todos los multiplicadores que atañen al personaje.
  1406.  *   -XRate es el producto de todos los multiplicadores especiales que atañen
  1407.  *    al personaje.
  1408.  *   -Buff es el efecto de fortalecer/debilitar.
  1409.  *   -Flat es la suma de todas las características flat que atañen al personaje.
  1410.  *    No se ve afectado por los multiplicadores.
  1411.  *   -XFlat es la suma de todas las características flat especiales que atañen
  1412.  *    al personaje. No se ve afectado por los multiplicadores.
  1413.  *
  1414.  *
  1415.  * XRate, XFlat y Buff permiten ir más allá del primer límite.
  1416.  *
  1417.  * Para hacer los parámetros predeterminados del MV más personalizables he
  1418.  * cambiado un poco sus fórmulas:
  1419.  *
  1420.  * Param  = (Base + Plus) * Rate * XRate * Buff + Flat + XFlat
  1421.  * TP     = (Base + Plus) * Rate * XRate + Flat + XFlat
  1422.  * XParam = (Base + Plus) * Rate + Flat
  1423.  * SParam = (Base + Plus) * Rate + Flat
  1424.  *
  1425.  * Siguen funcionando como de costumbre pero ahora puedes añadir más
  1426.  * características para tener un mayor control.
  1427.  *
  1428.  * Para añadir características basta con añadir etiquetas en los cuadros de notas
  1429.  * respectivos.
  1430.  *
  1431.  * Héroes, clases y enemigos solo:
  1432.  *
  1433.  * <NPARAM: NParam Base Grow HGrow Cap>
  1434.  * <CPARAM: CParam Base Grow HGrow Cap>
  1435.  *    -Cambia la base predeterminada del NParam por una específica.
  1436.  *     NParam se puede referenciar por su nombre o índice.
  1437.  *     Base es el valor inicial en el nivel 1.
  1438.  *     Grow es cuanto se incrementa por nivel. Si está vacío cuenta como 0.
  1439.  *     HGrow es similar a Grow pero de crecimiento exponencial.
  1440.  *     Cap es el nivel en el cual el NParam deja de subir.
  1441.  *     Puedes usar números decimales.
  1442.  *    
  1443.  * <VALID CPARAMS: cparam cparam cparam>
  1444.  * <MAIN CPARAMS: cparam cparam cparam>
  1445.  *    -Cambia los CParams válidos/principales para el héroe/enemigo/clase
  1446.  *     específicos. Puedes poner todos los que hagan falta en una línea.
  1447.  *
  1448.  *
  1449.  * Armas, armaduras y estados alterados solo:
  1450.  *
  1451.  * <NPARAM: NParam Value>
  1452.  * <CPARAM: CParam Value>
  1453.  * <PPARAM: PParam Value>
  1454.  *    -Fija un valor determinado de N/P/CParam para el arma o armadura.
  1455.  *     Se puede hacer referncia por el nombre o índice.
  1456.  *    
  1457.  *
  1458.  * Héroes, clases, enemigos, armas, armaduras y estados alterados:
  1459.  *
  1460.  * <NDEBUFFRATE: NParam Rate>
  1461.  * <CDEBUFFRATE: CParam Rate>
  1462.  *    -Se usa para la resistencia al debilitamiento en dicho nparam
  1463.  *     o cparam, básicamente es la probabilidad de acierto.
  1464.  *     0.5 significa 50% acierto, 0.2 es 20%, etc.
  1465.  *
  1466.  *
  1467.  * <NPARAMPLUS: NParam Plus>
  1468.  * <NPARAMRATE: NParam Rate>
  1469.  * <NPARAMXRATE: NParam XRate>
  1470.  * <NPARAMFLAT: NParam Flat>
  1471.  * <NPARAMXFLAT: NParam XFlat>
  1472.  *    -Modificadores para el nparam.
  1473.  *
  1474.  * <PPARAMPLUS: PParam Plus>
  1475.  * <PPARAMRATE: PParam Rate>
  1476.  * <PPARAMFLAT: PParam Flat>
  1477.  *    -Modificadores para el pparam.
  1478.  *
  1479.  * <CPARAMPLUS: CParam Plus>
  1480.  * <CPARAMRATE: CParam Rate>
  1481.  * <CPARAMXRATE: CParam XRate>
  1482.  * <CPARAMFLAT: CParam Flat>
  1483.  * <CPARAMXFLAT: CParam Flat>
  1484.  *    -Modificadores para el cparam.
  1485.  *
  1486.  * <PARAMPLUS: Param Plus>
  1487.  * <PARAMRATE: Param Rate>
  1488.  * <PARAMXRATE: Param XRate>
  1489.  * <PARAMFLAT: Param Flat>
  1490.  * <PARAMXFLAT: Param XFlat>
  1491.  * <xPARAMPLUS: XParam Plus>
  1492.  * <XPARAMRATE: XParam Rate>
  1493.  * <XPARAMFLAT: XParam Flat>
  1494.  * <SPARAMPLUS: SParam Plus>
  1495.  * <SPARAMRATE: SParam Rate>
  1496.  * <SPARAMFLAT: SParam Flat>
  1497.  * <TP PLUS: Plus>
  1498.  * <TP RATE: Rate>
  1499.  * <TP FLAT: Flat>
  1500.  * <TP XRATE: XRate>
  1501.  * <TP XFLAT: XFlat>
  1502.  *    -Modificadores para los parámetros básicos, x, y y tp.
  1503.  *     Los he incluido para dar más control.
  1504.  *
  1505.  *
  1506.  * Habilidades y objetos solo:
  1507.  *
  1508.  * <NBUFF: NParam turnos>
  1509.  * <NDEBUFF: NParam turnos>
  1510.  * <REMOVE NBUFF: NParam>
  1511.  * <REMOVE NDEBUFF: NParam>
  1512.  * <CBUFF: CParam turnos>
  1513.  * <CDEBUFF: CParam turnos>
  1514.  * <REMOVE CBUFF: CParam>
  1515.  * <REMOVE CDEBUFF: CParam>
  1516.  *    -Efectos de añadir y quitar fortalecimiento/debilitamiento.
  1517.  *
  1518.  * <NPARAM GROW: NParam amount>
  1519.  *    -Permite incrementar/decrementar el nparam una cantidad específica.
  1520.  *
  1521.  * <PPARAM GROW: PParam amount>
  1522.  *    -Permite incrementar/decrementar el pparam una cantidad específica.
  1523.  *
  1524.  * <CPARAM GROW: CParam amount>
  1525.  *    -Permite incrementar/decrementar el cparam una cantidad específica.
  1526.  *
  1527.  * <XPARAM GROW: XParam amount>
  1528.  *    -Permite incrementar/decrementar el xparam una cantidad específica.
  1529.  *
  1530.  * <SPARAM GROW: SParam amount>
  1531.  *    -Permite incrementar/decrementar el sparam una cantidad específica.
  1532.  *
  1533.  * <DAMAGE TYPE: CParam>
  1534.  *    -Cambia el tipo de daño de hp o mp para afectar un cparam en su lugar.
  1535.  *     Daño de hp/mp pasa a ser daño de cparam.
  1536.  *     Recuperación de hp/mp pasa a ser recuperación de cparam.
  1537.  *     Drenaje de hp/mp pasa a ser drenaje de cparam.
  1538.  *
  1539.  * <RECOVER CPARAM: CParam amount>
  1540.  * <RECOVER CPARAM: CParam RATE amount>
  1541.  * <RECOVER CPARAM: CParam amount RATE amount>
  1542.  *    -Permite recuperar cparam una cantidad específica, un porcentaje
  1543.  *     específico o ambas.
  1544.  *
  1545.  * ============================================================================
  1546.  * Comandos de CParam
  1547.  * ============================================================================
  1548.  *
  1549.  * Se han añadido controles para el uso/gasto/pérdida de cantidades de un
  1550.  * cparam específico. Se trata de funciones en javascript similares a las de
  1551.  * hp, mp y tp.
  1552.  *
  1553.  * gain[cparam](amount)
  1554.  *    -Incrementar (o gastar si es negativo) una cantidad específica del cparam.
  1555.  *     Sustituir [cparam] con el nombre del contador con la primera letra en
  1556.  *     Sustituir [cparam] con el nombre del contador con la primera letra en
  1557.  *     mayúsculas.
  1558.  *
  1559.  * gainSilent[cparam](amount)
  1560.  *    -Incrementar (o gastar si es negativo) una cantidad específica del cparam
  1561.  *     sin que sea visible en batalla.
  1562.  *     Sustituir [cparam] con el nombre del contador con la primera letra en
  1563.  *     mayúsculas.
  1564.  *
  1565.  * set[cparam](amount)
  1566.  *    -Fija el valor de un cparam.
  1567.  *     Sustituir [cparam] con el nombre del contador con la primera letra en
  1568.  *     mayúsculas.
  1569.  *
  1570.  * [cparam]Rate()
  1571.  *    -Obtener el ratio (desde 0 para 0% hasta 1 para 100%) del cparam.
  1572.  *     Sustituir [cparam] con el nombre del contador en minúsculas.
  1573.  *
  1574.  * ============================================================================
  1575.  * Comandos de parámetros
  1576.  * ============================================================================
  1577.  *
  1578.  * Se han añadido también comandos javascript para editar los parámetros de un
  1579.  * modo directo. Se divide entre básico y plus. El valor básico es el que el
  1580.  * personaje tiene actualmente mientras que el plus es un valor añadido.
  1581.  * Cambiando el valor básico el resultado será drástico mientras que cambiando
  1582.  * el plus cambias el añadido sin afectar al que viene dado por el nivel.
  1583.  *
  1584.  * set[param]Base(amount)
  1585.  * set[param]Plus(amount)
  1586.  *    -Fija el valor básico o plus de un parámetro.
  1587.  *     Sustituir [param] con el nombre del parámetro con la primera letra en
  1588.  *     mayúsculas.
  1589.  *     Para editar cparam utiliza el nombre del valor máximo en lugar del
  1590.  *     contador.
  1591.  *
  1592.  *
  1593.  * ============================================================================
  1594.  * Lunatic Mode
  1595.  * ============================================================================
  1596.  *
  1597.  * Para aquellos que quieren utilizar un modo personalizado para calcular
  1598.  * los parámetros he añadido el modo lunático.
  1599.  * El modo lunático permite utilizar código javascript diréctamente.
  1600.  *
  1601.  * Usa las siguientes etiquetas en las clases y enemigos:
  1602.  *
  1603.  * <CUSTOM NPARAM BASE NPARAM>
  1604.  * value = 2;
  1605.  * value += 25;
  1606.  * </CUSTOM NPARAM BASE>
  1607.  *
  1608.  * <CUSTOM CPARAM BASE CPARAM>
  1609.  * value = 2;
  1610.  * value += 25;
  1611.  * </CUSTOM CPARAM BASE>
  1612.  *
  1613.  * <CUSTOM PARAM BASE PARAM>
  1614.  * value = base;
  1615.  * value += 25;
  1616.  * </CUSTOM PARAM BASE>
  1617.  *
  1618.  * <CUSTOM TP BASE>
  1619.  * value = 100;
  1620.  * value += 25;
  1621.  * </CUSTOM TP BASE>
  1622.  *
  1623.  * Dicho código se ejecutará en lugar de la fórmula predeterminada.
  1624.  * Los parámetros básicos además permiten usar la variable 'base' dentro de su
  1625.  * fórmula. Equivale al valor que tendría en el nivel 1.
  1626.  *
  1627.  * value - Esta es la variable donde se almacena el resultado.
  1628.  *         Si no se especifica será 0.
  1629.  *
  1630.  * Etiquetas para equipamiento y estados alterados:
  1631.  *
  1632.  * <CUSTOM NPARAMS>
  1633.  * javascript
  1634.  * javascript
  1635.  * 0 = $gameVariables.value(35)
  1636.  * int = $gameSwitches.value(12)? 50 : 1
  1637.  * </CUSTOM NPARAMS>
  1638.  *
  1639.  * <CUSTOM PPARAMS>
  1640.  * javascript
  1641.  * javascript
  1642.  * 0 = $gameVariables.value(35)
  1643.  * int = $gameSwitches.value(12)? 50 : 1
  1644.  * </CUSTOM PPARAMS>
  1645.  *
  1646.  * <CUSTOM CPARAMS>
  1647.  * javascript
  1648.  * javascript
  1649.  * 0 = $gameVariables.value(35)
  1650.  * mbul = $gameSwitches.value(12)? 50 : 1
  1651.  * </CUSTOM CPARAMS>
  1652.  *
  1653.  * <CUSTOM PARAMS>
  1654.  * javascript
  1655.  * javascript
  1656.  * 0 = $gameVariables.value(35)
  1657.  * mhp = $gameSwitches.value(12)? 50 : 1
  1658.  * </CUSTOM PARAMS>
  1659.  *
  1660.  * Añade valores evaluables para nparams, pparams, cparams y params básicos
  1661.  * a armas, armaduras y estados.
  1662.  * Primero se añade código javascript que afecta todos los parámetros de su
  1663.  * tipo. Después se utiliza un identificador que puede ser un número o el
  1664.  * nombre del parámetro, un igual y la fórmula que se va a evaluar.
  1665.  *
  1666.  * Ejemplo:
  1667.  * <CUSTOM PARAMS>
  1668.  * var bonus = this.level;
  1669.  * var restrict = 5;
  1670.  * mhp = $gameVariables.value(35) + bonus * 5 - restrict
  1671.  * mmp = ($gameSwitches.value(12)? 50 : 1) + bonus / restrict
  1672.  * </CUSTOM PARAMS>
  1673.  *
  1674.  * ============================================================================
  1675.  * Parámetros
  1676.  * ============================================================================
  1677.  *
  1678.  * Puedes crear hasta 100 parámetros de cada tipo con índices del 0 al 99.
  1679.  *
  1680.  * NParam/PParam/Bparam Name: el nombre interno que le vas a dar al parámetro.
  1681.  * Se utilizará en fórmulas y se puede usar como referencia en las etiquetas en
  1682.  * las notas. Dejar vacío si no se quiere usar.
  1683.  *
  1684.  * - Nota: Los bparams existen de por sí pero se pueden redefinir.
  1685.  *
  1686.  * NParam/PParam/XParam/SParam Full Name: el nombre que quieres dar al nparam.
  1687.  * Por el momento no se usa aquí pero sirve para los plugins que usen este.
  1688.  *
  1689.  * CParam Name / Full Name Basic: nombre y nombre a mostrar para el parámetro
  1690.  * que representa el valor máximo. Por el momento no se usa aquí pero sirve para
  1691.  * los plugins que usen este.
  1692.  *
  1693.  * CParam Name / Full Name Counter: nombre y nombre a mostrar para el parámetro
  1694.  * que representa el valor actual. Por el momento no se usa aquí pero sirve para
  1695.  * los plugins que usen este.
  1696.  *
  1697.  * CParam Abreviation: abreviatura a mostrar para el parámetro que representa el
  1698.  * valor actual. Si se deja en blanco se usará el del contador. Por el momento no
  1699.  * se usa aquí pero sirve para los plugins que usen este.
  1700.  *
  1701.  * NParam/PParam/CParam/Bparam/XParam/SParam/TP Icon: permite añadir iconos a
  1702.  * los parámetros. Por el momento no se usa aquí pero sirve para los plugins que
  1703.  * lo necesiten.
  1704.  *
  1705.  * NParam/PParam Color: un color para representar nparam y pparam para plugins
  1706.  * que lo necesiten. Puede ser un número o un color html.
  1707.  *
  1708.  * CParam ColorX: colores para la barra de medición del cparam. Puede ser un
  1709.  * número o un color html.
  1710.  *
  1711.  * NParam/CParam Base: la fórmula predeterminada para clases y enemigos que no
  1712.  * tengan. El primer númber es el valor en el nivel 1. El segundo es cuanto sube
  1713.  * cada nivel. El tercero es de crecimiento exponencial y el cuarto es el nivel
  1714.  * en el cual va a dejar de subir.
  1715.  *
  1716.  * PParam/XParam/SParam/TP Base: es un valor básico con el que los pparam pueden
  1717.  * emular los x/sparams, y dar más control a los x/sparams mediante fórmulas.
  1718.  * 0 suele ser el valor de un xparam y 1 el de un sparam.
  1719.  *
  1720.  * NParam/CParam/BParam Base Eval: permite el uso de formulas para los nparams y
  1721.  * bparams, al igual que los p/x/sparams. Si se define una fórmula se utilizará
  1722.  * en lugar del modo predeterminado del MV para los BParams o del modo
  1723.  * tradicional de los NParams.
  1724.  * Los parámetros básicos además permiten usar la variable 'base' dentro de su
  1725.  * fórmula. Equivale al valor que tendría en el nivel 1.
  1726.  *
  1727.  * NParam/CParam/BParam/TP Limits: los valores mínimo y máximo que puede tener
  1728.  * el nparam, cparam, param o tp. Ahora se utiliza como fórmula que da 3 valores.
  1729.  * El primero es el mínimo, el segundo es máximo normal y el tercero es
  1730.  * el extra máximo.
  1731.  * (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  1732.  *
  1733.  * PParam Limits: igual que el anterior pero solo usa 2 valores (mínimo y máximo).
  1734.  * (this.isActor())? [0, 999] : [0, 999]
  1735.  *
  1736.  * NParam/CParam Buff Icons: conjunto de iconos separados por espacios.
  1737.  * Cuando dicho parámetro se vea afectado por un fortalecimiento se mostrará
  1738.  * el icono correspondiente al fortalecimiento acumulado.
  1739.  * Si se deja en blanco no se usará.
  1740.  *
  1741.  * NParam/CParam Debuff Icons: igual que el anterior pero para los
  1742.  * debilitamientos del parámetro.
  1743.  *
  1744.  * CParam Reset Type:
  1745.  * Determina cuando se reinicia al valor básico.
  1746.  *     0 - el valor no se reinicia.
  1747.  *     1 - se reinicia con el comando de curar a todos.
  1748.  *     2 - se reinicia al ser derrotado.
  1749.  *     3 - se reinicia al principio y final de batalla.
  1750.  *
  1751.  * CParam Reset Value:
  1752.  * Valor básico del contador cuando se reinicia. Puedes usar 0 para vaciar,
  1753.  * 1 para llenar el contador, 0.5 para dejarlo por la mitad, etc.
  1754.  *
  1755.  * Default Valid CParams:
  1756.  * Determina qué cparams van a ser visibles durante el combate separados por
  1757.  * espacios. Los parámetros válidos son aquellos que se verán cuando un
  1758.  * personaje recibe daño o recupera una cantidad. Para que todos sean válidos
  1759.  * por defecto puedes dejarlo vacío y para que todos sean inválidos puedes poner
  1760.  * un nombre que no sea válido.
  1761.  *
  1762.  * Default Main CParams:
  1763.  * Determina qué cparams son importantes durante el combate separados por
  1764.  * espacios. Los parámetros importantes son aquellos que se muesta su efecto
  1765.  * antes que el de hp mientras que los no principales son los últimos en ser
  1766.  * mostrados. Para que todos sean válidos por defecto puedes dejarlo vacío y
  1767.  * para que todos sean inválidos puedes poner un nombre que no sea válido.
  1768.  * De todos modos cuando una acción afecta a un cparam válido directamente éste
  1769.  * será tratado como principal.
  1770.  *
  1771.  * El modo de comprobación de cparams válid/principales de un personaje o enemigo
  1772.  * es primero el de héroe/enemigo en cuestión, si no la clase y si tampoco hay
  1773.  * se tendrá en cuenta el predeterminado.
  1774.  *
  1775.  * Use Damage Icons:
  1776.  * There are icons avaiable for params. This option allows tu use them inside
  1777.  * damage popups for hp, mp and tp to make them more understandable.
  1778.  * CParam damage popups will use icons anyway to avoid the needing of a lot of
  1779.  * system damage graphics.
  1780.  *
  1781.  * @desc Usa iconos en los gráficos de daño para hp, mp y tp. En el caso de los cparams los iconos se usan igualmente.
  1782.  *
  1783.  *
  1784.  * Developer HaltJS: Esta es una variable de uso durante el desarrollo del juego
  1785.  * útil cuando quieres comprobar si hay alguna función personalizada incorrecta.
  1786.  * Cuando está activado al encontrar un error el juego se para y muestra
  1787.  * en qué parámetro se encuentra el error.
  1788.  * Cuando está desactivado ignora el error y el juego continúa.
  1789.  *
  1790.  * ============================================================================
  1791.  * Incompatibilidades
  1792.  * ============================================================================
  1793.  *
  1794.  * No se conocen complementos que sean incompatibles hasta la fecha.
  1795.  *
  1796.  * ============================================================================
  1797.  * Problemas conocidos
  1798.  * ============================================================================
  1799.  *
  1800.  * Por el momento ninguno.
  1801.  *
  1802.  * ============================================================================
  1803.  * Historial de versiones
  1804.  * ============================================================================
  1805.  *
  1806.  * Versión 1.08:
  1807.  * - Se han añadido modificadores para el tp.
  1808.  * - Se han añadido más controles para los CParam.
  1809.  * - Se han añadido controles para mostrar el daño y recuperación de CParams.
  1810.  *
  1811.  * Versión 1.07:
  1812.  * - Permite que los objetos y habilidades alteren los CParams.
  1813.  * - Permite el crecimiento de los x/sparams.
  1814.  * - Permite fijar el valor de los parámetros.
  1815.  * - Se han añadido parámetros evaluables para los estados alterados.
  1816.  *
  1817.  * Versión 1.06:
  1818.  * - Se han añadido los CParams.
  1819.  * - Se han eliminado funciones y parámetros obsoletos.
  1820.  * - Pequeñas mejoras.
  1821.  *
  1822.  * Versión 1.05:
  1823.  * - Se han añadido parámetros evaluables para el equipamiento.
  1824.  * - Se ha añadido el uso de nparams en el equipamiento.
  1825.  * - Se ha expandido el modo lunático para incluir a los personajes y classes
  1826.  *   para enemigos.
  1827.  * - Permite el crecimiento de los pparams.
  1828.  * - Permite fórmulas personalizadas para los parámetros básicos y los nparams.
  1829.  * - Uso del sistema de parámetros del 1.5.0.
  1830.  *
  1831.  * Versión 1.04:
  1832.  * - Permite el ICF-Soft Main Core.
  1833.  * - Se ha expandido el modo lunático para afectar enemigos.
  1834.  * - Mayor control para los nparams.
  1835.  *
  1836.  * Versión 1.03:
  1837.  * - Se ha añadido el modificador XFlat para el doble máximo.
  1838.  * - Se ha subido la cantidad de n/pparams a 30.
  1839.  * - Permite nombrar los parámetros especiales y extra.
  1840.  *
  1841.  * Versión 1.02:
  1842.  * - Permite añadir alias o redefinir los parámetros básicos.
  1843.  *
  1844.  * Versión 1.01:
  1845.  * - Se empieza a utilizar el ICF-Soft Main Utility.
  1846.  * - Se ha añadido el modo lunático para params y nparams.
  1847.  * - Se ha cambiado el cómo funcionan los límites mínimo y máximo.
  1848.  * - Se ha añadido el doble máximo.
  1849.  * - Se han añadido más características.
  1850.  * - Se pueden usar los base params.
  1851.  *
  1852.  * Versión 1.00:
  1853.  * - Complemento terminado.
  1854.  *
  1855.  * ============================================================================
  1856.  *
  1857.  * Para juegos comerciales y no comerciales.
  1858.  * Se debe incluir a ICF-Soft en los créditos.
  1859.  * Esta cabecera debe incluirse íntegramente con el plugin.
  1860.  *
  1861.  * ============================================================================
  1862. */
  1863. /*~struct~NormalParams:
  1864.  * @param Name
  1865.  * @desc Name for this new param in lowercase without spaces. Empty to skip.
  1866.  * @default
  1867.  *
  1868.  * @param Full Name
  1869.  * @desc Name that will be shown for this new param.
  1870.  * @default
  1871.  *
  1872.  * @param Icon
  1873.  * @desc An icon for this parameter.
  1874.  * @default 0
  1875.  *
  1876.  * @param Base
  1877.  * @desc How this new param is configured by default. See help.
  1878.  * @default 30 15
  1879.  *
  1880.  * @param Base Eval
  1881.  * @desc A formula to use instead of base.
  1882.  * @default
  1883.  *
  1884.  * @param Color
  1885.  * @desc A color for param. Can be a html code or a number.
  1886.  * @default
  1887.  *
  1888.  * @param Limits
  1889.  * @desc Formula for min and max value for this new param. See help.
  1890.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  1891.  *
  1892.  * @param Buff Icons
  1893.  * @desc Icons for each buff stack. Empty to don't use. See help.
  1894.  * @default
  1895.  *
  1896.  * @param Debuff Icons
  1897.  * @desc Icons for each debuff stack. Empty to don't use. See help.
  1898.  * @default
  1899.  *
  1900.  */
  1901. /*~struct~PlainParams:
  1902.  * @param Name
  1903.  * @desc Name for this plain param in lowercase without spaces. Empty to skip.
  1904.  * @default
  1905.  *
  1906.  * @param Full Name
  1907.  * @desc Name that will be shown for this plain param.
  1908.  * @default
  1909.  *
  1910.  * @param Icon
  1911.  * @desc An icon for this parameter.
  1912.  * @default 0
  1913.  *
  1914.  * @param Base
  1915.  * @desc How this plain param is configured by default. See help.
  1916.  * @default 0
  1917.  *
  1918.  * @param Is Percentage
  1919.  * @desc Tell if this plain param is a percentage.
  1920.  * @default false
  1921.  *
  1922.  * @param Color
  1923.  * @desc A color for param. Can be a html code or a number.
  1924.  * @default
  1925.  *
  1926.  * @param Limits
  1927.  * @desc Formula for min and max value for this plain param. See help.
  1928.  * @default (this.isActor())? [0, 999] : [0, 999]
  1929.  *
  1930.  */
  1931. /*~struct~CountingParams:
  1932.  * @param Name Basic
  1933.  * @desc Name for this count param in lowercase without spaces. Empty to skip.
  1934.  * @default
  1935.  *
  1936.  * @param Full Name Basic
  1937.  * @desc Name that will be shown for this count param.
  1938.  * @default
  1939.  *
  1940.  * @param Name Counter
  1941.  * @desc Name for current value param in lowercase without spaces. Empty to skip.
  1942.  * @default
  1943.  *
  1944.  * @param Full Name Counter
  1945.  * @desc Name that will be shown for current value param.
  1946.  * @default
  1947.  *
  1948.  * @param Abreviation
  1949.  * @desc Short name that will be shown for current value param.
  1950.  * @default
  1951.  *
  1952.  * @param Icon
  1953.  * @desc An icon for this parameter.
  1954.  * @default 0
  1955.  *
  1956.  * @param Base
  1957.  * @desc How this count param max value is configured by default. See help.
  1958.  * @default 30 15
  1959.  *
  1960.  * @param Base Eval
  1961.  * @desc A formula to use instead of base.
  1962.  * @default
  1963.  *
  1964.  * @param Reset Type
  1965.  * @desc Determines when the count value is reseted.
  1966.  * 0 - no reset  1 - on inn  2 - on ko  3 - on battle
  1967.  * @default 1
  1968.  *
  1969.  * @param Reset Value
  1970.  * @desc Default value when a cparam is reseted.
  1971.  * 0 - empty  1 - full
  1972.  * @default 1
  1973.  *
  1974.  * @param Color1
  1975.  * @desc First color for gauge. Can be a html code or a number.
  1976.  * @default
  1977.  *
  1978.  * @param Color2
  1979.  * @desc Second color for gauge. Can be a html code or a number.
  1980.  * @default
  1981.  *
  1982.  * @param Limits
  1983.  * @desc Formula for min and max value for this count param. See help.
  1984.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  1985.  *
  1986.  * @param Buff Icons
  1987.  * @desc Icons for each buff stack. Empty to don't use. See help.
  1988.  * @default
  1989.  *
  1990.  * @param Debuff Icons
  1991.  * @desc Icons for each debuff stack. Empty to don't use. See help.
  1992.  * @default
  1993.  *
  1994.  */
  1995. /*~struct~NormalParams:es
  1996.  * @param Name
  1997.  * @desc Nombre para este nuevo parámetro en minúsculas. Vacío para saltar.
  1998.  * @default
  1999.  *
  2000.  * @param Full Name
  2001.  * @desc Nombre mostrado para este nuevo parámetro.
  2002.  * @default
  2003.  *
  2004.  * @param Icon
  2005.  * @desc Un icono para este parámetro.
  2006.  * @default 0
  2007.  *
  2008.  * @param Base
  2009.  * @desc Modo predeterminado de configuración. Ver ayuda.
  2010.  * @default 30 15
  2011.  *
  2012.  * @param Base Eval
  2013.  * @desc Una fórmula para usar en lugar del modo predeterminado.
  2014.  * @default
  2015.  *
  2016.  * @param Color
  2017.  * @desc Un color para representar el parámetro. Se puede usar un color html o un número.
  2018.  * @default
  2019.  *
  2020.  * @param Limits
  2021.  * @desc Una fórmula para los valores mínimo y máximos para este
  2022.  * nuevo parámetro. Ver ayuda.
  2023.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  2024.  *
  2025.  * @param Buff Icons
  2026.  * @desc Iconos a mostrar para cada valor de fortalecimiento.
  2027.  * Vacío no usar ninguno. Ver ayuda.
  2028.  * @default
  2029.  *
  2030.  * @param Debuff Icons
  2031.  * @desc Iconos a mostrar para cada valor de debilitamiento.
  2032.  * Vacío no usar ninguno. Ver ayuda.
  2033.  * @default
  2034.  *
  2035.  */
  2036. /*~struct~PlainParams:es
  2037.  * @param Name
  2038.  * @desc Nombre para este parámetro plano en minúsculas. Vacío para saltar.
  2039.  * @default
  2040.  *
  2041.  * @param Full Name
  2042.  * @desc Nombre para mostrar para este parámetro plano.
  2043.  * @default
  2044.  *
  2045.  * @param Icon
  2046.  * @desc Un icono para este parámetro.
  2047.  * @default 0
  2048.  *
  2049.  * @param Base
  2050.  * @desc Fórmula para calcular el Valor básico de este parámetro plano.
  2051.  * @default 0
  2052.  *
  2053.  * @param Is Percentage
  2054.  * @desc Indica si este parámetro plano es un porcentage.
  2055.  * @default false
  2056.  *
  2057.  * @param Color
  2058.  * @desc Un color para representar el parámetro. Se puede usar un color html o un número.
  2059.  * @default
  2060.  *
  2061.  * @param Limits
  2062.  * @desc Una fórmula para los valores mínimo y máximos para este
  2063.  * parámetro plano. Ver ayuda.
  2064.  * @default (this.isActor())? [0, 999] : [0, 999]
  2065.  *
  2066.  */
  2067. /*~struct~CountingParams:es
  2068.  * @param Name Basic
  2069.  * @desc Nombre para este parámetro máximo en minúsculas. Vacío para saltar.
  2070.  * @default
  2071.  *
  2072.  * @param Full Name Basic
  2073.  * @desc Nombre para mostrar para este parámetro máximo.
  2074.  * @default
  2075.  *
  2076.  * @param Name Counter
  2077.  * @desc Nombre para este parámetro contador en minúsculas. Vacío para saltar.
  2078.  * @default
  2079.  *
  2080.  * @param Full Name Counter
  2081.  * @desc Nombre para mostrar para este parámetro contador.
  2082.  * @default
  2083.  *
  2084.  * @param Abreviation
  2085.  * @desc Nombre abreviado para mostrar para este parámetro contador.
  2086.  * @default
  2087.  *
  2088.  * @param Icon
  2089.  * @desc Un icono para este parámetro.
  2090.  * @default 0
  2091.  *
  2092.  * @param Base
  2093.  * @desc Modo predeterminado de configuración. Ver ayuda.
  2094.  * @default 30 15
  2095.  *
  2096.  * @param Base Eval
  2097.  * @desc Una fórmula para usar en lugar del modo predeterminado.
  2098.  * @default
  2099.  *
  2100.  * @param Reset Type
  2101.  * @desc Determina cuando se reinicia al valor básico.
  2102.  * 0 - nunca  1 - al descansar  2 - al quedar ko  3 - en combate
  2103.  * @default 1
  2104.  *
  2105.  * @param Reset Value
  2106.  * @desc Valor básico del contador cuando se reinicia.
  2107.  * 0 - vacío  1 - lleno
  2108.  * @default 1
  2109.  *
  2110.  * @param Color1
  2111.  * @desc Primer color de la barra. Se puede usar un color html o un número.
  2112.  * @default
  2113.  *
  2114.  * @param Color2
  2115.  * @desc Segundo color de la barra. Se puede usar un color html o un número.
  2116.  * @default
  2117.  *
  2118.  * @param Limits
  2119.  * @desc Una fórmula para los valores mínimo y máximos para este
  2120.  * nuevo parámetro. Ver ayuda.
  2121.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  2122.  *
  2123.  * @param Buff Icons
  2124.  * @desc Iconos a mostrar para cada valor de fortalecimiento.
  2125.  * Vacío no usar ninguno. Ver ayuda.
  2126.  * @default
  2127.  *
  2128.  * @param Debuff Icons
  2129.  * @desc Iconos a mostrar para cada valor de debilitamiento.
  2130.  * Vacío no usar ninguno. Ver ayuda.
  2131.  * @default
  2132.  *
  2133.  */
  2134. //=============================================================================
  2135.  
  2136. //=============================================================================
  2137. // Parameter Variables
  2138. //=============================================================================
  2139.  
  2140. ICF.Parameters = PluginManager.parameters('ICFSoft_ParamsCore');
  2141. ICF.Param = ICF.Param || {};
  2142.  
  2143. if (!Imported.ICFSoft_MainUtility) {throw new Error('This plugin requires ICF-Soft Main Utility plugin version 1.05 to work.\nYou can download it at icfsoft.blogspot.com inside plugins section.');}
  2144. if (ICF.MainUtility.Version < 105) {throw new Error('This plugin requires ICF-Soft Main Utility plugin version 1.05 to work.\nYou can download it at icfsoft.blogspot.com inside plugins section.');}
  2145.  
  2146. ICF.Param.NParams = [];
  2147. ICF.Param.NParamsFullName = [];
  2148. ICF.Param.NParamIcon = [];
  2149. ICF.Param.NParamBase = [];
  2150. ICF.Param.NParamLimit = [];
  2151. ICF.Param.NParamBuffIcons = [];
  2152. ICF.Param.NParamDebuffIcons = [];
  2153. ICF.Param.NParamColor1 = [];
  2154. ICF.Param.PParams = [];
  2155. ICF.Param.PParamsFullName = [];
  2156. ICF.Param.PParamIcon = [];
  2157. ICF.Param.PParamBase = [];
  2158. ICF.Param.PParamLimit = [];
  2159. ICF.Param.PParamColor1 = [];
  2160. ICF.Param.PParamIsPercent = [];
  2161. ICF.Param.CParams = [];
  2162. ICF.Param.CParamsFullName = [];
  2163. ICF.Param.CParamsMax = [];
  2164. ICF.Param.CParamsMaxFullName = [];
  2165. ICF.Param.CParamsAbreviation = [];
  2166. ICF.Param.CParamIcon = [];
  2167. ICF.Param.CParamBase = [];
  2168. ICF.Param.CParamLimit = [];
  2169. ICF.Param.CParamBuffIcons = [];
  2170. ICF.Param.CParamDebuffIcons = [];
  2171. ICF.Param.CParamColor1 = [];
  2172. ICF.Param.CParamColor2 = [];
  2173. ICF.Param.CParamResetValue = [];
  2174. ICF.Param.CParamResetType = [];
  2175. ICF.Param.BParamIcon = [];
  2176. ICF.Param.BParamLimit = [];
  2177. ICF.Param.BParamBase = [];
  2178. ICF.Param.XParamsFullName = [];
  2179. ICF.Param.XParamIcon = [];
  2180. ICF.Param.XParamBase = [];
  2181. ICF.Param.SParamsFullName = [];
  2182. ICF.Param.SParamIcon = [];
  2183. ICF.Param.SParamBase = [];
  2184.  
  2185. ICF.Param.defaultValidCParams = ICF.Parameters['Default Valid CParams'].trim().split(/\s+/);
  2186. for (var i = 0; i < ICF.Param.defaultValidCParams.length; i++) {
  2187.     if (ICF.Param.CParams.contains(ICF.Param.defaultValidCParams[i])) ICF.Param.defaultValidCParams[i] = ICF.Param.CParams.indexOf(ICF.Param.defaultValidCParams[i]);
  2188.     else ICF.Param.defaultValidCParams[i] = ICF.Param.CParamsMax.indexOf(ICF.Param.defaultValidCParams[i]);
  2189. }
  2190. ICF.Param.defaultMainCParams = ICF.Parameters['Default Main CParams'].trim().split(/\s+/);
  2191. for (var i = 0; i < ICF.Param.defaultMainCParams.length; i++) {
  2192.     if (ICF.Param.CParams.contains(ICF.Param.defaultMainCParams[i])) ICF.Param.defaultMainCParams[i] = ICF.Param.CParams.indexOf(ICF.Param.defaultMainCParams[i]);
  2193.     else ICF.Param.defaultMainCParams[i] = ICF.Param.CParamsMax.indexOf(ICF.Param.defaultMainCParams[i]);
  2194. }
  2195.  
  2196. ICF.Param.TPParamEval = ICF.Parameters['TP Base'] || 100;
  2197. ICF.Param.TPParamLimit = ICF.Parameters['TP Limits'] || "(this.isActor())? [0, 999, 1200] : [0, 999, 1200]";
  2198. ICF.Param.TPIcon = Number(ICF.Parameters['TP Icon']) || -1;
  2199.  
  2200. ICF.Param.useDamageIcons = ICF.Parameters['Use Damage Icons'].toLowerCase() === "true";
  2201.  
  2202. ICF.Param.BParams = ["mhp", "mmp", "atk", "def", "mat", "mdf", "agi", "luk"];
  2203. ICF.Param.XParams = ["hit", "eva", "cri", "cev", "mev", "mrf", "cnt", "hrg", "mrg", "trg"];
  2204. ICF.Param.SParams = ["tgr", "grd", "rec", "pha", "mcr", "tcr", "pdr", "mdr", "fdr", "exr"];
  2205.  
  2206. ICF.temp = JSON.parse(ICF.Parameters['NParams']);
  2207. for (var i = 0; i < ICF.temp.length; i++) {
  2208.     ICF.temp[i] = JSON.parse(ICF.temp[i]);
  2209.     ICF.Param.NParams[i] = ICF.temp[i]['Name'];
  2210.     ICF.Param.NParamsFullName[i] = ICF.temp[i]['Full Name'];
  2211.     ICF.Param.NParamIcon[i] = Number(ICF.temp[i]['Icon']) || -1;
  2212.     ICF.Param.NParamBase[i] = ICF.temp[i]['Base'].split(/\s+/).leaveNumbers();
  2213.     if (ICF.temp[i]['Base Eval'].trim().length > 0) ICF.Param.NParamBase[i] = ICF.temp[i]['Base Eval'];
  2214.     ICF.Param.NParamLimit[i] = ICF.temp[i]['Limits'];
  2215.     ICF.Param.NParamBuffIcons[i] = ICF.temp[i]['Buff Icons'].split(/\s+/).leaveNumbers();
  2216.     ICF.Param.NParamDebuffIcons[i] = ICF.temp[i]['Debuff Icons'].split(/\s+/).leaveNumbers();
  2217.     ICF.Param.NParamColor1[i] = ICF.MainUtility.validateColor(ICF.temp[i]['Color']);
  2218. }
  2219. ICF.temp = JSON.parse(ICF.Parameters['PParams']);
  2220. for (var i = 0; i < ICF.temp.length; i++) {
  2221.     ICF.temp[i] = JSON.parse(ICF.temp[i]);
  2222.     ICF.Param.PParams[i] = ICF.temp[i]['Name'];
  2223.     ICF.Param.PParamsFullName[i] = ICF.temp[i]['Full Name'];
  2224.     ICF.Param.PParamIcon[i] = Number(ICF.temp[i]['Icon']) || -1;
  2225.     ICF.Param.PParamIsPercent[i] = ICF.temp[i]['Is Percentage'] && ICF.temp[i]['Is Percentage'].toLowerCase() == "true";
  2226.     ICF.Param.PParamBase[i] = ICF.temp[i]['Base'];
  2227.     ICF.Param.PParamLimit[i] = ICF.temp[i]['Limits'];
  2228.     ICF.Param.PParamColor1[i] = ICF.MainUtility.validateColor(ICF.temp[i]['Color']);
  2229. }
  2230.  
  2231. ICF.temp = JSON.parse(ICF.Parameters['CParams']);
  2232. for (var i = 0; i < ICF.temp.length; i++) {
  2233.     ICF.temp[i] = JSON.parse(ICF.temp[i]);
  2234.     ICF.Param.CParamsMax[i] = ICF.temp[i]['Name Basic'];
  2235.     ICF.Param.CParamsMaxFullName[i] = ICF.temp[i]['Full Name Basic'];
  2236.     ICF.Param.CParams[i] = ICF.temp[i]['Name Counter'];
  2237.     ICF.Param.CParamsFullName[i] = ICF.temp[i]['Full Name Counter'];
  2238.     ICF.Param.CParamsAbreviation[i] = ICF.temp[i]['Abreviation']? ICF.temp[i]['Abreviation'] : ICF.Param.CParamsFullName[i];
  2239.     ICF.Param.CParamIcon[i] = Number(ICF.temp[i]['Icon']) || -1;
  2240.     ICF.Param.CParamBase[i] = ICF.temp[i]['Base'].split(/\s+/).leaveNumbers();
  2241.     if (ICF.temp[i]['Base Eval'].trim().length > 0) ICF.Param.CParamBase[i] = ICF.temp[i]['Base Eval'];
  2242.     ICF.Param.CParamLimit[i] = ICF.temp[i]['Limits'];
  2243.     ICF.Param.CParamBuffIcons[i] = ICF.temp[i]['Buff Icons'].split(/\s+/).leaveNumbers();
  2244.     ICF.Param.CParamDebuffIcons[i] = ICF.temp[i]['Debuff Icons'].split(/\s+/).leaveNumbers();
  2245.     ICF.Param.CParamColor1[i] = ICF.MainUtility.validateColor(ICF.temp[i]['Color1']);
  2246.     ICF.Param.CParamColor2[i] = ICF.MainUtility.validateColor(ICF.temp[i]['Color2']);
  2247.     ICF.Param.CParamResetType[i] = isNaN(Number(ICF.temp[i]['Reset Type']))? 1 : Number(ICF.temp[i]['Reset Type']);
  2248.     ICF.Param.CParamResetValue[i] = isNaN(Number(ICF.temp[i]['Reset Value']))? 1 : Number(ICF.temp[i]['Reset Value']);
  2249. }
  2250.  
  2251. for (var i = 0; i < 10; i++) {
  2252.     ICF.Param.XParamsFullName[i] = String(ICF.Parameters['XParam' + i + ' Full Name']);
  2253.     ICF.Param.XParamIcon[i] = Number(ICF.Parameters['XParam' + i + ' Icon']) || -1;
  2254.     ICF.Param.XParamBase[i] = String(ICF.Parameters['XParam' + i + ' Base']);
  2255.     ICF.Param.SParamsFullName[i] = String(ICF.Parameters['SParam' + i + ' Full Name']);
  2256.     ICF.Param.SParamIcon[i] = Number(ICF.Parameters['SParam' + i + ' Icon']) || -1;
  2257.     ICF.Param.SParamBase[i] = String(ICF.Parameters['SParam' + i + ' Base']);
  2258. }
  2259.  
  2260. for (var i = 0; i < 8; i++) {
  2261.     ICF.Param.BParams[i] = String(ICF.Parameters['BParam' + i + ' Name']);
  2262.     ICF.Param.BParamIcon[i] = Number(ICF.Parameters['BParam' + i + ' Icon']) || -1;
  2263.     ICF.Param.BParamBase[i] = String(ICF.Parameters['BParam' + i + ' Base Eval']).trim();
  2264.     ICF.Param.BParamLimit[i] = String(ICF.Parameters['BParam' + i + ' Limits']);
  2265. }
  2266.  
  2267. ICF.Param.ParamCoreHalt = ICF.Parameters['Developer HaltJS'].toLowerCase() === "true";
  2268.  
  2269. //=============================================================================
  2270. // Constants
  2271. //=============================================================================
  2272.  
  2273. Game_BattlerBase.TRAIT_NPARAM          = 24;
  2274. Game_BattlerBase.TRAIT_PPARAM          = 25;
  2275. Game_BattlerBase.TRAIT_CPARAM          = 26;
  2276. Game_BattlerBase.TRAIT_TPPARAM         = 27;
  2277. Game_Action.EFFECT_RECOVER_CPARAM      = 14;
  2278. Game_Action.EFFECT_ADD_NBUFF           = 35;
  2279. Game_Action.EFFECT_ADD_NDEBUFF         = 36;
  2280. Game_Action.EFFECT_REMOVE_NBUFF        = 37;
  2281. Game_Action.EFFECT_REMOVE_NDEBUFF      = 38;
  2282. Game_Action.EFFECT_NGROW               = 45;
  2283. Game_Action.EFFECT_PGROW               = 46;
  2284. Game_Action.EFFECT_CGROW               = 47;
  2285.  
  2286. //=============================================================================
  2287. // TextManager
  2288. //=============================================================================
  2289.  
  2290. ICF.ParamCore.TextManager_param = TextManager.param;
  2291. TextManager.param = function (paramId) {
  2292.     if (ICF.Param.NParams.indexOf(paramId) > -1) {
  2293.     var parId = ICF.Param.NParams.indexOf(paramId);
  2294.     return ICF.Param.NParamsFullName[parId];
  2295.     } else if (ICF.Param.PParams.indexOf(paramId) > -1) {
  2296.     var parId = ICF.Param.PParams.indexOf(paramId);
  2297.     return ICF.Param.PParamsFullName[parId];
  2298.     } else if (ICF.Param.CParams.indexOf(paramId) > -1) {
  2299.     var parId = ICF.Param.CParams.indexOf(paramId);
  2300.     return ICF.Param.CParamsFullName[parId];
  2301.     } else if (ICF.Param.CParamsMax.indexOf(paramId) > -1) {
  2302.     var parId = ICF.Param.CParamsMax.indexOf(paramId);
  2303.     return ICF.Param.CParamsMaxFullName[parId];
  2304.     } else if (ICF.Param.BParams.indexOf(paramId) > -1) {
  2305.     var parId = ICF.Param.BParams.indexOf(paramId);
  2306.     return ICF.ParamCore.TextManager_param.call(this, parId);
  2307.     } else if (ICF.Param.XParams.indexOf(paramId) > -1) {
  2308.     var parId = ICF.Param.XParams.indexOf(paramId);
  2309.     return ICF.Param.XParamsFullName[parId];
  2310.     } else if (ICF.Param.SParams.indexOf(paramId) > -1) {
  2311.     var parId = ICF.Param.SParams.indexOf(paramId);
  2312.     return ICF.Param.SParamsFullName[parId];
  2313.     } else {
  2314.     return ICF.ParamCore.TextManager_param.call(this, paramId);
  2315.     }
  2316. };
  2317.  
  2318. //=============================================================================
  2319. // DataManager
  2320. //=============================================================================
  2321.  
  2322. ICF.ParamCore.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
  2323. DataManager.isDatabaseLoaded = function() {
  2324.     if (!ICF.ParamCore.DataManager_isDatabaseLoaded.call(this)) return false;
  2325.     if (!ICF.ParamCore.Procesed) {
  2326.     ICF.NotetagsProcessor.ParamCoreB($dataActors);
  2327.     ICF.NotetagsProcessor.ParamCoreB($dataClasses);
  2328.     ICF.NotetagsProcessor.ParamCoreB($dataEnemies);
  2329.     ICF.NotetagsProcessor.ParamCoreC($dataWeapons);
  2330.     ICF.NotetagsProcessor.ParamCoreC($dataArmors);
  2331.     ICF.NotetagsProcessor.ParamCoreC($dataStates);
  2332.     ICF.NotetagsProcessor.ParamCoreD($dataSkills);
  2333.     ICF.NotetagsProcessor.ParamCoreD($dataItems);
  2334.     ICF.ParamCore.Procesed = true;
  2335.     }
  2336.     return true;
  2337. };
  2338.  
  2339. ICF.NotetagsProcessor.ParamCore = function(group) {
  2340.     var note1 = /<(?:NPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2341.     var note1b = /<(?:NPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2342.     var note1c = /<(?:NPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2343.     var note1d = /<(?:NPARAMXRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2344.     var note1e = /<(?:NPARAMXFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2345.     var note2 = /<(?:PPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2346.     var note2b = /<(?:PPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2347.     var note2c = /<(?:PPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2348.     var note3 = /<(?:xPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2349.     var note3b = /<(?:XPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2350.     var note3c = /<(?:XPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2351.     var note4 = /<(?:SPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2352.     var note4b = /<(?:SPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2353.     var note4c = /<(?:SPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2354.     var note5 = /<(?:PARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2355.     var note5b = /<(?:PARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2356.     var note5c = /<(?:PARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2357.     var note5d = /<(?:PARAMXRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2358.     var note5e = /<(?:PARAMXFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2359.     var note6 = /<(?:CPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2360.     var note6b = /<(?:CPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2361.     var note6c = /<(?:CPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2362.     var note6d = /<(?:CPARAMXRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2363.     var note6e = /<(?:CPARAMXFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2364.     var note7 = /<(?:TP PLUS):[ ]*((?:\-)?\d+(?:\.\d+)?)>/i;
  2365.     var note7b = /<(?:TP RATE):[ ]*(\d+(?:\.\d+)?)>/i;
  2366.     var note7c = /<(?:TP FLAT):[ ]*((?:\-)?\d+(?:\.\d+)?)>/i;
  2367.     var note7d = /<(?:TP XRATE):[ ]*(\d+(?:\.\d+)?)>/i;
  2368.     var note7e = /<(?:TP XFLAT):[ ]*((?:\-)?\d+(?:\.\d+)?)>/i;
  2369.     var note8 = /<(?:NDEBUFFRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2370.     var note8b = /<(?:CDEBUFFRATE):[ ]*(\w+)[ ]+(\d+(?:\.\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.traits.push({code:24, dataId:indx, value:Number(RegExp.$2)});
  2381.         } else if (line.match(note1b)) {
  2382.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2383.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 100, value:Number(RegExp.$2)});
  2384.         } else if (line.match(note1c)) {
  2385.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2386.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 200, value:Number(RegExp.$2)});
  2387.         } else if (line.match(note1d)) {
  2388.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2389.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 300, value:Number(RegExp.$2)});
  2390.         } else if (line.match(note1e)) {
  2391.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2392.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 400, value:Number(RegExp.$2)});
  2393.         } else if (line.match(note2)) {
  2394.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2395.             if (indx > -1) obj.traits.push({code:25, dataId:indx, value:Number(RegExp.$2)});
  2396.         } else if (line.match(note2b)) {
  2397.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2398.             if (indx > -1) obj.traits.push({code:25, dataId:indx + 100, value:Number(RegExp.$2)});
  2399.         } else if (line.match(note2c)) {
  2400.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2401.             if (indx > -1) obj.traits.push({code:25, dataId:indx + 200, value:Number(RegExp.$2)});
  2402.         } else if (line.match(note3)) {
  2403.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2404.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx, value:Number(RegExp.$2)});
  2405.         } else if (line.match(note3b)) {
  2406.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2407.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx + 10, value:Number(RegExp.$2)});
  2408.         } else if (line.match(note3c)) {
  2409.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2410.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx + 20, value:Number(RegExp.$2)});
  2411.         } else if (line.match(note4)) {
  2412.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2413.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx + 10, value:Number(RegExp.$2)});
  2414.         } else if (line.match(note4b)) {
  2415.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2416.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx, value:Number(RegExp.$2)});
  2417.         } else if (line.match(note4c)) {
  2418.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2419.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx + 20, value:Number(RegExp.$2)});
  2420.         } else if (line.match(note5)) {
  2421.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2422.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 10, value:Number(RegExp.$2)});
  2423.         } else if (line.match(note5b)) {
  2424.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2425.             if (indx > -1) obj.traits.push({code:21, dataId:indx, value:Number(RegExp.$2)});
  2426.         } else if (line.match(note5c)) {
  2427.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2428.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 20, value:Number(RegExp.$2)});
  2429.         } else if (line.match(note5d)) {
  2430.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2431.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 30, value:Number(RegExp.$2)});
  2432.         } else if (line.match(note5e)) {
  2433.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2434.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 40, value:Number(RegExp.$2)});
  2435.         } else if (line.match(note6)) {
  2436.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2437.             if (indx > -1) obj.traits.push({code:26, dataId:indx, value:Number(RegExp.$2)});
  2438.         } else if (line.match(note6b)) {
  2439.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2440.             if (indx > -1) obj.traits.push({code:26, dataId:indx + 100, value:Number(RegExp.$2)});
  2441.         } else if (line.match(note6c)) {
  2442.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2443.             if (indx > -1) obj.traits.push({code:26, dataId:indx + 200, value:Number(RegExp.$2)});
  2444.         } else if (line.match(note6d)) {
  2445.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2446.             if (indx > -1) obj.traits.push({code:26, dataId:indx + 300, value:Number(RegExp.$2)});
  2447.         } else if (line.match(note6e)) {
  2448.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2449.             if (indx > -1) obj.traits.push({code:26, dataId:indx + 400, value:Number(RegExp.$2)});
  2450.         } else if (line.match(note7)) {
  2451.             obj.traits.push({code:27, dataId:0, value:Number(RegExp.$1)});
  2452.         } else if (line.match(note7b)) {
  2453.             obj.traits.push({code:27, dataId:1, value:Number(RegExp.$1)});
  2454.         } else if (line.match(note7c)) {
  2455.             obj.traits.push({code:27, dataId:2, value:Number(RegExp.$1)});
  2456.         } else if (line.match(note7d)) {
  2457.             obj.traits.push({code:27, dataId:3, value:Number(RegExp.$1)});
  2458.         } else if (line.match(note7e)) {
  2459.             obj.traits.push({code:27, dataId:4, value:Number(RegExp.$1)});
  2460.         } else if (line.match(note8)) {
  2461.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2462.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_DEBUFF_RATE, dataId:indx + 10, value:Number(RegExp.$2)});
  2463.         } else if (line.match(note8b)) {
  2464.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2465.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_DEBUFF_RATE, dataId:indx + 200, value:Number(RegExp.$2)});
  2466.         }
  2467.     }
  2468.     }
  2469. };
  2470.  
  2471. ICF.NotetagsProcessor.ParamCoreB = function(group) {
  2472.     var grouparray = [];
  2473.     var note1 = /<(?:NPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2474.     var note1b = /<(?:NPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2475.     var note1c = /<(?:NPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2476.     var note1d = /<(?:NPARAMXRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2477.     var note1e = /<(?:NPARAMXFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2478.     var note1x = /<(?:NPARAM):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)(?:[ ]+(\d+(?:\.\d+)?))?(?:[ ]+(\d+(?:\.\d+)?))?(?:[ ]+(\d+(?:\.\d+)?))?>/i;
  2479.     var note1y = /<(?:CUSTOM NPARAM BASE)[ ]+(\w+)>/i;
  2480.     var note1z = /<\/(?:CUSTOM NPARAM BASE)>/i;
  2481.     var note2 = /<(?:PPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2482.     var note2b = /<(?:PPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2483.     var note2c = /<(?:PPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2484.     var note3 = /<(?:xPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2485.     var note3b = /<(?:XPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2486.     var note3c = /<(?:XPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2487.     var note4 = /<(?:SPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2488.     var note4b = /<(?:SPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2489.     var note4c = /<(?:SPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2490.     var note5 = /<(?:PARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2491.     var note5b = /<(?:PARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2492.     var note5c = /<(?:PARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2493.     var note5d = /<(?:PARAMXRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2494.     var note5e = /<(?:PARAMXFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2495.     var note5y = /<(?:CUSTOM PARAM BASE)[ ]+(\w+)>/i;
  2496.     var note5z = /<\/(?:CUSTOM PARAM BASE)>/i;
  2497.     var note6 = /<(?:CPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2498.     var note6b = /<(?:CPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2499.     var note6c = /<(?:CPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2500.     var note6d = /<(?:CPARAMXRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2501.     var note6e = /<(?:CPARAMXFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2502.     var note6m = /<(?:VALID CPARAMS):[ ]*(\w+(?:\s+\w+)*)[ ]*>/i;
  2503.     var note6n = /<(?:MAIN CPARAMS):[ ]*(\w+(?:\s+\w+)*)[ ]*>/i;
  2504.     var note6x = /<(?:CPARAM):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)(?:[ ]+(\d+(?:\.\d+)?))?(?:[ ]+(\d+(?:\.\d+)?))?(?:[ ]+(\d+(?:\.\d+)?))?>/i;
  2505.     var note6y = /<(?:CUSTOM CPARAM BASE)[ ]+(\w+)>/i;
  2506.     var note6z = /<\/(?:CUSTOM CPARAM BASE)>/i;
  2507.     var note7 = /<(?:TP PLUS):[ ]*((?:\-)?\d+(?:\.\d+)?)>/i;
  2508.     var note7b = /<(?:TP RATE):[ ]*(\d+(?:\.\d+)?)>/i;
  2509.     var note7c = /<(?:TP FLAT):[ ]*((?:\-)?\d+(?:\.\d+)?)>/i;
  2510.     var note7d = /<(?:TP XRATE):[ ]*(\d+(?:\.\d+)?)>/i;
  2511.     var note7e = /<(?:TP XFLAT):[ ]*((?:\-)?\d+(?:\.\d+)?)>/i;
  2512.     var note7y = /<(?:CUSTOM TP BASE)>/i;
  2513.     var note7z = /<\/(?:CUSTOM TP BASE)>/i;
  2514.     var note8 = /<(?:NDEBUFFRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2515.     var note8b = /<(?:CDEBUFFRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2516.  
  2517.     for (var n = 1; n < group.length; n++) {
  2518.     var obj = group[n];
  2519.     var notedata = obj.note.split(/[\r\n]+/);
  2520.  
  2521.     obj.basicNParam = [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]];
  2522.     obj.basicCParam = [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]];
  2523.     obj.customNParam = ['','','','','','','','','','','','','','','','','','','','','','','','','','','','','',''];
  2524.     obj.customCParam = ['','','','','','','','','','','','','','','','','','','','','','','','','','','','','',''];
  2525.     obj.customBParam = ['','','','','','','','','',''];
  2526.     obj.customTp = '';
  2527.     obj.validCParams = [];
  2528.     obj.mainCParams = [];
  2529.  
  2530.     var nFlag = false;
  2531.     var bFlag = false;
  2532.     var cFlag = false;
  2533.     var tpFlag = false;
  2534.     var nIndex = -1;
  2535.     var bIndex = -1;
  2536.     var cIndex = -1;
  2537.  
  2538.     for (var i = 0; i < notedata.length; i++) {
  2539.         var line = notedata[i];
  2540.         if (line.match(note1)) {
  2541.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2542.             if (indx > -1) obj.traits.push({code:24, dataId:indx, value:Number(RegExp.$2)});
  2543.             }
  2544.         else if (line.match(note1b)) {
  2545.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2546.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 100, value:Number(RegExp.$2)});
  2547.             }
  2548.         else if (line.match(note1c)) {
  2549.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2550.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 200, value:Number(RegExp.$2)});
  2551.             }
  2552.         else if (line.match(note1d)) {
  2553.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2554.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 300, value:Number(RegExp.$2)});
  2555.             }
  2556.         else if (line.match(note1e)) {
  2557.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2558.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 400, value:Number(RegExp.$2)});
  2559.             }
  2560.         else if (line.match(note1x)) {
  2561.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2562.             obj.basicNParam[indx] = [Number(RegExp.$2)];
  2563.             if (!isNaN(Number(RegExp.$3))) obj.basicNParam[indx] = obj.basicNParam[indx].concat([Number(RegExp.$3)]);
  2564.             if (!isNaN(Number(RegExp.$4))) obj.basicNParam[indx] = obj.basicNParam[indx].concat([Number(RegExp.$4)]);
  2565.             if (!isNaN(Number(RegExp.$5))) obj.basicNParam[indx] = obj.basicNParam[indx].concat([Number(RegExp.$5)]);
  2566.             }
  2567.         else if (line.match(note1y)) {
  2568.             nFlag = true;
  2569.             nIndex = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2570.             }
  2571.         else if (line.match(note1z)) {
  2572.             nFlag = false;
  2573.             }
  2574.         else if (line.match(note2)) {
  2575.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2576.             if (indx > -1) obj.traits.push({code:25, dataId:indx, value:Number(RegExp.$2)});
  2577.             }
  2578.         else if (line.match(note2b)) {
  2579.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2580.             if (indx > -1) obj.traits.push({code:25, dataId:indx + 100, value:Number(RegExp.$2)});
  2581.             }
  2582.         else if (line.match(note2c)) {
  2583.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2584.             if (indx > -1) obj.traits.push({code:25, dataId:indx + 200, value:Number(RegExp.$2)});
  2585.             }
  2586.         else if (line.match(note3)) {
  2587.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2588.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx, value:Number(RegExp.$2)});
  2589.             }
  2590.         else if (line.match(note3b)) {
  2591.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2592.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx + 10, value:Number(RegExp.$2)});
  2593.             }
  2594.         else if (line.match(note3c)) {
  2595.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2596.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx + 20, value:Number(RegExp.$2)});
  2597.             }
  2598.         else if (line.match(note4)) {
  2599.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2600.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx + 10, value:Number(RegExp.$2)});
  2601.             }
  2602.         else if (line.match(note4b)) {
  2603.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2604.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx, value:Number(RegExp.$2)});
  2605.             }
  2606.         else if (line.match(note4c)) {
  2607.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2608.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx + 20, value:Number(RegExp.$2)});
  2609.             }
  2610.         else if (line.match(note5)) {
  2611.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2612.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 10, value:Number(RegExp.$2)});
  2613.             }
  2614.         else if (line.match(note5b)) {
  2615.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2616.             if (indx > -1) obj.traits.push({code:21, dataId:indx, value:Number(RegExp.$2)});
  2617.             }
  2618.         else if (line.match(note5c)) {
  2619.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2620.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 20, value:Number(RegExp.$2)});
  2621.             }
  2622.         else if (line.match(note5d)) {
  2623.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2624.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 30, value:Number(RegExp.$2)});
  2625.             }
  2626.         else if (line.match(note5e)) {
  2627.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2628.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 40, value:Number(RegExp.$2)});
  2629.             }
  2630.         else if (line.match(note5y)) {
  2631.             bFlag = true;
  2632.             bIndex = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2633.             }
  2634.         else if (line.match(note5z)) {
  2635.             bFlag = false;
  2636.             }
  2637.         else if (line.match(note6)) {
  2638.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2639.             if (indx > -1) obj.traits.push({code:26, dataId:indx, value:Number(RegExp.$2)});
  2640.             }
  2641.         else if (line.match(note6b)) {
  2642.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2643.             if (indx > -1) obj.traits.push({code:26, dataId:indx + 100, value:Number(RegExp.$2)});
  2644.             }
  2645.         else if (line.match(note6c)) {
  2646.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2647.             if (indx > -1) obj.traits.push({code:26, dataId:indx + 200, value:Number(RegExp.$2)});
  2648.             }
  2649.         else if (line.match(note6d)) {
  2650.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2651.             if (indx > -1) obj.traits.push({code:26, dataId:indx + 300, value:Number(RegExp.$2)});
  2652.             }
  2653.         else if (line.match(note6e)) {
  2654.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2655.             if (indx > -1) obj.traits.push({code:26, dataId:indx + 400, value:Number(RegExp.$2)});
  2656.             }
  2657.         else if (line.match(note6m)) {
  2658.             obj.validCParams = obj.validCParams.concat(RegExp.$1.trim().split(/\s+/));
  2659.             }
  2660.         else if (line.match(note6n)) {
  2661.             obj.mainCParams = obj.mainCParams.concat(RegExp.$1.trim().split(/\s+/));
  2662.             }
  2663.         else if (line.match(note6x)) {
  2664.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2665.             obj.basicCParam[indx] = [Number(RegExp.$2)];
  2666.             if (!isNaN(Number(RegExp.$3))) obj.basicCParam[indx] = obj.basicCParam[indx].concat([Number(RegExp.$3)]);
  2667.             if (!isNaN(Number(RegExp.$4))) obj.basicCParam[indx] = obj.basicCParam[indx].concat([Number(RegExp.$4)]);
  2668.             if (!isNaN(Number(RegExp.$5))) obj.basicCParam[indx] = obj.basicCParam[indx].concat([Number(RegExp.$5)]);
  2669.             }
  2670.         else if (line.match(note6y)) {
  2671.             cFlag = true;
  2672.             cIndex = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2673.             }
  2674.         else if (line.match(note6z)) {
  2675.             cFlag = false;
  2676.             }
  2677.         else if (line.match(note7)) {
  2678.             obj.traits.push({code:27, dataId:0, value:Number(RegExp.$1)});
  2679.             }
  2680.         else if (line.match(note7b)) {
  2681.             obj.traits.push({code:27, dataId:1, value:Number(RegExp.$1)});
  2682.             }
  2683.         else if (line.match(note7c)) {
  2684.             obj.traits.push({code:27, dataId:2, value:Number(RegExp.$1)});
  2685.             }
  2686.         else if (line.match(note7d)) {
  2687.             obj.traits.push({code:27, dataId:3, value:Number(RegExp.$1)});
  2688.             }
  2689.         else if (line.match(note7e)) {
  2690.             obj.traits.push({code:27, dataId:4, value:Number(RegExp.$1)});
  2691.             }
  2692.         else if (line.match(note7y)) {
  2693.             tpFlag = true;
  2694.             }
  2695.         else if (line.match(note7z)) {
  2696.             tpFlag = false;
  2697.             }
  2698.         else if (line.match(note8)) {
  2699.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2700.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_DEBUFF_RATE, dataId:indx + 10, value:Number(RegExp.$2)});
  2701.             }
  2702.         else if (line.match(note8b)) {
  2703.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2704.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_DEBUFF_RATE, dataId:indx + 200, value:Number(RegExp.$2)});
  2705.             }
  2706.         else if (nFlag && nIndex > -1) {
  2707.             obj.customNParam[nIndex] = obj.customNParam[nIndex] + line + '\n';
  2708.             }
  2709.         else if (bFlag && bIndex > -1) {
  2710.             obj.customBParam[bIndex] = obj.customBParam[bIndex] + line + '\n';
  2711.             }
  2712.         else if (cFlag && cIndex > -1) {
  2713.             obj.customCParam[cIndex] = obj.customCParam[cIndex] + line + '\n';
  2714.             }
  2715.         else if (tpFlag) {
  2716.             obj.customTp = obj.customTp + line + '\n';
  2717.             }
  2718.     }
  2719.     }
  2720. };
  2721.  
  2722. ICF.NotetagsProcessor.ParamCoreC = function(group) {
  2723.     var grouparray = [];
  2724.     var note1 = /<(?:NPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2725.     var note1b = /<(?:NPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2726.     var note1c = /<(?:NPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2727.     var note1d = /<(?:NPARAMXRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2728.     var note1e = /<(?:NPARAMXFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2729.     var note1x = /<(?:NPARAM):[ ]*(\w+)[ ]+(\d+)>/i;
  2730.     var note1y = /<(?:CUSTOM NPARAMS)>/i;
  2731.     var note1z = /<\/(?:CUSTOM NPARAMS)>/i;
  2732.     var note2 = /<(?:PPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2733.     var note2b = /<(?:PPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2734.     var note2c = /<(?:PPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2735.     var note2x = /<(?:PPARAM):[ ]*(\w+)[ ]+(\d+)>/i;
  2736.     var note2y = /<(?:CUSTOM PPARAMS)>/i;
  2737.     var note2z = /<\/(?:CUSTOM PPARAMS)>/i;
  2738.     var note3 = /<(?:xPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2739.     var note3b = /<(?:XPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2740.     var note3c = /<(?:XPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2741.     var note4 = /<(?:SPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2742.     var note4b = /<(?:SPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2743.     var note4c = /<(?:SPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2744.     var note5 = /<(?:PARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2745.     var note5b = /<(?:PARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2746.     var note5c = /<(?:PARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2747.     var note5d = /<(?:PARAMXRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2748.     var note5e = /<(?:PARAMXFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2749.     var note5y = /<(?:CUSTOM PARAMS)>/i;
  2750.     var note5z = /<\/(?:CUSTOM PARAMS)>/i;
  2751.     var note6 = /<(?:CPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2752.     var note6b = /<(?:CPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2753.     var note6c = /<(?:CPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2754.     var note6d = /<(?:CPARAMXRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2755.     var note6e = /<(?:CPARAMXFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2756.     var note6x = /<(?:CPARAM):[ ]*(\w+)[ ]+(\d+)>/i;
  2757.     var note6y = /<(?:CUSTOM CPARAMS)>/i;
  2758.     var note6z = /<\/(?:CUSTOM CPARAMS)>/i;
  2759.     var note7 = /<(?:TP PLUS):[ ]*((?:\-)?\d+(?:\.\d+)?)>/i;
  2760.     var note7b = /<(?:TP RATE):[ ]*(\d+(?:\.\d+)?)>/i;
  2761.     var note7c = /<(?:TP FLAT):[ ]*((?:\-)?\d+(?:\.\d+)?)>/i;
  2762.     var note7d = /<(?:TP XRATE):[ ]*(\d+(?:\.\d+)?)>/i;
  2763.     var note7e = /<(?:TP XFLAT):[ ]*((?:\-)?\d+(?:\.\d+)?)>/i;
  2764.     var note8 = /<(?:NDEBUFFRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2765.     var note8b = /<(?:CDEBUFFRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  2766.  
  2767.     for (var n = 1; n < group.length; n++) {
  2768.     var obj = group[n];
  2769.     var notedata = obj.note.split(/[\r\n]+/);
  2770.  
  2771.     obj.NParams = [];
  2772.     obj.PParams = [];
  2773.     obj.CParams = [];
  2774.  
  2775.     obj.NParamEval = [];
  2776.     obj.PParamEval = [];
  2777.     obj.CParamEval = [];
  2778.     obj.BParamEval = [];
  2779.  
  2780.     obj.NParamEvalAll = '';
  2781.     obj.PParamEvalAll = '';
  2782.     obj.CParamEvalAll = '';
  2783.     obj.BParamEvalAll = '';
  2784.  
  2785.     var nFlag = false;
  2786.     var pFlag = false;
  2787.     var cFlag = false;
  2788.     var bFlag = false;
  2789.  
  2790.     for (var i = 0; i < notedata.length; i++) {
  2791.         var line = notedata[i];
  2792.         if (line.match(note1)) {
  2793.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2794.             if (indx > -1) obj.traits.push({code:24, dataId:indx, value:Number(RegExp.$2)});
  2795.             }
  2796.         else if (line.match(note1b)) {
  2797.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2798.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 100, value:Number(RegExp.$2)});
  2799.             }
  2800.         else if (line.match(note1c)) {
  2801.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2802.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 200, value:Number(RegExp.$2)});
  2803.             }
  2804.         else if (line.match(note1d)) {
  2805.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2806.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 300, value:Number(RegExp.$2)});
  2807.             }
  2808.         else if (line.match(note1e)) {
  2809.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2810.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 400, value:Number(RegExp.$2)});
  2811.             }
  2812.         else if (line.match(note1x)) {
  2813.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2814.             if (indx > -1) obj.NParams[indx] = Number(RegExp.$2);
  2815.             }
  2816.         else if (line.match(note1y)) {
  2817.             nFlag = true;
  2818.             }
  2819.         else if (line.match(note1z)) {
  2820.             nFlag = false;
  2821.             }
  2822.         else if (line.match(note2)) {
  2823.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2824.             if (indx > -1) obj.traits.push({code:25, dataId:indx, value:Number(RegExp.$2)});
  2825.             }
  2826.         else if (line.match(note2b)) {
  2827.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2828.             if (indx > -1) obj.traits.push({code:25, dataId:indx + 100, value:Number(RegExp.$2)});
  2829.             }
  2830.         else if (line.match(note2c)) {
  2831.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2832.             if (indx > -1) obj.traits.push({code:25, dataId:indx + 200, value:Number(RegExp.$2)});
  2833.             }
  2834.         else if (line.match(note2x)) {
  2835.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2836.             if (indx > -1) obj.PParams[indx] = Number(RegExp.$2);
  2837.             }
  2838.         else if (line.match(note2y)) {
  2839.             pFlag = true;
  2840.             }
  2841.         else if (line.match(note2z)) {
  2842.             pFlag = false;
  2843.             }
  2844.         else if (line.match(note3)) {
  2845.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2846.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx, value:Number(RegExp.$2)});
  2847.             }
  2848.         else if (line.match(note3b)) {
  2849.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2850.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx + 10, value:Number(RegExp.$2)});
  2851.             }
  2852.         else if (line.match(note3c)) {
  2853.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2854.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx + 20, value:Number(RegExp.$2)});
  2855.             }
  2856.         else if (line.match(note4)) {
  2857.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2858.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx + 10, value:Number(RegExp.$2)});
  2859.             }
  2860.         else if (line.match(note4b)) {
  2861.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2862.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx, value:Number(RegExp.$2)});
  2863.             }
  2864.         else if (line.match(note4c)) {
  2865.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2866.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx + 20, value:Number(RegExp.$2)});
  2867.             }
  2868.         else if (line.match(note5)) {
  2869.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2870.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 10, value:Number(RegExp.$2)});
  2871.             }
  2872.         else if (line.match(note5b)) {
  2873.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2874.             if (indx > -1) obj.traits.push({code:21, dataId:indx, value:Number(RegExp.$2)});
  2875.             }
  2876.         else if (line.match(note5c)) {
  2877.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2878.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 20, value:Number(RegExp.$2)});
  2879.             }
  2880.         else if (line.match(note5d)) {
  2881.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2882.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 30, value:Number(RegExp.$2)});
  2883.             }
  2884.         else if (line.match(note5e)) {
  2885.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2886.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 40, value:Number(RegExp.$2)});
  2887.             }
  2888.         else if (line.match(note5y)) {
  2889.             bFlag = true;
  2890.             }
  2891.         else if (line.match(note5z)) {
  2892.             bFlag = false;
  2893.             }
  2894.         else if (line.match(note6)) {
  2895.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2896.             if (indx > -1) obj.traits.push({code:26, dataId:indx, value:Number(RegExp.$2)});
  2897.             }
  2898.         else if (line.match(note6b)) {
  2899.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2900.             if (indx > -1) obj.traits.push({code:26, dataId:indx + 100, value:Number(RegExp.$2)});
  2901.             }
  2902.         else if (line.match(note6c)) {
  2903.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2904.             if (indx > -1) obj.traits.push({code:26, dataId:indx + 200, value:Number(RegExp.$2)});
  2905.             }
  2906.         else if (line.match(note6d)) {
  2907.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2908.             if (indx > -1) obj.traits.push({code:26, dataId:indx + 300, value:Number(RegExp.$2)});
  2909.             }
  2910.         else if (line.match(note6e)) {
  2911.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2912.             if (indx > -1) obj.traits.push({code:26, dataId:indx + 400, value:Number(RegExp.$2)});
  2913.             }
  2914.         else if (line.match(note6x)) {
  2915.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2916.             if (indx > -1) obj.CParams[indx] = Number(RegExp.$2);
  2917.             }
  2918.         else if (line.match(note6y)) {
  2919.             cFlag = true;
  2920.             }
  2921.         else if (line.match(note6z)) {
  2922.             cFlag = false;
  2923.             }
  2924.         else if (line.match(note7)) {
  2925.             obj.traits.push({code:27, dataId:0, value:Number(RegExp.$1)});
  2926.             }
  2927.         else if (line.match(note7b)) {
  2928.             obj.traits.push({code:27, dataId:1, value:Number(RegExp.$1)});
  2929.             }
  2930.         else if (line.match(note7c)) {
  2931.             obj.traits.push({code:27, dataId:2, value:Number(RegExp.$1)});
  2932.             }
  2933.         else if (line.match(note7d)) {
  2934.             obj.traits.push({code:27, dataId:3, value:Number(RegExp.$1)});
  2935.             }
  2936.         else if (line.match(note7e)) {
  2937.             obj.traits.push({code:27, dataId:4, value:Number(RegExp.$1)});
  2938.             }
  2939.         else if (line.match(note8)) {
  2940.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2941.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_DEBUFF_RATE, dataId:indx + 10, value:Number(RegExp.$2)});
  2942.             }
  2943.         else if (line.match(note8b)) {
  2944.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  2945.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_DEBUFF_RATE, dataId:indx + 200, value:Number(RegExp.$2)});
  2946.             }
  2947.         else if (nFlag) {
  2948.             if (line.match(/(\w+) = (.*)/i)) {
  2949.                 var indx = RegExp.$1;
  2950.                 if (isNaN(Number(indx))) indx = ICF.Param.NParams.indexOf(indx.toLowerCase());
  2951.                 indx = (Number(indx));
  2952.                 if (Number(indx) > -1) obj.NParamEval[indx] = RegExp.$2;
  2953.                 else obj.NParamEvalAll = obj.NParamEvalAll + line + '\n';
  2954.             } else obj.NParamEvalAll = obj.NParamEvalAll + line + '\n';
  2955.             }
  2956.         else if (pFlag) {
  2957.             if (line.match(/(\w+) = (.*)/i)) {
  2958.                 var indx = RegExp.$1;
  2959.                 if (isNaN(Number(indx))) indx = ICF.Param.PParams.indexOf(indx.toLowerCase());
  2960.                 indx = (Number(indx));
  2961.                 if (Number(indx) > -1) obj.PParamEval[indx] = RegExp.$2;
  2962.                 else obj.PParamEvalAll = obj.PParamEvalAll + line + '\n';
  2963.             } else obj.PParamEvalAll = obj.PParamEvalAll + line + '\n';
  2964.             }
  2965.         else if (cFlag) {
  2966.             if (line.match(/(\w+) = (.*)/i)) {
  2967.                 var indx = RegExp.$1;
  2968.                 if (isNaN(Number(indx))) indx = ICF.Param.CParamsMax.indexOf(indx.toLowerCase());
  2969.                 indx = (Number(indx));
  2970.                 if (Number(indx) > -1) obj.CParamEval[indx] = RegExp.$2;
  2971.                 else obj.CParamEvalAll = obj.CParamEvalAll + line + '\n';
  2972.             } else obj.CParamEvalAll = obj.CParamEvalAll + line + '\n';
  2973.             }
  2974.         else if (bFlag) {
  2975.             if (line.match(/(\w+) = (.*)/i)) {
  2976.                 var indx = RegExp.$1;
  2977.                 if (isNaN(Number(indx))) indx = ICF.Param.BParams.indexOf(indx.toLowerCase());
  2978.                 indx = (Number(indx));
  2979.                 if (Number(indx) > -1) obj.BParamEval[indx] = RegExp.$2;
  2980.                 else obj.NParamEvalAll = obj.BParamEvalAll + line + '\n';
  2981.             } else obj.NParamEvalAll = obj.BParamEvalAll + line + '\n';
  2982.             }
  2983.     }
  2984.     }
  2985. };
  2986.  
  2987. ICF.NotetagsProcessor.ParamCoreD = function(group) {
  2988.     var note1 = /<(?:NBUFF):[ ]*(\w+)[ ]+(\d+)>/i;
  2989.     var note1b = /<(?:NDEBUFF):[ ]*(\w+)[ ]+(\d+)>/i;
  2990.     var note1c = /<(?:REMOVE NBUFF):[ ]*(\w+)[ ]+>/i;
  2991.     var note1d = /<(?:REMOVE NDEBUFF):[ ]*(\w+)[ ]+>/i;
  2992.     var note2 = /<(?:CBUFF):[ ]*(\w+)[ ]+(\d+)>/i;
  2993.     var note2b = /<(?:CDEBUFF):[ ]*(\w+)[ ]+(\d+)>/i;
  2994.     var note2c = /<(?:REMOVE CBUFF):[ ]*(\w+)[ ]+>/i;
  2995.     var note2d = /<(?:REMOVE CDEBUFF):[ ]*(\w+)[ ]+>/i;
  2996.     var note3 = /<(?:NPARAM GROW):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2997.     var note3b = /<(?:PPARAM GROW):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2998.     var note3c = /<(?:CPARAM GROW):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  2999.     var note3d = /<(?:XPARAM GROW):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  3000.     var note3e = /<(?:SPARAM GROW):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  3001.     var note4 = /<(?:DAMAGE TYPE):[ ]+(\w+)>/i;
  3002.     var note4b = /<(?:RECOVER CPARAM):[ ]+(\w+)(?:\s+((?:\-)?\d+))?(?:\s+rate\s+((?:\-)?\d+(?:\.\d+)?))?>/i;
  3003.  
  3004.     for (var n = 1; n < group.length; n++) {
  3005.     var obj = group[n];
  3006.     var notedata = obj.note.split(/[\r\n]+/);
  3007.  
  3008.     obj.damage.cparam = -1;
  3009.  
  3010.     for (var i = 0; i < notedata.length; i++) {
  3011.         var line = notedata[i];
  3012.         if (line.match(note1)) {
  3013.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  3014.             if (indx > -1) obj.effects.push({code:35, dataId:indx, value1:Number(RegExp.$2)});
  3015.             }
  3016.         else if (line.match(note1b)) {
  3017.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  3018.             if (indx > -1) obj.effects.push({code:36, dataId:indx, value1:Number(RegExp.$2)});
  3019.             }
  3020.         else if (line.match(note1c)) {
  3021.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  3022.             if (indx > -1) obj.effects.push({code:37, dataId:indx, value1:0});
  3023.             }
  3024.         else if (line.match(note1d)) {
  3025.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  3026.             if (indx > -1) obj.effects.push({code:38, dataId:indx, value1:0});
  3027.             }
  3028.         else if (line.match(note2)) {
  3029.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  3030.             if (indx > -1) obj.effects.push({code:35, dataId:indx + 100, value1:Number(RegExp.$2)});
  3031.             }
  3032.         else if (line.match(note2b)) {
  3033.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  3034.             if (indx > -1) obj.effects.push({code:36, dataId:indx + 100, value1:Number(RegExp.$2)});
  3035.             }
  3036.         else if (line.match(note2c)) {
  3037.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  3038.             if (indx > -1) obj.effects.push({code:37, dataId:indx + 100, value1:0});
  3039.             }
  3040.         else if (line.match(note2d)) {
  3041.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  3042.             if (indx > -1) obj.effects.push({code:38, dataId:indx + 100, value1:0});
  3043.             }
  3044.         else if (line.match(note3)) {
  3045.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  3046.             if (indx > -1) obj.effects.push({code:45, dataId:indx, value1:Number(RegExp.$2)});
  3047.             }
  3048.         else if (line.match(note3b)) {
  3049.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  3050.             if (indx > -1) obj.effects.push({code:46, dataId:indx, value1:Number(RegExp.$2)});
  3051.             }
  3052.         else if (line.match(note3c)) {
  3053.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  3054.             if (indx > -1) obj.effects.push({code:47, dataId:indx, value1:Number(RegExp.$2)});
  3055.             }
  3056.         else if (line.match(note3d)) {
  3057.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  3058.             if (indx > -1) obj.effects.push({code:42, dataId:indx + 10, value1:Number(RegExp.$2)});
  3059.             }
  3060.         else if (line.match(note3e)) {
  3061.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  3062.             if (indx > -1) obj.effects.push({code:42, dataId:indx + 20, value1:Number(RegExp.$2)});
  3063.             }
  3064.         else if (line.match(note4)) {
  3065.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  3066.             if (indx < 0) indx = ICF.Param.CParams.indexOf(RegExp.$1.toLowerCase());
  3067.             if (indx > -1) obj.damage.cparam = indx;
  3068.             }
  3069.         else if (line.match(note4b)) {
  3070.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.CParamsMax.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  3071.             if (indx < 0) indx = ICF.Param.CParams.indexOf(RegExp.$1.toLowerCase());
  3072.             if (indx > -1) {
  3073.                 var v1 = (isNaN(Number(RegExp.$2)))? 0 : Number(RegExp.$2);
  3074.                 var v2 = (isNaN(Number(RegExp.$3)))? 0 : Number(RegExp.$3);
  3075.                 if (v1 != 0 || v2 != 0) obj.effects.push({code:14, dataId:indx, value1:v1, value2:v2});
  3076.             }
  3077.         }
  3078.     }
  3079.     }
  3080. };
  3081.  
  3082. //=============================================================================
  3083. // Game_BattlerBase
  3084. //=============================================================================
  3085.  
  3086. if (ICF.Param.BParams[0].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.BParams[0], { get: function() { return this.param(0); }, configurable: true });
  3087. if (ICF.Param.BParams[1].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.BParams[1], { get: function() { return this.param(1); }, configurable: true });
  3088. if (ICF.Param.BParams[2].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.BParams[2], { get: function() { return this.param(2); }, configurable: true });
  3089. if (ICF.Param.BParams[3].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.BParams[3], { get: function() { return this.param(3); }, configurable: true });
  3090. if (ICF.Param.BParams[4].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.BParams[4], { get: function() { return this.param(4); }, configurable: true });
  3091. if (ICF.Param.BParams[5].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.BParams[5], { get: function() { return this.param(5); }, configurable: true });
  3092. if (ICF.Param.BParams[6].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.BParams[6], { get: function() { return this.param(6); }, configurable: true });
  3093. if (ICF.Param.BParams[7].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.BParams[7], { get: function() { return this.param(7); }, configurable: true });
  3094.  
  3095. Object.defineProperty(Game_BattlerBase.prototype, 'mtp', { get: function() { return this.maxTp(); }, configurable: true });
  3096.  
  3097.  
  3098. for (var i = 0; i < ICF.Param.NParams.length; i++) {
  3099.     if (ICF.Param.NParams[i].length > 0) {
  3100.         eval("Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.NParams[" + i + "], { get: function() { return this.NParam(" + i + "); }, configurable: true });");
  3101.     }
  3102. }
  3103. for (var i = 0; i < ICF.Param.PParams.length; i++) {
  3104.     if (ICF.Param.PParams[i].length > 0) {
  3105.         eval("Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.PParams[" + i + "], { get: function() { return this.PParam(" + i + "); }, configurable: true });");
  3106.     }
  3107. }
  3108. for (var i = 0; i < ICF.Param.CParamsMax.length; i++) {
  3109.     if (ICF.Param.CParamsMax[i].length > 0) {
  3110.         eval("Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.CParamsMax[" + i + "], { get: function() { return this.CParam(" + i + "); }, configurable: true });");
  3111.     }
  3112.     if (ICF.Param.CParams[i].length > 0) {
  3113.         eval("Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.CParams[" + i + "], { get: function() { return this.CParamValue(" + i + "); }, configurable: true });");
  3114.     }
  3115. }
  3116.  
  3117. Object.defineProperty(Game_BattlerBase.prototype, 'level', { value: 1, configurable: true});
  3118.  
  3119. if (!Game_BattlerBase.prototype.equips) Game_BattlerBase.prototype.equips = function() { return []; };
  3120. if (!Game_BattlerBase.prototype.currentClass) Game_BattlerBase.prototype.currentClass = function() { return null; };
  3121.  
  3122. ICF.ParamCore.clearParamPlus = Game_BattlerBase.prototype.clearParamPlus;
  3123. Game_BattlerBase.prototype.clearParamPlus = function() {
  3124.     ICF.ParamCore.clearParamPlus.call(this);
  3125.     this._NParamPlus = [];
  3126.     this._PParamPlus = [];
  3127.     this._CParamPlus = [];
  3128. };
  3129.  
  3130. ICF.ParamCore.clearBuffs = Game_BattlerBase.prototype.clearBuffs;
  3131. Game_BattlerBase.prototype.clearBuffs = function() {
  3132.     ICF.ParamCore.clearBuffs.call(this);
  3133.     this._NBuffs = [];
  3134.     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];
  3135.     this._CBuffs = [];
  3136.     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];
  3137. };
  3138.  
  3139. ICF.ParamCore.battlerRefresh = Game_BattlerBase.prototype.refresh;
  3140. Game_BattlerBase.prototype.refresh = function() {
  3141.     ICF.ParamCore.battlerRefresh.call(this);
  3142.     if (!this._CParamValues) this._CParamValues = [];
  3143.     for (var i = 0; i < ICF.Param.CParamsMax.length; i++) {
  3144.         if (this._CParamValues[i] === undefined) this._CParamValues[i] = this.CParam(i);
  3145.         this._CParamValues[i] = this._CParamValues[i].clamp(0, this.CParam(i));
  3146.     }
  3147. };
  3148.  
  3149. ICF.ParamCore.battlerRecoverAll = Game_BattlerBase.prototype.recoverAll;
  3150. Game_BattlerBase.prototype.recoverAll = function() {
  3151.     ICF.ParamCore.battlerRecoverAll.call(this);
  3152.     this.resetCParams(1);
  3153. };
  3154.  
  3155. ICF.ParamCore.battlerDie = Game_BattlerBase.prototype.die;
  3156. Game_BattlerBase.prototype.die = function() {
  3157.     ICF.ParamCore.battlerDie.call(this);
  3158.     this.resetCParams(2);
  3159. };
  3160.  
  3161. Game_BattlerBase.prototype.eraseNBuff = function(paramId) {
  3162.     this._NBuffs[paramId] = 0;
  3163.     this._NBuffTurns[paramId] = 0;
  3164. };
  3165.  
  3166. Game_BattlerBase.prototype.NBuffLength = function() {
  3167.     return this._NBuffs.length;
  3168. };
  3169.  
  3170. Game_BattlerBase.prototype.NBuff = function(paramId) {
  3171.     if (!this._NBuffs[paramId]) this._NBuffs[paramId] = 0;
  3172.     return this._NBuffs[paramId];
  3173. };
  3174.  
  3175. Game_BattlerBase.prototype.isNBuffAffected = function(paramId) {
  3176.     if (!this._NBuffs[paramId]) this._NBuffs[paramId] = 0;
  3177.     return this._NBuffs[paramId] > 0;
  3178. };
  3179.  
  3180. Game_BattlerBase.prototype.isNDebuffAffected = function(paramId) {
  3181.     if (!this._NBuffs[paramId]) this._NBuffs[paramId] = 0;
  3182.     return this._NBuffs[paramId] < 0;
  3183. };
  3184.  
  3185. Game_BattlerBase.prototype.isNBuffOrDebuffAffected = function(paramId) {
  3186.     if (!this._NBuffs[paramId]) this._NBuffs[paramId] = 0;
  3187.     return this._NBuffs[paramId] !== 0;
  3188. };
  3189.  
  3190. Game_BattlerBase.prototype.isMaxNBuffAffected = function(paramId) {
  3191.     if (!this._NBuffs[paramId]) this._NBuffs[paramId] = 0;
  3192.     return this._NBuffs[paramId] >= 2;
  3193. };
  3194.  
  3195. Game_BattlerBase.prototype.isMaxNDebuffAffected = function(paramId) {
  3196.     if (!this._NBuffs[paramId]) this._NBuffs[paramId] = 0;
  3197.     return this._NBuffs[paramId] <= -2;
  3198. };
  3199.  
  3200. Game_BattlerBase.prototype.increaseNBuff = function(paramId) {
  3201.     if (!this._NBuffs[paramId]) this._NBuffs[paramId] = 0;
  3202.     if (!this.isMaxNBuffAffected(paramId)) {
  3203.         this._NBuffs[paramId]++;
  3204.     }
  3205. };
  3206.  
  3207. Game_BattlerBase.prototype.decreaseNBuff = function(paramId) {
  3208.     if (!this._NBuffs[paramId]) this._NBuffs[paramId] = 0;
  3209.     if (!this.isMaxNDebuffAffected(paramId)) {
  3210.         this._NBuffs[paramId]--;
  3211.     }
  3212. };
  3213.  
  3214. Game_BattlerBase.prototype.overwriteNBuffTurns = function(paramId, turns) {
  3215.     if (!this._NBuffTurns[paramId]) this._NBuffTurns[paramId] = 0;
  3216.     if (this._NBuffTurns[paramId] < turns) {
  3217.         this._NBuffTurns[paramId] = turns;
  3218.     }
  3219. };
  3220.  
  3221. Game_BattlerBase.prototype.isNBuffExpired = function(paramId) {
  3222.     if (!this._NBuffTurns[paramId]) this._NBuffTurns[paramId] = 0;
  3223.     return this._NBuffTurns[paramId] === 0;
  3224. };
  3225.  
  3226. Game_BattlerBase.prototype.eraseCBuff = function(paramId) {
  3227.     this._CBuffs[paramId] = 0;
  3228.     this._CBuffTurns[paramId] = 0;
  3229. };
  3230.  
  3231. Game_BattlerBase.prototype.CBuffLength = function() {
  3232.     return this._CBuffs.length;
  3233. };
  3234.  
  3235. Game_BattlerBase.prototype.CBuff = function(paramId) {
  3236.     if (!this._CBuffs[paramId]) this._CBuffs[paramId] = 0;
  3237.     return this._CBuffs[paramId];
  3238. };
  3239.  
  3240. Game_BattlerBase.prototype.isCBuffAffected = function(paramId) {
  3241.     if (!this._CBuffs[paramId]) this._CBuffs[paramId] = 0;
  3242.     return this._CBuffs[paramId] > 0;
  3243. };
  3244.  
  3245. Game_BattlerBase.prototype.isCDebuffAffected = function(paramId) {
  3246.     if (!this._CBuffs[paramId]) this._CBuffs[paramId] = 0;
  3247.     return this._CBuffs[paramId] < 0;
  3248. };
  3249.  
  3250. Game_BattlerBase.prototype.isCBuffOrDebuffAffected = function(paramId) {
  3251.     if (!this._CBuffs[paramId]) this._CBuffs[paramId] = 0;
  3252.     return this._CBuffs[paramId] !== 0;
  3253. };
  3254.  
  3255. Game_BattlerBase.prototype.isMaxCBuffAffected = function(paramId) {
  3256.     if (!this._CBuffs[paramId]) this._CBuffs[paramId] = 0;
  3257.     return this._CBuffs[paramId] >= 2;
  3258. };
  3259.  
  3260. Game_BattlerBase.prototype.isMaxCDebuffAffected = function(paramId) {
  3261.     if (!this._CBuffs[paramId]) this._CBuffs[paramId] = 0;
  3262.     return this._CBuffs[paramId] <= -2;
  3263. };
  3264.  
  3265. Game_BattlerBase.prototype.increaseCBuff = function(paramId) {
  3266.     if (!this._CBuffs[paramId]) this._CBuffs[paramId] = 0;
  3267.     if (!this.isMaxCBuffAffected(paramId)) {
  3268.         this._CBuffs[paramId]++;
  3269.     }
  3270. };
  3271.  
  3272. Game_BattlerBase.prototype.decreaseCBuff = function(paramId) {
  3273.     if (!this._CBuffs[paramId]) this._CBuffs[paramId] = 0;
  3274.     if (!this.isMaxCDebuffAffected(paramId)) {
  3275.         this._CBuffs[paramId]--;
  3276.     }
  3277. };
  3278.  
  3279. Game_BattlerBase.prototype.overwriteCBuffTurns = function(paramId, turns) {
  3280.     if (!this._CBuffTurns[paramId]) this._CBuffTurns[paramId] = 0;
  3281.     if (this._CBuffTurns[paramId] < turns) {
  3282.         this._CBuffTurns[paramId] = turns;
  3283.     }
  3284. };
  3285.  
  3286. Game_BattlerBase.prototype.isCBuffExpired = function(paramId) {
  3287.     if (!this._CBuffTurns[paramId]) this._CBuffTurns[paramId] = 0;
  3288.     return this._CBuffTurns[paramId] === 0;
  3289. };
  3290.  
  3291. ICF.ParamCore.updateBuffTurns = Game_BattlerBase.prototype.updateBuffTurns;
  3292. Game_BattlerBase.prototype.updateBuffTurns = function() {
  3293.     ICF.ParamCore.updateBuffTurns.call(this);
  3294.     for (var i = 0; i < this._NBuffTurns.length; i++) {
  3295.         if (this._NBuffTurns[i] > 0) {
  3296.             this._NBuffTurns[i]--;
  3297.         }
  3298.     }
  3299.     for (var i = 0; i < this._CBuffTurns.length; i++) {
  3300.         if (this._CBuffTurns[i] > 0) {
  3301.             this._CBuffTurns[i]--;
  3302.         }
  3303.     }
  3304. };
  3305.  
  3306. ICF.ParamCore.buffIcons = Game_BattlerBase.prototype.buffIcons;
  3307. Game_BattlerBase.prototype.buffIcons = function() {
  3308.     var icons = ICF.ParamCore.buffIcons.call(this);
  3309.     for (var i = 0; i < this._NBuffs.length; i++) {
  3310.         if ((this._NBuffs[i] > 0)&&(ICF.Param.NParamBuffIcons[i].length > 0)) {
  3311.             icons.push(ICF.Param.NParamBuffIcons[i][Math.min(ICF.Param.NParamBuffIcons[i].length, this._NBuffs[i]) - 1]);
  3312.         } else if ((this._NBuffs[i] < 0)&&(ICF.Param.NParamDebuffIcons[i].length > 0)) {
  3313.             icons.push(ICF.Param.NParamDebuffIcons[i][Math.min(ICF.Param.NParamDebuffIcons[i].length, Math.abs(this._NBuffs[i])) - 1]);
  3314.         }
  3315.     }
  3316.     for (var i = 0; i < this._CBuffs.length; i++) {
  3317.         if ((this._CBuffs[i] > 0)&&(ICF.Param.CParamBuffIcons[i].length > 0)) {
  3318.             icons.push(ICF.Param.CParamBuffIcons[i][Math.min(ICF.Param.CParamBuffIcons[i].length, this._CBuffs[i]) - 1]);
  3319.         } else if ((this._CBuffs[i] < 0)&&(ICF.Param.CParamDebuffIcons[i].length > 0)) {
  3320.             icons.push(ICF.Param.CParamDebuffIcons[i][Math.min(ICF.Param.CParamDebuffIcons[i].length, Math.abs(this._CBuffs[i])) - 1]);
  3321.         }
  3322.     }
  3323.     return icons;
  3324. };
  3325.  
  3326. Game_BattlerBase.prototype.NParamBasic = function(array, level) {
  3327.     if (array.length == 1) {
  3328.         return Number(array[0]);
  3329.     } else if (array.length == 2) {
  3330.         return Number(array[0]) + Number(array[1] * (level - 1));
  3331.     } else if (array.length == 3 || array[3] > level) {
  3332.         return Number(array[0]) + Number(array[1] * (level - 1)) + Number(array[2] * Math.pow(level - 1, 1.2));
  3333.     } else if (array.length > 3) {
  3334.         return Number(array[0]) + Number(array[1] * (array[3] - 1)) + Number(array[2] * Math.pow(array[3] - 1, 1.2));
  3335.     } else {
  3336.         return 0;
  3337.     }
  3338. };
  3339.  
  3340. Game_BattlerBase.prototype.NParamBase = function(paramId) {
  3341.     var array = ICF.Param.NParamBase[paramId];
  3342.     if (!Array.isArray(array)) return (array != '')? eval(array) : 0;
  3343.     if (array.length < 1) {
  3344.         return 0;
  3345.     } else {
  3346.         return this.NParamBasic(array, this.level);
  3347.     }
  3348. };
  3349.  
  3350. Game_BattlerBase.prototype.NParamPlus = function(paramId) {
  3351.     if (!this._NParamPlus[paramId]) this._NParamPlus[paramId] = 0;
  3352.     return this._NParamPlus[paramId] + this.traitsSum(Game_BattlerBase.TRAIT_NPARAM, paramId) + this.NParamEquips(paramId) + this.NParamStates(paramId);
  3353. };
  3354.  
  3355. Game_BattlerBase.prototype.NParamEquips = function(paramId) {
  3356.     var value = 0;
  3357.     var equips = this.equips();
  3358.     for (var i = 0; i < equips.length; i++) {
  3359.         var item = equips[i];
  3360.         if (item && item.NParams[paramId]) value += item.NParams[paramId];
  3361.         if (item && item.NParamEval[paramId]) {
  3362.         try {
  3363.         value += eval(item.NParamEvalAll + ';' + item.NParamEval[paramId]);
  3364.             }
  3365.         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);}}
  3366.         }
  3367.     }
  3368.     return value;
  3369. };
  3370.  
  3371. Game_BattlerBase.prototype.NParamStates = function(paramId) {
  3372.     var value = 0;
  3373.     var states = this.states();
  3374.     for (var i = 0; i < states.length; i++) {
  3375.         var item = states[i];
  3376.         if (item && item.NParams[paramId]) value += item.NParams[paramId];
  3377.         if (item && item.NParamEval[paramId]) {
  3378.         try {
  3379.         value += eval(item.NParamEvalAll + ';' + item.NParamEval[paramId]);
  3380.             }
  3381.         catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom NParam Base #' + paramId + ' in state #' + item.id);}}
  3382.         }
  3383.     }
  3384.     return value;
  3385. };
  3386.  
  3387. Game_BattlerBase.prototype.NParamEval = function(paramId) {
  3388.     return 0;
  3389. };
  3390.  
  3391. Game_BattlerBase.prototype.NParamLimits = function(paramId) {
  3392.     var array = eval(ICF.Param.NParamLimit[paramId]);
  3393.     if (!Array.isArray(array)) return (!isNaN(Number(array)))? [array] : [];
  3394.     return array;
  3395. };
  3396.  
  3397. Game_BattlerBase.prototype.NParamRate = function(paramId) {
  3398.     return this.traitsPi(Game_BattlerBase.TRAIT_NPARAM, paramId + 100);
  3399. };
  3400.  
  3401. Game_BattlerBase.prototype.NParamXRate = function(paramId) {
  3402.     return this.traitsPi(Game_BattlerBase.TRAIT_NPARAM, paramId + 300);
  3403. };
  3404.  
  3405. Game_BattlerBase.prototype.NParamBuffRate = function(paramId) {
  3406.     if (!this._NBuffs[paramId]) this._NBuffs[paramId] = 0;
  3407.     return this._NBuffs[paramId] * 0.25 + 1.0;
  3408. };
  3409.  
  3410. Game_BattlerBase.prototype.NParamFlat = function(paramId) {
  3411.     return this.traitsSum(Game_BattlerBase.TRAIT_NPARAM, paramId + 200);
  3412. };
  3413.  
  3414. Game_BattlerBase.prototype.NParamXFlat = function(paramId) {
  3415.     return this.traitsSum(Game_BattlerBase.TRAIT_NPARAM, paramId + 400);
  3416. };
  3417.  
  3418. Game_BattlerBase.prototype.NParam = function(paramId) {
  3419.     var value = this.NParamBase(paramId) + this.NParamEval(paramId) + this.NParamPlus(paramId);
  3420.     value *= this.NParamRate(paramId);
  3421.     var limits = this.NParamLimits(paramId);
  3422.     var buff = this.NParamXRate(paramId) * this.NParamBuffRate(paramId);
  3423.     if (limits.length > 1) value = Math.min(value, limits[1]);
  3424.     var flat = 0;
  3425.     if (limits.length > 1) flat = (buff > 1)? Math.min(this.NParamFlat(paramId), limits[1] - value) : Math.min(this.NParamFlat(paramId), limits[1] - value * buff);
  3426.     else flat = this.NParamFlat(paramId);
  3427.     value *= buff;
  3428.     value += flat + this.NParamXFlat(paramId);
  3429.     if (limits.length < 1) return Math.round(value);
  3430.     if (limits.length < 3) return Math.round(Math.max(value,limits[0]));
  3431.     return Math.round(value.clamp(limits[0], limits[2]));
  3432. };
  3433.  
  3434. Game_BattlerBase.prototype.setNParamBase = function(paramId, amount) {
  3435.     this._NParamPlus[paramId] = amount - this.NParamBase(paramId);
  3436. };
  3437.  
  3438. Game_BattlerBase.prototype.setNParamPlus = function(paramId, amount) {
  3439.     this._NParamPlus[paramId] = amount;
  3440. };
  3441.  
  3442. for (var i = 0; i < ICF.Param.NParams.length; i++) {
  3443.     if (ICF.Param.NParams[i].length > 0) {
  3444.         param = "set" + ICF.Param.NParams[i].substr(0,1).toUpperCase() + (ICF.Param.NParams[i].substr(1).toLowerCase());
  3445.         eval('Game_BattlerBase.prototype.' + param + 'Base = function(amount) { this.setNParamBase(' + i + ', amount); };');
  3446.         eval('Game_BattlerBase.prototype.' + param + 'Plus = function(amount) { this.setNParamPlus(' + i + ', amount); };');
  3447.     }
  3448. }
  3449.  
  3450. Game_BattlerBase.prototype.CParamBase = function(paramId) {
  3451.     var array = ICF.Param.CParamBase[paramId];
  3452.     if (!Array.isArray(array)) return (array != '')? eval(array) : 0;
  3453.     if (array.length < 1) {
  3454.         return 0;
  3455.     } else {
  3456.         return this.NParamBasic(array, this.level);
  3457.     }
  3458. };
  3459.  
  3460. Game_BattlerBase.prototype.CParamPlus = function(paramId) {
  3461.     if (!this._CParamPlus[paramId]) this._CParamPlus[paramId] = 0;
  3462.     return this._CParamPlus[paramId] + this.traitsSum(Game_BattlerBase.TRAIT_CPARAM, paramId) + this.CParamEquips(paramId) + this.CParamStates(paramId);
  3463. };
  3464.  
  3465. Game_BattlerBase.prototype.CParamEquips = function(paramId) {
  3466.     var value = 0;
  3467.     var equips = this.equips();
  3468.     for (var i = 0; i < equips.length; i++) {
  3469.         var item = equips[i];
  3470.         if (item && item.CParams[paramId]) value += item.CParams[paramId];
  3471.         if (item && item.CParamEval[paramId]) {
  3472.         try {
  3473.         value += eval(item.CParamEvalAll + ';' + item.CParamEval[paramId]);
  3474.             }
  3475.         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);}}
  3476.         }
  3477.     }
  3478.     return value;
  3479. };
  3480.  
  3481. Game_BattlerBase.prototype.CParamStates = function(paramId) {
  3482.     var value = 0;
  3483.     var states = this.states();
  3484.     for (var i = 0; i < states.length; i++) {
  3485.         var item = states[i];
  3486.         if (item && item.CParams[paramId]) value += item.CParams[paramId];
  3487.         if (item && item.CParamEval[paramId]) {
  3488.         try {
  3489.         value += eval(item.CParamEvalAll + ';' + item.CParamEval[paramId]);
  3490.             }
  3491.         catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom CParam Base #' + paramId + ' in state #' + item.id);}}
  3492.         }
  3493.     }
  3494.     return value;
  3495. };
  3496.  
  3497. Game_BattlerBase.prototype.CParamEval = function(paramId) {
  3498.     return 0;
  3499. };
  3500.  
  3501. Game_BattlerBase.prototype.CParamLimits = function(paramId) {
  3502.     var array = eval(ICF.Param.CParamLimit[paramId]);
  3503.     if (!Array.isArray(array)) return (!isNaN(Number(array)))? [array] : [];
  3504.     return array;
  3505. };
  3506.  
  3507. Game_BattlerBase.prototype.CParamRate = function(paramId) {
  3508.     return this.traitsPi(Game_BattlerBase.TRAIT_CPARAM, paramId + 100);
  3509. };
  3510.  
  3511. Game_BattlerBase.prototype.CParamXRate = function(paramId) {
  3512.     return this.traitsPi(Game_BattlerBase.TRAIT_CPARAM, paramId + 300);
  3513. };
  3514.  
  3515. Game_BattlerBase.prototype.CParamBuffRate = function(paramId) {
  3516.     if (!this._CBuffs[paramId]) this._CBuffs[paramId] = 0;
  3517.     return this._CBuffs[paramId] * 0.25 + 1.0;
  3518. };
  3519.  
  3520. Game_BattlerBase.prototype.CParamFlat = function(paramId) {
  3521.     return this.traitsSum(Game_BattlerBase.TRAIT_CPARAM, paramId + 200);
  3522. };
  3523.  
  3524. Game_BattlerBase.prototype.CParamXFlat = function(paramId) {
  3525.     return this.traitsSum(Game_BattlerBase.TRAIT_CPARAM, paramId + 400);
  3526. };
  3527.  
  3528. Game_BattlerBase.prototype.CParam = function(paramId) {
  3529.     var value = this.CParamBase(paramId) + this.CParamEval(paramId) + this.CParamPlus(paramId);
  3530.     value *= this.CParamRate(paramId);
  3531.     var limits = this.CParamLimits(paramId);
  3532.     var buff = this.CParamXRate(paramId) * this.CParamBuffRate(paramId);
  3533.     if (limits.length > 1) value = Math.min(value, limits[1]);
  3534.     var flat = 0;
  3535.     if (limits.length > 1) flat = (buff > 1)? Math.min(this.CParamFlat(paramId), limits[1] - value) : Math.min(this.CParamFlat(paramId), limits[1] - value * buff);
  3536.     else flat = this.CParamFlat(paramId);
  3537.     value *= buff;
  3538.     value += flat + this.CParamXFlat(paramId);
  3539.     if (limits.length < 1) return Math.round(value);
  3540.     if (limits.length < 3) return Math.round(Math.max(value,limits[0]));
  3541.     return Math.round(value.clamp(limits[0], limits[2]));
  3542. };
  3543.  
  3544. Game_BattlerBase.prototype.resetCParamValue = function(paramId) {
  3545.     if (!this._CParamValues) this._CParamValues = [];
  3546.     this._CParamValues[paramId] = this.CParam(paramId) * ICF.Param.CParamResetValue[paramId];
  3547.     this._CParamValues[paramId] = this._CParamValues[paramId].clamp(0, this.CParam(paramId));
  3548. };
  3549.  
  3550. Game_BattlerBase.prototype.resetCParams = function(ctype) {
  3551.     for (var i = 0; i < ICF.Param.CParams.length; i++) {
  3552.     if (ICF.Param.CParamResetType[i] == ctype) this.resetCParamValue(i);
  3553.     }
  3554. };
  3555.  
  3556. Game_BattlerBase.prototype.CParamValue = function(paramId) {
  3557.     if (!this._CParamValues) this._CParamValues = [];
  3558.     if (this._CParamValues[paramId] === undefined) this.resetCParamValue(paramId);
  3559.     return this._CParamValues[paramId];
  3560. };
  3561.  
  3562. Game_BattlerBase.prototype.setCParamValue = function(paramId, amount) {
  3563.     if (!this._CParamValues) this._CParamValues = [];
  3564.     this._CParamValues[paramId] = amount;
  3565.     this._CParamValues[paramId] = this._CParamValues[paramId].clamp(0, this.CParam(paramId));
  3566. };
  3567.  
  3568. Game_BattlerBase.prototype.isCParamValid = function(paramId) {
  3569.     if (ICF.Param.defaultValidCParams.length == 0) return true;
  3570.     return ICF.Param.defaultValidCParams.contains(paramId);
  3571. };
  3572.  
  3573. Game_BattlerBase.prototype.isCParamMain = function(paramId) {
  3574.     if (ICF.Param.defaultMainCParams.length == 0) return true;
  3575.     return ICF.Param.defaultMainCParams.contains(paramId);
  3576. };
  3577.  
  3578. Game_BattlerBase.prototype.gainCParamValue = function(paramId, amount) {
  3579.     if (this.isCParamValid(paramId)) {
  3580.     this._result.cparamDamages.push([paramId, -amount]);
  3581.     if (this._result.cparamDamage[paramId] === undefined) this._result.cparamDamage[paramId] = 0;
  3582.     this._result.cparamDamage[paramId] -= amount;
  3583.     if (this.isCParamMain(paramId) && !this._result.cparams.contains(paramId)) this._result.cparams.push(paramId);
  3584.     }
  3585.     if (!this._CParamValues) this._CParamValues = [];
  3586.     if (this._CParamValues[paramId] === undefined) this.resetCParamValue(paramId);
  3587.     this._CParamValues[paramId] += amount;
  3588.     this._CParamValues[paramId] = this._CParamValues[paramId].clamp(0, this.CParam(paramId));
  3589. };
  3590.  
  3591. Game_BattlerBase.prototype.gainSilentCParamValue = function(paramId, amount) {
  3592.     if (!this._CParamValues) this._CParamValues = [];
  3593.     if (this._CParamValues[paramId] === undefined) this.resetCParamValue(paramId);
  3594.     this._CParamValues[paramId] += amount;
  3595.     this._CParamValues[paramId] = this._CParamValues[paramId].clamp(0, this.CParam(paramId));
  3596. };
  3597.  
  3598. Game_BattlerBase.prototype.setCParamBase = function(paramId, amount) {
  3599.     this._CParamPlus[paramId] = amount - this.CParamBase(paramId);
  3600. };
  3601.  
  3602. Game_BattlerBase.prototype.setCParamPlus = function(paramId, amount) {
  3603.     this._CParamPlus[paramId] = amount;
  3604. };
  3605.  
  3606. for (var i = 0; i < ICF.Param.CParams.length; i++) {
  3607.     if (ICF.Param.CParams[i].length > 0) {
  3608.         var param = "gain" + ICF.Param.CParams[i].substr(0,1).toUpperCase() + (ICF.Param.CParams[i].substr(1).toLowerCase());
  3609.         eval('Game_BattlerBase.prototype.' + param + ' = function(amount) { this.gainCParamValue(' + i + ', amount); };');
  3610.         param = "gainSilent" + ICF.Param.CParams[i].substr(0,1).toUpperCase() + (ICF.Param.CParams[i].substr(1).toLowerCase());
  3611.         eval('Game_BattlerBase.prototype.' + param + ' = function(amount) { this.gainSilentCParamValue(' + i + ', amount); };');
  3612.         param = "set" + ICF.Param.CParams[i].substr(0,1).toUpperCase() + (ICF.Param.CParams[i].substr(1).toLowerCase());
  3613.         eval('Game_BattlerBase.prototype.' + param + ' = function(amount) { this.setCParamValue(' + i + ', amount); };');
  3614.         eval('Game_BattlerBase.prototype.' + ICF.Param.CParams[i] + 'Rate = function(amount) { return (this.CParamValue(' + i + ') / this.CParam(' + i + ')).clamp(0, 1); };');
  3615.         param = "set" + ICF.Param.CParamsMax[i].substr(0,1).toUpperCase() + (ICF.Param.CParamsMax[i].substr(1).toLowerCase());
  3616.         eval('Game_BattlerBase.prototype.' + param + 'Base = function(amount) { this.setCParamBase(' + i + ', amount); };');
  3617.         eval('Game_BattlerBase.prototype.' + param + 'Plus = function(amount) { this.setCParamPlus(' + i + ', amount); };');
  3618.     }
  3619. }
  3620.  
  3621. Game_BattlerBase.prototype.PParamBase = function(pparamId) {
  3622.     return eval(ICF.Param.PParamBase[pparamId]) || 0;
  3623. }
  3624.  
  3625. Game_BattlerBase.prototype.PParamEquips = function(paramId) {
  3626.     var value = 0;
  3627.     var equips = this.equips();
  3628.     for (var i = 0; i < equips.length; i++) {
  3629.         var item = equips[i];
  3630.         if (item && item.PParams[paramId]) value += item.PParams[paramId];
  3631.         if (item && item.PParamEval[paramId]) {
  3632.         try {
  3633.         value += eval(item.PParamEvalAll + ';' + item.PParamEval[paramId]);
  3634.             }
  3635.         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);}}
  3636.         }
  3637.     }
  3638.     return value;
  3639. };
  3640.  
  3641. Game_BattlerBase.prototype.PParamStates = function(paramId) {
  3642.     var value = 0;
  3643.     var states = this.states();
  3644.     for (var i = 0; i < states.length; i++) {
  3645.         var item = states[i];
  3646.         if (item && item.PParams[paramId]) value += item.PParams[paramId];
  3647.         if (item && item.PParamEval[paramId]) {
  3648.         try {
  3649.         value += eval(item.PParamEvalAll + ';' + item.PParamEval[paramId]);
  3650.             }
  3651.         catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom PParam Base #' + paramId + ' in state #' + item.id);}}
  3652.         }
  3653.     }
  3654.     return value;
  3655. };
  3656.  
  3657. Game_BattlerBase.prototype.PParamLimits = function(paramId) {
  3658.     var array = eval(ICF.Param.PParamLimit[paramId]);
  3659.     if (!Array.isArray(array)) return (!isNaN(Number(array)))? [array] : [];
  3660.     return array;
  3661. };
  3662.  
  3663. Game_BattlerBase.prototype.PParamPlus = function(pparamId) {
  3664.     if (!this._PParamPlus) this._PParamPlus = [];
  3665.     if (isNaN(this._PParamPlus[pparamId])) this._PParamPlus[pparamId] = 0;
  3666.     return this._PParamPlus[pparamId];
  3667. };
  3668.  
  3669. Game_BattlerBase.prototype.PParam = function(pparamId) {
  3670.     var value = this.PParamBase(pparamId) + this.traitsSum(Game_BattlerBase.TRAIT_PPARAM, pparamId);
  3671.     var limits = this.PParamLimits(pparamId);
  3672.     value += this.PParamEquips(pparamId) + this.PParamPlus(pparamId) + this.PParamStates(pparamId);
  3673.     value *= this.traitsPi(Game_BattlerBase.TRAIT_PPARAM, pparamId + 100);
  3674.     value += this.traitsSum(Game_BattlerBase.TRAIT_PPARAM, pparamId + 200);
  3675.     if (limits.length > 1) return value.clamp(limits[0], limits[1]);
  3676.     if (limits.length > 0) return Math.max(value, limits[0]);
  3677.     return value;
  3678. };
  3679.  
  3680. Game_BattlerBase.prototype.setPParamBase = function(paramId, amount) {
  3681.     if (!this._PParamPlus) this._PParamPlus = [];
  3682.     this._PParamPlus[paramId] = amount - this.PParamBase(paramId);
  3683. };
  3684.  
  3685. Game_BattlerBase.prototype.setPParamPlus = function(paramId, amount) {
  3686.     if (!this._PParamPlus) this._PParamPlus = [];
  3687.     this._PParamPlus[paramId] = amount;
  3688. };
  3689.  
  3690. for (var i = 0; i < ICF.Param.PParams.length; i++) {
  3691.     if (ICF.Param.PParams[i].length > 0) {
  3692.         param = "set" + ICF.Param.PParams[i].substr(0,1).toUpperCase() + (ICF.Param.PParams[i].substr(1).toLowerCase());
  3693.         eval('Game_BattlerBase.prototype.' + param + 'Base = function(amount) { this.setPParamBase(' + i + ', amount); };');
  3694.         eval('Game_BattlerBase.prototype.' + param + 'Plus = function(amount) { this.setPParamPlus(' + i + ', amount); };');
  3695.     }
  3696. }
  3697.  
  3698. ICF.ParamCore.paramplus = Game_BattlerBase.prototype.paramPlus;
  3699. Game_BattlerBase.prototype.paramPlus = function(paramId) {
  3700.     return ICF.ParamCore.paramplus.call(this, paramId) + this.traitsSum(Game_BattlerBase.TRAIT_PARAM, paramId + 10);
  3701. };
  3702.  
  3703. Game_BattlerBase.prototype.paramFlat = function(paramId) {
  3704.     return this.traitsSum(Game_BattlerBase.TRAIT_PARAM, paramId + 20);
  3705. };
  3706.  
  3707. Game_BattlerBase.prototype.paramXFlat = function(paramId) {
  3708.     return this.traitsSum(Game_BattlerBase.TRAIT_PARAM, paramId + 40);
  3709. };
  3710.  
  3711. Game_BattlerBase.prototype.paramXRate = function(paramId) {
  3712.     return this.traitsPi(Game_BattlerBase.TRAIT_PARAM, paramId + 30);
  3713. };
  3714.  
  3715. Game_BattlerBase.prototype.paramLimits = function(paramId) {
  3716.     var array = eval(ICF.Param.BParamLimit[paramId]);
  3717.     if (!Array.isArray(array)) return (!isNaN(Number(array)))? [array] : [];
  3718.     return array;
  3719. };
  3720.  
  3721. Game_BattlerBase.prototype.paramEquips = function(paramId) {
  3722.     var value = 0;
  3723.     var equips = this.equips();
  3724.     for (var i = 0; i < equips.length; i++) {
  3725.         var item = equips[i];
  3726.         if (item && item.BParamEval[paramId]) {
  3727.         try {
  3728.         value += eval(item.BParamEval[paramId]);
  3729.             }
  3730.         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);}}
  3731.         }
  3732.     }
  3733.     return value;
  3734. };
  3735.  
  3736. Game_BattlerBase.prototype.paramStates = function(paramId) {
  3737.     var value = 0;
  3738.     var states = this.states();
  3739.     for (var i = 0; i < states.length; i++) {
  3740.         var item = states[i];
  3741.         if (item && item.BParamEval[paramId]) {
  3742.         try {
  3743.         value += eval(item.BParamEvalAll + ';' + item.BParamEval[paramId]);
  3744.             }
  3745.         catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom BParam Base #' + paramId + ' in state #' + item.id);}}
  3746.         }
  3747.     }
  3748.     return value;
  3749. };
  3750.  
  3751. Game_BattlerBase.prototype.paramEval = function(paramId) {
  3752.     return 0;
  3753. };
  3754.  
  3755. Game_BattlerBase.prototype.param = function(paramId) {
  3756.     var value = this.paramBase(paramId) + this.paramPlus(paramId) + this.paramEquips(paramId) + this.paramEval(paramId);
  3757.     value *= this.paramRate(paramId);
  3758.     var limits = this.paramLimits(paramId);
  3759.     var buff = this.paramXRate(paramId) * this.paramBuffRate(paramId);
  3760.     if (limits.length > 1) value = Math.min(value, limits[1]);
  3761.     var flat = 0;
  3762.     if (limits.length > 1) flat = (buff > 1)? Math.min(this.paramFlat(paramId), limits[1] - value) : Math.min(this.paramFlat(paramId), limits[1] - value * buff);
  3763.     else flat = this.paramFlat(paramId);
  3764.     value *= buff;
  3765.     value += flat + this.paramXFlat(paramId);
  3766.     if (limits.length < 1) return Math.round(value);
  3767.     if (limits.length < 3) return Math.round(Math.max(value,limits[0]));
  3768.     return Math.round(value.clamp(limits[0], limits[2]));
  3769. };
  3770.  
  3771. Game_BattlerBase.prototype.setBParamBase = function(paramId, amount) {
  3772.     this._paramPlus[paramId] = amount - this.paramBase(paramId);
  3773. };
  3774.  
  3775. Game_BattlerBase.prototype.setBParamPlus = function(paramId, amount) {
  3776.     this._paramPlus[paramId] = amount;
  3777. };
  3778.  
  3779. for (var i = 0; i < ICF.Param.BParams.length; i++) {
  3780.     if (ICF.Param.BParams[i].length > 0) {
  3781.         param = "set" + ICF.Param.BParams[i].substr(0,1).toUpperCase() + (ICF.Param.BParams[i].substr(1).toLowerCase());
  3782.         eval('Game_BattlerBase.prototype.' + param + 'Base = function(amount) { this.setBParamBase(' + i + ', amount); };');
  3783.         eval('Game_BattlerBase.prototype.' + param + 'Plus = function(amount) { this.setBParamPlus(' + i + ', amount); };');
  3784.     }
  3785. }
  3786.  
  3787. Game_BattlerBase.prototype.maxTpBase = function() {
  3788.     return eval(ICF.Param.TPParamEval);
  3789. };
  3790.  
  3791. Game_BattlerBase.prototype.maxTpPlus = function() {
  3792.     return this.traitsSum(Game_BattlerBase.TRAIT_TPPARAM, 0);
  3793. };
  3794.  
  3795. Game_BattlerBase.prototype.maxTpRate = function() {
  3796.     return this.traitsPi(Game_BattlerBase.TRAIT_TPPARAM, 1);
  3797. };
  3798.  
  3799. Game_BattlerBase.prototype.maxTpFlat = function() {
  3800.     return this.traitsSum(Game_BattlerBase.TRAIT_TPPARAM, 2);
  3801. };
  3802.  
  3803. Game_BattlerBase.prototype.maxTpXRate = function() {
  3804.     return this.traitsPi(Game_BattlerBase.TRAIT_TPPARAM, 3);
  3805. };
  3806.  
  3807. Game_BattlerBase.prototype.maxTpXFlat = function() {
  3808.     return this.traitsSum(Game_BattlerBase.TRAIT_TPPARAM, 4);
  3809. };
  3810.  
  3811. Game_BattlerBase.prototype.maxTpLimits = function() { return [];
  3812.     var array = eval(ICF.Param.TPParamLimit);
  3813.     if (!Array.isArray(array)) return (!isNaN(Number(array)))? [array] : [];
  3814.     return array;
  3815. };
  3816.  
  3817. Game_BattlerBase.prototype.maxTp = function() {
  3818.     var value = this.maxTpBase() + this.maxTpPlus();
  3819.     value *= this.maxTpRate();
  3820.     var limits = this.maxTpLimits();
  3821.     var buff = this.maxTpXRate();
  3822.     if (limits.length > 1) value = Math.min(value, limits[1]);
  3823.     var flat = 0;
  3824.     if (limits.length > 1) flat = (buff > 1)? Math.min(this.maxTpFlat(), limits[1] - value) : Math.min(this.maxTpFlat(), limits[1] - value * buff);
  3825.     else flat = this.maxTpFlat();
  3826.     value *= buff;
  3827.     value += flat + this.maxTpXFlat();
  3828.     if (limits.length < 1) return Math.round(value);
  3829.     if (limits.length < 3) return Math.round(Math.max(value,limits[0]));
  3830.     return Math.round(value.clamp(limits[0], limits[2]));
  3831. };
  3832.  
  3833. Game_BattlerBase.prototype.setMaxTpBase = function(paramId, amount) {
  3834.     this._paramPlus[paramId] = amount - this.paramBase(paramId);
  3835. };
  3836.  
  3837. Game_BattlerBase.prototype.setMaxTpPlus = function(paramId, amount) {
  3838.     this._paramPlus[paramId] = amount;
  3839. };
  3840.  
  3841. Game_BattlerBase.prototype.xparamBase = function(xparamId) {
  3842.     return eval(ICF.Param.XParamBase[xparamId]) || 0;
  3843. }
  3844.  
  3845. Game_BattlerBase.prototype.xparamPlus = function(xparamId) {
  3846.     if (!this._XParamPlus) this._XParamPlus = [];
  3847.     return (this._XParamPlus[xparamId] || 0) + this.traitsSum(Game_BattlerBase.TRAIT_XPARAM, xparamId);
  3848. }
  3849.  
  3850. Game_BattlerBase.prototype.xparam = function(xparamId) {
  3851.     return (this.xparamBase(xparamId) + this.xparamPlus(xparamId)) * this.traitsPi(Game_BattlerBase.TRAIT_XPARAM, xparamId + 10) + this.traitsSum(Game_BattlerBase.TRAIT_XPARAM, xparamId + 20);
  3852. };
  3853.  
  3854. Game_BattlerBase.prototype.setXParamBase = function(paramId, amount) {
  3855.     if (!this._XParamPlus) this._XParamPlus = [];
  3856.     this._XParamPlus[paramId] = amount - this.xparamBase(paramId);
  3857. };
  3858.  
  3859. Game_BattlerBase.prototype.setXParamPlus = function(paramId, amount) {
  3860.     if (!this._XParamPlus) this._XParamPlus = [];
  3861.     this._XParamPlus[paramId] = amount;
  3862. };
  3863.  
  3864. for (var i = 0; i < ICF.Param.XParams.length; i++) {
  3865.     if (ICF.Param.XParams[i].length > 0) {
  3866.         param = "set" + ICF.Param.XParams[i].substr(0,1).toUpperCase() + (ICF.Param.XParams[i].substr(1).toLowerCase());
  3867.         eval('Game_BattlerBase.prototype.' + param + 'Base = function(amount) { this.setXParamBase(' + i + ', amount); };');
  3868.         eval('Game_BattlerBase.prototype.' + param + 'Plus = function(amount) { this.setXParamPlus(' + i + ', amount); };');
  3869.     }
  3870. }
  3871.  
  3872. Game_BattlerBase.prototype.sparamBase = function(sparamId) {
  3873.     return eval(ICF.Param.SParamBase[sparamId]) || 1;
  3874. }
  3875.  
  3876. Game_BattlerBase.prototype.sparamPlus = function(sparamId) {
  3877.     if (!this._SParamPlus) this._SParamPlus = [];
  3878.     return (this._SParamPlus[sparamId] || 0) + this.traitsSum(Game_BattlerBase.TRAIT_SPARAM, sparamId + 10);
  3879. }
  3880.  
  3881. Game_BattlerBase.prototype.sparam = function(sparamId) {
  3882.     return (this.sparamBase(sparamId) + this.sparamPlus(sparamId)) * this.traitsPi(Game_BattlerBase.TRAIT_SPARAM, sparamId) + this.traitsSum(Game_BattlerBase.TRAIT_SPARAM, sparamId + 20);
  3883. };
  3884.  
  3885. Game_BattlerBase.prototype.setSParamBase = function(paramId, amount) {
  3886.     if (!this._SParamPlus) this._SParamPlus = [];
  3887.     this._SParamPlus[paramId] = amount - this.sparamBase(paramId);
  3888. };
  3889.  
  3890. Game_BattlerBase.prototype.setSParamPlus = function(paramId, amount) {
  3891.     if (!this._SParamPlus) this._SParamPlus = [];
  3892.     this._SParamPlus[paramId] = amount;
  3893. };
  3894.  
  3895. for (var i = 0; i < ICF.Param.SParams.length; i++) {
  3896.     if (ICF.Param.SParams[i].length > 0) {
  3897.         param = "set" + ICF.Param.SParams[i].substr(0,1).toUpperCase() + (ICF.Param.SParams[i].substr(1).toLowerCase());
  3898.         eval('Game_BattlerBase.prototype.' + param + 'Base = function(amount) { this.setSParamBase(' + i + ', amount); };');
  3899.         eval('Game_BattlerBase.prototype.' + param + 'Plus = function(amount) { this.setSParamPlus(' + i + ', amount); };');
  3900.     }
  3901. }
  3902.  
  3903. Game_BattlerBase.prototype.NDebuffRate = function(paramId) {
  3904.     return this.traitsPi(Game_BattlerBase.TRAIT_DEBUFF_RATE, paramId + 10);
  3905. };
  3906.  
  3907. Game_BattlerBase.prototype.CDebuffRate = function(paramId) {
  3908.     return this.traitsPi(Game_BattlerBase.TRAIT_DEBUFF_RATE, paramId + 200);
  3909. };
  3910.  
  3911. Game_BattlerBase.prototype.addNParam = function(paramId, value) {
  3912.     if (!this._NParamPlus) this._NParamPlus = [];
  3913.     if (!this._NParamPlus[paramId]) this._NParamPlus[paramId] = 0;
  3914.     this._NParamPlus[paramId] += value;
  3915.     this.refresh();
  3916. };
  3917.  
  3918. Game_BattlerBase.prototype.addPParam = function(paramId, value) {
  3919.     if (!this._PParamPlus) this._PParamPlus = [];
  3920.     if (!this._PParamPlus[paramId]) this._PParamPlus[paramId] = 0;
  3921.     this._PParamPlus[paramId] += value;
  3922.     this.refresh();
  3923. };
  3924.  
  3925. Game_BattlerBase.prototype.addCParam = function(paramId, value) {
  3926.     if (!this._CParamPlus) this._CParamPlus = [];
  3927.     if (!this._CParamPlus[paramId]) this._CParamPlus[paramId] = 0;
  3928.     this._CParamPlus[paramId] += value;
  3929.     this.refresh();
  3930. };
  3931.  
  3932. Game_BattlerBase.prototype.addXParam = function(paramId, value) {
  3933.     if (!this._XParamPlus) this._XParamPlus = [];
  3934.     if (!this._XParamPlus[paramId]) this._XParamPlus[paramId] = 0;
  3935.     this._XParamPlus[paramId] += value;
  3936.     this.refresh();
  3937. };
  3938.  
  3939. Game_BattlerBase.prototype.addSParam = function(paramId, value) {
  3940.     if (!this._SParamPlus) this._SParamPlus = [];
  3941.     if (!this._SParamPlus[paramId]) this._SParamPlus[paramId] = 0;
  3942.     this._SParamPlus[paramId] += value;
  3943.     this.refresh();
  3944. };
  3945.  
  3946. //=============================================================================
  3947. // Game_Battler
  3948. //=============================================================================
  3949.  
  3950. Game_Battler.prototype.addNBuff = function(paramId, turns) {
  3951.     if (this.isAlive()) {
  3952.         this.increaseNBuff(paramId);
  3953.         if (this.isNBuffAffected(paramId)) {
  3954.             this.overwriteNBuffTurns(paramId, turns);
  3955.         }
  3956.         this._result.pushAddedNBuff(paramId);
  3957.         this.refresh();
  3958.     }
  3959. };
  3960.  
  3961. Game_Battler.prototype.addNDebuff = function(paramId, turns) {
  3962.     if (this.isAlive()) {
  3963.         this.decreaseNBuff(paramId);
  3964.         if (this.isNDebuffAffected(paramId)) {
  3965.             this.overwriteNBuffTurns(paramId, turns);
  3966.         }
  3967.         this._result.pushAddedNDebuff(paramId);
  3968.         this.refresh();
  3969.     }
  3970. };
  3971.  
  3972. Game_Battler.prototype.removeNBuff = function(paramId) {
  3973.     if (this.isAlive() && this.isNBuffOrDebuffAffected(paramId)) {
  3974.         this.eraseNBuff(paramId);
  3975.         this._result.pushRemovedNBuff(paramId);
  3976.         this.refresh();
  3977.     }
  3978. };
  3979.  
  3980. Game_Battler.prototype.addCBuff = function(paramId, turns) {
  3981.     if (this.isAlive()) {
  3982.         this.increaseCBuff(paramId);
  3983.         if (this.isCBuffAffected(paramId)) {
  3984.             this.overwriteCBuffTurns(paramId, turns);
  3985.         }
  3986.         this._result.pushAddedCBuff(paramId);
  3987.         this.refresh();
  3988.     }
  3989. };
  3990.  
  3991. Game_Battler.prototype.addCDebuff = function(paramId, turns) {
  3992.     if (this.isAlive()) {
  3993.         this.decreaseCBuff(paramId);
  3994.         if (this.isCDebuffAffected(paramId)) {
  3995.             this.overwriteCBuffTurns(paramId, turns);
  3996.         }
  3997.         this._result.pushAddedCDebuff(paramId);
  3998.         this.refresh();
  3999.     }
  4000. };
  4001.  
  4002. Game_Battler.prototype.removeCBuff = function(paramId) {
  4003.     if (this.isAlive() && this.isCBuffOrDebuffAffected(paramId)) {
  4004.         this.eraseCBuff(paramId);
  4005.         this._result.pushRemovedCBuff(paramId);
  4006.         this.refresh();
  4007.     }
  4008. };
  4009.  
  4010. ICF.ParamCore.removeAllBuffs = Game_Battler.prototype.removeAllBuffs;
  4011. Game_Battler.prototype.removeAllBuffs = function() {
  4012.     ICF.ParamCore.removeAllBuffs.call(this);
  4013.     for (var i = 0; i < this.NBuffLength(); i++) {
  4014.         this.removeNBuff(i);
  4015.     }
  4016.     for (var i = 0; i < this.CBuffLength(); i++) {
  4017.         this.removeCBuff(i);
  4018.     }
  4019. };
  4020.  
  4021. ICF.ParamCore.removeBuffsAuto = Game_Battler.prototype.removeBuffsAuto;
  4022. Game_Battler.prototype.removeBuffsAuto = function() {
  4023.     ICF.ParamCore.removeBuffsAuto.call(this);
  4024.     for (var i = 0; i < this.NBuffLength(); i++) {
  4025.         if (this.isNBuffExpired(i)) {
  4026.             this.removeNBuff(i);
  4027.         }
  4028.     }
  4029.     for (var i = 0; i < this.CBuffLength(); i++) {
  4030.         if (this.isCBuffExpired(i)) {
  4031.             this.removeCBuff(i);
  4032.         }
  4033.     }
  4034. };
  4035.  
  4036. ICF.ParamCore.onBattleStart = Game_Battler.prototype.onBattleStart;
  4037. Game_Battler.prototype.onBattleStart = function() {
  4038.     ICF.ParamCore.onBattleStart.call(this);
  4039.     this.resetCParams(3);
  4040. };
  4041.  
  4042. ICF.ParamCore.onBattleEnd = Game_Battler.prototype.onBattleEnd;
  4043. Game_Battler.prototype.onBattleEnd = function() {
  4044.     ICF.ParamCore.onBattleEnd.call(this);
  4045.     this.resetCParams(3);
  4046. };
  4047.  
  4048. //=============================================================================
  4049. // Game_Actor
  4050. //=============================================================================
  4051.  
  4052. Game_Actor.prototype.NParamBase = function(paramId) {
  4053.     if ($dataActors[this._actorId].customNParam[paramId] != '') {
  4054.     try {   var value = 0;
  4055.         eval($dataActors[this._actorId].customNParam[paramId]);
  4056.         return value;
  4057.         }
  4058.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom NParam Base #' + paramId + ' in actor #' + this._actorId);}}
  4059.     }
  4060.     if ($dataClasses[this._classId].customNParam[paramId] != '') {
  4061.     try {   var value = 0;
  4062.         eval($dataClasses[this._classId].customNParam[paramId]);
  4063.         return value;
  4064.         }
  4065.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom NParam Base #' + paramId + ' in actor class #' + this._classId);}}
  4066.     }
  4067.  
  4068.     var array = $dataActors[this._actorId].basicNParam[paramId];
  4069.     if (!array || array.length < 1) array = $dataClasses[this._classId].basicNParam[paramId];
  4070.  
  4071.     if (!array || array.length < 1) return Game_BattlerBase.prototype.NParamBase.call(this, paramId);
  4072.     return this.NParamBasic(array, this.level);
  4073. };
  4074.  
  4075. Game_Actor.prototype.CParamBase = function(paramId) {
  4076.     if ($dataActors[this._actorId].customCParam[paramId] != '') {
  4077.     try {   var value = 0;
  4078.         eval($dataActors[this._actorId].customCParam[paramId]);
  4079.         return value;
  4080.         }
  4081.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom CParam Base #' + paramId + ' in actor #' + this._actorId);}}
  4082.     }
  4083.     if ($dataClasses[this._classId].customCParam[paramId] != '') {
  4084.     try {   var value = 0;
  4085.         eval($dataClasses[this._classId].customCParam[paramId]);
  4086.         return value;
  4087.         }
  4088.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom CParam Base #' + paramId + ' in actor class #' + this._classId);}}
  4089.     }
  4090.  
  4091.     var array = $dataActors[this._actorId].basicCParam[paramId];
  4092.     if (!array || array.length < 1) array = $dataClasses[this._classId].basicCParam[paramId];
  4093.  
  4094.     if (!array || array.length < 1) return Game_BattlerBase.prototype.CParamBase.call(this, paramId);
  4095.     return this.NParamBasic(array, this.level);
  4096. };
  4097.  
  4098. ICF.ParamCore.actorparambase = Game_Actor.prototype.paramBase;
  4099. Game_Actor.prototype.paramBase = function(paramId) {
  4100.     if ($dataActors[this._actorId].customBParam[paramId] != '') {
  4101.     try {   var value = 0;
  4102.         var base = this.currentClass().params[paramId][1];
  4103.         eval($dataActors[this._actorId].customBParam[paramId]);
  4104.         return value;
  4105.         }
  4106.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom Param Base #' + paramId + ' in actor #' + this._actorId);}}
  4107.     }
  4108.     if ($dataClasses[this._classId].customBParam[paramId] != '') {
  4109.     try {   var value = 0;
  4110.         var base = this.currentClass().params[paramId][1];
  4111.         eval($dataClasses[this._classId].customBParam[paramId]);
  4112.         return value;
  4113.         }
  4114.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom Param Base #' + paramId + ' in actor class #' + this._classId);}}
  4115.     }
  4116.  
  4117.     if (ICF.Param.BParamBase[paramId].length > 0) {
  4118.     try {   var base = this.currentClass().params[paramId][1];
  4119.         return eval(ICF.Param.BParamBase[paramId]);
  4120.         }
  4121.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in default Param Base #' + paramId);}}
  4122.     }
  4123.     return ICF.ParamCore.actorparambase.call(this, paramId);
  4124. };
  4125.  
  4126. Game_Actor.prototype.maxTpBase = function() {
  4127.     if ($dataActors[this._actorId].customTp != '') {
  4128.     try {   var value = 0;
  4129.         eval($dataActors[this._actorId].customTp);
  4130.         return value;
  4131.         }
  4132.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom Tp Base in actor #' + this._actorId);}}
  4133.     }
  4134.     if ($dataClasses[this._classId].customTp != '') {
  4135.     try {   var value = 0;
  4136.         eval($dataClasses[this._classId].customTp);
  4137.         return value;
  4138.         }
  4139.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom Tp Base in actor class #' + this._classId);}}
  4140.     }
  4141.  
  4142.     return Game_BattlerBase.prototype.maxTpBase.call(this);
  4143. };
  4144.  
  4145. Game_Actor.prototype.isCParamValid = function(paramId) {
  4146.     var ary = $dataActors[this._actorId].validCParams;
  4147.     if (ary.length == 0) ary = $dataClasses[this._classId].validCParams;
  4148.     if (ary.length > 0) return ary.contains(paramId);
  4149.     return Game_BattlerBase.prototype.isCParamValid.call(this, paramId);
  4150. };
  4151.  
  4152. Game_Actor.prototype.isCParamMain = function(paramId) {
  4153.     var ary = $dataActors[this._actorId].mainCParams;
  4154.     if (ary.length == 0) ary = $dataClasses[this._classId].mainCParams;
  4155.     if (ary.length > 0) return ary.contains(paramId);
  4156.     return Game_BattlerBase.prototype.isCParamMain.call(this, paramId);
  4157. };
  4158.  
  4159. //=============================================================================
  4160. // Game_Enemy
  4161. //=============================================================================
  4162.  
  4163. Game_Enemy.prototype.NParamBase = function(paramId) {
  4164.     if ($dataEnemies[this._enemyId].customNParam[paramId] != '') {
  4165.     try {   var value = 0;
  4166.         eval($dataEnemies[this._enemyId].customNParam[paramId]);
  4167.         return value;
  4168.         }
  4169.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom NParam Base #' + paramId + ' in enemy #' + this._enemyId);}}
  4170.     }
  4171.     var currentClass = this.currentClass();
  4172.     if (currentClass && currentClass.customNParam[paramId] != '') {
  4173.     try {   var value = 0;
  4174.         eval(currentClass.customNParam[paramId]);
  4175.         return value;
  4176.         }
  4177.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom NParam Base #' + paramId + ' in enemy class #' + this._classId);}}
  4178.     }
  4179.  
  4180.  
  4181.     var array = $dataEnemies[this._enemyId].basicNParam[paramId];
  4182.     if ((!array || array.length < 1) && currentClass) array = currentClass.basicNParam[paramId];
  4183.  
  4184.     if (!array || array.length < 1) return Game_BattlerBase.prototype.NParamBase.call(this, paramId);
  4185.     return this.NParamBasic(array, this.level);
  4186. };
  4187.  
  4188. Game_Enemy.prototype.CParamBase = function(paramId) {
  4189.     if ($dataEnemies[this._enemyId].customCParam[paramId] != '') {
  4190.     try {   var value = 0;
  4191.         eval($dataEnemies[this._enemyId].customCParam[paramId]);
  4192.         return value;
  4193.         }
  4194.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom CParam Base #' + paramId + ' in enemy #' + this._enemyId);}}
  4195.     }
  4196.     var currentClass = this.currentClass();
  4197.     if (currentClass && currentClass.customCParam[paramId] != '') {
  4198.     try {   var value = 0;
  4199.         eval(currentClass.customCParam[paramId]);
  4200.         return value;
  4201.         }
  4202.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom CParam Base #' + paramId + ' in enemy class #' + this._classId);}}
  4203.     }
  4204.  
  4205.  
  4206.     var array = $dataEnemies[this._enemyId].basicCParam[paramId];
  4207.     if ((!array || array.length < 1) && currentClass) array = currentClass.basicCParam[paramId];
  4208.  
  4209.     if (!array || array.length < 1) return Game_BattlerBase.prototype.CParamBase.call(this, paramId);
  4210.     return this.NParamBasic(array, this.level);
  4211. };
  4212.  
  4213. ICF.ParamCore.enemyparambase = Game_Enemy.prototype.paramBase;
  4214. Game_Enemy.prototype.paramBase = function(paramId) {
  4215.     if ($dataEnemies[this._enemyId].customBParam[paramId] != '') {
  4216.     try {   var value = 0;
  4217.         var base = (this.currentClass())? this.currentClass().params[paramId][1] : this.enemy().params[paramId];
  4218.         eval($dataEnemies[this._enemyId].customBParam[paramId]);
  4219.         return value;
  4220.         }
  4221.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom Param Base #' + paramId + ' in enemy #' + this._enemyId);}}
  4222.     }
  4223.     var currentClass = this.currentClass();
  4224.     if (currentClass && currentClass.customBParam[paramId] != '') {
  4225.     try {   var value = 0;
  4226.         var base = (this.currentClass())? this.currentClass().params[paramId][1] : this.enemy().params[paramId];
  4227.         eval(currentClass.customBParam[paramId]);
  4228.         return value;
  4229.         }
  4230.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom Param Base #' + paramId + ' in enemy class #' + this._classId);}}
  4231.     }
  4232.  
  4233.     if (ICF.Param.BParamBase[paramId].length > 0) {
  4234.     try {   var base = (this.currentClass())? this.currentClass().params[paramId][1] : this.enemy().params[paramId];
  4235.         return eval(ICF.Param.BParamBase[paramId]);
  4236.         }
  4237.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in default Param Base #' + paramId);}}
  4238.     }
  4239.     return ICF.ParamCore.enemyparambase.call(this, paramId);
  4240. };
  4241.  
  4242. Game_Enemy.prototype.maxTpBase = function() {
  4243.     if ($dataEnemies[this._enemyId].customTp != '') {
  4244.     try {   var value = 0;
  4245.         eval($dataEnemies[this._enemyId].customTp);
  4246.         return value;
  4247.         }
  4248.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom Tp in enemy #' + this._enemyId);}}
  4249.     }
  4250.     var currentClass = this.currentClass();
  4251.     if (currentClass && currentClass.customTp != '') {
  4252.     try {   var value = 0;
  4253.         eval(currentClass.customTp);
  4254.         return value;
  4255.         }
  4256.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom Tp in enemy class #' + this._classId);}}
  4257.     }
  4258.  
  4259.     return Game_BattlerBase.prototype.maxTpBase.call(this);
  4260. };
  4261.  
  4262. Game_Enemy.prototype.isCParamValid = function(paramId) {
  4263.     var ary = $dataEnemies[this._enemyId].validCParams;
  4264.     var currentClass = this.currentClass();
  4265.     if ((ary.length == 0) && currentClass) ary = currentClass.validCParams;
  4266.     if (ary.length > 0) return ary.contains(paramId);
  4267.     return Game_BattlerBase.prototype.isCParamValid.call(this, paramId);
  4268. };
  4269.  
  4270. Game_Enemy.prototype.isCParamMain = function(paramId) {
  4271.     var ary = $dataEnemies[this._enemyId].mainCParams;
  4272.     var currentClass = this.currentClass();
  4273.     if ((ary.length == 0) && currentClass) ary = currentClass.mainCParams;
  4274.     if (ary.length > 0) return ary.contains(paramId);
  4275.     return Game_BattlerBase.prototype.isCParamMain.call(this, paramId);
  4276. };
  4277.  
  4278. //=============================================================================
  4279. // Game_Action
  4280. //=============================================================================
  4281.  
  4282. Game_Action.prototype.CParamEffect = function() {
  4283.     return this.item().damage.cparam;
  4284. };
  4285.  
  4286. Game_Action.prototype.isCParamEffect = function() {
  4287.     return this.item().damage.cparam > -1;
  4288. };
  4289.  
  4290. ICF.ParamCore.isHpEffect = Game_Action.prototype.isHpEffect;
  4291. Game_Action.prototype.isHpEffect = function() {
  4292.     if (this.isCParamEffect()) return false;
  4293.     return ICF.ParamCore.isHpEffect.call(this);
  4294. };
  4295.  
  4296. ICF.ParamCore.isMpEffect = Game_Action.prototype.isMpEffect;
  4297. Game_Action.prototype.isMpEffect = function() {
  4298.     if (this.isCParamEffect()) return false;
  4299.     return ICF.ParamCore.isMpEffect.call(this);
  4300. };
  4301.  
  4302. ICF.ParamCore.isHpRecover = Game_Action.prototype.isHpRecover;
  4303. Game_Action.prototype.isHpRecover = function() {
  4304.     if (this.isCParamEffect()) return false;
  4305.     return ICF.ParamCore.isHpRecover.call(this);
  4306. };
  4307.  
  4308. ICF.ParamCore.isMpRecover = Game_Action.prototype.isMpRecover;
  4309. Game_Action.prototype.isMpRecover = function() {
  4310.     if (this.isCParamEffect()) return false;
  4311.     return ICF.ParamCore.isMpRecover.call(this);
  4312. };
  4313.  
  4314. Game_Action.prototype.isCParamRecover = function() {
  4315.     if (!this.isCParamEffect()) return false;
  4316.     return this.checkDamageType([3, 4]);
  4317. };
  4318.  
  4319. ICF.ParamCore.testItemEffect = Game_Action.prototype.testItemEffect;
  4320. Game_Action.prototype.testItemEffect = function(target, effect) {
  4321.     switch (effect.code) {
  4322.     case Game_Action.EFFECT_RECOVER_CPARAM :
  4323.         return target.CParamValue(effect.dataId) < target.CParam(effect.dataId) || effect.value1 < 0 || effect.value2 < 0;
  4324.     case Game_Action.EFFECT_ADD_NBUFF :
  4325.     if (effect.dataId >= 100) return !target.isMaxCBuffAffected(effect.dataId - 100);
  4326.         return !target.isMaxNBuffAffected(effect.dataId);
  4327.     case Game_Action.EFFECT_ADD_NDEBUFF :
  4328.     if (effect.dataId >= 100) return !target.isMaxCDebuffAffected(effect.dataId - 100);
  4329.         return !target.isMaxNDebuffAffected(effect.dataId);
  4330.     case Game_Action.REMOVE_NBUFF:
  4331.     if (effect.dataId >= 100) return !target.isCBuffAffected(effect.dataId - 100);
  4332.         return target.isNBuffAffected(effect.dataId);
  4333.     case Game_Action.REMOVE_NDEBUFF:
  4334.     if (effect.dataId >= 100) return !target.isCDebuffAffected(effect.dataId - 100);
  4335.         return target.isNDebuffAffected(effect.dataId);
  4336.     default:
  4337.         return ICF.ParamCore.testItemEffect.call(this, target, effect);
  4338.     }
  4339. };
  4340.  
  4341. ICF.ParamCore.executeDamage = Game_Action.prototype.executeDamage;
  4342. Game_Action.prototype.executeDamage = function(target, value) {
  4343.     var result = target.result();
  4344.     if (value === 0) {
  4345.         result.critical = false;
  4346.     }
  4347.     if (this.isCParamEffect()) {
  4348.         this.executeCParamDamage(target, this.CParamEffect(), value);
  4349.     }
  4350.     else {
  4351.         ICF.ParamCore.executeDamage.call(this, target, value);
  4352.     }
  4353. };
  4354.  
  4355. Game_Action.prototype.executeCParamDamage = function(target, cparamId, value) {
  4356.     if (this.isDrain()) {
  4357.         value = Math.min(target.CParamValue(cparamId), value);
  4358.     }
  4359.     this.makeSuccess(target);
  4360.     if (target.isCParamValid(cparamId)) target.result().cparams.push(cparamId);
  4361.     target.gainCParamValue(cparamId, -value);
  4362.     if (value > 0) {
  4363.         target.onDamage(value);
  4364.     }
  4365.     this.gainDrainedCParam(cparamId, value);
  4366. };
  4367.  
  4368. Game_Action.prototype.gainDrainedCParam = function(cparamId, value) {
  4369.     if (this.isDrain()) {
  4370.     var gainTarget = this.subject();
  4371.     if (this._reflectionTarget !== undefined) {
  4372.         gainTarget = this._reflectionTarget;
  4373.     }
  4374.     gainTarget.gainCParamValue(cparamId, value);
  4375.     }
  4376. };
  4377.  
  4378. ICF.ParamCore.applyItemEffect = Game_Action.prototype.applyItemEffect;
  4379. Game_Action.prototype.applyItemEffect = function(target, effect) {
  4380.     switch (effect.code) {
  4381.     case Game_Action.EFFECT_RECOVER_CPARAM:
  4382.         this.itemEffectRecoverCParam(target, effect);
  4383.         break;
  4384.     case Game_Action.EFFECT_ADD_NBUFF:
  4385.     if (effect.dataId >= 100) {
  4386.         effect.dataId -= 100;
  4387.         this.itemEffectAddCBuff(target, effect);
  4388.         effect.dataId += 100;
  4389.         } else this.itemEffectAddNBuff(target, effect);
  4390.         break;
  4391.     case Game_Action.EFFECT_ADD_NDEBUFF:
  4392.         if (effect.dataId >= 100) {
  4393.         effect.dataId -= 100;
  4394.         this.itemEffectAddCDebuff(target, effect);
  4395.         effect.dataId += 100;
  4396.         } else this.itemEffectAddNDebuff(target, effect);
  4397.         break;
  4398.     case Game_Action.EFFECT_REMOVE_NBUFF:
  4399.         if (effect.dataId >= 100) {
  4400.         effect.dataId -= 100;
  4401.         this.itemEffectRemoveCBuff(target, effect);
  4402.         effect.dataId += 100;
  4403.         } else this.itemEffectRemoveNBuff(target, effect);
  4404.         break;
  4405.     case Game_Action.EFFECT_REMOVE_NDEBUFF:
  4406.         if (effect.dataId >= 100) {
  4407.         effect.dataId -= 100;
  4408.         this.itemEffectRemoveCDebuff(target, effect);
  4409.         effect.dataId += 100;
  4410.         } else this.itemEffectRemoveNDebuff(target, effect);
  4411.         break;
  4412.     case Game_Action.EFFECT_NGROW:
  4413.         this.itemEffectGrowNParam(target, effect);
  4414.         break;
  4415.     case Game_Action.EFFECT_PGROW:
  4416.         this.itemEffectGrowPParam(target, effect);
  4417.         break;
  4418.     case Game_Action.EFFECT_CGROW:
  4419.         this.itemEffectGrowCParam(target, effect);
  4420.         break;
  4421.     default:
  4422.         ICF.ParamCore.applyItemEffect.call(this, target, effect);
  4423.     }
  4424. };
  4425.  
  4426. Game_Action.prototype.itemEffectRecoverCParam = function(target, effect) {
  4427.     var value = (target.CParam(effect.dataId) * effect.value2 + effect.value1) * target.rec;
  4428.     if (this.isItem()) {
  4429.         value *= this.subject().pha;
  4430.     }
  4431.     value = Math.floor(value);
  4432.     if (value !== 0) {
  4433.         target.gainCParamValue(effect.dataId, value);
  4434.         this.makeSuccess(target);
  4435.     }
  4436. };
  4437.  
  4438. Game_Action.prototype.itemEffectAddNBuff = function(target, effect) {
  4439.     target.addNBuff(effect.dataId, effect.value1);
  4440.     this.makeSuccess(target);
  4441. };
  4442.  
  4443. Game_Action.prototype.itemEffectAddNDebuff = function(target, effect) {
  4444.     var chance = target.NDebuffRate(effect.dataId) * this.lukEffectRate(target);
  4445.     if (Math.random() < chance) {
  4446.         target.addNDebuff(effect.dataId, effect.value1);
  4447.         this.makeSuccess(target);
  4448.     }
  4449. };
  4450.  
  4451. Game_Action.prototype.itemEffectRemoveNBuff = function(target, effect) {
  4452.     if (target.isNBuffAffected(effect.dataId)) {
  4453.         target.removeNBuff(effect.dataId);
  4454.         this.makeSuccess(target);
  4455.     }
  4456. };
  4457.  
  4458. Game_Action.prototype.itemEffectRemoveNDebuff = function(target, effect) {
  4459.     if (target.isNDebuffAffected(effect.dataId)) {
  4460.         target.removeNBuff(effect.dataId);
  4461.         this.makeSuccess(target);
  4462.     }
  4463. };
  4464.  
  4465. Game_Action.prototype.itemEffectAddCBuff = function(target, effect) {
  4466.     target.addCBuff(effect.dataId, effect.value1);
  4467.     this.makeSuccess(target);
  4468. };
  4469.  
  4470. Game_Action.prototype.itemEffectAddCDebuff = function(target, effect) {
  4471.     var chance = target.CDebuffRate(effect.dataId) * this.lukEffectRate(target);
  4472.     if (Math.random() < chance) {
  4473.         target.addCDebuff(effect.dataId, effect.value1);
  4474.         this.makeSuccess(target);
  4475.     }
  4476. };
  4477.  
  4478. Game_Action.prototype.itemEffectRemoveCBuff = function(target, effect) {
  4479.     if (target.isCBuffAffected(effect.dataId)) {
  4480.         target.removeCBuff(effect.dataId);
  4481.         this.makeSuccess(target);
  4482.     }
  4483. };
  4484.  
  4485. Game_Action.prototype.itemEffectRemoveCDebuff = function(target, effect) {
  4486.     if (target.isCDebuffAffected(effect.dataId)) {
  4487.         target.removeCBuff(effect.dataId);
  4488.         this.makeSuccess(target);
  4489.     }
  4490. };
  4491.  
  4492. Game_Action.prototype.itemEffectGrow = function(target, effect) {
  4493.     if (effect.dataId >= 20) target.addSParam(effect.dataId - 20, Math.floor(effect.value1));
  4494.     else if (effect.dataId >= 10) target.addXParam(effect.dataId - 10, Math.floor(effect.value1));
  4495.     else target.addParam(effect.dataId, Math.floor(effect.value1));
  4496.     this.makeSuccess(target);
  4497. };
  4498.  
  4499. Game_Action.prototype.itemEffectGrowNParam = function(target, effect) {
  4500.     target.addNParam(effect.dataId, Math.floor(effect.value1));
  4501.     this.makeSuccess(target);
  4502. };
  4503.  
  4504. Game_Action.prototype.itemEffectGrowPParam = function(target, effect) {
  4505.     target.addPParam(effect.dataId, Math.floor(effect.value1));
  4506.     this.makeSuccess(target);
  4507. };
  4508.  
  4509. Game_Action.prototype.itemEffectGrowCParam = function(target, effect) {
  4510.     target.addCParam(effect.dataId, Math.floor(effect.value1));
  4511.     this.makeSuccess(target);
  4512. };
  4513.  
  4514. //=============================================================================
  4515. // Game_ActionResult
  4516. //=============================================================================
  4517.  
  4518. ICF.ParamCore.GARClear = Game_ActionResult.prototype.clear;
  4519. Game_ActionResult.prototype.clear = function() {
  4520.     ICF.ParamCore.GARClear.call(this);
  4521.     this.addedNBuffs = [];
  4522.     this.addedNDebuffs = [];
  4523.     this.removedNBuffs = [];
  4524.     this.cparamDamages = [];
  4525.     this.cparamDamage = {};
  4526.     this.cparams = [];
  4527. };
  4528.  
  4529. Game_ActionResult.prototype.isNBuffAdded = function(paramId) {
  4530.     return this.addedNBuffs.contains(paramId);
  4531. };
  4532.  
  4533. Game_ActionResult.prototype.pushAddedNBuff = function(paramId) {
  4534.     if (!this.isNBuffAdded(paramId)) {
  4535.         this.addedNBuffs.push(paramId);
  4536.     }
  4537. };
  4538.  
  4539. Game_ActionResult.prototype.isNDebuffAdded = function(paramId) {
  4540.     return this.addedNDebuffs.contains(paramId);
  4541. };
  4542.  
  4543. Game_ActionResult.prototype.pushAddedNDebuff = function(paramId) {
  4544.     if (!this.isNDebuffAdded(paramId)) {
  4545.         this.addedNDebuffs.push(paramId);
  4546.     }
  4547. };
  4548.  
  4549. Game_ActionResult.prototype.isNBuffRemoved = function(paramId) {
  4550.     return this.removedNBuffs.contains(paramId);
  4551. };
  4552.  
  4553. Game_ActionResult.prototype.pushnRemovedBuff = function(paramId) {
  4554.     if (!this.isNBuffRemoved(paramId)) {
  4555.         this.removedNBuffs.push(paramId);
  4556.     }
  4557. };
  4558.  
  4559. //=============================================================================
  4560. // Game_Item
  4561. //=============================================================================
  4562.  
  4563. Game_Item.prototype.nparamTypes = function() {
  4564.     return this.traitDataTypesMod(24, 100);
  4565. };
  4566.  
  4567. Game_Item.prototype.pparamTypes = function() {
  4568.     return this.traitDataTypesMod(25, 100);
  4569. };
  4570.  
  4571. Game_Item.prototype.cparamTypes = function() {
  4572.     return this.traitDataTypesMod(26, 100);
  4573. };
  4574.  
  4575. Game_Item.prototype.paramTypes = function() {
  4576.     return this.traitDataTypesMod(21, 10);
  4577. };
  4578.  
  4579. Game_Item.prototype.xparamTypes = function() {
  4580.     return this.traitDataTypesMod(22, 10);
  4581. };
  4582.  
  4583. Game_Item.prototype.sparamTypes = function() {
  4584.     return this.traitDataTypesMod(23, 10);
  4585. };
  4586.  
  4587. //=============================================================================
  4588. // Sprite_Damage
  4589. //=============================================================================
  4590.  
  4591. if (Imported.ICFSoft_MainCore) Sprite_Damage.prototype.setup = function(target) {
  4592.     var result = target.result();
  4593.     if (result.missed || result.evaded) {
  4594.         this.createMiss();
  4595.     result.missed = false;
  4596.     result.evaded = false;
  4597.     } else if (target.isAlive() && result.cparamDamages.length > 0 && result.cparams.contains(result.cparamDamages[0][0])) {
  4598.         this.createCParamDigits(result.cparamDamages[0]);
  4599.         result.cparamDamages.splice(0,1);
  4600.     } else if (result.damages[0].length > 0) {
  4601.         this.createDigits(0, -result.damages[0][0]);
  4602.         result.damages[0].splice(0,1);
  4603.     } else if (target.isAlive() && result.damages[1].length > 0) {
  4604.         this.createDigits(2, -result.damages[1][0]);
  4605.         result.damages[1].splice(0,1);
  4606.     } else if (target.isAlive() && result.damages[2].length > 0) {
  4607.         this.createTpDigits(-result.damages[2][0]);
  4608.         result.damages[2].splice(0,1);
  4609.     } else if (target.isAlive() && result.cparamDamages.length > 0) {
  4610.         this.createCParamDigits(result.cparamDamages[0]);
  4611.         result.cparamDamages.splice(0,1);
  4612.     } else {
  4613.         result.damages[1] = [];
  4614.         result.damages[2] = [];
  4615.     result.cparamDamages = [];
  4616.     }
  4617.     if (!result.missed && !result.evaded && result.critical) {
  4618.         this.setupCriticalEffect();
  4619.     result.critical = false;
  4620.     }
  4621.     if (result.delay > 0) {
  4622.     this.opacity = 0;
  4623.     }
  4624.     this._delay = result.delay;
  4625.     result.delay += 35;
  4626. };
  4627.  
  4628. else Sprite_Damage.prototype.setup = function(target) {
  4629.     var result = target.result();
  4630.     if (result.missed || result.evaded) {
  4631.         this.createMiss();
  4632.     } else if (target.isAlive() && result.cparamDamages.length > 0 && result.cparams.contains(result.cparamDamages[0][0])) {
  4633.         this.createCParamDigits(result.cparamDamages[0]);
  4634.         result.cparamDamages.splice(0,1);
  4635.     } else if (result.hpAffected) {
  4636.         this.createDigits(0, result.hpDamage);
  4637.     } else if (target.isAlive() && result.mpDamage !== 0) {
  4638.         this.createDigits(2, result.mpDamage);
  4639.     } else if (target.isAlive() && result.cparamDamages.length > 0) {
  4640.         this.createCParamDigits(result.cparamDamages[0]);
  4641.         result.cparamDamages.splice(0,1);
  4642.     } else {
  4643.     result.cparamDamages = [];
  4644.     }
  4645.     if (result.critical) {
  4646.         this.setupCriticalEffect();
  4647.     }
  4648. };
  4649.  
  4650. Sprite_Damage.prototype.createCParamDigits = function(ary) {
  4651.     var string = Math.abs(ary[1]).toString();
  4652.     var row = (ary[1] < 0 ? 1 : 0);
  4653.     var w = this.digitWidth();
  4654.     var h = this.digitHeight();
  4655.     for (var i = 0; i < string.length; i++) {
  4656.         var sprite = this.createChildSprite();
  4657.         var n = Number(string[i]);
  4658.         sprite.setFrame(n * w, row * h, w, h);
  4659.         sprite.x = (i - (string.length - 1) / 2) * w;
  4660.         sprite.dy = -i;
  4661.     }
  4662.     var pw = Window_Base._iconWidth;
  4663.     var ph = Window_Base._iconHeight;
  4664.     var sx = ICF.Param.CParamIcon[ary[0]] % 16 * pw;
  4665.     var sy = Math.floor(ICF.Param.CParamIcon[ary[0]] / 16) * ph;
  4666.         var sprite = this.createChildSprite();
  4667.         sprite.bitmap = ImageManager.loadSystem('IconSet');
  4668.         sprite.setFrame(sx, sy, pw, ph);
  4669.         sprite.x = (string.length - (string.length - 1) / 2) * w + 8;
  4670.         sprite.dy = -string.length;
  4671. };
  4672.  
  4673. ICF.ParamCore.Sprite_Damage_createDigits = Sprite_Damage.prototype.createDigits;
  4674. if (ICF.Param.useDamageIcons) Sprite_Damage.prototype.createDigits = function(baseRow, value) {
  4675.     ICF.ParamCore.Sprite_Damage_createDigits.call(this, baseRow, value);
  4676.     var string = Math.abs(value).toString();
  4677.     var row = baseRow / 2;
  4678.     var pw = Window_Base._iconWidth;
  4679.     var ph = Window_Base._iconHeight;
  4680.     var sx = ICF.Param.BParamIcon[row] % 16 * pw;
  4681.     var sy = Math.floor(ICF.Param.BParamIcon[row] / 16) * ph;
  4682.         var sprite = this.createChildSprite();
  4683.         sprite.bitmap = ImageManager.loadSystem('IconSet');
  4684.         sprite.setFrame(sx, sy, pw, ph);
  4685.         sprite.x = (string.length - (string.length - 1) / 2) * this.digitWidth() + 8;
  4686.         sprite.dy = -string.length;
  4687. };
  4688.  
  4689. Sprite_Damage.prototype.createTpDigits = function(value) {
  4690.     var string = Math.abs(value).toString();
  4691.     var row = (value < 0 ? 1 : 0);
  4692.     var w = this.digitWidth();
  4693.     var h = this.digitHeight();
  4694.     for (var i = 0; i < string.length; i++) {
  4695.         var sprite = this.createChildSprite();
  4696.         var n = Number(string[i]);
  4697.         sprite.bitmap = this._dtpDamageBitmap;
  4698.         sprite.setFrame(n * w, row * h, w, h);
  4699.         sprite.x = (i - (string.length - 1) / 2) * w;
  4700.         sprite.dy = -i;
  4701.     }
  4702. };
  4703.  
  4704. ICF.ParamCore.Sprite_Damage_createTpDigits = Sprite_Damage.prototype.createTpDigits;
  4705. if (ICF.Param.useDamageIcons) Sprite_Damage.prototype.createTpDigits = function(value) {
  4706.     ICF.ParamCore.Sprite_Damage_createTpDigits.call(this, value);
  4707.     var string = Math.abs(value).toString();
  4708.     var pw = Window_Base._iconWidth;
  4709.     var ph = Window_Base._iconHeight;
  4710.     var sx = ICF.Param.TPIcon % 16 * pw;
  4711.     var sy = Math.floor(ICF.Param.TPIcon / 16) * ph;
  4712.         var sprite = this.createChildSprite();
  4713.         sprite.bitmap = ImageManager.loadSystem('IconSet');
  4714.         sprite.setFrame(sx, sy, pw, ph);
  4715.         sprite.x = (string.length - (string.length - 1) / 2) * this.digitWidth() + 8;
  4716.         sprite.dy = -string.length;
  4717. };
  4718.  
  4719. //=============================================================================
  4720. // Window_BattleLog
  4721. //=============================================================================
  4722.  
  4723. Window_BattleLog.prototype.displayDamage = function(target) {
  4724.     if (target.result().missed) {
  4725.         this.displayMiss(target);
  4726.     } else if (target.result().evaded) {
  4727.         this.displayEvasion(target);
  4728.     } else {
  4729.         this.displayCParamDamage(target, true);
  4730.         this.displayHpDamage(target);
  4731.         this.displayMpDamage(target);
  4732.         this.displayTpDamage(target);
  4733.         this.displayCParamDamage(target, false);
  4734.     }
  4735. };
  4736.  
  4737. Window_BattleLog.prototype.displayCParamDamage = function(target, main) {
  4738.     var result = target.result();
  4739.     var keys = Object.keys(result.cparamDamage);
  4740.     if (main) { for (var i = 0; i < keys.length; i++) {
  4741.     if (result.cparams.contains(Number(keys[i]))) {
  4742.         if (result.cparamDamage[keys[i]] > 0 && !result.drain) {
  4743.         this.push('performDamage', target);
  4744.         }
  4745.         if (result.cparamDamage[keys[i]] < 0) {
  4746.         this.push('performRecovery', target);
  4747.         }
  4748.         this.push('addText', this.makeCParamDamageText(target, keys[i], result.cparamDamage[keys[i]]));
  4749.     }
  4750.     } } else { for (var i = 0; i < keys.length; i++) {
  4751.     if (!result.cparams.contains(Number(keys[i]))) {
  4752.         if (result.cparamDamage[keys[i]] < 0) {
  4753.         this.push('performRecovery', target);
  4754.         }
  4755.         this.push('addText', this.makeCParamDamageText(target, keys[i], result.cparamDamage[keys[i]]));
  4756.     }
  4757.     } }
  4758. };
  4759.  
  4760. Window_BattleLog.prototype.makeCParamDamageText = function(target, key, damage) {
  4761.     var result = target.result();
  4762.     var label = ICF.Param.CParamsFullName[key];
  4763.     var isActor = target.isActor();
  4764.     var fmt;
  4765.     if (damage > 0 && result.drain) {
  4766.         fmt = isActor ? TextManager.actorDrain : TextManager.enemyDrain;
  4767.         return fmt.format(target.name(), label, damage);
  4768.     } else if (damage > 0) {
  4769.         fmt = isActor ? TextManager.actorLoss : TextManager.enemyLoss;
  4770.         return fmt.format(target.name(), label, damage);
  4771.     } else if (damage < 0) {
  4772.         fmt = isActor ? TextManager.actorRecovery : TextManager.enemyRecovery;
  4773.         return fmt.format(target.name(), label, -damage);
  4774.     } else {
  4775.         fmt = isActor ? TextManager.actorNoDamage : TextManager.enemyNoDamage;
  4776.         return fmt.format(target.name());
  4777.     }
  4778. };
  4779.  
  4780. //=============================================================================
  4781. // End of File
  4782. //=============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement