Advertisement
ICF-Soft

ICF-Soft Params Core 1.01 RPG Maker MV

Aug 27th, 2016
144
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.  
  12. ICF.ParamCore.Version = 101; // 1.01
  13.  
  14. //=============================================================================
  15.  /*:
  16.  * @plugindesc v1.01b This plugin allow to add new full custom params and
  17.  * more x/sparam control.
  18.  * @author ICF-Soft [http://icfsoft.blogspot.com.es/]
  19.  *
  20.  * @param NParam0 Name
  21.  * @desc Name for this new param in lowercase without spaces. Empty to skip.
  22.  * @default
  23.  *
  24.  * @param NParam0 Full Name
  25.  * @desc Name that will be shown for this new param.
  26.  * @default
  27.  *
  28.  * @param NParam0 Base
  29.  * @desc How this new param is configured by default. See help.
  30.  * @default 30 15
  31.  *
  32.  * @param NParam0 Limits
  33.  * @desc Formula for min and max value for this new param. See help.
  34.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  35.  *
  36.  * @param NParam0 Buff Icons
  37.  * @desc Icons for each buff stack. Empty to don't use. See help.
  38.  * @default
  39.  *
  40.  * @param NParam0 Debuff Icons
  41.  * @desc Icons for each debuff stack. Empty to don't use. See help.
  42.  * @default
  43.  *
  44.  * @param NParam1 Name
  45.  * @desc Name for this new param in lowercase without spaces. Empty to skip.
  46.  * @default
  47.  *
  48.  * @param NParam1 Full Name
  49.  * @desc Name that will be shown for this new param.
  50.  * @default
  51.  *
  52.  * @param NParam1 Base
  53.  * @desc How this new param is configured by default. See help.
  54.  * @default 30 15
  55.  *
  56.  * @param NParam1 Limits
  57.  * @desc Formula for min and max value for this new param. See help.
  58.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  59.  *
  60.  * @param NParam1 Buff Icons
  61.  * @desc Icons for each buff stack. Empty to don't use. See help.
  62.  * @default
  63.  *
  64.  * @param NParam1 Debuff Icons
  65.  * @desc Icons for each debuff stack. Empty to don't use. See help.
  66.  * @default
  67.  *
  68.  * @param NParam2 Name
  69.  * @desc Name for this new param in lowercase without spaces. Empty to skip.
  70.  * @default
  71.  *
  72.  * @param NParam2 Full Name
  73.  * @desc Name that will be shown for this new param.
  74.  * @default
  75.  *
  76.  * @param NParam2 Base
  77.  * @desc How this new param is configured by default. See help.
  78.  * @default 30 15
  79.  *
  80.  * @param NParam2 Limits
  81.  * @desc Formula for min and max value for this new param. See help.
  82.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  83.  *
  84.  * @param NParam2 Buff Icons
  85.  * @desc Icons for each buff stack. Empty to don't use. See help.
  86.  * @default
  87.  *
  88.  * @param NParam2 Debuff Icons
  89.  * @desc Icons for each debuff stack. Empty to don't use. See help.
  90.  * @default
  91.  *
  92.  * @param NParam3 Name
  93.  * @desc Name for this new param in lowercase without spaces. Empty to skip.
  94.  * @default
  95.  *
  96.  * @param NParam3 Full Name
  97.  * @desc Name that will be shown for this new param.
  98.  * @default
  99.  *
  100.  * @param NParam3 Base
  101.  * @desc How this new param is configured by default. See help.
  102.  * @default 30 15
  103.  *
  104.  * @param NParam3 Limits
  105.  * @desc Formula for min and max value for this new param. See help.
  106.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  107.  *
  108.  * @param NParam3 Buff Icons
  109.  * @desc Icons for each buff stack. Empty to don't use. See help.
  110.  * @default
  111.  *
  112.  * @param NParam3 Debuff Icons
  113.  * @desc Icons for each debuff stack. Empty to don't use. See help.
  114.  * @default
  115.  *
  116.  * @param NParam4 Name
  117.  * @desc Name for this new param in lowercase without spaces. Empty to skip.
  118.  * @default
  119.  *
  120.  * @param NParam4 Full Name
  121.  * @desc Name that will be shown for this new param.
  122.  * @default
  123.  *
  124.  * @param NParam4 Base
  125.  * @desc How this new param is configured by default. See help.
  126.  * @default 30 15
  127.  *
  128.  * @param NParam4 Limits
  129.  * @desc Formula for min and max value for this new param. See help.
  130.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  131.  *
  132.  * @param NParam4 Buff Icons
  133.  * @desc Icons for each buff stack. Empty to don't use. See help.
  134.  * @default
  135.  *
  136.  * @param NParam4 Debuff Icons
  137.  * @desc Icons for each debuff stack. Empty to don't use. See help.
  138.  * @default
  139.  *
  140.  * @param NParam5 Name
  141.  * @desc Name for this new param in lowercase without spaces. Empty to skip.
  142.  * @default
  143.  *
  144.  * @param NParam5 Full Name
  145.  * @desc Name that will be shown for this new param.
  146.  * @default
  147.  *
  148.  * @param NParam5 Base
  149.  * @desc How this new param is configured by default. See help.
  150.  * @default 30 15
  151.  *
  152.  * @param NParam5 Limits
  153.  * @desc Formula for min and max value for this new param. See help.
  154.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  155.  *
  156.  * @param NParam5 Buff Icons
  157.  * @desc Icons for each buff stack. Empty to don't use. See help.
  158.  * @default
  159.  *
  160.  * @param NParam5 Debuff Icons
  161.  * @desc Icons for each debuff stack. Empty to don't use. See help.
  162.  * @default
  163.  *
  164.  * @param NParam6 Name
  165.  * @desc Name for this new param in lowercase without spaces. Empty to skip.
  166.  * @default
  167.  *
  168.  * @param NParam6 Full Name
  169.  * @desc Name that will be shown for this new param.
  170.  * @default
  171.  *
  172.  * @param NParam6 Base
  173.  * @desc How this new param is configured by default. See help.
  174.  * @default 30 15
  175.  *
  176.  * @param NParam6 Limits
  177.  * @desc Formula for min and max value for this new param. See help.
  178.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  179.  *
  180.  * @param NParam6 Buff Icons
  181.  * @desc Icons for each buff stack. Empty to don't use. See help.
  182.  * @default
  183.  *
  184.  * @param NParam6 Debuff Icons
  185.  * @desc Icons for each debuff stack. Empty to don't use. See help.
  186.  * @default
  187.  *
  188.  * @param NParam7 Name
  189.  * @desc Name for this new param in lowercase without spaces. Empty to skip.
  190.  * @default
  191.  *
  192.  * @param NParam7 Full Name
  193.  * @desc Name that will be shown for this new param.
  194.  * @default
  195.  *
  196.  * @param NParam7 Base
  197.  * @desc How this new param is configured by default. See help.
  198.  * @default 30 15
  199.  *
  200.  * @param NParam7 Limits
  201.  * @desc Formula for min and max value for this new param. See help.
  202.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  203.  *
  204.  * @param NParam7 Buff Icons
  205.  * @desc Icons for each buff stack. Empty to don't use. See help.
  206.  * @default
  207.  *
  208.  * @param NParam7 Debuff Icons
  209.  * @desc Icons for each debuff stack. Empty to don't use. See help.
  210.  * @default
  211.  *
  212.  * @param NParam8 Name
  213.  * @desc Name for this new param in lowercase without spaces. Empty to skip.
  214.  * @default
  215.  *
  216.  * @param NParam8 Full Name
  217.  * @desc Name that will be shown for this new param.
  218.  * @default
  219.  *
  220.  * @param NParam8 Base
  221.  * @desc How this new param is configured by default. See help.
  222.  * @default 30 15
  223.  *
  224.  * @param NParam8 Limits
  225.  * @desc Formula for min and max value for this new param. See help.
  226.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  227.  *
  228.  * @param NParam8 Buff Icons
  229.  * @desc Icons for each buff stack. Empty to don't use. See help.
  230.  * @default
  231.  *
  232.  * @param NParam8 Debuff Icons
  233.  * @desc Icons for each debuff stack. Empty to don't use. See help.
  234.  * @default
  235.  *
  236.  * @param NParam9 Name
  237.  * @desc Name for this new param in lowercase without spaces. Empty to skip.
  238.  * @default
  239.  *
  240.  * @param NParam9 Full Name
  241.  * @desc Name that will be shown for this new param.
  242.  * @default
  243.  *
  244.  * @param NParam9 Base
  245.  * @desc How this new param is configured by default. See help.
  246.  * @default 30 15
  247.  *
  248.  * @param NParam9 Limits
  249.  * @desc Formula for min and max value for this new param. See help.
  250.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  251.  *
  252.  * @param NParam9 Buff Icons
  253.  * @desc Icons for each buff stack. Empty to don't use. See help.
  254.  * @default
  255.  *
  256.  * @param NParam9 Debuff Icons
  257.  * @desc Icons for each debuff stack. Empty to don't use. See help.
  258.  * @default
  259.  *
  260.  * @param PParam0 Name
  261.  * @desc Name for this plain param in lowercase without spaces. Empty to skip.
  262.  * @default
  263.  *
  264.  * @param PParam0 Full Name
  265.  * @desc Name that will be shown for this plain param.
  266.  * @default
  267.  *
  268.  * @param PParam0 Base
  269.  * @desc Formula for base value for this plain param.
  270.  * @default 0
  271.  *
  272.  * @param PParam1 Name
  273.  * @desc Name for this plain param in lowercase without spaces. Empty to skip.
  274.  * @default
  275.  *
  276.  * @param PParam1 Full Name
  277.  * @desc Name that will be shown for this plain param.
  278.  * @default
  279.  *
  280.  * @param PParam1 Base
  281.  * @desc Formula for base value for this plain param.
  282.  * @default 0
  283.  *
  284.  * @param PParam2 Name
  285.  * @desc Name for this plain param in lowercase without spaces. Empty to skip.
  286.  * @default
  287.  *
  288.  * @param PParam2 Full Name
  289.  * @desc Name that will be shown for this plain param.
  290.  * @default
  291.  *
  292.  * @param PParam2 Base
  293.  * @desc Formula for base value for this plain param.
  294.  * @default 0
  295.  *
  296.  * @param PParam3 Name
  297.  * @desc Name for this plain param in lowercase without spaces. Empty to skip.
  298.  * @default
  299.  *
  300.  * @param PParam3 Full Name
  301.  * @desc Name that will be shown for this plain param.
  302.  * @default
  303.  *
  304.  * @param PParam3 Base
  305.  * @desc Formula for base value for this plain param.
  306.  * @default 0
  307.  *
  308.  * @param PParam4 Name
  309.  * @desc Name for this plain param in lowercase without spaces. Empty to skip.
  310.  * @default
  311.  *
  312.  * @param PParam4 Full Name
  313.  * @desc Name that will be shown for this plain param.
  314.  * @default
  315.  *
  316.  * @param PParam4 Base
  317.  * @desc Formula for base value for this plain param.
  318.  * @default 0
  319.  *
  320.  * @param PParam5 Name
  321.  * @desc Name for this plain param in lowercase without spaces. Empty to skip.
  322.  * @default
  323.  *
  324.  * @param PParam5 Full Name
  325.  * @desc Name that will be shown for this plain param.
  326.  * @default
  327.  *
  328.  * @param PParam5 Base
  329.  * @desc Formula for base value for this plain param.
  330.  * @default 0
  331.  *
  332.  * @param PParam6 Name
  333.  * @desc Name for this plain param in lowercase without spaces. Empty to skip.
  334.  * @default
  335.  *
  336.  * @param PParam6 Full Name
  337.  * @desc Name that will be shown for this plain param.
  338.  * @default
  339.  *
  340.  * @param PParam6 Base
  341.  * @desc Formula for base value for this plain param.
  342.  * @default 0
  343.  *
  344.  * @param PParam7 Name
  345.  * @desc Name for this plain param in lowercase without spaces. Empty to skip.
  346.  * @default
  347.  *
  348.  * @param PParam7 Full Name
  349.  * @desc Name that will be shown for this plain param.
  350.  * @default
  351.  *
  352.  * @param PParam7 Base
  353.  * @desc Formula for base value for this plain param.
  354.  * @default 0
  355.  *
  356.  * @param PParam8 Name
  357.  * @desc Name for this plain param in lowercase without spaces. Empty to skip.
  358.  * @default
  359.  *
  360.  * @param PParam8 Full Name
  361.  * @desc Name that will be shown for this plain param.
  362.  * @default
  363.  *
  364.  * @param PParam8 Base
  365.  * @desc Formula for base value for this plain param.
  366.  * @default 0
  367.  *
  368.  * @param PParam9 Name
  369.  * @desc Name for this plain param in lowercase without spaces. Empty to skip.
  370.  * @default
  371.  *
  372.  * @param PParam9 Full Name
  373.  * @desc Name that will be shown for this plain param.
  374.  * @default
  375.  *
  376.  * @param PParam9 Base
  377.  * @desc Formula for base value for this plain param.
  378.  * @default 0
  379.  *
  380.  * @param BParam0 Limits
  381.  * @desc Formula for min and max value for this new param. See help.
  382.  * Hit points
  383.  * @default (this.isActor())? [1, 9999, 12000] : [1, 999999, 1200000]
  384.  *
  385.  * @param BParam1 Limits
  386.  * @desc Formula for min and max value for this new param. See help.
  387.  * Magic points
  388.  * @default (this.isActor())? [0, 9999, 12000] : [0, 9999, 12000]
  389.  *
  390.  * @param BParam2 Limits
  391.  * @desc Formula for min and max value for this new param. See help.
  392.  * Attack
  393.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  394.  *
  395.  * @param BParam3 Limits
  396.  * @desc Formula for min and max value for this new param. See help.
  397.  * Defense
  398.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  399.  *
  400.  * @param BParam4 Limits
  401.  * @desc Formula for min and max value for this new param. See help.
  402.  * Magic attack
  403.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  404.  *
  405.  * @param BParam5 Limits
  406.  * @desc Formula for min and max value for this new param. See help.
  407.  * Magic defense
  408.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  409.  *
  410.  * @param BParam6 Limits
  411.  * @desc Formula for min and max value for this new param. See help.
  412.  * Agility
  413.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  414.  *
  415.  * @param BParam7 Limits
  416.  * @desc Formula for min and max value for this new param. See help.
  417.  * Luck
  418.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  419.  *
  420.  * @param XParam0 Base
  421.  * @desc Formula for base value for x param hit (HIT rate).
  422.  * @default 0
  423.  *
  424.  * @param XParam1 Base
  425.  * @desc Formula for base value for x param eva (EVAsion rate).
  426.  * @default 0
  427.  *
  428.  * @param XParam2 Base
  429.  * @desc Formula for base value for x param cri (CRItical rate).
  430.  * @default 0
  431.  *
  432.  * @param XParam3 Base
  433.  * @desc Formula for base value for x param cev (Critical Evasion Rate).
  434.  * @default 0
  435.  *
  436.  * @param XParam4 Base
  437.  * @desc Formula for base value for x param mev (Magic EVasion rate).
  438.  * @default 0
  439.  *
  440.  * @param XParam5 Base
  441.  * @desc Formula for base value for x param mrf (Magic ReFlection rate).
  442.  * @default 0
  443.  *
  444.  * @param XParam6 Base
  445.  * @desc Formula for base value for x param cnt (CouNTer attack rate).
  446.  * @default 0
  447.  *
  448.  * @param XParam7 Base
  449.  * @desc Formula for base value for x param hrg (Hp ReGeneration rate).
  450.  * @default 0
  451.  *
  452.  * @param XParam8 Base
  453.  * @desc Formula for base value for x param mrg (Mp ReGeneration rate).
  454.  * @default 0
  455.  *
  456.  * @param XParam9 Base
  457.  * @desc Formula for base value for x param trg (Tp ReGeneration rate).
  458.  * @default 0
  459.  *
  460.  * @param SParam0 Base
  461.  * @desc Formula for base value for x param tgr (TarGet Rate).
  462.  * @default 1
  463.  *
  464.  * @param SParam1 Base
  465.  * @desc Formula for base value for s param grd (GuaRD effect rate).
  466.  * @default 1
  467.  *
  468.  * @param SParam2 Base
  469.  * @desc Formula for base value for s param rec (RECovery effect rate).
  470.  * @default 1
  471.  *
  472.  * @param SParam3 Base
  473.  * @desc Formula for base value for s param pha (PHArmacology).
  474.  * @default 1
  475.  *
  476.  * @param SParam4 Base
  477.  * @desc Formula for base value for s param mcr (Mp Cost Rate).
  478.  * @default 1
  479.  *
  480.  * @param SParam5 Base
  481.  * @desc Formula for base value for s param tcr (Tp Cost Rate).
  482.  * @default 1
  483.  *
  484.  * @param SParam6 Base
  485.  * @desc Formula for base value for s param pdr (Physical Damage Rate).
  486.  * @default 1
  487.  *
  488.  * @param SParam7 Base
  489.  * @desc Formula for base value for s param mdr (Magical Damage Rate).
  490.  * @default 1
  491.  *
  492.  * @param SParam8 Base
  493.  * @desc Formula for base value for s param fdr (Floor Damage Rate).
  494.  * @default 1
  495.  *
  496.  * @param SParam9 Base
  497.  * @desc Formula for base value for s param exr (EXperience Rate).
  498.  * @default 1
  499.  *
  500.  * @param Developer HaltJS
  501.  * @desc When true it throws an error if a custom class param/nparam
  502.  * javascript doesn't work.   NO - false     YES - true
  503.  * @default false
  504.  *
  505.  * @help
  506.  * ============================================================================
  507.  * Introduction
  508.  *
  509.  * By default there are some fixed types of params, there are usefull but
  510.  * have specified purposes and limits the way you can use them.
  511.  *
  512.  * With this plugin you can add new params that can be used in your formulas
  513.  * and every use you can imagine.
  514.  *
  515.  * There are 2 new param types:
  516.  *  -New/Normal Params: Level based params like the default ones,
  517.  *   with buff/debuff effects and trait modifiers.
  518.  *   Plus an option that can be used in some enemy levels plugins.
  519.  *
  520.  *  -Plain Params: Non level based params, these work as x/sparams
  521.  *   with trait modifiers.
  522.  *
  523.  * Now there are more customization and control for basic, x and s params.
  524.  * And a new double cap feature.
  525.  *
  526.  * ============================================================================
  527.  * How to use
  528.  * ============================================================================
  529.  *
  530.  * NParams and PParams are calculated with their respective formulas:
  531.  *
  532.  * NParam = (Base + Plus) * Rate * XRate * Buff + Flat
  533.  * PParam = (Base + Plus) * Rate + Flat
  534.  *
  535.  *   -Base is different for n and pparams. For NParams is a level based value.
  536.  *    For PParam is a fixed value used to emulate x/sparams (0 and 1).
  537.  *   -Plus is the sum of all plus traits attached to a battler. In case of
  538.  *    NParam there is an extra added by script calls and item effects.
  539.  *   -Rate is the product of all trait multipliers attached to a battler.
  540.  *   -XRate is the product of all trait x-multipliers attached to a battler.
  541.  *   -Buff is de effect of buff/debuff.
  542.  *   -Flat is the sum of all flat trais attached to a battler. It isn't affected
  543.  *    by any rate.
  544.  *
  545.  * XRate and Buff can make param to pass througth first max cap.
  546.  *
  547.  * To make XParams and SParams more customizable I've changed a little
  548.  * their formulas:
  549.  *
  550.  * Param  = (Base + Plus) * Rate * XRate * Buff + Flat
  551.  * XParam = (Base + Plus) * Rate + Flat
  552.  * SParam = (Base + Plus) * Rate + Flat
  553.  *
  554.  * They still work as usual but now you can add traits to have more control.
  555.  *
  556.  * To add traits you can use notetags inside data.
  557.  *
  558.  * Classes and enemies only:
  559.  *
  560.  * <NPARAM: NParam Base Grow>
  561.  *    -Overrides default NParam for specified class/enemy.
  562.  *     NParam can be referenced by it's name or index.
  563.  *     Base is the initial value in level 1.
  564.  *     Grow is how much is increased per level. If empty it will be fixed.
  565.  *    
  566.  *
  567.  * Actors, classes, enemies, weapons, armors and states:
  568.  *
  569.  * <NDEBUFFRATE: NParam Rate>
  570.  *    -This is used for nparam debuff resistance, it's the chance of
  571.  *     succes debuff.
  572.  *     0.5 means 50% debuff succes, 0.2 is 20% and so on.
  573.  *
  574.  *
  575.  * <NPARAMPLUS: NParam Plus>
  576.  * <NPARAMRATE: NParam Rate>
  577.  * <NPARAMXRATE: NParam XRate>
  578.  * <NPARAMFLAT: NParam Flat>
  579.  *    -There are plus, rate, xrate and flat modifiers for nparam.
  580.  *
  581.  * <PPARAMPLUS: PParam Plus>
  582.  * <PPARAMRATE: PParam Rate>
  583.  * <PPARAMFLAT: PParam Flat>
  584.  *    -There are plus, rate and flat modifiers for pparam.
  585.  *
  586.  * <PARAMPLUS: Param Plus>
  587.  * <PARAMRATE: Param Rate>
  588.  * <PARAMXRATE: Param XRate>
  589.  * <PARAMFLAT: Param Flat>
  590.  * <xPARAMPLUS: XParam Plus>
  591.  * <XPARAMRATE: XParam Rate>
  592.  * <XPARAMFLAT: XParam Flat>
  593.  * <SPARAMPLUS: SParam Plus>
  594.  * <SPARAMRATE: SParam Rate>
  595.  * <SPARAMFLAT: SParam Flat>
  596.  *    -There are plus, rate, xrate and flat modifiers for x and sparam.
  597.  *     I have included these to give more control.
  598.  *
  599.  *
  600.  * Skills and items only:
  601.  *
  602.  * <NBUFF: NParam turns>
  603.  * <NDEBUFF: NParam turns>
  604.  * <REMOVE NBUFF: NParam>
  605.  * <REMOVE NDEBUFF: NParam>
  606.  *    -There are buff/debuff effects to attach to skills and items.
  607.  *
  608.  * <NPARAM GROW: NParam amount>
  609.  *    -Allow to increase/decrease nparam by a specified amount.
  610.  *
  611.  * ============================================================================
  612.  * Lunatic Mode
  613.  * ============================================================================
  614.  *
  615.  * Knowing javascript you can redefine specific base value for params
  616.  * and nparams for classes through lunatic mode.
  617.  *
  618.  * It also work in notetags inside classes:
  619.  *
  620.  * <CUSTOM NPARAM BASE NPARAM>
  621.  * value = 2;
  622.  * value += 25;
  623.  * </CUSTOM NPARAM BASE>
  624.  *
  625.  * <CUSTOM PARAM BASE PARAM>
  626.  * value = 2;
  627.  * value += 25;
  628.  * </CUSTOM PARAM BASE>
  629.  *
  630.  * Those params defined will use their formula instead of normal base
  631.  * value calculation. You can use javascript between these tags to alter
  632.  * the final result.
  633.  *
  634.  * value - This is the value you want to alter with your own formula.
  635.  *         It starts at 0.
  636.  *
  637.  * ============================================================================
  638.  * Parameters
  639.  * ============================================================================
  640.  *
  641.  * There are avaiable up to 10 params of each type with indexes from 0 to 9.
  642.  *
  643.  * NParamX Name: the name you give to specified nparam. It will be used
  644.  * in formulas and can be used to reference a notetag.
  645.  * Leave empty to skip.
  646.  *
  647.  * NParamX Full Name: the name you give to specified nparam. It is not used
  648.  * here but usefull for plugins that need this.
  649.  *
  650.  * NParamX Base: the default formula for classes/enemies if they haven't.
  651.  * First number is the value at level 1. Second is the amount gained
  652.  * each level.
  653.  *
  654.  * NParamX Limits: the min and max value a nparam can be. It's used now
  655.  * as a formula and needs 3 values.
  656.  * First is min, second is normal max and third is X-max.
  657.  * By default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  658.  *
  659.  * NParamX Buff Icons:
  660.  * This is an array of icons separated by spaces. When specified param is
  661.  * affected by a positive buff will be shown. Is starts with first and
  662.  * use next for each buff stack. If you don't want to use it leave Empty.
  663.  *
  664.  * NParamX Debuff Icons:
  665.  * Same as previous but with debuff stack. Empty to don't use.
  666.  *
  667.  * PParamX Name: the name you give to specified pparam. It will be used
  668.  * in formulas and can be used to reference a notetag.
  669.  * Leave empty to skip.
  670.  *
  671.  * PParamX Full Name: the name you give to specified pparam. It is not used
  672.  * here but usefull for plugins that need this.
  673.  *
  674.  * PParamX Base: is a base value that can be used to emulate x/sparams.
  675.  * 0 is used for a xparam and 1 for a sparam.
  676.  * It works as a formula so you can do it param based.
  677.  *
  678.  * Current basic, x and s params can also be customized througth params.
  679.  *
  680.  * BParamX Limits: the min and max value a param can be. It uses a
  681.  * formula and needs 3 values. Same as nparams.
  682.  * First is min, second is normal max and third is X-max.
  683.  *
  684.  * XParamX Base: xparams are 0 by default but you can have more control
  685.  * because it works as a formula.
  686.  *
  687.  * SParamX Base: sparams are 1 by default but you can have more control
  688.  * because it works as a formula.
  689.  *
  690.  * ============================================================================
  691.  * Incompatibilities
  692.  * ============================================================================
  693.  *
  694.  * There's no known incompatible plugins yet.
  695.  *
  696.  * ============================================================================
  697.  * Known isues
  698.  * ============================================================================
  699.  *
  700.  * Not yet.
  701.  *
  702.  * ============================================================================
  703.  * Changelog
  704.  * ============================================================================
  705.  *
  706.  * Version 1.01:
  707.  * - Use of ICF-Soft Main Utility.
  708.  * - Added lunatic mode for custom params and nparams.
  709.  * - Changed how min and max limits work.
  710.  * - Added double cap.
  711.  * - Added more traits.
  712.  * - Use of base params.
  713.  *
  714.  * Version 1.00:
  715.  * - Finished plugin!
  716.  *
  717.  * ============================================================================
  718.  *
  719.  * For commercial and non-commercial games.
  720.  * Credit to ICF-Soft.
  721.  * This entire header must be included with plugin.
  722.  *
  723.  * ============================================================================
  724. */
  725. //=============================================================================
  726.  /*:es
  727.  * @plugindesc v1.01b Este complemento permite añadir nuevos parámetros
  728.  * personalizables y mayor control sobre los x/sparam.
  729.  * @author ICF-Soft [http://icfsoft.blogspot.com.es/]
  730.  *
  731.  * @param NParam0 Name
  732.  * @desc Nombre para este nuevo parámetro en minúsculas. Vacío para saltar.
  733.  * @default
  734.  *
  735.  * @param NParam0 Full Name
  736.  * @desc Nombre mostrado para este nuevo parámetro.
  737.  * @default
  738.  *
  739.  * @param NParam0 Base
  740.  * @desc Modo predeterminado de configuración. Ver ayuda.
  741.  * @default 30 15
  742.  *
  743.  * @param NParam0 Limits
  744.  * @desc Una fórmula para los valores mínimo y máximos para este
  745.  * nuevo parámetro. Ver ayuda.
  746.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  747.  *
  748.  * @param NParam0 Buff Icons
  749.  * @desc Iconos a mostrar para cada valor de fortalecimiento.
  750.  * Vacío no usar ninguno. Ver ayuda.
  751.  * @default
  752.  *
  753.  * @param NParam0 Debuff Icons
  754.  * @desc Iconos a mostrar para cada valor de debilitamiento.
  755.  * Vacío no usar ninguno. Ver ayuda.
  756.  * @default
  757.  *
  758.  * @param NParam1 Name
  759.  * @desc Nombre para este nuevo parámetro en minúsculas. Vacío para saltar.
  760.  * @default
  761.  *
  762.  * @param NParam1 Full Name
  763.  * @desc Nombre mostrado para este nuevo parámetro.
  764.  * @default
  765.  *
  766.  * @param NParam1 Base
  767.  * @desc Modo predeterminado de configuración. Ver ayuda.
  768.  * @default 30 15
  769.  *
  770.  * @param NParam1 Limits
  771.  * @desc Una fórmula para los valores mínimo y máximos para este
  772.  * nuevo parámetro. Ver ayuda.
  773.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  774.  *
  775.  * @param NParam1 Buff Icons
  776.  * @desc Iconos a mostrar para cada valor de fortalecimiento.
  777.  * Vacío no usar ninguno. Ver ayuda.
  778.  * @default
  779.  *
  780.  * @param NParam1 Debuff Icons
  781.  * @desc Iconos a mostrar para cada valor de debilitamiento.
  782.  * Vacío no usar ninguno. Ver ayuda.
  783.  * @default
  784.  *
  785.  * @param NParam2 Name
  786.  * @desc Nombre para este nuevo parámetro en minúsculas. Vacío para saltar.
  787.  * @default
  788.  *
  789.  * @param NParam2 Full Name
  790.  * @desc Nombre mostrado para este nuevo parámetro.
  791.  * @default
  792.  *
  793.  * @param NParam2 Base
  794.  * @desc Modo predeterminado de configuración. Ver ayuda.
  795.  * @default 30 15
  796.  *
  797.  * @param NParam2 Limits
  798.  * @desc Una fórmula para los valores mínimo y máximos para este
  799.  * nuevo parámetro. Ver ayuda.
  800.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  801.  *
  802.  * @param NParam2 Buff Icons
  803.  * @desc Iconos a mostrar para cada valor de fortalecimiento.
  804.  * Vacío no usar ninguno. Ver ayuda.
  805.  * @default
  806.  *
  807.  * @param NParam2 Debuff Icons
  808.  * @desc Iconos a mostrar para cada valor de debilitamiento.
  809.  * Vacío no usar ninguno. Ver ayuda.
  810.  * @default
  811.  *
  812.  * @param NParam3 Name
  813.  * @desc Nombre para este nuevo parámetro en minúsculas. Vacío para saltar.
  814.  * @default
  815.  *
  816.  * @param NParam3 Full Name
  817.  * @desc Nombre mostrado para este nuevo parámetro.
  818.  * @default
  819.  *
  820.  * @param NParam3 Base
  821.  * @desc Modo predeterminado de configuración. Ver ayuda.
  822.  * @default 30 15
  823.  *
  824.  * @param NParam3 Limits
  825.  * @desc Una fórmula para los valores mínimo y máximos para este
  826.  * nuevo parámetro. Ver ayuda.
  827.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  828.  *
  829.  * @param NParam3 Buff Icons
  830.  * @desc Iconos a mostrar para cada valor de fortalecimiento.
  831.  * Vacío no usar ninguno. Ver ayuda.
  832.  * @default
  833.  *
  834.  * @param NParam3 Debuff Icons
  835.  * @desc Iconos a mostrar para cada valor de debilitamiento.
  836.  * Vacío no usar ninguno. Ver ayuda.
  837.  * @default
  838.  *
  839.  * @param NParam4 Name
  840.  * @desc Nombre para este nuevo parámetro en minúsculas. Vacío para saltar.
  841.  * @default
  842.  *
  843.  * @param NParam4 Full Name
  844.  * @desc Nombre mostrado para este nuevo parámetro.
  845.  * @default
  846.  *
  847.  * @param NParam4 Base
  848.  * @desc Modo predeterminado de configuración. Ver ayuda.
  849.  * @default 30 15
  850.  *
  851.  * @param NParam4 Limits
  852.  * @desc Una fórmula para los valores mínimo y máximos para este
  853.  * nuevo parámetro. Ver ayuda.
  854.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  855.  *
  856.  * @param NParam4 Buff Icons
  857.  * @desc Iconos a mostrar para cada valor de fortalecimiento.
  858.  * Vacío no usar ninguno. Ver ayuda.
  859.  * @default
  860.  *
  861.  * @param NParam4 Debuff Icons
  862.  * @desc Iconos a mostrar para cada valor de debilitamiento.
  863.  * Vacío no usar ninguno. Ver ayuda.
  864.  * @default
  865.  *
  866.  * @param NParam5 Name
  867.  * @desc Nombre para este nuevo parámetro en minúsculas. Vacío para saltar.
  868.  * @default
  869.  *
  870.  * @param NParam5 Full Name
  871.  * @desc Nombre mostrado para este nuevo parámetro.
  872.  * @default
  873.  *
  874.  * @param NParam5 Base
  875.  * @desc Modo predeterminado de configuración. Ver ayuda.
  876.  * @default 30 15
  877.  *
  878.  * @param NParam5 Limits
  879.  * @desc Una fórmula para los valores mínimo y máximos para este
  880.  * nuevo parámetro. Ver ayuda.
  881.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  882.  *
  883.  * @param NParam5 Buff Icons
  884.  * @desc Iconos a mostrar para cada valor de fortalecimiento.
  885.  * Vacío no usar ninguno. Ver ayuda.
  886.  * @default
  887.  *
  888.  * @param NParam5 Debuff Icons
  889.  * @desc Iconos a mostrar para cada valor de debilitamiento.
  890.  * Vacío no usar ninguno. Ver ayuda.
  891.  * @default
  892.  *
  893.  * @param NParam6 Name
  894.  * @desc Nombre para este nuevo parámetro en minúsculas. Vacío para saltar.
  895.  * @default
  896.  *
  897.  * @param NParam6 Full Name
  898.  * @desc Nombre mostrado para este nuevo parámetro.
  899.  * @default
  900.  *
  901.  * @param NParam6 Base
  902.  * @desc Modo predeterminado de configuración. Ver ayuda.
  903.  * @default 30 15
  904.  *
  905.  * @param NParam6 Limits
  906.  * @desc Una fórmula para los valores mínimo y máximos para este
  907.  * nuevo parámetro. Ver ayuda.
  908.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  909.  *
  910.  * @param NParam6 Buff Icons
  911.  * @desc Iconos a mostrar para cada valor de fortalecimiento.
  912.  * Vacío no usar ninguno. Ver ayuda.
  913.  * @default
  914.  *
  915.  * @param NParam6 Debuff Icons
  916.  * @desc Iconos a mostrar para cada valor de debilitamiento.
  917.  * Vacío no usar ninguno. Ver ayuda.
  918.  * @default
  919.  *
  920.  * @param NParam7 Name
  921.  * @desc Nombre para este nuevo parámetro en minúsculas. Vacío para saltar.
  922.  * @default
  923.  *
  924.  * @param NParam7 Full Name
  925.  * @desc Nombre mostrado para este nuevo parámetro.
  926.  * @default
  927.  *
  928.  * @param NParam7 Base
  929.  * @desc Modo predeterminado de configuración. Ver ayuda.
  930.  * @default 30 15
  931.  *
  932.  * @param NParam7 Limits
  933.  * @desc Una fórmula para los valores mínimo y máximos para este
  934.  * nuevo parámetro. Ver ayuda.
  935.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  936.  *
  937.  * @param NParam7 Buff Icons
  938.  * @desc Iconos a mostrar para cada valor de fortalecimiento.
  939.  * Vacío no usar ninguno. Ver ayuda.
  940.  * @default
  941.  *
  942.  * @param NParam7 Debuff Icons
  943.  * @desc Iconos a mostrar para cada valor de debilitamiento.
  944.  * Vacío no usar ninguno. Ver ayuda.
  945.  * @default
  946.  *
  947.  * @param NParam8 Name
  948.  * @desc Nombre para este nuevo parámetro en minúsculas. Vacío para saltar.
  949.  * @default
  950.  *
  951.  * @param NParam8 Full Name
  952.  * @desc Nombre mostrado para este nuevo parámetro.
  953.  * @default
  954.  *
  955.  * @param NParam8 Base
  956.  * @desc Modo predeterminado de configuración. Ver ayuda.
  957.  * @default 30 15
  958.  *
  959.  * @param NParam8 Limits
  960.  * @desc Una fórmula para los valores mínimo y máximos para este
  961.  * nuevo parámetro. Ver ayuda.
  962.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  963.  *
  964.  * @param NParam8 Buff Icons
  965.  * @desc Iconos a mostrar para cada valor de fortalecimiento.
  966.  * Vacío no usar ninguno. Ver ayuda.
  967.  * @default
  968.  *
  969.  * @param NParam8 Debuff Icons
  970.  * @desc Iconos a mostrar para cada valor de debilitamiento.
  971.  * Vacío no usar ninguno. Ver ayuda.
  972.  * @default
  973.  *
  974.  * @param NParam9 Name
  975.  * @desc Nombre para este nuevo parámetro en minúsculas. Vacío para saltar.
  976.  * @default
  977.  *
  978.  * @param NParam9 Full Name
  979.  * @desc Nombre mostrado para este nuevo parámetro.
  980.  * @default
  981.  *
  982.  * @param NParam9 Base
  983.  * @desc Modo predeterminado de configuración. Ver ayuda.
  984.  * @default 30 15
  985.  *
  986.  * @param NParam9 Limits
  987.  * @desc Una fórmula para los valores mínimo y máximos para este
  988.  * nuevo parámetro. Ver ayuda.
  989.  * @default (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  990.  *
  991.  * @param NParam9 Buff Icons
  992.  * @desc Iconos a mostrar para cada valor de fortalecimiento.
  993.  * Vacío no usar ninguno. Ver ayuda.
  994.  * @default
  995.  *
  996.  * @param NParam9 Debuff Icons
  997.  * @desc Iconos a mostrar para cada valor de debilitamiento.
  998.  * Vacío no usar ninguno. Ver ayuda.
  999.  * @default
  1000.  *
  1001.  * @param PParam0 Name
  1002.  * @desc Nombre para este parámetro plano en minúsculas. Vacío para saltar.
  1003.  * @default
  1004.  *
  1005.  * @param PParam0 Full Name
  1006.  * @desc Nombre para mostrar para este parámetro plano.
  1007.  * @default
  1008.  *
  1009.  * @param PParam0 Base
  1010.  * @desc Fórmula para calcular el Valor básico de este parámetro plano.
  1011.  * @default 0
  1012.  *
  1013.  * @param PParam1 Name
  1014.  * @desc Nombre para este parámetro plano en minúsculas. Vacío para saltar.
  1015.  * @default
  1016.  *
  1017.  * @param PParam1 Full Name
  1018.  * @desc Nombre para mostrar para este parámetro plano.
  1019.  * @default
  1020.  *
  1021.  * @param PParam1 Base
  1022.  * @desc Fórmula para calcular el Valor básico de este parámetro plano.
  1023.  * @default 0
  1024.  *
  1025.  * @param PParam2 Name
  1026.  * @desc Nombre para este parámetro plano en minúsculas. Vacío para saltar.
  1027.  * @default
  1028.  *
  1029.  * @param PParam2 Full Name
  1030.  * @desc Nombre para mostrar para este parámetro plano.
  1031.  * @default
  1032.  *
  1033.  * @param PParam2 Base
  1034.  * @desc Fórmula para calcular el Valor básico de este parámetro plano.
  1035.  * @default 0
  1036.  *
  1037.  * @param PParam3 Name
  1038.  * @desc Nombre para este parámetro plano en minúsculas. Vacío para saltar.
  1039.  * @default
  1040.  *
  1041.  * @param PParam3 Full Name
  1042.  * @desc Nombre para mostrar para este parámetro plano.
  1043.  * @default
  1044.  *
  1045.  * @param PParam3 Base
  1046.  * @desc Fórmula para calcular el Valor básico de este parámetro plano.
  1047.  * @default 0
  1048.  *
  1049.  * @param PParam4 Name
  1050.  * @desc Nombre para este parámetro plano en minúsculas. Vacío para saltar.
  1051.  * @default
  1052.  *
  1053.  * @param PParam4 Full Name
  1054.  * @desc Nombre para mostrar para este parámetro plano.
  1055.  * @default
  1056.  *
  1057.  * @param PParam4 Base
  1058.  * @desc Fórmula para calcular el Valor básico de este parámetro plano.
  1059.  * @default 0
  1060.  *
  1061.  * @param PParam5 Name
  1062.  * @desc Nombre para este parámetro plano en minúsculas. Vacío para saltar.
  1063.  * @default
  1064.  *
  1065.  * @param PParam5 Full Name
  1066.  * @desc Nombre para mostrar para este parámetro plano.
  1067.  * @default
  1068.  *
  1069.  * @param PParam5 Base
  1070.  * @desc Fórmula para calcular el Valor básico de este parámetro plano.
  1071.  * @default 0
  1072.  *
  1073.  * @param PParam6 Name
  1074.  * @desc Nombre para este parámetro plano en minúsculas. Vacío para saltar.
  1075.  * @default
  1076.  *
  1077.  * @param PParam6 Full Name
  1078.  * @desc Nombre para mostrar para este parámetro plano.
  1079.  * @default
  1080.  *
  1081.  * @param PParam6 Base
  1082.  * @desc Fórmula para calcular el Valor básico de este parámetro plano.
  1083.  * @default 0
  1084.  *
  1085.  * @param PParam7 Name
  1086.  * @desc Nombre para este parámetro plano en minúsculas. Vacío para saltar.
  1087.  * @default
  1088.  *
  1089.  * @param PParam7 Full Name
  1090.  * @desc Nombre para mostrar para este parámetro plano.
  1091.  * @default
  1092.  *
  1093.  * @param PParam7 Base
  1094.  * @desc Fórmula para calcular el Valor básico de este parámetro plano.
  1095.  * @default 0
  1096.  *
  1097.  * @param PParam8 Name
  1098.  * @desc Nombre para este parámetro plano en minúsculas. Vacío para saltar.
  1099.  * @default
  1100.  *
  1101.  * @param PParam8 Full Name
  1102.  * @desc Nombre para mostrar para este parámetro plano.
  1103.  * @default
  1104.  *
  1105.  * @param PParam8 Base
  1106.  * @desc Fórmula para calcular el Valor básico de este parámetro plano.
  1107.  * @default 0
  1108.  *
  1109.  * @param PParam9 Name
  1110.  * @desc Nombre para este parámetro plano en minúsculas. Vacío para saltar.
  1111.  * @default
  1112.  *
  1113.  * @param PParam9 Full Name
  1114.  * @desc Nombre para mostrar para este parámetro plano.
  1115.  * @default
  1116.  *
  1117.  * @param PParam9 Base
  1118.  * @desc Fórmula para calcular el Valor básico de este parámetro plano.
  1119.  * @default 0
  1120.  *
  1121.  * @param BParam0 Limits
  1122.  * @desc Una fórmula para los valores mínimo y máximos. Ver ayuda.
  1123.  * Vida
  1124.  * @default (this.isActor())? [1, 9999, 12000] : [1, 999999, 1200000]
  1125.  *
  1126.  * @param BParam1 Limits
  1127.  * @desc Una fórmula para los valores mínimo y máximos. Ver ayuda.
  1128.  * Magia
  1129.  * @default (this.isActor())? [0, 9999, 12000] : [0, 9999, 12000]
  1130.  *
  1131.  * @param BParam2 Limits
  1132.  * @desc Una fórmula para los valores mínimo y máximos. Ver ayuda.
  1133.  * Ataque
  1134.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  1135.  *
  1136.  * @param BParam3 Limits
  1137.  * @desc Una fórmula para los valores mínimo y máximos. Ver ayuda.
  1138.  * Defensa
  1139.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  1140.  *
  1141.  * @param BParam4 Limits
  1142.  * @desc Una fórmula para los valores mínimo y máximos. Ver ayuda.
  1143.  * Ataque mágico
  1144.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  1145.  *
  1146.  * @param BParam5 Limits
  1147.  * @desc Una fórmula para los valores mínimo y máximos. Ver ayuda.
  1148.  * Defensa mágica
  1149.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  1150.  *
  1151.  * @param BParam6 Limits
  1152.  * @desc Una fórmula para los valores mínimo y máximos. Ver ayuda.
  1153.  * Agilidad
  1154.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  1155.  *
  1156.  * @param BParam7 Limits
  1157.  * @desc Una fórmula para los valores mínimo y máximos. Ver ayuda.
  1158.  * Suerte
  1159.  * @default (this.isActor())? [1, 999, 1200]   : [1, 999, 1200]
  1160.  *
  1161.  * @param XParam0 Base
  1162.  * @desc Fórmula para el parámetro-x hit (Puntería).
  1163.  * @default 0
  1164.  *
  1165.  * @param XParam1 Base
  1166.  * @desc Fórmula para el parámetro-x eva (EVAsión).
  1167.  * @default 0
  1168.  *
  1169.  * @param XParam2 Base
  1170.  * @desc Fórmula para el parámetro-x cri (probabilidad de CRÍtico).
  1171.  * @default 0
  1172.  *
  1173.  * @param XParam3 Base
  1174.  * @desc Fórmula para el parámetro-x cev (evadir Crítico).
  1175.  * @default 0
  1176.  *
  1177.  * @param XParam4 Base
  1178.  * @desc Fórmula para el parámetro-x param mev (evasión Mágica).
  1179.  * @default 0
  1180.  *
  1181.  * @param XParam5 Base
  1182.  * @desc Fórmula para el parámetro-x mrf (reflejar Magia).
  1183.  * @default 0
  1184.  *
  1185.  * @param XParam6 Base
  1186.  * @desc Fórmula para el parámetro-x cnt (CoNTraataque).
  1187.  * @default 0
  1188.  *
  1189.  * @param XParam7 Base
  1190.  * @desc Fórmula para el parámetro-x hrg (regeneración de vida).
  1191.  * @default 0
  1192.  *
  1193.  * @param XParam8 Base
  1194.  * @desc Fórmula para el parámetro-x mrg (regeneración de magia).
  1195.  * @default 0
  1196.  *
  1197.  * @param XParam9 Base
  1198.  * @desc Fórmula para el parámetro-x trg (regeneración de tp).
  1199.  * @default 0
  1200.  *
  1201.  * @param SParam0 Base
  1202.  * @desc Fórmula para el parámetro-s tgr (ser el objetivo).
  1203.  * @default 1
  1204.  *
  1205.  * @param SParam1 Base
  1206.  * @desc Fórmula para el parámetro-s grd (efecto de defensa).
  1207.  * @default 1
  1208.  *
  1209.  * @param SParam2 Base
  1210.  * @desc Fórmula para el parámetro-s rec (efecto de RECuperación).
  1211.  * @default 1
  1212.  *
  1213.  * @param SParam3 Base
  1214.  * @desc Fórmula para el parámetro-s pha (PHArmacología).
  1215.  * @default 1
  1216.  *
  1217.  * @param SParam4 Base
  1218.  * @desc Fórmula para el parámetro-s mcr (coste de Mp).
  1219.  * @default 1
  1220.  *
  1221.  * @param SParam5 Base
  1222.  * @desc Fórmula para el parámetro-s tcr (coste de Tp).
  1223.  * @default 1
  1224.  *
  1225.  * @param SParam6 Base
  1226.  * @desc Fórmula para el parámetro-s pdr (daño físico recibido).
  1227.  * @default 1
  1228.  *
  1229.  * @param SParam7 Base
  1230.  * @desc Fórmula para el parámetro-s mdr (daño Mágico recibido).
  1231.  * @default 1
  1232.  *
  1233.  * @param SParam8 Base
  1234.  * @desc Fórmula para el parámetro-s fdr (daño por el suelo).
  1235.  * @default 1
  1236.  *
  1237.  * @param SParam9 Base
  1238.  * @desc Fórmula para el parámetro-s exr (EXperiencia obtenida).
  1239.  * @default 1
  1240.  *
  1241.  * @param Developer HaltJS
  1242.  * @desc Si está activado salta cuando una función personalizada
  1243.  * da error.   No - false   Si - true
  1244.  * @default false
  1245.  *
  1246.  * @help
  1247.  * ============================================================================
  1248.  * Introducción
  1249.  * ============================================================================
  1250.  *
  1251.  * El RPG Maker MV viene con unos tipos fijos de parámetros, son útiles pero
  1252.  * tienen sus propósitos específicos y limita el modo en que los puedes usar.
  1253.  *
  1254.  * Coneste complemento puedes añadir nuevos para usarlos en tus fórmulas
  1255.  * y cualquier uso que puedas imaginar.
  1256.  *
  1257.  * Existen 2 nuevos tipos de parámetros:
  1258.  *  -Nuevo/Normal Params: Basados en el nivel igual que los que vienen por
  1259.  *   defecto, con los efectos de fortalecer/debilitar y modificadores.
  1260.  *   Además de una opción que puede servir en distintos complementos
  1261.  *   de niveles de enemigos.
  1262.  *
  1263.  *  -Planos Params: No basados en nivel, funcionan como los x/sparams
  1264.  *   con modificadores.
  1265.  *
  1266.  * Además se ha añadido personalización para los x/sparams que permite mayor
  1267.  * control.
  1268.  * Now there are more customization and control for basic, x and s params.
  1269.  * And a new double cap feature.
  1270.  *
  1271.  * ============================================================================
  1272.  * Uso
  1273.  * ============================================================================
  1274.  *
  1275.  * Los NParams y PParams son calculados mediante sus respectivas fórmulas:
  1276.  *
  1277.  * NParam = (Base + Plus) * Rate * XRate * Buff + Flat
  1278.  * PParam = (Base + Plus) * Rate + Flat
  1279.  *
  1280.  *   -Base es distinto entre ambas. Para los NParams está basado en el nivel.
  1281.  *    Para los PParam el valor es fijo emulando los x/sparams (0 y 1).
  1282.  *   -Plus es la suma de todas las características plus que atañen al personaje.
  1283.  *    En el caso de NParam existe un extra añadido mediante llamadas a script
  1284.  *    y efectos de los objetos.
  1285.  *   -Rate es el producto de todos los multiplicadores que atañen al personaje.
  1286.  *   -XRate es el producto de todos los multiplicadores especiales que atañen
  1287.  *    al personaje.
  1288.  *   -Buff es el efecto de fortalecer/debilitar.
  1289.  *   -Flat es la suma de todas las características flat que atañen al personaje.
  1290.  *    No se ve afectado por los multiplicadores.
  1291.  *
  1292.  * XRate y Buff permiten ir más allá del primer límite.
  1293.  *
  1294.  * Para hacer los XParams y SParams más personalizables he cambiado un poco
  1295.  * sus fórmulas:
  1296.  *
  1297.  * Param  = (Base + Plus) * Rate * XRate * Buff + Flat
  1298.  * XParam = (Base + Plus) * Rate + Flat
  1299.  * SParam = (Base + Plus) * Rate + Flat
  1300.  *
  1301.  * Siguen funcionando como de costumbre pero ahora puedes añadir más
  1302.  * características para tener un mayor control.
  1303.  *
  1304.  * Para añadir características basta con añadir etiquetas en los cuadros de notas
  1305.  * respectivos.
  1306.  *
  1307.  * Clases y enemigos solo:
  1308.  *
  1309.  * <NPARAM: NParam Base Grow>
  1310.  *    -Cambia la base predeterminada del NParam por una específica.
  1311.  *     NParam se puede referenciar por su nombre o índice.
  1312.  *     Base es el valor inicial en el nivel 1.
  1313.  *     Grow es cuanto se incrementa por nivel. Si está vacío cuenta como 0.
  1314.  *    
  1315.  *
  1316.  * Héroes, clases, enemigos, armas, armaduras y estados alterados:
  1317.  *
  1318.  * <NDEBUFFRATE: NParam Rate>
  1319.  *    -Se usa para la resistencia al debilitamiento en dicho nparam debuff,
  1320.  *     básicamente es la probabilidad de acierto.
  1321.  *     0.5 significa 50% acierto, 0.2 es 20%, etc.
  1322.  *
  1323.  *
  1324.  * <NPARAMPLUS: NParam Plus>
  1325.  * <NPARAMRATE: NParam Rate>
  1326.  * <NPARAMXRATE: NParam XRate>
  1327.  * <NPARAMFLAT: NParam Flat>
  1328.  *    -Modificadores para el nparam.
  1329.  *
  1330.  * <PPARAMPLUS: PParam Plus>
  1331.  * <PPARAMRATE: PParam Rate>
  1332.  * <PPARAMFLAT: PParam Flat>
  1333.  *    -Modificadores para el pparam.
  1334.  *
  1335.  * <PARAMPLUS: Param Plus>
  1336.  * <PARAMRATE: Param Rate>
  1337.  * <PARAMXRATE: Param XRate>
  1338.  * <PARAMFLAT: Param Flat>
  1339.  * <xPARAMPLUS: XParam Plus>
  1340.  * <XPARAMRATE: XParam Rate>
  1341.  * <XPARAMFLAT: XParam Flat>
  1342.  * <SPARAMPLUS: SParam Plus>
  1343.  * <SPARAMRATE: SParam Rate>
  1344.  * <SPARAMFLAT: SParam Flat>
  1345.  *    -Modificadores para los parámetros básicos, x e y.
  1346.  *     Los he incluido para dar más control.
  1347.  *
  1348.  *
  1349.  * Habilidades y objetos solo:
  1350.  *
  1351.  * <NBUFF: NParam turns>
  1352.  * <NDEBUFF: NParam turns>
  1353.  * <REMOVE NBUFF: NParam>
  1354.  * <REMOVE NDEBUFF: NParam>
  1355.  *    -Efectos de añadir y quitar fortalecimiento/debilitamiento.
  1356.  *
  1357.  * <NPARAM GROW: NParam amount>
  1358.  *    -Permite incrementar/decrementar el nparam una cantidad específica.
  1359.  *
  1360.  * ============================================================================
  1361.  * Lunatic Mode
  1362.  * ============================================================================
  1363.  *
  1364.  * Para aquellos que quieren utilizar un modo personalizado para calcular
  1365.  * los parámetros he añadido el modo lunático.
  1366.  * El modo lunático permite utilizar código javascript diréctamente.
  1367.  *
  1368.  * Usa las siguientes etiquetas en las clases:
  1369.  *
  1370.  * <CUSTOM NPARAM BASE NPARAM>
  1371.  * value = 2;
  1372.  * value += 25;
  1373.  * </CUSTOM NPARAM BASE>
  1374.  *
  1375.  * <CUSTOM PARAM BASE PARAM>
  1376.  * value = 2;
  1377.  * value += 25;
  1378.  * </CUSTOM PARAM BASE>
  1379.  *
  1380.  * Dicho código se ejecutará en lugar de la fórmula predeterminada.
  1381.  *
  1382.  * value - Esta es la variable donde se almacena el resultado.
  1383.  *         Si no se especifica será 0.
  1384.  *
  1385.  * ============================================================================
  1386.  * Parámetros
  1387.  * ============================================================================
  1388.  *
  1389.  * Hay disponibles hasta 10 parámetros de cada tipo con índices de 0 a 9.
  1390.  *
  1391.  * NParamX Name: el nombre que le vas a dar al nparam. Se utilizará en
  1392.  * fórmulas y se puede usar como referencia en las etiquetas en las notas.
  1393.  * Dejar vacío si no se quiere usar.
  1394.  *
  1395.  * NParamX Full Name: el nombre que quieres dar al nparam. Por el momento
  1396.  * no se usa aquí pero sirve para los plugins que usen este.
  1397.  *
  1398.  * NParamX Base: la fórmula predeterminada para clases y enemigos que no tengan.
  1399.  * El primer númber es el valor en el nivel 1. El segundo es cuanto sube
  1400.  * cada nivel.
  1401.  *
  1402.  * NParamX Limits: los valores mínimo y máximo que puede tener el nparam.
  1403.  * Ahora se utiliza como fórmula que da 3 valores.
  1404.  * El primero es el mínimo, el segundo es máximo normal y el tercero es
  1405.  * el extra máximo.
  1406.  * (this.isActor())? [0, 999, 1200] : [0, 999, 1200]
  1407.  *
  1408.  * NParamX Buff Icons: conjunto de iconos separados por espacios.
  1409.  * Cuando dicho parámetro se vea afectado por un fortalecimiento se mostrará
  1410.  * el icono correspondiente al fortalecimiento acumulado.
  1411.  * Si se deja en blanco no se usará.
  1412.  *
  1413.  * NParamX Debuff Icons: igual que el anterior pero para los
  1414.  * debilitamientos del parámetro.
  1415.  *
  1416.  * PParamX Name: el nombre que le vas a dar al pparam. Se utilizará en
  1417.  * fórmulas y se puede usar como referencia en las etiquetas en las notas.
  1418.  * Dejar vacío si no se quiere usar.
  1419.  *
  1420.  * PParamX Full Name: el nombre que quieres dar al pparam. Por el momento
  1421.  * no se usa aquí pero sirve para los plugins que usen este.
  1422.  *
  1423.  * PParamX Base: es un valor básico con el que se pueden emular los x/sparams.
  1424.  * 0 para un xparam y 1 para un sparam. Ahora se pueden utilizar como
  1425.  * fórmulas para hacerlo más personalizable.
  1426.  *
  1427.  * Los parámetros básicos, x y s ahora se pueden personalizar mediante
  1428.  * los siguientes parámetros.
  1429.  *
  1430.  * BParamX Limits: límites igual que en los nparams.
  1431.  * El primero es el mínimo, el segundo es máximo normal y el tercero es
  1432.  * el extra máximo.
  1433.  *
  1434.  * XParamX Base: 0 como predeterminado, pero ahora como fórmula.
  1435.  *
  1436.  * SParamX Base: 1 como predeterminado, pero ahora como fórmula.
  1437.  *
  1438.  * ============================================================================
  1439.  * Incompatibilidades
  1440.  * ============================================================================
  1441.  *
  1442.  * No se conocen complementos que sean incompatibles hasta la fecha.
  1443.  *
  1444.  * ============================================================================
  1445.  * Problemas conocidos
  1446.  * ============================================================================
  1447.  *
  1448.  * Por el momento ninguno.
  1449.  *
  1450.  * ============================================================================
  1451.  * Historial de versiones
  1452.  * ============================================================================
  1453.  *
  1454.  * Versión 1.01:
  1455.  * - Se epieza a utilizar el ICF-Soft Main Utility.
  1456.  * - Se ha añadido el modo lunático para params y nparams.
  1457.  * - Se ha cambiado el cómo funcionan los límites mínimo y máximo.
  1458.  * - Se ha añadido el doble máximo.
  1459.  * - Se han añadido más características.
  1460.  * - Se pueden usar los base params.
  1461.  *
  1462.  * Versión 1.00:
  1463.  * - Complemento terminado.
  1464.  *
  1465.  * ============================================================================
  1466.  *
  1467.  * Para juegos comerciales y no comerciales.
  1468.  * Se debe incluir a ICF-Soft en los créditos.
  1469.  * Esta cabecera debe incluirse íntegramente con el plugin.
  1470.  *
  1471.  * ============================================================================
  1472. */
  1473. //=============================================================================
  1474.  
  1475. //=============================================================================
  1476. // Parameter Variables
  1477. //=============================================================================
  1478.  
  1479. ICF.Parameters = PluginManager.parameters('ICFSoft_ParamsCore');
  1480. ICF.Param = ICF.Param || {};
  1481.  
  1482. ICF.Param.NParams = [];
  1483. ICF.Param.NParamsFullName = [];
  1484. ICF.Param.NParamBase = [];
  1485. ICF.Param.NParamLimit = [];
  1486. ICF.Param.NParamBuffIcons = [];
  1487. ICF.Param.NParamDebuffIcons = [];
  1488. ICF.Param.PParams = [];
  1489. ICF.Param.PParamsFullName = [];
  1490. ICF.Param.PParamBase = [];
  1491. ICF.Param.BParamLimit = [];
  1492. ICF.Param.XParamBase = [];
  1493. ICF.Param.SParamBase = [];
  1494.  
  1495. ICF.Param.BParams = ["mhp", "mmp", "atk", "def", "mat", "mdf", "agi", "luk"];
  1496. ICF.Param.XParams = ["hit", "eva", "cri", "cev", "mev", "mrf", "cnt", "hrg", "mrg", "trg"];
  1497. ICF.Param.SParams = ["tgr", "grd", "rec", "pha", "mcr", "tcr", "pdr", "mdr", "fdr", "exr"];
  1498.  
  1499. for (var i = 0; i < 10; i++) {
  1500.     ICF.Param.NParams[i] = String(ICF.Parameters['NParam' + i + ' Name']);
  1501.     ICF.Param.NParamsFullName[i] = String(ICF.Parameters['NParam' + i + ' Full Name']);
  1502.     ICF.Param.NParamBase[i] = String(ICF.Parameters['NParam' + i + ' Base']).split(/\s+/).leaveNumbers();
  1503.     ICF.Param.NParamLimit[i] = String(ICF.Parameters['NParam' + i + ' Limits']);
  1504.     ICF.Param.NParamBuffIcons[i] = String(ICF.Parameters['NParam' + i + ' Buff Icons']).split(/\s+/).leaveNumbers();
  1505.     ICF.Param.NParamDebuffIcons[i] = String(ICF.Parameters['NParam' + i + ' Debuff Icons']).split(/\s+/).leaveNumbers();
  1506.     ICF.Param.PParams[i] = String(ICF.Parameters['PParam' + i + ' Name']);
  1507.     ICF.Param.PParamsFullName[i] = String(ICF.Parameters['PParam' + i + ' Full Name']);
  1508.     ICF.Param.PParamBase[i] = String(ICF.Parameters['PParam' + i + ' Base']);
  1509.     ICF.Param.XParamBase[i] = String(ICF.Parameters['XParam' + i + ' Base']);
  1510.     ICF.Param.SParamBase[i] = String(ICF.Parameters['SParam' + i + ' Base']);
  1511. }
  1512.  
  1513. for (var i = 0; i < 8; i++) {
  1514.     ICF.Param.BParamLimit[i] = String(ICF.Parameters['BParam' + i + ' Limits']);
  1515. }
  1516.  
  1517. ICF.Param.ParamCoreHalt = ICF.Parameters['Developer HaltJS'].toLowerCase() === "true";
  1518.  
  1519. //=============================================================================
  1520. // Constants
  1521. //=============================================================================
  1522.  
  1523. Game_BattlerBase.TRAIT_NPARAM          = 24;
  1524. Game_BattlerBase.TRAIT_PPARAM          = 25;
  1525. Game_Action.EFFECT_ADD_NBUFF           = 35;
  1526. Game_Action.EFFECT_ADD_NDEBUFF         = 36;
  1527. Game_Action.EFFECT_REMOVE_NBUFF        = 37;
  1528. Game_Action.EFFECT_REMOVE_NDEBUFF      = 38;
  1529. Game_Action.EFFECT_NGROW               = 45;
  1530.  
  1531. //=============================================================================
  1532. // DataManager
  1533. //=============================================================================
  1534.  
  1535. ICF.ParamCore.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
  1536. DataManager.isDatabaseLoaded = function() {
  1537.     if (!ICF.ParamCore.DataManager_isDatabaseLoaded.call(this)) return false;
  1538.     if (!ICF.ParamCore.Procesed) {
  1539.     DataManager.processParamCoreNotetags($dataActors);
  1540.     DataManager.processParamCoreNotetagsB($dataClasses);
  1541.     DataManager.processParamCoreNotetagsB($dataEnemies);
  1542.     DataManager.processParamCoreNotetags($dataWeapons);
  1543.     DataManager.processParamCoreNotetags($dataArmors);
  1544.     DataManager.processParamCoreNotetags($dataStates);
  1545.     DataManager.processParamCoreNotetagsC($dataSkills);
  1546.     DataManager.processParamCoreNotetagsC($dataItems);
  1547.     ICF.ParamCore.Procesed = true;
  1548.     }
  1549.     return true;
  1550. };
  1551.  
  1552. DataManager.processParamCoreNotetags = function(group) {
  1553.     var note1 = /<(?:NPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1554.     var note1b = /<(?:NPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1555.     var note1c = /<(?:NPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1556.     var note1d = /<(?:NPARAMXRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1557.     var note2 = /<(?:PPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1558.     var note2b = /<(?:PPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1559.     var note2c = /<(?:PPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1560.     var note3 = /<(?:xPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1561.     var note3b = /<(?:XPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1562.     var note3c = /<(?:XPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1563.     var note4 = /<(?:SPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1564.     var note4b = /<(?:SPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1565.     var note4c = /<(?:SPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1566.     var note5 = /<(?:PARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1567.     var note5b = /<(?:PARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1568.     var note5c = /<(?:PARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1569.     var note5d = /<(?:PARAMXRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1570.     var note6 = /<(?:NDEBUFFRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1571.  
  1572.     for (var n = 1; n < group.length; n++) {
  1573.     var obj = group[n];
  1574.     var notedata = obj.note.split(/[\r\n]+/);
  1575.  
  1576.     for (var i = 0; i < notedata.length; i++) {
  1577.         var line = notedata[i];
  1578.         if (line.match(note1)) {
  1579.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1580.             if (indx > -1) obj.traits.push({code:24, dataId:indx, value:Number(RegExp.$2)});
  1581.             }
  1582.         else if (line.match(note1b)) {
  1583.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1584.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 10, value:Number(RegExp.$2)});
  1585.             }
  1586.         else if (line.match(note1c)) {
  1587.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1588.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 20, value:Number(RegExp.$2)});
  1589.             }
  1590.         else if (line.match(note1d)) {
  1591.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1592.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 30, value:Number(RegExp.$2)});
  1593.             }
  1594.         else if (line.match(note2)) {
  1595.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1596.             if (indx > -1) obj.traits.push({code:25, dataId:indx, value:Number(RegExp.$2)});
  1597.             }
  1598.         else if (line.match(note2b)) {
  1599.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1600.             if (indx > -1) obj.traits.push({code:25, dataId:indx + 10, value:Number(RegExp.$2)});
  1601.             }
  1602.         else if (line.match(note2c)) {
  1603.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1604.             if (indx > -1) obj.traits.push({code:25, dataId:indx + 20, value:Number(RegExp.$2)});
  1605.             }
  1606.         else if (line.match(note3)) {
  1607.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1608.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx, value:Number(RegExp.$2)});
  1609.             }
  1610.         else if (line.match(note3b)) {
  1611.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1612.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx + 10, value:Number(RegExp.$2)});
  1613.             }
  1614.         else if (line.match(note3c)) {
  1615.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1616.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx + 20, value:Number(RegExp.$2)});
  1617.             }
  1618.         else if (line.match(note4)) {
  1619.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1620.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx + 10, value:Number(RegExp.$2)});
  1621.             }
  1622.         else if (line.match(note4b)) {
  1623.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1624.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx, value:Number(RegExp.$2)});
  1625.             }
  1626.         else if (line.match(note4c)) {
  1627.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1628.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx + 20, value:Number(RegExp.$2)});
  1629.             }
  1630.         else if (line.match(note5)) {
  1631.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1632.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 10, value:Number(RegExp.$2)});
  1633.             }
  1634.         else if (line.match(note5b)) {
  1635.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1636.             if (indx > -1) obj.traits.push({code:21, dataId:indx, value:Number(RegExp.$2)});
  1637.             }
  1638.         else if (line.match(note5c)) {
  1639.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1640.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 20, value:Number(RegExp.$2)});
  1641.             }
  1642.         else if (line.match(note5d)) {
  1643.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1644.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 30, value:Number(RegExp.$2)});
  1645.             }
  1646.         else if (line.match(note6)) {
  1647.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1648.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_DEBUFF_RATE, dataId:indx + 10, value:Number(RegExp.$2)});
  1649.             }
  1650.     }
  1651.     }
  1652. };
  1653.  
  1654. DataManager.processParamCoreNotetagsB = function(group) {
  1655.     var grouparray = [];
  1656.     var note1 = /<(?:NPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1657.     var note1b = /<(?:NPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1658.     var note1c = /<(?:NPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1659.     var note1d = /<(?:NPARAMXRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1660.     var note1x = /<(?:NPARAM):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)(?:[ ]+(\d+(?:\.\d+)?))?>/i;
  1661.     var note1y = /<(?:CUSTOM NPARAM BASE)[ ]+(\w+)>/i;
  1662.     var note1z = /<\/<(?:CUSTOM NPARAM BASE)>/i;
  1663.     var note2 = /<(?:PPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1664.     var note2b = /<(?:PPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1665.     var note2c = /<(?:PPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1666.     var note3 = /<(?:xPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1667.     var note3b = /<(?:XPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1668.     var note3c = /<(?:XPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1669.     var note4 = /<(?:SPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1670.     var note4b = /<(?:SPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1671.     var note4c = /<(?:SPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1672.     var note5 = /<(?:PARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1673.     var note5b = /<(?:PARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1674.     var note5c = /<(?:PARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  1675.     var note5d = /<(?:PARAMXRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1676.     var note5y = /<(?:CUSTOM PARAM BASE)[ ]+(\w+)>/i;
  1677.     var note5z = /<\/<(?:CUSTOM PARAM BASE)>/i;
  1678.     var note6 = /<(?:NDEBUFFRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  1679.  
  1680.     for (var n = 1; n < group.length; n++) {
  1681.     var obj = group[n];
  1682.     var notedata = obj.note.split(/[\r\n]+/);
  1683.  
  1684.     obj.basicNParam = [[],[],[],[],[],[],[],[],[],[]];
  1685.     obj.customNParam = ['','','','','','','','','',''];
  1686.     obj.customBParam = ['','','','','','','','','',''];
  1687.  
  1688.     var nFlag = false;
  1689.     var bFlag = false;
  1690.     var nIndex = -1;
  1691.     var bIndex = -1;
  1692.  
  1693.     for (var i = 0; i < notedata.length; i++) {
  1694.         var line = notedata[i];
  1695.         if (line.match(note1)) {
  1696.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1697.             if (indx > -1) obj.traits.push({code:24, dataId:indx, value:Number(RegExp.$2)});
  1698.             }
  1699.         else if (line.match(note1b)) {
  1700.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1701.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 10, value:Number(RegExp.$2)});
  1702.             }
  1703.         else if (line.match(note1c)) {
  1704.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1705.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 20, value:Number(RegExp.$2)});
  1706.             }
  1707.         else if (line.match(note1d)) {
  1708.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1709.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 30, value:Number(RegExp.$2)});
  1710.             }
  1711.         else if (line.match(note1x)) {
  1712.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1713.             obj.basicNParam[indx] = [Number(RegExp.$2)];
  1714.             if (!isNaN(Number(RegExp.$3))) obj.basicNParam[indx] = obj.basicNParam[indx].concat([Number(RegExp.$3)]);
  1715.             }
  1716.         else if (line.match(note1y)) {
  1717.             nFlag = true;
  1718.             nIndex = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1719.             }
  1720.         else if (line.match(note1z)) {
  1721.             nFlag = false;
  1722.             }
  1723.         else if (line.match(note2)) {
  1724.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1725.             if (indx > -1) obj.traits.push({code:25, dataId:indx, value:Number(RegExp.$2)});
  1726.             }
  1727.         else if (line.match(note2b)) {
  1728.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1729.             if (indx > -1) obj.traits.push({code:25, dataId:indx + 10, value:Number(RegExp.$2)});
  1730.             }
  1731.         else if (line.match(note2c)) {
  1732.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1733.             if (indx > -1) obj.traits.push({code:25, dataId:indx + 20, value:Number(RegExp.$2)});
  1734.             }
  1735.         else if (line.match(note3)) {
  1736.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1737.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx, value:Number(RegExp.$2)});
  1738.             }
  1739.         else if (line.match(note3b)) {
  1740.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1741.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx + 10, value:Number(RegExp.$2)});
  1742.             }
  1743.         else if (line.match(note3c)) {
  1744.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1745.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx + 20, value:Number(RegExp.$2)});
  1746.             }
  1747.         else if (line.match(note4)) {
  1748.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1749.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx + 10, value:Number(RegExp.$2)});
  1750.             }
  1751.         else if (line.match(note4b)) {
  1752.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1753.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx, value:Number(RegExp.$2)});
  1754.             }
  1755.         else if (line.match(note4c)) {
  1756.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1757.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx + 20, value:Number(RegExp.$2)});
  1758.             }
  1759.         else if (line.match(note5)) {
  1760.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1761.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 10, value:Number(RegExp.$2)});
  1762.             }
  1763.         else if (line.match(note5b)) {
  1764.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1765.             if (indx > -1) obj.traits.push({code:21, dataId:indx, value:Number(RegExp.$2)});
  1766.             }
  1767.         else if (line.match(note5c)) {
  1768.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1769.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 20, value:Number(RegExp.$2)});
  1770.             }
  1771.         else if (line.match(note5d)) {
  1772.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1773.             if (indx > -1) obj.traits.push({code:21, dataId:indx + 30, value:Number(RegExp.$2)});
  1774.             }
  1775.         else if (line.match(note5y)) {
  1776.             bFlag = true;
  1777.             bIndex = (isNaN(Number(RegExp.$1)))? ICF.Param.BParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1778.             }
  1779.         else if (line.match(note5z)) {
  1780.             bFlag = false;
  1781.             }
  1782.         else if (line.match(note6)) {
  1783.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1784.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_DEBUFF_RATE, dataId:indx + 10, value:Number(RegExp.$2)});
  1785.             }
  1786.         else if (nFlag && nIndex > -1) {
  1787.             obj.customNParam[nIndex] = obj.customNParam[nIndex] + line + '\n';
  1788.             }
  1789.         else if (bFlag && bIndex > -1) {
  1790.             obj.customBParam[bIndex] = obj.customBParam[bIndex] + line + '\n';
  1791.             }
  1792.     }
  1793.     }
  1794. };
  1795.  
  1796. DataManager.processParamCoreNotetagsC = function(group) {
  1797.     var note1 = /<(?:NBUFF):[ ]*(\w+)[ ]+(\d+)>/i;
  1798.     var note2 = /<(?:NDEBUFF):[ ]*(\w+)[ ]+(\d+)>/i;
  1799.     var note3 = /<(?:REMOVE NBUFF):[ ]*(\w+)[ ]+>/i;
  1800.     var note4 = /<(?:REMOVE NDEBUFF):[ ]*(\w+)[ ]+>/i;
  1801.     var note5 = /<(?:NPARAM GROW):[ ]*(\w+)[ ]+((?:\-)?\d+)>/i;
  1802.  
  1803.     for (var n = 1; n < group.length; n++) {
  1804.     var obj = group[n];
  1805.     var notedata = obj.note.split(/[\r\n]+/);
  1806.  
  1807.     for (var i = 0; i < notedata.length; i++) {
  1808.         var line = notedata[i];
  1809.         if (line.match(note1)) {
  1810.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1811.             if (indx > -1) obj.effects.push({code:35, dataId:indx, value1:Number(RegExp.$2)});
  1812.             }
  1813.         else if (line.match(note2)) {
  1814.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1815.             if (indx > -1) obj.effects.push({code:36, dataId:indx, value1:Number(RegExp.$2)});
  1816.             }
  1817.         else if (line.match(note3)) {
  1818.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1819.             if (indx > -1) obj.effects.push({code:37, dataId:indx, value1:0});
  1820.             }
  1821.         else if (line.match(note4)) {
  1822.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1823.             if (indx > -1) obj.effects.push({code:38, dataId:indx, value1:0});
  1824.             }
  1825.         else if (line.match(note5)) {
  1826.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  1827.             if (indx > -1) obj.effects.push({code:45, dataId:indx, value1:Number(RegExp.$2)});
  1828.             }
  1829.     }
  1830.     }
  1831. };
  1832.  
  1833. //=============================================================================
  1834. // Game_BattlerBase
  1835. //=============================================================================
  1836.  
  1837. if (ICF.Param.NParams[0].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.NParams[0], { get: function() { return this.NParam(0); }, configurable: true });
  1838. if (ICF.Param.NParams[1].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.NParams[1], { get: function() { return this.NParam(1); }, configurable: true });
  1839. if (ICF.Param.NParams[2].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.NParams[2], { get: function() { return this.NParam(2); }, configurable: true });
  1840. if (ICF.Param.NParams[3].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.NParams[3], { get: function() { return this.NParam(3); }, configurable: true });
  1841. if (ICF.Param.NParams[4].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.NParams[4], { get: function() { return this.NParam(4); }, configurable: true });
  1842. if (ICF.Param.NParams[5].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.NParams[5], { get: function() { return this.NParam(5); }, configurable: true });
  1843. if (ICF.Param.NParams[6].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.NParams[6], { get: function() { return this.NParam(6); }, configurable: true });
  1844. if (ICF.Param.NParams[7].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.NParams[7], { get: function() { return this.NParam(7); }, configurable: true });
  1845.  
  1846. if (ICF.Param.PParams[0].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.PParams[0], { get: function() { return this.PParam(0); }, configurable: true });
  1847. if (ICF.Param.PParams[1].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.PParams[1], { get: function() { return this.PParam(1); }, configurable: true });
  1848. if (ICF.Param.PParams[2].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.PParams[2], { get: function() { return this.PParam(2); }, configurable: true });
  1849. if (ICF.Param.PParams[3].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.PParams[3], { get: function() { return this.PParam(3); }, configurable: true });
  1850. if (ICF.Param.PParams[4].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.PParams[4], { get: function() { return this.PParam(4); }, configurable: true });
  1851. if (ICF.Param.PParams[5].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.PParams[5], { get: function() { return this.PParam(5); }, configurable: true });
  1852. if (ICF.Param.PParams[6].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.PParams[6], { get: function() { return this.PParam(6); }, configurable: true });
  1853. if (ICF.Param.PParams[7].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.PParams[7], { get: function() { return this.PParam(7); }, configurable: true });
  1854.  
  1855. Object.defineProperty(Game_BattlerBase.prototype, 'level', { value: 1, configurable: true});
  1856.  
  1857. ICF.ParamCore.clearParamPlus = Game_BattlerBase.prototype.clearParamPlus;
  1858. Game_BattlerBase.prototype.clearParamPlus = function() {
  1859.     ICF.ParamCore.clearParamPlus.call(this);
  1860.     this._NParamPlus = [0,0,0,0,0,0,0,0,0,0];
  1861. };
  1862.  
  1863. ICF.ParamCore.clearBuffs = Game_BattlerBase.prototype.clearBuffs;
  1864. Game_BattlerBase.prototype.clearBuffs = function() {
  1865.     ICF.ParamCore.clearBuffs.call(this);
  1866.     this._NBuffs = [0,0,0,0,0,0,0,0,0,0];
  1867.     this._NBuffTurns = [0,0,0,0,0,0,0,0,0,0];
  1868. };
  1869.  
  1870. Game_BattlerBase.prototype.eraseNBuff = function(paramId) {
  1871.     this._NBuffs[paramId] = 0;
  1872.     this._NBuffTurns[paramId] = 0;
  1873. };
  1874.  
  1875. Game_BattlerBase.prototype.NBuffLength = function() {
  1876.     return this._NBuffs.length;
  1877. };
  1878.  
  1879. Game_BattlerBase.prototype.NBuff = function(paramId) {
  1880.     return this._NBuffs[paramId];
  1881. };
  1882.  
  1883. Game_BattlerBase.prototype.isNBuffAffected = function(paramId) {
  1884.     return this._NBuffs[paramId] > 0;
  1885. };
  1886.  
  1887. Game_BattlerBase.prototype.isNDebuffAffected = function(paramId) {
  1888.     return this._NBuffs[paramId] < 0;
  1889. };
  1890.  
  1891. Game_BattlerBase.prototype.isNBuffOrDebuffAffected = function(paramId) {
  1892.     return this._NBuffs[paramId] !== 0;
  1893. };
  1894.  
  1895. Game_BattlerBase.prototype.isMaxNBuffAffected = function(paramId) {
  1896.     return this._NBuffs[paramId] === 2;
  1897. };
  1898.  
  1899. Game_BattlerBase.prototype.isMaxNDebuffAffected = function(paramId) {
  1900.     return this._NBuffs[paramId] === -2;
  1901. };
  1902.  
  1903. Game_BattlerBase.prototype.increaseNBuff = function(paramId) {
  1904.     if (!this.isMaxNBuffAffected(paramId)) {
  1905.         this._NBuffs[paramId]++;
  1906.     }
  1907. };
  1908.  
  1909. Game_BattlerBase.prototype.decreaseNBuff = function(paramId) {
  1910.     if (!this.isMaxNDebuffAffected(paramId)) {
  1911.         this._NBuffs[paramId]--;
  1912.     }
  1913. };
  1914.  
  1915. Game_BattlerBase.prototype.overwriteNBuffTurns = function(paramId, turns) {
  1916.     if (this._NBuffTurns[paramId] < turns) {
  1917.         this._NBuffTurns[paramId] = turns;
  1918.     }
  1919. };
  1920.  
  1921. Game_BattlerBase.prototype.isNBuffExpired = function(paramId) {
  1922.     return this._NBuffTurns[paramId] === 0;
  1923. };
  1924.  
  1925. ICF.ParamCore.updateBuffTurns = Game_BattlerBase.prototype.updateBuffTurns;
  1926. Game_BattlerBase.prototype.updateBuffTurns = function() {
  1927.     ICF.ParamCore.updateBuffTurns.call(this);
  1928.     for (var i = 0; i < this._NBuffTurns.length; i++) {
  1929.         if (this._NBuffTurns[i] > 0) {
  1930.             this._NBuffTurns[i]--;
  1931.         }
  1932.     }
  1933. };
  1934.  
  1935. ICF.ParamCore.buffIcons = Game_BattlerBase.prototype.buffIcons;
  1936. Game_BattlerBase.prototype.buffIcons = function() {
  1937.     var icons = ICF.ParamCore.buffIcons.call(this);
  1938.     for (var i = 0; i < this._NBuffs.length; i++) {
  1939.         if ((this._NBuffs[i] > 0)&&(ICF.Param.NParamBuffIcons[i].length > 0)) {
  1940.             icons.push(ICF.Param.NParamBuffIcons[i][Math.min(ICF.Param.NParamBuffIcons[i].length, this._NBuffs[i]) - 1]);
  1941.         } else if ((this._NBuffs[i] < 0)&&(ICF.Param.NParamDebuffIcons[i].length > 0)) {
  1942.             icons.push(ICF.Param.NParamDebuffIcons[i][Math.min(ICF.Param.NParamDebuffIcons[i].length, Math.abs(this._NBuffs[i])) - 1]);
  1943.         }
  1944.     }
  1945.     return icons;
  1946. };
  1947.  
  1948. Game_BattlerBase.prototype.NParamBase = function(paramId) {
  1949.     if (ICF.Param.NParamBase[paramId].length == 1) {
  1950.         return Number(ICF.Param.NParamBase[paramId][0]);
  1951.     } else if (ICF.Param.NParamBase[paramId].length > 1) {
  1952.         return Number(ICF.Param.NParamBase[paramId][0]) + Number(ICF.Param.NParamBase[paramId][1] * (this.level - 1));
  1953.     } else {
  1954.         return 0;
  1955.     }
  1956. };
  1957.  
  1958. Game_BattlerBase.prototype.NParamPlus = function(paramId) {
  1959.     return this._NParamPlus[paramId] + this.traitsSum(Game_BattlerBase.TRAIT_NPARAM, paramId);
  1960. };
  1961.  
  1962. Game_BattlerBase.prototype.NParamLimits = function(paramId) {
  1963.     var array = eval(ICF.Param.NParamLimit[paramId]);
  1964.     if (!Array.isArray(array)) array = ICF.Param.NParamLimit[paramId].split(/\s+/).leaveNumbers();
  1965.     if (array.length < 1) array[0] = 0;
  1966.     if (array.length < 2) array[1] = 999;
  1967.     if (array.length < 3) array[2] = array[1];
  1968.     return array;
  1969. };
  1970.  
  1971. Game_BattlerBase.prototype.NParamRate = function(paramId) {
  1972.     return this.traitsPi(Game_BattlerBase.TRAIT_NPARAM, paramId + 10);
  1973. };
  1974.  
  1975. Game_BattlerBase.prototype.NParamXRate = function(paramId) {
  1976.     return this.traitsPi(Game_BattlerBase.TRAIT_NPARAM, paramId + 30);
  1977. };
  1978.  
  1979. Game_BattlerBase.prototype.NParamBuffRate = function(paramId) {
  1980.     return this._NBuffs[paramId] * 0.25 + 1.0;
  1981. };
  1982.  
  1983. Game_BattlerBase.prototype.NParamFlat = function(paramId) {
  1984.     return this.traitsSum(Game_BattlerBase.TRAIT_NPARAM, paramId + 20);
  1985. };
  1986.  
  1987. Game_BattlerBase.prototype.NParam = function(paramId) {
  1988.     var value = this.NParamBase(paramId) + this.NParamPlus(paramId);
  1989.     value *= this.NParamRate(paramId);
  1990.     var limits = this.NParamLimits(paramId);
  1991.     var buff = this.NParamXRate(paramId) * this.NParamBuffRate(paramId);
  1992.     value = Math.min(value, limits[1]);
  1993.     var flat = (buff > 1)? Math.min(this.NParamFlat(paramId), limits[1] - value) : Math.min(this.NParamFlat(paramId), limits[1] - value * buff);
  1994.     value *= buff;
  1995.     value += flat;
  1996.     return Math.round(value.clamp(limits[0], limits[2]));
  1997. };
  1998.  
  1999. Game_BattlerBase.prototype.PParamBase = function(pparamId) {
  2000.     return eval(ICF.Param.PParamBase[pparamId]) || 0;
  2001. }
  2002.  
  2003. Game_BattlerBase.prototype.PParam = function(pparamId) {
  2004.     var value = this.PParamBase(pparamId) + this.traitsSum(Game_BattlerBase.TRAIT_PPARAM, pparamId);
  2005.     value *= this.traitsPi(Game_BattlerBase.TRAIT_PPARAM, pparamId + 10);
  2006.     value += this.traitsSum(Game_BattlerBase.TRAIT_PPARAM, pparamId + 20);
  2007.     return value;
  2008. };
  2009.  
  2010. ICF.ParamCore.paramplus = Game_BattlerBase.prototype.paramPlus;
  2011. Game_BattlerBase.prototype.paramPlus = function(paramId) {
  2012.     return ICF.ParamCore.paramplus.call(this, paramId) + this.traitsSum(Game_BattlerBase.TRAIT_PARAM, paramId + 10);
  2013. };
  2014.  
  2015. Game_BattlerBase.prototype.paramFlat = function(paramId) {
  2016.     return this.traitsSum(Game_BattlerBase.TRAIT_PARAM, paramId + 20);
  2017. };
  2018.  
  2019. Game_BattlerBase.prototype.paramXRate = function(paramId) {
  2020.     return this.traitsPi(Game_BattlerBase.TRAIT_PARAM, paramId + 30);
  2021. };
  2022.  
  2023. Game_BattlerBase.prototype.paramLimits = function(paramId) {
  2024.     return eval(ICF.Param.BParamLimit[paramId]) || [0, 999, 1200];
  2025. };
  2026.  
  2027. Game_BattlerBase.prototype.param = function(paramId) {
  2028.     var value = this.paramBase(paramId) + this.paramPlus(paramId);
  2029.     value *= this.paramRate(paramId);
  2030.     var limits = this.paramLimits(paramId);
  2031.     var buff = this.paramXRate(paramId) * this.paramBuffRate(paramId);
  2032.     value = Math.min(value, limits[1]);
  2033.     var flat = (buff > 1)? Math.min(this.paramFlat(paramId), limits[1] - value) : Math.min(this.paramFlat(paramId), limits[1] - value * buff);
  2034.     value *= buff;
  2035.     value += flat;
  2036.     return Math.round(value.clamp(limits[0], limits[2]));
  2037. };
  2038.  
  2039. Game_BattlerBase.prototype.xparamBase = function(xparamId) {
  2040.     return eval(ICF.Param.XParamBase[xparamId]) || 0;
  2041. }
  2042.  
  2043. Game_BattlerBase.prototype.xparam = function(xparamId) {
  2044.     return (this.xparamBase(xparamId) + this.traitsSum(Game_BattlerBase.TRAIT_XPARAM, xparamId)) * this.traitsPi(Game_BattlerBase.TRAIT_XPARAM, xparamId + 10) + this.traitsSum(Game_BattlerBase.TRAIT_XPARAM, xparamId + 20);
  2045. };
  2046.  
  2047. Game_BattlerBase.prototype.sparamBase = function(sparamId) {
  2048.     return eval(ICF.Param.SParamBase[sparamId]) || 1;
  2049. }
  2050.  
  2051. Game_BattlerBase.prototype.sparam = function(sparamId) {
  2052.     return (this.sparamBase(sparamId) + this.traitsSum(Game_BattlerBase.TRAIT_SPARAM, sparamId + 10)) * this.traitsPi(Game_BattlerBase.TRAIT_SPARAM, sparamId) + this.traitsSum(Game_BattlerBase.TRAIT_SPARAM, sparamId + 20);
  2053. };
  2054.  
  2055. Game_BattlerBase.prototype.NDebuffRate = function(paramId) {
  2056.     return this.traitsPi(Game_BattlerBase.TRAIT_DEBUFF_RATE, paramId + 10);
  2057. };
  2058.  
  2059. Game_BattlerBase.prototype.addNParam = function(paramId, value) {
  2060.     this._NParamPlus[paramId] += value;
  2061.     this.refresh();
  2062. };
  2063.  
  2064. //=============================================================================
  2065. // Game_Battler
  2066. //=============================================================================
  2067.  
  2068. Game_Battler.prototype.addNBuff = function(paramId, turns) {
  2069.     if (this.isAlive()) {
  2070.         this.increaseNBuff(paramId);
  2071.         if (this.isNBuffAffected(paramId)) {
  2072.             this.overwriteNBuffTurns(paramId, turns);
  2073.         }
  2074.         this._result.pushAddedNBuff(paramId);
  2075.         this.refresh();
  2076.     }
  2077. };
  2078.  
  2079. Game_Battler.prototype.addNDebuff = function(paramId, turns) {
  2080.     if (this.isAlive()) {
  2081.         this.decreaseNBuff(paramId);
  2082.         if (this.isNDebuffAffected(paramId)) {
  2083.             this.overwriteNBuffTurns(paramId, turns);
  2084.         }
  2085.         this._result.pushAddedNDebuff(paramId);
  2086.         this.refresh();
  2087.     }
  2088. };
  2089.  
  2090. Game_Battler.prototype.removeNBuff = function(paramId) {
  2091.     if (this.isAlive() && this.isNBuffOrDebuffAffected(paramId)) {
  2092.         this.eraseNBuff(paramId);
  2093.         this._result.pushRemovedNBuff(paramId);
  2094.         this.refresh();
  2095.     }
  2096. };
  2097.  
  2098. ICF.ParamCore.removeAllBuffs = Game_Battler.prototype.removeAllBuffs;
  2099. Game_Battler.prototype.removeAllBuffs = function() {
  2100.     ICF.ParamCore.removeAllBuffs.call(this);
  2101.     for (var i = 0; i < this.NBuffLength(); i++) {
  2102.         this.removeNBuff(i);
  2103.     }
  2104. };
  2105.  
  2106. ICF.ParamCore.removeBuffsAuto = Game_Battler.prototype.removeBuffsAuto;
  2107. Game_Battler.prototype.removeBuffsAuto = function() {
  2108.     ICF.ParamCore.removeBuffsAuto.call(this);
  2109.     for (var i = 0; i < this.NBuffLength(); i++) {
  2110.         if (this.isNBuffExpired(i)) {
  2111.             this.removeNBuff(i);
  2112.         }
  2113.     }
  2114. };
  2115.  
  2116. //=============================================================================
  2117. // Game_Actor
  2118. //=============================================================================
  2119.  
  2120. Game_Actor.prototype.NParamBase = function(paramId) {
  2121.     if ($dataClasses[this._classId].customNParam[paramId] != '') {
  2122.     try {   var value = 0;
  2123.         eval($dataClasses[this._classId].customNParam[paramId]);
  2124.         return value;
  2125.         }
  2126.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom NParam Base #' + paramId + ' in actor class #' + this._classId);}}
  2127.     }
  2128.  
  2129.     var array = $dataClasses[this._classId].basicNParam[paramId];
  2130.  
  2131.     if (!array) return Game_BattlerBase.prototype.NParamBase.call(this, paramId);
  2132.     if (array.length == 1) {
  2133.         return array[0];
  2134.     } else if (array.length > 1) {
  2135.         return array[0] + array[1] * (this.level - 1);
  2136.     } else {
  2137.         return Game_BattlerBase.prototype.NParamBase.call(this, paramId);
  2138.     }
  2139. };
  2140.  
  2141. ICF.ParamCore.actorparambase = Game_Actor.prototype.paramBase;
  2142. Game_Actor.prototype.paramBase = function(paramId) {
  2143.     if ($dataClasses[this._classId].customBParam[paramId] != '') {
  2144.     try {   var value = 0;
  2145.         eval($dataClasses[this._classId].customBParam[paramId]);
  2146.         return value;
  2147.         }
  2148.     catch (e) {if(ICF.Param.ParamCoreHalt){throw new Error('Error in custom Param Base #' + paramId + ' in actor class #' + this._classId);}}
  2149.     }
  2150.  
  2151.     return ICF.ParamCore.actorparambase.call(this, paramId);
  2152. };
  2153.  
  2154. //=============================================================================
  2155. // Game_Enemy
  2156. //=============================================================================
  2157.  
  2158. Game_Enemy.prototype.NParamBase = function(paramId) {
  2159.     var array = $dataEnemies[this._enemyId].basicNParam[paramId];
  2160.  
  2161.     if (!array) return Game_BattlerBase.prototype.NParamBase.call(this, paramId);
  2162.     if (array.length == 1) {
  2163.         return array[0];
  2164.     } else if (array.length > 1) {
  2165.         return array[0] + array[1] * (this.level - 1);
  2166.     } else {
  2167.         return Game_BattlerBase.prototype.NParamBase.call(this, paramId);
  2168.     }
  2169. };
  2170.  
  2171. //=============================================================================
  2172. // Game_Action
  2173. //=============================================================================
  2174.  
  2175. ICF.ParamCore.testItemEffect = Game_Action.prototype.testItemEffect;
  2176. Game_Action.prototype.testItemEffect = function(target, effect) {
  2177.     switch (effect.code) {
  2178.     case Game_Action.EFFECT_ADD_NBUFF :
  2179.         return !target.isMaxNBuffAffected(effect.dataId);
  2180.     case Game_Action.EFFECT_ADD_NDEBUFF :
  2181.         return !target.isMaxNDebuffAffected(effect.dataId);
  2182.     case Game_Action.REMOVE_NBUFF:
  2183.         return target.isNBuffAffected(effect.dataId);
  2184.     case Game_Action.REMOVE_NDEBUFF:
  2185.         return target.isNDebuffAffected(effect.dataId);
  2186.     default:
  2187.         return ICF.ParamCore.testItemEffect.call(this, target, effect);
  2188.     }
  2189. };
  2190.  
  2191. ICF.ParamCore.applyItemEffect = Game_Action.prototype.applyItemEffect;
  2192. Game_Action.prototype.applyItemEffect = function(target, effect) {
  2193.     switch (effect.code) {
  2194.     case Game_Action.EFFECT_ADD_NBUFF:
  2195.         this.itemEffectAddNBuff(target, effect);
  2196.         break;
  2197.     case Game_Action.EFFECT_ADD_NDEBUFF:
  2198.         this.itemEffectAddNDebuff(target, effect);
  2199.         break;
  2200.     case Game_Action.EFFECT_REMOVE_NBUFF:
  2201.         this.itemEffectRemoveNBuff(target, effect);
  2202.         break;
  2203.     case Game_Action.EFFECT_REMOVE_NDEBUFF:
  2204.         this.itemEffectRemoveNDebuff(target, effect);
  2205.         break;
  2206.     case Game_Action.EFFECT_NGROW:
  2207.         this.itemEffectGrowNParam(target, effect);
  2208.         break;
  2209.     default:
  2210.         ICF.ParamCore.applyItemEffect.call(this, target, effect);
  2211.     }
  2212. };
  2213.  
  2214. Game_Action.prototype.itemEffectAddNBuff = function(target, effect) {
  2215.     target.addNBuff(effect.dataId, effect.value1);
  2216.     this.makeSuccess(target);
  2217. };
  2218.  
  2219. Game_Action.prototype.itemEffectAddNDebuff = function(target, effect) {
  2220.     var chance = target.NDebuffRate(effect.dataId) * this.lukEffectRate(target);
  2221.     if (Math.random() < chance) {
  2222.         target.addNDebuff(effect.dataId, effect.value1);
  2223.         this.makeSuccess(target);
  2224.     }
  2225. };
  2226.  
  2227. Game_Action.prototype.itemEffectRemoveNBuff = function(target, effect) {
  2228.     if (target.isNBuffAffected(effect.dataId)) {
  2229.         target.removeNBuff(effect.dataId);
  2230.         this.makeSuccess(target);
  2231.     }
  2232. };
  2233.  
  2234. Game_Action.prototype.itemEffectRemoveNDebuff = function(target, effect) {
  2235.     if (target.isNDebuffAffected(effect.dataId)) {
  2236.         target.removeNBuff(effect.dataId);
  2237.         this.makeSuccess(target);
  2238.     }
  2239. };
  2240.  
  2241. Game_Action.prototype.itemEffectGrowNParam = function(target, effect) {
  2242.     target.addNParam(effect.dataId, Math.floor(effect.value1));
  2243.     this.makeSuccess(target);
  2244. };
  2245.  
  2246. //=============================================================================
  2247. // Game_ActionResult
  2248. //=============================================================================
  2249.  
  2250. ICF.ParamCore.GARClear = Game_ActionResult.prototype.clear;
  2251. Game_ActionResult.prototype.clear = function() {
  2252.     ICF.ParamCore.GARClear.call(this);
  2253.     this.addedNBuffs = [];
  2254.     this.addedNDebuffs = [];
  2255.     this.removedNBuffs = [];
  2256. };
  2257.  
  2258. Game_ActionResult.prototype.isNBuffAdded = function(paramId) {
  2259.     return this.addedNBuffs.contains(paramId);
  2260. };
  2261.  
  2262. Game_ActionResult.prototype.pushAddedNBuff = function(paramId) {
  2263.     if (!this.isNBuffAdded(paramId)) {
  2264.         this.addedNBuffs.push(paramId);
  2265.     }
  2266. };
  2267.  
  2268. Game_ActionResult.prototype.isNDebuffAdded = function(paramId) {
  2269.     return this.addedNDebuffs.contains(paramId);
  2270. };
  2271.  
  2272. Game_ActionResult.prototype.pushAddedNDebuff = function(paramId) {
  2273.     if (!this.isNDebuffAdded(paramId)) {
  2274.         this.addedNDebuffs.push(paramId);
  2275.     }
  2276. };
  2277.  
  2278. Game_ActionResult.prototype.isNBuffRemoved = function(paramId) {
  2279.     return this.removedNBuffs.contains(paramId);
  2280. };
  2281.  
  2282. Game_ActionResult.prototype.pushnRemovedBuff = function(paramId) {
  2283.     if (!this.isNBuffRemoved(paramId)) {
  2284.         this.removedNBuffs.push(paramId);
  2285.     }
  2286. };
  2287.  
  2288. //=============================================================================
  2289. // Game_Item
  2290. //=============================================================================
  2291.  
  2292. Game_Item.prototype.nparamTypes = function() {
  2293.     return this.traitDataTypesMod(24, 10);
  2294. };
  2295.  
  2296. Game_Item.prototype.pparamTypes = function() {
  2297.     return this.traitDataTypesMod(25, 10);
  2298. };
  2299.  
  2300. Game_Item.prototype.paramTypes = function() {
  2301.     return this.traitDataTypesMod(21, 10);
  2302. };
  2303.  
  2304. Game_Item.prototype.xparamTypes = function() {
  2305.     return this.traitDataTypesMod(22, 10);
  2306. };
  2307.  
  2308. Game_Item.prototype.sparamTypes = function() {
  2309.     return this.traitDataTypesMod(23, 10);
  2310. };
  2311.  
  2312. //=============================================================================
  2313. // End of File
  2314. //=============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement