Advertisement
ICF-Soft

ICF-Soft Params Core RPG Maker MV

Jul 9th, 2016
227
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. //=============================================================================
  13.  /*:
  14.  * @plugindesc v1.00b This plugin allow to add new full custom params and
  15.  * more x/sparam control.
  16.  * @author ICF-Soft [http://icfsoft.blogspot.com.es/]
  17.  *
  18.  * @param NParam0 Name
  19.  * @desc Name for this new param in lowercase without spaces. Empty to skip.
  20.  * @default
  21.  *
  22.  * @param NParam0 Base
  23.  * @desc How this new param is configured by default. See help.
  24.  * @default 30 15
  25.  *
  26.  * @param NParam0 Limits
  27.  * @desc Min and max value for this new param.
  28.  * @default 0 999
  29.  *
  30.  * @param NParam1 Name
  31.  * @desc Name for this new param in lowercase without spaces. Empty to skip.
  32.  * @default
  33.  *
  34.  * @param NParam1 Base
  35.  * @desc How this new param is configured by default. See help.
  36.  * @default 30 15
  37.  *
  38.  * @param NParam1 Limits
  39.  * @desc Min and max value for this new param.
  40.  * @default 0 999
  41.  *
  42.  * @param NParam2 Name
  43.  * @desc Name for this new param in lowercase without spaces. Empty to skip.
  44.  * @default
  45.  *
  46.  * @param NParam2 Base
  47.  * @desc How this new param is configured by default. See help.
  48.  * @default 30 15
  49.  *
  50.  * @param NParam2 Limits
  51.  * @desc Min and max value for this new param.
  52.  * @default 0 999
  53.  *
  54.  * @param NParam3 Name
  55.  * @desc Name for this new param in lowercase without spaces. Empty to skip.
  56.  * @default
  57.  *
  58.  * @param NParam3 Base
  59.  * @desc How this new param is configured by default. See help.
  60.  * @default 30 15
  61.  *
  62.  * @param NParam3 Limits
  63.  * @desc Min and max value for this new param.
  64.  * @default 0 999
  65.  *
  66.  * @param NParam4 Name
  67.  * @desc Name for this new param in lowercase without spaces. Empty to skip.
  68.  * @default
  69.  *
  70.  * @param NParam4 Base
  71.  * @desc How this new param is configured by default. See help.
  72.  * @default 30 15
  73.  *
  74.  * @param NParam4 Limits
  75.  * @desc Min and max value for this new param.
  76.  * @default 0 999
  77.  *
  78.  * @param NParam5 Name
  79.  * @desc Name for this new param in lowercase without spaces. Empty to skip.
  80.  * @default
  81.  *
  82.  * @param NParam5 Base
  83.  * @desc How this new param is configured by default. See help.
  84.  * @default 30 15
  85.  *
  86.  * @param NParam5 Limits
  87.  * @desc Min and max value for this new param.
  88.  * @default 0 999
  89.  *
  90.  * @param NParam6 Name
  91.  * @desc Name for this new param in lowercase without spaces. Empty to skip.
  92.  * @default
  93.  *
  94.  * @param NParam6 Base
  95.  * @desc How this new param is configured by default. See help.
  96.  * @default 30 15
  97.  *
  98.  * @param NParam6 Limits
  99.  * @desc Min and max value for this new param.
  100.  * @default 0 999
  101.  *
  102.  * @param NParam7 Name
  103.  * @desc Name for this new param in lowercase without spaces. Empty to skip.
  104.  * @default
  105.  *
  106.  * @param NParam7 Base
  107.  * @desc How this new param is configured by default. See help.
  108.  * @default 30 15
  109.  *
  110.  * @param NParam7 Limits
  111.  * @desc Min and max value for this new param.
  112.  * @default 0 999
  113.  *
  114.  * @param NParam Buff Icon Start
  115.  * @desc Starting icon for new param buff.
  116.  * @default 0
  117.  *
  118.  * @param NParam Deuff Icon Start
  119.  * @desc Starting icon for new param debuff.
  120.  * @default 0
  121.  *
  122.  * @param PParam0 Name
  123.  * @desc Name for this plain param in lowercase without spaces. Empty to skip.
  124.  * @default
  125.  *
  126.  * @param PParam0 Base
  127.  * @desc Base value for this plain param.
  128.  * @default 0
  129.  *
  130.  * @param PParam1 Name
  131.  * @desc Name for this plain param in lowercase without spaces. Empty to skip.
  132.  * @default
  133.  *
  134.  * @param PParam1 Base
  135.  * @desc Base value for this plain param.
  136.  * @default 0
  137.  *
  138.  * @param PParam2 Name
  139.  * @desc Name for this plain param in lowercase without spaces. Empty to skip.
  140.  * @default
  141.  *
  142.  * @param PParam2 Base
  143.  * @desc Base value for this plain param.
  144.  * @default 0
  145.  *
  146.  * @param PParam3 Name
  147.  * @desc Name for this plain param in lowercase without spaces. Empty to skip.
  148.  * @default
  149.  *
  150.  * @param PParam3 Base
  151.  * @desc Base value for this plain param.
  152.  * @default 0
  153.  *
  154.  * @param PParam4 Name
  155.  * @desc Name for this plain param in lowercase without spaces. Empty to skip.
  156.  * @default
  157.  *
  158.  * @param PParam4 Base
  159.  * @desc Base value for this plain param.
  160.  * @default 0
  161.  *
  162.  * @param PParam5 Name
  163.  * @desc Name for this plain param in lowercase without spaces. Empty to skip.
  164.  * @default
  165.  *
  166.  * @param PParam5 Base
  167.  * @desc Base value for this plain param.
  168.  * @default 0
  169.  *
  170.  * @param PParam6 Name
  171.  * @desc Name for this plain param in lowercase without spaces. Empty to skip.
  172.  * @default
  173.  *
  174.  * @param PParam6 Base
  175.  * @desc Base value for this plain param.
  176.  * @default 0
  177.  *
  178.  * @param PParam7 Name
  179.  * @desc Name for this plain param in lowercase without spaces. Empty to skip.
  180.  * @default
  181.  *
  182.  * @param PParam7 Base
  183.  * @desc Base value for this plain param.
  184.  * @default 0
  185.  *
  186.  * @help
  187.  * ============================================================================
  188.  * Introduction
  189.  *
  190.  * By default there are some fixed types of params, there are usefull but
  191.  * have specified purposes and limits the way you can use them.
  192.  *
  193.  * With this plugin you can add new params that can be used in your formulas
  194.  * and every use you can imagine.
  195.  *
  196.  * There are 2 new param types:
  197.  *  -New/Normal Params: Level based params like the default ones,
  198.  *   with buff/debuff effects and trait modifiers.
  199.  *   Plus an option that can be used in some enemy levels plugins.
  200.  *
  201.  *  -Plain Params: Non level based params, these work as x/sparams
  202.  *   with trait modifiers.
  203.  *
  204.  * Also some customization are added to have more control for x/sparams.
  205.  *
  206.  * ============================================================================
  207.  * How to use
  208.  * ============================================================================
  209.  *
  210.  * NParams and PParams are calculated with their respective formulas:
  211.  *
  212.  * NParam = (Base + Plus) * Rate * Buff + Flat
  213.  * PParam = (Base + Plus) * Rate + Flat
  214.  *
  215.  *   -Base is different for n and pparams. For NParams is a level based value.
  216.  *    For PParam is a fixed value used to emulate x/sparams (0 and 1).
  217.  *   -Plus is the sum of all plus traits attached to a battler. In case of
  218.  *    NParam there is an extra added by script calls and item effects.
  219.  *   -Rate is the product of all trait multipliers attached to a battler.
  220.  *   -Buff is de effect of buff/debuff.
  221.  *   -Flat is the sum of all flat trais attached to a battler. It isn't affected
  222.  *    by rate.
  223.  *
  224.  * To make XParams and SParams more customizable I've changed a little
  225.  * their formulas:
  226.  *
  227.  * XParam = (0 + Plus) * Rate + Flat
  228.  * SParam = (1 + Plus) * Rate + Flat
  229.  *
  230.  * They still work as usual but now you can add traits to have more control.
  231.  *
  232.  * To add traits you can use notetags inside data.
  233.  *
  234.  * Classes and enemies only:
  235.  *
  236.  * <NPARAM: NParam Base Grow>
  237.  *    -Overrides default NParam for specified class/enemy.
  238.  *     NParam can be referenced by it's name or index.
  239.  *     Base is the initial value in level 1.
  240.  *     Grow is how much is increased per level. If empty it will be fixed.
  241.  *    
  242.  *
  243.  * Actors, classes, enemies, weapons, armors and states:
  244.  *
  245.  * <NDEBUFFRATE: NParam Rate>
  246.  *    -This is used for nparam debuff resistance, it's the chance of
  247.  *     succes debuff.
  248.  *     0.5 means 50% debuff succes, 0.2 is 20% and so on.
  249.  *
  250.  *
  251.  * <NPARAMPLUS: NParam Plus>
  252.  * <NPARAMRATE: NParam Rate>
  253.  * <NPARAMFLAT: NParam Flat>
  254.  *    -There are plus, rate and flat modifiers for nparam.
  255.  *
  256.  * <PPARAMPLUS: PParam Plus>
  257.  * <PPARAMRATE: PParam Rate>
  258.  * <PPARAMFLAT: PParam Flat>
  259.  *    -There are plus, rate and flat modifiers for pparam.
  260.  *
  261.  * <xPARAMPLUS: XParam Plus>
  262.  * <XPARAMRATE: XParam Rate>
  263.  * <XPARAMFLAT: XParam Flat>
  264.  * <SPARAMPLUS: SParam Plus>
  265.  * <SPARAMRATE: SParam Rate>
  266.  * <SPARAMFLAT: SParam Flat>
  267.  *    -There are plus, rate and flat modifiers for x and sparam.
  268.  *     I have included these to give more control.
  269.  *
  270.  *
  271.  * Skills and items only:
  272.  *
  273.  * <NBUFF: NParam turns>
  274.  * <NDEBUFF: NParam turns>
  275.  * <REMOVE NBUFF: NParam>
  276.  * <REMOVE NDEBUFF: NParam>
  277.  *    -There are buff/debuff effects to attach to skills and items.
  278.  *
  279.  * <NPARAM GROW: NParam amount>
  280.  *    -Allow to increase/decrease nparam by a specified amount.
  281.  *
  282.  * ============================================================================
  283.  * Parameters
  284.  * ============================================================================
  285.  *
  286.  * There are avaiable up to 8 params of each type with indexes from 0 to 7.
  287.  *
  288.  * NParamX Name: the name you give to specified nparam. It will be used
  289.  * in formulas and can be used to reference a notetag.
  290.  * Leave empty to skip.
  291.  *
  292.  * NParamX Base: the default formula for classes/enemies if they haven't.
  293.  * First number is the value at level 1. Second is the amount gained
  294.  * each level.
  295.  *
  296.  * NParamX Limits: the min and max value a nparam can be. If a 3rd value is
  297.  * added will be used as max for enemies.
  298.  *
  299.  * NParam Buff Icon Start: the starting icon for buffs. It's actually
  300.  * made to work as normal buffs but will change.
  301.  *
  302.  * NParam Deuff Icon Start: the starting icon for debuffs. It's actually
  303.  * made to work as normal debuffs but will change.
  304.  *
  305.  * PParamX Name: the name you give to specified pparam. It will be used
  306.  * in formulas and can be used to reference a notetag.
  307.  * Leave empty to skip.
  308.  *
  309.  * PParamX Base: is a base value that can be used to emulate x/sparams.
  310.  * 0 is used for a xparam and 1 for a sparam, but you can use the value
  311.  * you want for your purposes.
  312.  *
  313.  * ============================================================================
  314.  * Incompatibilities
  315.  * ============================================================================
  316.  *
  317.  * There's no known incompatible plugins yet.
  318.  *
  319.  * ============================================================================
  320.  * Known isues
  321.  * ============================================================================
  322.  *
  323.  * Not yet.
  324.  *
  325.  * ============================================================================
  326.  *
  327.  * For commercial and non-commercial games.
  328.  * Credit to ICF-Soft.
  329.  * This entire header must be included with plugin.
  330.  *
  331.  * ============================================================================
  332. */
  333. //=============================================================================
  334.  /*:es
  335.  * @plugindesc v1.00b Este complemento permite añadir nuevos parámetros
  336.  * personalizables y mayor control sobre los x/sparam.
  337.  * @author ICF-Soft [http://icfsoft.blogspot.com.es/]
  338.  *
  339.  * @param NParam0 Name
  340.  * @desc Nombre para este nuevo parámetro en minúsculas. Vacío para saltar.
  341.  * @default
  342.  *
  343.  * @param NParam0 Base
  344.  * @desc Modo predeterminado de configuración. Ver ayuda.
  345.  * @default 30 15
  346.  *
  347.  * @param NParam0 Limits
  348.  * @desc Valores mínimo y máximo para este nuevo parámetro.
  349.  * @default 0 999
  350.  *
  351.  * @param NParam1 Name
  352.  * @desc Nombre para este nuevo parámetro en minúsculas. Vacío para saltar.
  353.  * @default
  354.  *
  355.  * @param NParam1 Base
  356.  * @desc Modo predeterminado de configuración. Ver ayuda.
  357.  * @default 30 15
  358.  *
  359.  * @param NParam1 Limits
  360.  * @desc Valores mínimo y máximo para este nuevo parámetro.
  361.  * @default 0 999
  362.  *
  363.  * @param NParam2 Name
  364.  * @desc Nombre para este nuevo parámetro en minúsculas. Vacío para saltar.
  365.  * @default
  366.  *
  367.  * @param NParam2 Base
  368.  * @desc Modo predeterminado de configuración. Ver ayuda.
  369.  * @default 30 15
  370.  *
  371.  * @param NParam2 Limits
  372.  * @desc Valores mínimo y máximo para este nuevo parámetro.
  373.  * @default 0 999
  374.  *
  375.  * @param NParam3 Name
  376.  * @desc Nombre para este nuevo parámetro en minúsculas. Vacío para saltar.
  377.  * @default
  378.  *
  379.  * @param NParam3 Base
  380.  * @desc Modo predeterminado de configuración. Ver ayuda.
  381.  * @default 30 15
  382.  *
  383.  * @param NParam3 Limits
  384.  * @desc Valores mínimo y máximo para este nuevo parámetro.
  385.  * @default 0 999
  386.  *
  387.  * @param NParam4 Name
  388.  * @desc Nombre para este nuevo parámetro en minúsculas. Vacío para saltar.
  389.  * @default
  390.  *
  391.  * @param NParam4 Base
  392.  * @desc Modo predeterminado de configuración. Ver ayuda.
  393.  * @default 30 15
  394.  *
  395.  * @param NParam4 Limits
  396.  * @desc Valores mínimo y máximo para este nuevo parámetro.
  397.  * @default 0 999
  398.  *
  399.  * @param NParam5 Name
  400.  * @desc Nombre para este nuevo parámetro en minúsculas. Vacío para saltar.
  401.  * @default
  402.  *
  403.  * @param NParam5 Base
  404.  * @desc Modo predeterminado de configuración. Ver ayuda.
  405.  * @default 30 15
  406.  *
  407.  * @param NParam5 Limits
  408.  * @desc Valores mínimo y máximo para este nuevo parámetro.
  409.  * @default 0 999
  410.  *
  411.  * @param NParam6 Name
  412.  * @desc Nombre para este nuevo parámetro en minúsculas. Vacío para saltar.
  413.  * @default
  414.  *
  415.  * @param NParam6 Base
  416.  * @desc Modo predeterminado de configuración. Ver ayuda.
  417.  * @default 30 15
  418.  *
  419.  * @param NParam6 Limits
  420.  * @desc Valores mínimo y máximo para este nuevo parámetro.
  421.  * @default 0 999
  422.  *
  423.  * @param NParam7 Name
  424.  * @desc Nombre para este nuevo parámetro en minúsculas. Vacío para saltar.
  425.  * @default
  426.  *
  427.  * @param NParam7 Base
  428.  * @desc Modo predeterminado de configuración. Ver ayuda.
  429.  * @default 30 15
  430.  *
  431.  * @param NParam7 Limits
  432.  * @desc Valores mínimo y máximo para este nuevo parámetro.
  433.  * @default 0 999
  434.  *
  435.  * @param NParam Buff Icon Start
  436.  * @desc Starting icon for new param buff.
  437.  * @default 0
  438.  *
  439.  * @param NParam Deuff Icon Start
  440.  * @desc Starting icon for new param debuff.
  441.  * @default 0
  442.  *
  443.  * @param PParam0 Name
  444.  * @desc Nombre para este parámetro plano en minúsculas. Vacío para saltar.
  445.  * @default
  446.  *
  447.  * @param PParam0 Base
  448.  * @desc Valor básico para este parámetro plano..
  449.  * @default 0
  450.  *
  451.  * @param PParam1 Name
  452.  * @desc Nombre para este parámetro plano en minúsculas. Vacío para saltar.
  453.  * @default
  454.  *
  455.  * @param PParam1 Base
  456.  * @desc Valor básico para este parámetro plano..
  457.  * @default 0
  458.  *
  459.  * @param PParam2 Name
  460.  * @desc Nombre para este parámetro plano en minúsculas. Vacío para saltar.
  461.  * @default
  462.  *
  463.  * @param PParam2 Base
  464.  * @desc Valor básico para este parámetro plano..
  465.  * @default 0
  466.  *
  467.  * @param PParam3 Name
  468.  * @desc Nombre para este parámetro plano en minúsculas. Vacío para saltar.
  469.  * @default
  470.  *
  471.  * @param PParam3 Base
  472.  * @desc Valor básico para este parámetro plano..
  473.  * @default 0
  474.  *
  475.  * @param PParam4 Name
  476.  * @desc Nombre para este parámetro plano en minúsculas. Vacío para saltar.
  477.  * @default
  478.  *
  479.  * @param PParam4 Base
  480.  * @desc Valor básico para este parámetro plano..
  481.  * @default 0
  482.  *
  483.  * @param PParam5 Name
  484.  * @desc Nombre para este parámetro plano en minúsculas. Vacío para saltar.
  485.  * @default
  486.  *
  487.  * @param PParam5 Base
  488.  * @desc Valor básico para este parámetro plano..
  489.  * @default 0
  490.  *
  491.  * @param PParam6 Name
  492.  * @desc Nombre para este parámetro plano en minúsculas. Vacío para saltar.
  493.  * @default
  494.  *
  495.  * @param PParam6 Base
  496.  * @desc Valor básico para este parámetro plano..
  497.  * @default 0
  498.  *
  499.  * @param PParam7 Name
  500.  * @desc Nombre para este parámetro plano en minúsculas. Vacío para saltar.
  501.  * @default
  502.  *
  503.  * @param PParam7 Base
  504.  * @desc Valor básico para este parámetro plano..
  505.  * @default 0
  506.  *
  507.  * @help
  508.  * ============================================================================
  509.  * Introducción
  510.  * ============================================================================
  511.  *
  512.  * El RPG Maker MV viene con unos tipos fijos de parámetros, son útiles pero
  513.  * tienen sus propósitos específicos y limita el modo en que los puedes usar.
  514.  *
  515.  * Coneste complemento puedes añadir nuevos para usarlos en tus fórmulas
  516.  * y cualquier uso que puedas imaginar.
  517.  *
  518.  * Existen 2 nuevos tipos de parámetros:
  519.  *  -Nuevo/Normal Params: Basados en el nivel igual que los que vienen por
  520.  *   defecto, con los efectos de fortalecer/debilitar y modificadores.
  521.  *   Además de una opción que puede servir en distintos complementos
  522.  *   de niveles de enemigos.
  523.  *
  524.  *  -Planos Params: No basados en nivel, funcionan como los x/sparams
  525.  *   con modificadores.
  526.  *
  527.  * Además se ha añadido personalización para los x/sparams que permite mayor
  528.  * control.
  529.  *
  530.  * ============================================================================
  531.  * Uso
  532.  * ============================================================================
  533.  *
  534.  * Los NParams y PParams son calculados mediante sus respectivas fórmulas:
  535.  *
  536.  * NParam = (Base + Plus) * Rate * Buff + Flat
  537.  * PParam = (Base + Plus) * Rate + Flat
  538.  *
  539.  *   -Base es distinto entre ambas. Para los NParams está basado en el nivel.
  540.  *    Para los PParam el valor es fijo emulando los x/sparams (0 y 1).
  541.  *   -Plus es la suma de todas las características plus que atañen al personaje.
  542.  *    En el caso de NParam existe un extra añadido mediante llamadas a script
  543.  *    y efectos de los objetos.
  544.  *   -Rate es el producto de todos los multiplicadores que atañen al personaje.
  545.  *   -Buff es el efecto de fortalecer/debilitar.
  546.  *   -Flat es la suma de todas las características flat que atañen al personaje.
  547.  *    No se ve afectado por los multiplicadores.
  548.  *
  549.  * Para hacer los XParams y SParams más personalizables he cambiado un poco
  550.  * sus fórmulas:
  551.  *
  552.  * XParam = (0 + Plus) * Rate + Flat
  553.  * SParam = (1 + Plus) * Rate + Flat
  554.  *
  555.  * Siguen funcionando como de costumbre pero ahora puedes añadir más
  556.  * características para tener un mayor control.
  557.  *
  558.  * Para añadir características basta con añadir etiquetas en los cuadros de notas
  559.  * respectivos.
  560.  *
  561.  * Clases y enemigos solo:
  562.  *
  563.  * <NPARAM: NParam Base Grow>
  564.  *    -Cambia la base predeterminada del NParam por una específica.
  565.  *     NParam se puede referenciar por su nombre o índice.
  566.  *     Base es el valor inicial en el nivel 1.
  567.  *     Grow es cuanto se incrementa por nivel. Si está vacío cuenta como 0.
  568.  *    
  569.  *
  570.  * Héroes, clases, enemigos, armas, armaduras y estados alterados:
  571.  *
  572.  * <NDEBUFFRATE: NParam Rate>
  573.  *    -Se usa para la resistencia al debilitamiento en dicho nparam debuff,
  574.  *     básicamente es la probabilidad de acierto.
  575.  *     0.5 significa 50% acierto, 0.2 es 20%, etc.
  576.  *
  577.  *
  578.  * <NPARAMPLUS: NParam Plus>
  579.  * <NPARAMRATE: NParam Rate>
  580.  * <NPARAMFLAT: NParam Flat>
  581.  *    -Modificadores para el nparam.
  582.  *
  583.  * <PPARAMPLUS: PParam Plus>
  584.  * <PPARAMRATE: PParam Rate>
  585.  * <PPARAMFLAT: PParam Flat>
  586.  *    -Modificadores para el pparam.
  587.  *
  588.  * <xPARAMPLUS: XParam Plus>
  589.  * <XPARAMRATE: XParam Rate>
  590.  * <XPARAMFLAT: XParam Flat>
  591.  * <SPARAMPLUS: SParam Plus>
  592.  * <SPARAMRATE: SParam Rate>
  593.  * <SPARAMFLAT: SParam Flat>
  594.  *    -Modificadores para los x y sparam.
  595.  *     Los he incluido para dar más control.
  596.  *
  597.  *
  598.  * Habilidades y objetos solo:
  599.  *
  600.  * <NBUFF: NParam turns>
  601.  * <NDEBUFF: NParam turns>
  602.  * <REMOVE NBUFF: NParam>
  603.  * <REMOVE NDEBUFF: NParam>
  604.  *    -Efectos de añadir y quitar fortalecimiento/debilitamiento.
  605.  *
  606.  * <NPARAM GROW: NParam amount>
  607.  *    -Permite incrementar/decrementar el nparam una cantidad específica.
  608.  *
  609.  * ============================================================================
  610.  * Parámetros
  611.  * ============================================================================
  612.  *
  613.  * Hay disponibles hasta 8 parámetros de cada tipo con índices de 0 a 7.
  614.  *
  615.  * NParamX Name: el nombre que le vas a dar al nparam. Se utilizará en
  616.  * fórmulas y se puede usar como referencia en las etiquetas en las notas.
  617.  * Dejar vacío si no se quiere usar.
  618.  *
  619.  * NParamX Base: la fórmula predeterminada para clases y enemigos que no tengan.
  620.  * El primer númber es el valor en el nivel 1. El segundo es cuanto sube
  621.  * cada nivel.
  622.  *
  623.  * NParamX Limits: los valores mínimo y máximo que puede tener el nparam.
  624.  * Si se añade un tercero se usará para máximo de enemigos.
  625.  *
  626.  * NParam Buff Icon Start: el primer icono para los fortalecimientos.
  627.  * Actualmente funciona como los normales pero lo cambiaré.
  628.  *
  629.  * NParam Deuff Icon Start: el primer icono para los debilitamientos.
  630.  * Actualmente funciona como los normales pero lo cambiaré.
  631.  *
  632.  * PParamX Name: el nombre que le vas a dar al pparam. Se utilizará en
  633.  * fórmulas y se puede usar como referencia en las etiquetas en las notas.
  634.  * Dejar vacío si no se quiere usar.
  635.  *
  636.  * PParamX Base: es un valor básico con el que se pueden emular los x/sparams.
  637.  * 0 para un xparam y 1 para un sparam, pero puedes poner el valor que
  638.  * quieras.
  639.  *
  640.  * ============================================================================
  641.  * Incompatibilidades
  642.  * ============================================================================
  643.  *
  644.  * No se conocen complementos que sean incompatibles hasta la fecha.
  645.  *
  646.  * ============================================================================
  647.  * Problemas conocidos
  648.  * ============================================================================
  649.  *
  650.  * Por el momento ninguno.
  651.  *
  652.  * ============================================================================
  653.  *
  654.  * Para juegos comerciales y no comerciales.
  655.  * Se debe incluir a ICF-Soft en los créditos.
  656.  * Esta cabecera debe incluirse íntegramente con el plugin.
  657.  *
  658.  * ============================================================================
  659. */
  660. //=============================================================================
  661.  
  662. //=============================================================================
  663. // Parameter Variables
  664. //=============================================================================
  665.  
  666. ICF.Parameters = PluginManager.parameters('ICFSoft_ParamsCore');
  667. ICF.Param = ICF.Param || {};
  668.  
  669. ICF.Param.NParams = [];
  670. ICF.Param.NParamBase = [];
  671. ICF.Param.NParamLimit = [];
  672. ICF.Param.PParams = [];
  673. ICF.Param.PParamBase = [];
  674.  
  675. ICF.Param.BParams = ["mhp", "mmp", "atk", "def", "mat", "mdf", "agi", "luk"];
  676. ICF.Param.XParams = ["hit", "eva", "cri", "cev", "mev", "mrf", "cnt", "hrg", "mrg", "trg"];
  677. ICF.Param.SParams = ["tgr", "grd", "rec", "pha", "mcr", "tcr", "pdr", "mdr", "fdr", "exr"];
  678.  
  679. ICF.Param.NParams[0] = String(ICF.Parameters['NParam0 Name']);
  680. ICF.Param.NParamBase[0] = String(ICF.Parameters['NParam0 Base']).split(" ");
  681. ICF.Param.NParamLimit[0] = String(ICF.Parameters['NParam0 Limits']).split(" ");
  682. ICF.Param.PParams[0] = String(ICF.Parameters['PParam0 Name']);
  683. ICF.Param.PParamBase[0] = Number(ICF.Parameters['PParam0 Base']);
  684. ICF.Param.NParams[1] = String(ICF.Parameters['NParam1 Name']);
  685. ICF.Param.NParamBase[1] = String(ICF.Parameters['NParam1 Base']).split(" ");
  686. ICF.Param.NParamLimit[1] = String(ICF.Parameters['NParam1 Limits']).split(" ");
  687. ICF.Param.PParams[1] = String(ICF.Parameters['PParam1 Name']);
  688. ICF.Param.PParamBase[1] = Number(ICF.Parameters['PParam1 Base']);
  689. ICF.Param.NParams[2] = String(ICF.Parameters['NParam2 Name']);
  690. ICF.Param.NParamBase[2] = String(ICF.Parameters['NParam2 Base']).split(" ");
  691. ICF.Param.NParamLimit[2] = String(ICF.Parameters['NParam2 Limits']).split(" ");
  692. ICF.Param.PParams[2] = String(ICF.Parameters['PParam2 Name']);
  693. ICF.Param.PParamBase[2] = Number(ICF.Parameters['PParam2 Base']);
  694. ICF.Param.NParams[3] = String(ICF.Parameters['NParam3 Name']);
  695. ICF.Param.NParamBase[3] = String(ICF.Parameters['NParam3 Base']).split(" ");
  696. ICF.Param.NParamLimit[3] = String(ICF.Parameters['NParam3 Limits']).split(" ");
  697. ICF.Param.PParams[3] = String(ICF.Parameters['PParam3 Name']);
  698. ICF.Param.PParamBase[3] = Number(ICF.Parameters['PParam3 Base']);
  699. ICF.Param.NParams[4] = String(ICF.Parameters['NParam4 Name']);
  700. ICF.Param.NParamBase[4] = String(ICF.Parameters['NParam4 Base']).split(" ");
  701. ICF.Param.NParamLimit[4] = String(ICF.Parameters['NParam4 Limits']).split(" ");
  702. ICF.Param.PParams[4] = String(ICF.Parameters['PParam4 Name']);
  703. ICF.Param.PParamBase[4] = Number(ICF.Parameters['PParam4 Base']);
  704. ICF.Param.NParams[5] = String(ICF.Parameters['NParam5 Name']);
  705. ICF.Param.NParamBase[5] = String(ICF.Parameters['NParam5 Base']).split(" ");
  706. ICF.Param.NParamLimit[5] = String(ICF.Parameters['NParam5 Limits']).split(" ");
  707. ICF.Param.PParams[5] = String(ICF.Parameters['PParam5 Name']);
  708. ICF.Param.PParamBase[5] = Number(ICF.Parameters['PParam5 Base']);
  709. ICF.Param.NParams[6] = String(ICF.Parameters['NParam6 Name']);
  710. ICF.Param.NParamBase[6] = String(ICF.Parameters['NParam6 Base']).split(" ");
  711. ICF.Param.NParamLimit[6] = String(ICF.Parameters['NParam6 Limits']).split(" ");
  712. ICF.Param.PParams[6] = String(ICF.Parameters['PParam6 Name']);
  713. ICF.Param.PParamBase[6] = Number(ICF.Parameters['PParam6 Base']);
  714. ICF.Param.NParams[7] = String(ICF.Parameters['NParam7 Name']);
  715. ICF.Param.NParamBase[7] = String(ICF.Parameters['NParam7 Base']).split(" ");
  716. ICF.Param.NParamLimit[7] = String(ICF.Parameters['NParam7 Limits']).split(" ");
  717. ICF.Param.PParams[7] = String(ICF.Parameters['PParam7 Name']);
  718. ICF.Param.PParamBase[7] = Number(ICF.Parameters['PParam7 Base']);
  719. ICF.Param.NParams[8] = String(ICF.Parameters['NParam8 Name']);
  720. ICF.Param.NParamBase[8] = String(ICF.Parameters['NParam8 Base']).split(" ");
  721. ICF.Param.NParamLimit[8] = String(ICF.Parameters['NParam8 Limits']).split(" ");
  722. ICF.Param.PParams[8] = String(ICF.Parameters['PParam8 Name']);
  723. ICF.Param.PParamBase[8] = Number(ICF.Parameters['PParam8 Base']);
  724.  
  725. ICF.Param.NBuffIconStart = Number(ICF.Parameters['NParam Buff Icon Start']);
  726. ICF.Param.NDebuffIconStart = Number(ICF.Parameters['NParam Debuff Icon Start']);
  727.  
  728. //=============================================================================
  729. // Constants
  730. //=============================================================================
  731.  
  732. Game_BattlerBase.TRAIT_NPARAM          = 24;
  733. Game_BattlerBase.TRAIT_PPARAM          = 25;
  734. Game_Action.EFFECT_ADD_NBUFF           = 35;
  735. Game_Action.EFFECT_ADD_NDEBUFF         = 36;
  736. Game_Action.EFFECT_REMOVE_NBUFF        = 37;
  737. Game_Action.EFFECT_REMOVE_NDEBUFF      = 38;
  738. Game_Action.EFFECT_NGROW               = 45;
  739.  
  740. //=============================================================================
  741. // DataManager
  742. //=============================================================================
  743.  
  744. ICF.ParamCore.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
  745. DataManager.isDatabaseLoaded = function() {
  746.     if (!ICF.ParamCore.DataManager_isDatabaseLoaded.call(this)) return false;
  747.     if (!ICF.ParamCore.Procesed) {
  748.     DataManager.processParamCoreNotetags($dataActors);
  749.     DataManager.processParamCoreNotetagsB($dataClasses, "ClassNParam");
  750.     DataManager.processParamCoreNotetagsB($dataEnemies, "EnemyNParam");
  751.     DataManager.processParamCoreNotetags($dataWeapons);
  752.     DataManager.processParamCoreNotetags($dataArmors);
  753.     DataManager.processParamCoreNotetags($dataStates);
  754.     DataManager.processParamCoreNotetagsC($dataSkills);
  755.     DataManager.processParamCoreNotetagsC($dataItems);
  756.     ICF.ParamCore.Procesed = true;
  757.     }
  758.     return true;
  759. };
  760.  
  761. DataManager.processParamCoreNotetags = function(group) {
  762.     var note1 = /<(?:NPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  763.     var note1b = /<(?:NPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  764.     var note1c = /<(?:NPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  765.     var note2 = /<(?:PPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  766.     var note2b = /<(?:PPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  767.     var note2c = /<(?:PPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  768.     var note3 = /<(?:xPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  769.     var note3b = /<(?:XPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  770.     var note3c = /<(?:XPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  771.     var note4 = /<(?:SPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  772.     var note4b = /<(?:SPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  773.     var note4c = /<(?:SPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  774.     var note5 = /<(?:NDEBUFFRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  775.  
  776.     for (var n = 1; n < group.length; n++) {
  777.     var obj = group[n];
  778.     var notedata = obj.note.split(/[\r\n]+/);
  779.  
  780.     for (var i = 0; i < notedata.length; i++) {
  781.         var line = notedata[i];
  782.         if (line.match(note1)) {
  783.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  784.             if (indx > -1) obj.traits.push({code:24, dataId:indx, value:Number(RegExp.$2)});
  785.             }
  786.         else if (line.match(note1b)) {
  787.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  788.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 10, value:Number(RegExp.$2)});
  789.             }
  790.         else if (line.match(note1c)) {
  791.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  792.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 20, value:Number(RegExp.$2)});
  793.             }
  794.         else if (line.match(note2)) {
  795.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  796.             if (indx > -1) obj.traits.push({code:25, dataId:indx, value:Number(RegExp.$2)});
  797.             }
  798.         else if (line.match(note2b)) {
  799.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  800.             if (indx > -1) obj.traits.push({code:25, dataId:indx + 10, value:Number(RegExp.$2)});
  801.             }
  802.         else if (line.match(note2c)) {
  803.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  804.             if (indx > -1) obj.traits.push({code:25, dataId:indx + 20, value:Number(RegExp.$2)});
  805.             }
  806.         else if (line.match(note3)) {
  807.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  808.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx, value:Number(RegExp.$2)});
  809.             }
  810.         else if (line.match(note3b)) {
  811.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  812.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx + 10, value:Number(RegExp.$2)});
  813.             }
  814.         else if (line.match(note3c)) {
  815.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  816.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx + 20, value:Number(RegExp.$2)});
  817.             }
  818.         else if (line.match(note4)) {
  819.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  820.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx + 10, value:Number(RegExp.$2)});
  821.             }
  822.         else if (line.match(note4b)) {
  823.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  824.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx, value:Number(RegExp.$2)});
  825.             }
  826.         else if (line.match(note4c)) {
  827.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  828.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx + 20, value:Number(RegExp.$2)});
  829.             }
  830.         else if (line.match(note5)) {
  831.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  832.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_DEBUFF_RATE, dataId:indx + 10, value:Number(RegExp.$2)});
  833.             }
  834.     }
  835.     }
  836. };
  837.  
  838. DataManager.processParamCoreNotetagsB = function(group, arrayname) {
  839.     var grouparray = [];
  840.     var note1 = /<(?:NPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  841.     var note1b = /<(?:NPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  842.     var note1c = /<(?:NPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  843.     var note1x = /<(?:NPARAM):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)(?:[ ]+(\d+(?:\.\d+)?))?>/i;
  844.     var note2 = /<(?:PPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  845.     var note2b = /<(?:PPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  846.     var note2c = /<(?:PPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  847.     var note3 = /<(?:xPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  848.     var note3b = /<(?:XPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  849.     var note3c = /<(?:XPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  850.     var note4 = /<(?:SPARAMPLUS):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  851.     var note4b = /<(?:SPARAMRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  852.     var note4c = /<(?:SPARAMFLAT):[ ]*(\w+)[ ]+((?:\-)?\d+(?:\.\d+)?)>/i;
  853.     var note5 = /<(?:NDEBUFFRATE):[ ]*(\w+)[ ]+(\d+(?:\.\d+)?)>/i;
  854.  
  855.     for (var n = 1; n < group.length; n++) {
  856.     grouparray[n] = [[],[],[],[],[],[],[],[]];
  857.     var obj = group[n];
  858.     var notedata = obj.note.split(/[\r\n]+/);
  859.  
  860.     for (var i = 0; i < notedata.length; i++) {
  861.         var line = notedata[i];
  862.         if (line.match(note1)) {
  863.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  864.             if (indx > -1) obj.traits.push({code:24, dataId:indx, value:Number(RegExp.$2)});
  865.             }
  866.         else if (line.match(note1b)) {
  867.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  868.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 10, value:Number(RegExp.$2)});
  869.             }
  870.         else if (line.match(note1c)) {
  871.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  872.             if (indx > -1) obj.traits.push({code:24, dataId:indx + 20, value:Number(RegExp.$2)});
  873.             }
  874.         else if (line.match(note1x)) {
  875.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  876.             grouparray[n][indx] = [Number(RegExp.$2)];
  877.             if (!isNaN(Number(RegExp.$3))) grouparray[n][indx] = grouparray[n][indx].concat([Number(RegExp.$3)]);
  878.             }
  879.         else if (line.match(note2)) {
  880.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  881.             if (indx > -1) obj.traits.push({code:25, dataId:indx, value:Number(RegExp.$2)});
  882.             }
  883.         else if (line.match(note2b)) {
  884.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  885.             if (indx > -1) obj.traits.push({code:25, dataId:indx + 10, value:Number(RegExp.$2)});
  886.             }
  887.         else if (line.match(note2c)) {
  888.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.PParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  889.             if (indx > -1) obj.traits.push({code:25, dataId:indx + 20, value:Number(RegExp.$2)});
  890.             }
  891.         else if (line.match(note3)) {
  892.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  893.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx, value:Number(RegExp.$2)});
  894.             }
  895.         else if (line.match(note3b)) {
  896.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  897.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx + 10, value:Number(RegExp.$2)});
  898.             }
  899.         else if (line.match(note3c)) {
  900.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.XParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  901.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_XPARAM, dataId:indx + 20, value:Number(RegExp.$2)});
  902.             }
  903.         else if (line.match(note4)) {
  904.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  905.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx + 10, value:Number(RegExp.$2)});
  906.             }
  907.         else if (line.match(note4b)) {
  908.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  909.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx, value:Number(RegExp.$2)});
  910.             }
  911.         else if (line.match(note4c)) {
  912.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.SParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  913.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_SPARAM, dataId:indx + 20, value:Number(RegExp.$2)});
  914.             }
  915.         else if (line.match(note5)) {
  916.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  917.             if (indx > -1) obj.traits.push({code:Game_BattlerBase.TRAIT_DEBUFF_RATE, dataId:indx + 10, value:Number(RegExp.$2)});
  918.             }
  919.     }
  920.     }
  921.     ICF.ParamCore[arrayname] = grouparray;
  922. };
  923.  
  924. DataManager.processParamCoreNotetagsC = function(group) {
  925.     var note1 = /<(?:NBUFF):[ ]*(\w+)[ ]+(\d+)>/i;
  926.     var note2 = /<(?:NDEBUFF):[ ]*(\w+)[ ]+(\d+)>/i;
  927.     var note3 = /<(?:REMOVE NBUFF):[ ]*(\w+)[ ]+>/i;
  928.     var note4 = /<(?:REMOVE NDEBUFF):[ ]*(\w+)[ ]+>/i;
  929.     var note5 = /<(?:NPARAM GROW):[ ]*(\w+)[ ]+((?:\-)?\d+)>/i;
  930.  
  931.     for (var n = 1; n < group.length; n++) {
  932.     var obj = group[n];
  933.     var notedata = obj.note.split(/[\r\n]+/);
  934.  
  935.     for (var i = 0; i < notedata.length; i++) {
  936.         var line = notedata[i];
  937.         if (line.match(note1)) {
  938.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  939.             if (indx > -1) obj.effects.push({code:35, dataId:indx, value1:Number(RegExp.$2)});
  940.             }
  941.         else if (line.match(note2)) {
  942.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  943.             if (indx > -1) obj.effects.push({code:36, dataId:indx, value1:Number(RegExp.$2)});
  944.             }
  945.         else if (line.match(note3)) {
  946.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  947.             if (indx > -1) obj.effects.push({code:37, dataId:indx, value1:0});
  948.             }
  949.         else if (line.match(note4)) {
  950.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  951.             if (indx > -1) obj.effects.push({code:38, dataId:indx, value1:0});
  952.             }
  953.         else if (line.match(note5)) {
  954.             var indx = (isNaN(Number(RegExp.$1)))? ICF.Param.NParams.indexOf(RegExp.$1.toLowerCase()) : Number(RegExp.$1);
  955.             if (indx > -1) obj.effects.push({code:45, dataId:indx, value1:Number(RegExp.$2)});
  956.             }
  957.     }
  958.     }
  959. };
  960.  
  961. //=============================================================================
  962. // Game_BattlerBase
  963. //=============================================================================
  964.  
  965. if (ICF.Param.NParams[0].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.NParams[0], { get: function() { return this.NParam(0); }, configurable: true });
  966. if (ICF.Param.NParams[1].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.NParams[1], { get: function() { return this.NParam(1); }, configurable: true });
  967. if (ICF.Param.NParams[2].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.NParams[2], { get: function() { return this.NParam(2); }, configurable: true });
  968. if (ICF.Param.NParams[3].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.NParams[3], { get: function() { return this.NParam(3); }, configurable: true });
  969. if (ICF.Param.NParams[4].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.NParams[4], { get: function() { return this.NParam(4); }, configurable: true });
  970. if (ICF.Param.NParams[5].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.NParams[5], { get: function() { return this.NParam(5); }, configurable: true });
  971. if (ICF.Param.NParams[6].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.NParams[6], { get: function() { return this.NParam(6); }, configurable: true });
  972. if (ICF.Param.NParams[7].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.NParams[7], { get: function() { return this.NParam(7); }, configurable: true });
  973.  
  974. if (ICF.Param.PParams[0].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.PParams[0], { get: function() { return this.PParam(0); }, configurable: true });
  975. if (ICF.Param.PParams[1].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.PParams[1], { get: function() { return this.PParam(1); }, configurable: true });
  976. if (ICF.Param.PParams[2].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.PParams[2], { get: function() { return this.PParam(2); }, configurable: true });
  977. if (ICF.Param.PParams[3].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.PParams[3], { get: function() { return this.PParam(3); }, configurable: true });
  978. if (ICF.Param.PParams[4].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.PParams[4], { get: function() { return this.PParam(4); }, configurable: true });
  979. if (ICF.Param.PParams[5].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.PParams[5], { get: function() { return this.PParam(5); }, configurable: true });
  980. if (ICF.Param.PParams[6].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.PParams[6], { get: function() { return this.PParam(6); }, configurable: true });
  981. if (ICF.Param.PParams[7].length > 0) Object.defineProperty(Game_BattlerBase.prototype, ICF.Param.PParams[7], { get: function() { return this.PParam(7); }, configurable: true });
  982.  
  983. Object.defineProperty(Game_BattlerBase.prototype, 'level', { value: 1, configurable: true});
  984.  
  985. ICF.ParamCore.clearParamPlus = Game_BattlerBase.prototype.clearParamPlus;
  986. Game_BattlerBase.prototype.clearParamPlus = function() {
  987.     ICF.ParamCore.clearParamPlus.call(this);
  988.     this._NParamPlus = [0,0,0,0,0,0,0,0];
  989. };
  990.  
  991. ICF.ParamCore.clearBuffs = Game_BattlerBase.prototype.clearBuffs;
  992. Game_BattlerBase.prototype.clearBuffs = function() {
  993.     ICF.ParamCore.clearBuffs.call(this);
  994.     this._NBuffs = [0,0,0,0,0,0,0,0];
  995.     this._NBuffTurns = [0,0,0,0,0,0,0,0];
  996. };
  997.  
  998. Game_BattlerBase.prototype.eraseNBuff = function(paramId) {
  999.     this._NBuffs[paramId] = 0;
  1000.     this._NBuffTurns[paramId] = 0;
  1001. };
  1002.  
  1003. Game_BattlerBase.prototype.NBuffLength = function() {
  1004.     return this._NBuffs.length;
  1005. };
  1006.  
  1007. Game_BattlerBase.prototype.NBuff = function(paramId) {
  1008.     return this._NBuffs[paramId];
  1009. };
  1010.  
  1011. Game_BattlerBase.prototype.isNBuffAffected = function(paramId) {
  1012.     return this._NBuffs[paramId] > 0;
  1013. };
  1014.  
  1015. Game_BattlerBase.prototype.isNDebuffAffected = function(paramId) {
  1016.     return this._NBuffs[paramId] < 0;
  1017. };
  1018.  
  1019. Game_BattlerBase.prototype.isNBuffOrDebuffAffected = function(paramId) {
  1020.     return this._NBuffs[paramId] !== 0;
  1021. };
  1022.  
  1023. Game_BattlerBase.prototype.isMaxNBuffAffected = function(paramId) {
  1024.     return this._NBuffs[paramId] === 2;
  1025. };
  1026.  
  1027. Game_BattlerBase.prototype.isMaxNDebuffAffected = function(paramId) {
  1028.     return this._NBuffs[paramId] === -2;
  1029. };
  1030.  
  1031. Game_BattlerBase.prototype.increaseNBuff = function(paramId) {
  1032.     if (!this.isMaxNBuffAffected(paramId)) {
  1033.         this._NBuffs[paramId]++;
  1034.     }
  1035. };
  1036.  
  1037. Game_BattlerBase.prototype.decreaseNBuff = function(paramId) {
  1038.     if (!this.isMaxNDebuffAffected(paramId)) {
  1039.         this._NBuffs[paramId]--;
  1040.     }
  1041. };
  1042.  
  1043. Game_BattlerBase.prototype.overwriteNBuffTurns = function(paramId, turns) {
  1044.     if (this._NBuffTurns[paramId] < turns) {
  1045.         this._NBuffTurns[paramId] = turns;
  1046.     }
  1047. };
  1048.  
  1049. Game_BattlerBase.prototype.isNBuffExpired = function(paramId) {
  1050.     return this._NBuffTurns[paramId] === 0;
  1051. };
  1052.  
  1053. ICF.ParamCore.updateBuffTurns = Game_BattlerBase.prototype.updateBuffTurns;
  1054. Game_BattlerBase.prototype.updateBuffTurns = function() {
  1055.     ICF.ParamCore.updateBuffTurns.call(this);
  1056.     for (var i = 0; i < this._NBuffTurns.length; i++) {
  1057.         if (this._NBuffTurns[i] > 0) {
  1058.             this._NBuffTurns[i]--;
  1059.         }
  1060.     }
  1061. };
  1062.  
  1063. ICF.ParamCore.buffIcons = Game_BattlerBase.prototype.buffIcons;
  1064. Game_BattlerBase.prototype.buffIcons = function() {
  1065.     var icons = ICF.ParamCore.buffIcons.call(this);
  1066.     if ((ICF.Param.NBuffIconStart == 0) || (ICF.Param.NBuffIconStart == 0)) return icons;
  1067.     for (var i = 0; i < this._NBuffs.length; i++) {
  1068.         if (this._NBuffs[i] !== 0) {
  1069.             icons.push(this.NBuffIconIndex(this._NBuffs[i], i));
  1070.         }
  1071.     }
  1072.     return icons;
  1073. };
  1074.  
  1075. Game_BattlerBase.prototype.NBuffIconIndex = function(buffLevel, paramId) {
  1076.     if (buffLevel > 0) {
  1077.         return ICF.Param.NBuffIconStart + (buffLevel - 1) * 8 + paramId;
  1078.     } else if (buffLevel < 0) {
  1079.         return ICF.Param.NDebuffIconStart + (-buffLevel - 1) * 8 + paramId;
  1080.     } else {
  1081.         return 0;
  1082.     }
  1083. };
  1084.  
  1085. Game_BattlerBase.prototype.NParamBase = function(paramId) { //return 5;
  1086.     if (ICF.Param.NParamBase[paramId].length == 1) {
  1087.         return Number(ICF.Param.NParamBase[paramId][0]);
  1088.     } else if (ICF.Param.NParamBase[paramId].length > 1) {
  1089.         return Number(ICF.Param.NParamBase[paramId][0]) + Number(ICF.Param.NParamBase[paramId][1] * (this.level - 1));
  1090.     } else {
  1091.         return 0;
  1092.     }
  1093. };
  1094.  
  1095. Game_BattlerBase.prototype.NParamPlus = function(paramId) {
  1096.     return this._NParamPlus[paramId] + this.traitsSum(Game_BattlerBase.TRAIT_NPARAM, paramId);
  1097. };
  1098.  
  1099. Game_BattlerBase.prototype.NParamMin = function(paramId) {
  1100.     return ICF.Param.NParamLimit[paramId][0];
  1101. };
  1102.  
  1103. Game_BattlerBase.prototype.NParamMax = function(paramId) {
  1104.     return ICF.Param.NParamLimit[paramId][1];
  1105. };
  1106.  
  1107. Game_BattlerBase.prototype.NParamRate = function(paramId) {
  1108.     return this.traitsPi(Game_BattlerBase.TRAIT_NPARAM, paramId + 10);
  1109. };
  1110.  
  1111. Game_BattlerBase.prototype.NParamBuffRate = function(paramId) {
  1112.     return this._NBuffs[paramId] * 0.25 + 1.0;
  1113. };
  1114.  
  1115. Game_BattlerBase.prototype.NParamFlat = function(paramId) {
  1116.     return this.traitsSum(Game_BattlerBase.TRAIT_NPARAM, paramId + 20);
  1117. };
  1118.  
  1119. Game_BattlerBase.prototype.NParam = function(paramId) {
  1120.     var value = this.NParamBase(paramId) + this.NParamPlus(paramId);
  1121.     value *= this.NParamRate(paramId) * this.NParamBuffRate(paramId);
  1122.     value += this.NParamFlat(paramId);
  1123.     var maxValue = this.NParamMax(paramId);
  1124.     var minValue = this.NParamMin(paramId);
  1125.     return Math.round(value.clamp(minValue, maxValue));
  1126. };
  1127.  
  1128. Game_BattlerBase.prototype.PParam = function(pparamId) {
  1129.     var value = Number(ICF.Param.PParamBase[pparamId]) + this.traitsSum(Game_BattlerBase.TRAIT_PPARAM, pparamId);
  1130.     value *= this.traitsPi(Game_BattlerBase.TRAIT_PPARAM, pparamId + 10);
  1131.     value += this.traitsSum(Game_BattlerBase.TRAIT_PPARAM, pparamId + 20);
  1132.     return value;
  1133. };
  1134.  
  1135. Game_BattlerBase.prototype.xparam = function(xparamId) {
  1136.     return this.traitsSum(Game_BattlerBase.TRAIT_XPARAM, xparamId) * this.traitsPi(Game_BattlerBase.TRAIT_XPARAM, xparamId + 10) + this.traitsSum(Game_BattlerBase.TRAIT_XPARAM, xparamId + 20);
  1137. };
  1138.  
  1139. Game_BattlerBase.prototype.sparam = function(sparamId) {
  1140.     return (1 + this.traitsSum(Game_BattlerBase.TRAIT_SPARAM, sparamId + 10)) * this.traitsPi(Game_BattlerBase.TRAIT_SPARAM, sparamId) + this.traitsSum(Game_BattlerBase.TRAIT_SPARAM, sparamId + 20);
  1141. };
  1142.  
  1143. Game_BattlerBase.prototype.NDebuffRate = function(paramId) {
  1144.     return this.traitsPi(Game_BattlerBase.TRAIT_DEBUFF_RATE, paramId + 10);
  1145. };
  1146.  
  1147. Game_BattlerBase.prototype.addNParam = function(paramId, value) {
  1148.     this._NParamPlus[paramId] += value;
  1149.     this.refresh();
  1150. };
  1151.  
  1152. //=============================================================================
  1153. // Game_Battler
  1154. //=============================================================================
  1155.  
  1156. Game_Battler.prototype.addNBuff = function(paramId, turns) {
  1157.     if (this.isAlive()) {
  1158.         this.increaseNBuff(paramId);
  1159.         if (this.isNBuffAffected(paramId)) {
  1160.             this.overwriteNBuffTurns(paramId, turns);
  1161.         }
  1162.         this._result.pushAddedNBuff(paramId);
  1163.         this.refresh();
  1164.     }
  1165. };
  1166.  
  1167. Game_Battler.prototype.addNDebuff = function(paramId, turns) {
  1168.     if (this.isAlive()) {
  1169.         this.decreaseNBuff(paramId);
  1170.         if (this.isNDebuffAffected(paramId)) {
  1171.             this.overwriteNBuffTurns(paramId, turns);
  1172.         }
  1173.         this._result.pushAddedNDebuff(paramId);
  1174.         this.refresh();
  1175.     }
  1176. };
  1177.  
  1178. Game_Battler.prototype.removeNBuff = function(paramId) {
  1179.     if (this.isAlive() && this.isNBuffOrDebuffAffected(paramId)) {
  1180.         this.eraseNBuff(paramId);
  1181.         this._result.pushRemovedNBuff(paramId);
  1182.         this.refresh();
  1183.     }
  1184. };
  1185.  
  1186. ICF.ParamCore.removeAllBuffs = Game_Battler.prototype.removeAllBuffs;
  1187. Game_Battler.prototype.removeAllBuffs = function() {
  1188.     ICF.ParamCore.removeAllBuffs.call(this);
  1189.     for (var i = 0; i < this.NBuffLength(); i++) {
  1190.         this.removeNBuff(i);
  1191.     }
  1192. };
  1193.  
  1194. ICF.ParamCore.removeBuffsAuto = Game_Battler.prototype.removeBuffsAuto;
  1195. Game_Battler.prototype.removeBuffsAuto = function() {
  1196.     ICF.ParamCore.removeBuffsAuto.call(this);
  1197.     for (var i = 0; i < this.NBuffLength(); i++) {
  1198.         if (this.isNBuffExpired(i)) {
  1199.             this.removeNBuff(i);
  1200.         }
  1201.     }
  1202. };
  1203.  
  1204. //=============================================================================
  1205. // Game_Actor
  1206. //=============================================================================
  1207.  
  1208. Game_Actor.prototype.NParamBase = function(paramId) {
  1209.     if (!ICF.ParamCore.ClassNParam) return Game_BattlerBase.prototype.NParamBase.call(this, paramId);
  1210.     if (ICF.ParamCore.ClassNParam[this._classId][paramId].length == 1) {
  1211.         return ICF.ParamCore.ClassNParam[this._classId][paramId][0];
  1212.     } else if (ICF.ParamCore.ClassNParam[this._classId][paramId].length > 1) {
  1213.         return ICF.ParamCore.ClassNParam[this._classId][paramId][0] + ICF.ParamCore.ClassNParam[this._classId][paramId][1] * (this.level - 1);
  1214.     } else {
  1215.         return Game_BattlerBase.prototype.NParamBase.call(this, paramId);
  1216.     }
  1217. };
  1218.  
  1219. //=============================================================================
  1220. // Game_Enemy
  1221. //=============================================================================
  1222.  
  1223. Game_Enemy.prototype.NParamMax = function(paramId) {
  1224.     return (ICF.Param.NParamLimit.length > 2)? ICF.Param.NParamLimit[paramId][2] : ICF.Param.NParamLimit[paramId][1];
  1225. };
  1226.  
  1227. Game_Enemy.prototype.NParamBase = function(paramId) {
  1228.     if (ICF.ParamCore.EnemyNParam[this._enemyId][paramId].length == 1) {
  1229.         return ICF.ParamCore.EnemyNParam[this._enemyId][paramId][0];
  1230.     } else if (ICF.ParamCore.EnemyNParam[this._enemyId][paramId].length > 1) {
  1231.         return ICF.ParamCore.EnemyNParam[this._enemyId][paramId][0] + ICF.ParamCore.EnemyNParam[this._enemyId][paramId][1] * (this.level - 1);
  1232.     } else {
  1233.         return Game_BattlerBase.prototype.NParamBase.call(this, paramId);
  1234.     }
  1235. };
  1236.  
  1237. //=============================================================================
  1238. // Game_Action
  1239. //=============================================================================
  1240.  
  1241. ICF.ParamCore.testItemEffect = Game_Action.prototype.testItemEffect;
  1242. Game_Action.prototype.testItemEffect = function(target, effect) {
  1243.     switch (effect.code) {
  1244.     case Game_Action.EFFECT_ADD_NBUFF :
  1245.         return !target.isMaxNBuffAffected(effect.dataId);
  1246.     case Game_Action.EFFECT_ADD_NDEBUFF :
  1247.         return !target.isMaxNDebuffAffected(effect.dataId);
  1248.     case Game_Action.REMOVE_NBUFF:
  1249.         return target.isNBuffAffected(effect.dataId);
  1250.     case Game_Action.REMOVE_NDEBUFF:
  1251.         return target.isNDebuffAffected(effect.dataId);
  1252.     default:
  1253.         return ICF.ParamCore.testItemEffect.call(this, target, effect);
  1254.     }
  1255. };
  1256.  
  1257. ICF.ParamCore.applyItemEffect = Game_Action.prototype.applyItemEffect;
  1258. Game_Action.prototype.applyItemEffect = function(target, effect) {
  1259.     switch (effect.code) {
  1260.     case Game_Action.EFFECT_ADD_NBUFF:
  1261.         this.itemEffectAddNBuff(target, effect);
  1262.         break;
  1263.     case Game_Action.EFFECT_ADD_NDEBUFF:
  1264.         this.itemEffectAddNDebuff(target, effect);
  1265.         break;
  1266.     case Game_Action.EFFECT_REMOVE_NBUFF:
  1267.         this.itemEffectRemoveNBuff(target, effect);
  1268.         break;
  1269.     case Game_Action.EFFECT_REMOVE_NDEBUFF:
  1270.         this.itemEffectRemoveNDebuff(target, effect);
  1271.         break;
  1272.     case Game_Action.EFFECT_NGROW:
  1273.         this.itemEffectGrowNParam(target, effect);
  1274.         break;
  1275.     default:
  1276.         ICF.ParamCore.applyItemEffect.call(this, target, effect);
  1277.     }
  1278. };
  1279.  
  1280. Game_Action.prototype.itemEffectAddNBuff = function(target, effect) {
  1281.     target.addNBuff(effect.dataId, effect.value1);
  1282.     this.makeSuccess(target);
  1283. };
  1284.  
  1285. Game_Action.prototype.itemEffectAddNDebuff = function(target, effect) {
  1286.     var chance = target.NDebuffRate(effect.dataId) * this.lukEffectRate(target);
  1287.     if (Math.random() < chance) {
  1288.         target.addNDebuff(effect.dataId, effect.value1);
  1289.         this.makeSuccess(target);
  1290.     }
  1291. };
  1292.  
  1293. Game_Action.prototype.itemEffectRemoveNBuff = function(target, effect) {
  1294.     if (target.isNBuffAffected(effect.dataId)) {
  1295.         target.removeNBuff(effect.dataId);
  1296.         this.makeSuccess(target);
  1297.     }
  1298. };
  1299.  
  1300. Game_Action.prototype.itemEffectRemoveNDebuff = function(target, effect) {
  1301.     if (target.isNDebuffAffected(effect.dataId)) {
  1302.         target.removeNBuff(effect.dataId);
  1303.         this.makeSuccess(target);
  1304.     }
  1305. };
  1306.  
  1307. Game_Action.prototype.itemEffectGrowNParam = function(target, effect) {
  1308.     target.addNParam(effect.dataId, Math.floor(effect.value1));
  1309.     this.makeSuccess(target);
  1310. };
  1311.  
  1312. //=============================================================================
  1313. // Game_ActionResult
  1314. //=============================================================================
  1315.  
  1316. ICF.ParamCore.GARClear = Game_ActionResult.prototype.clear;
  1317. Game_ActionResult.prototype.clear = function() {
  1318.     ICF.ParamCore.GARClear.call(this);
  1319.     this.addedNBuffs = [];
  1320.     this.addedNDebuffs = [];
  1321.     this.removedNBuffs = [];
  1322. };
  1323.  
  1324. Game_ActionResult.prototype.isNBuffAdded = function(paramId) {
  1325.     return this.addedNBuffs.contains(paramId);
  1326. };
  1327.  
  1328. Game_ActionResult.prototype.pushAddedNBuff = function(paramId) {
  1329.     if (!this.isNBuffAdded(paramId)) {
  1330.         this.addedNBuffs.push(paramId);
  1331.     }
  1332. };
  1333.  
  1334. Game_ActionResult.prototype.isNDebuffAdded = function(paramId) {
  1335.     return this.addedNDebuffs.contains(paramId);
  1336. };
  1337.  
  1338. Game_ActionResult.prototype.pushAddedNDebuff = function(paramId) {
  1339.     if (!this.isNDebuffAdded(paramId)) {
  1340.         this.addedNDebuffs.push(paramId);
  1341.     }
  1342. };
  1343.  
  1344. Game_ActionResult.prototype.isNBuffRemoved = function(paramId) {
  1345.     return this.removedNBuffs.contains(paramId);
  1346. };
  1347.  
  1348. Game_ActionResult.prototype.pushnRemovedBuff = function(paramId) {
  1349.     if (!this.isNBuffRemoved(paramId)) {
  1350.         this.removedNBuffs.push(paramId);
  1351.     }
  1352. };
  1353.  
  1354. //=============================================================================
  1355. // End of File
  1356. //=============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement