Advertisement
ICF-Soft

ICF-Soft Params Core 1.07 RPG Maker MV

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