Advertisement
ICF-Soft

ICF-Soft Status Menu 1.04 RPG Maker MV

Oct 21st, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // ICF-Soft Plugins - Status Menu
  3. // ICFSoft_StatusMenu.js
  4. //=============================================================================
  5.  
  6. var Imported = Imported || {};
  7. Imported.ICFSoft_StatusMenu = true;
  8.  
  9. var ICF = ICF || {};
  10. ICF.StatusMenu = ICF.StatusMenu || {};
  11. ICF.NotetagsProcessor = ICF.NotetagsProcessor || {};
  12.  
  13. ICF.StatusMenu.Version = 104; // 1.04
  14.  
  15. //=============================================================================
  16.  /*:
  17.  * @plugindesc v1.04b A status menu where you can organize actor params.
  18.  * @author ICF-Soft [http://icfsoft.blogspot.com.es/]
  19.  *
  20.  * @param Main menu gauges1
  21.  * @desc Gauge names that will be shown in row.
  22.  * @default hp
  23.  *
  24.  * @param Main menu gauges2
  25.  * @desc Gauge names that will be shown in row.
  26.  * @default mp
  27.  *
  28.  * @param Main menu gauges3
  29.  * @desc Gauge names that will be shown in row.
  30.  * @default tp
  31.  *
  32.  * @param Status menu gauges1
  33.  * @desc Gauge names that will be shown in row.
  34.  * @default hp
  35.  *
  36.  * @param Status menu gauges2
  37.  * @desc Gauge names that will be shown in row.
  38.  * @default mp tp
  39.  *
  40.  * @param Column1
  41.  * @desc Param names that will be shown in column.
  42.  * @default atk def mat mdf agi luk
  43.  *
  44.  * @param Column2
  45.  * @desc Param names that will be shown in column.
  46.  * @default
  47.  *
  48.  * @param Column3
  49.  * @desc Param names that will be shown in column.
  50.  * @default
  51.  *
  52.  * @param Equip Column
  53.  * @desc Param names that will be shown in equip menu.
  54.  * @default atk def mat mdf agi luk
  55.  *
  56.  * @param Percentage params
  57.  * @desc What params will be used as percentages.
  58.  * @default
  59.  *
  60.  * @param Evaluables
  61.  * @desc Making values througth formulas.
  62.  * @type struct<Evals>[]
  63.  * @default ["{\"Name\":\"Something random\",\"Formula\":\"Math.trunc(Math.random() * 100)\"}"]
  64.  *
  65.  * @param Percentages
  66.  * @desc Making percentage values througth formulas.
  67.  * @type struct<Percents>[]
  68.  * @default ["{\"Name\":\"Something random\",\"Formula\":\"Math.random()\"}"]
  69.  *
  70.  * @param Gauges
  71.  * @desc Making gauges througth formulas.
  72.  * @type struct<Gauges>[]
  73.  * @default ["{\"Name\":\"Random gauge\",\"Current\":\"Math.trunc(Math.random() * 100)\",\"Max\":\"100\",\"Color1\":\"#e99\",\"Color2\":\"17\",\"Show Current and Max\":\"false\"}"]
  74.  *
  75.  * @param XParam0 Full Name
  76.  * @desc Name that will be shown for this extra param.
  77.  * @default Hit rate
  78.  *
  79.  * @param XParam1 Full Name
  80.  * @desc Name that will be shown for this extra param.
  81.  * @default Evasion rate
  82.  *
  83.  * @param XParam2 Full Name
  84.  * @desc Name that will be shown for this extra param.
  85.  * @default Critical rate
  86.  *
  87.  * @param XParam3 Full Name
  88.  * @desc Name that will be shown for this extra param.
  89.  * @default Critical evasion rate
  90.  *
  91.  * @param XParam4 Full Name
  92.  * @desc Name that will be shown for this extra param.
  93.  * @default Magic evasion rate
  94.  *
  95.  * @param XParam5 Full Name
  96.  * @desc Name that will be shown for this extra param.
  97.  * @default Magic reflection rate
  98.  *
  99.  * @param XParam6 Full Name
  100.  * @desc Name that will be shown for this extra param.
  101.  * @default Counter-attack rate
  102.  *
  103.  * @param XParam7 Full Name
  104.  * @desc Name that will be shown for this extra param.
  105.  * @default Hp-regen rate
  106.  *
  107.  * @param XParam8 Full Name
  108.  * @desc Name that will be shown for this extra param.
  109.  * @default Mp-regen rate
  110.  *
  111.  * @param XParam9 Full Name
  112.  * @desc Name that will be shown for this extra param.
  113.  * @default Tp-regen rate
  114.  *
  115.  * @param SParam0 Full Name
  116.  * @desc Name that will be shown for this special param.
  117.  * @default Targeted rate
  118.  *
  119.  * @param SParam1 Full Name
  120.  * @desc Name that will be shown for this special param.
  121.  * @default Guard rate
  122.  *
  123.  * @param SParam2 Full Name
  124.  * @desc Name that will be shown for this special param.
  125.  * @default Recovery rate
  126.  *
  127.  * @param SParam3 Full Name
  128.  * @desc Name that will be shown for this special param.
  129.  * @default Pharmacology
  130.  *
  131.  * @param SParam4 Full Name
  132.  * @desc Name that will be shown for this special param.
  133.  * @default Mp cost rate
  134.  *
  135.  * @param SParam5 Full Name
  136.  * @desc Name that will be shown for this special param.
  137.  * @default Tp cost rate
  138.  *
  139.  * @param SParam6 Full Name
  140.  * @desc Name that will be shown for this special param.
  141.  * @default Phisical damage rate
  142.  *
  143.  * @param SParam7 Full Name
  144.  * @desc Name that will be shown for this special param.
  145.  * @default Magical damage rate
  146.  *
  147.  * @param SParam8 Full Name
  148.  * @desc Name that will be shown for this special param.
  149.  * @default Floor damage rate
  150.  *
  151.  * @param SParam9 Full Name
  152.  * @desc Name that will be shown for this special param.
  153.  * @default Experience rate
  154.  *
  155.  * @help
  156.  * ============================================================================
  157.  * Introduction
  158.  * ============================================================================
  159.  *
  160.  * This plugin is made for use with ICF-Soft Params Core but can work alone.
  161.  *
  162.  * Allows you to show params in up to three columns plus equip, using all
  163.  * window width.
  164.  * Also allow using gauges for hp, mp, tp and cparams for simple status on
  165.  * status menu and main menu.
  166.  *
  167.  * You can use javascript code to be run to get a value and change columns
  168.  * for specified actors.
  169.  *
  170.  * ============================================================================
  171.  * How to use
  172.  * ============================================================================
  173.  *
  174.  * You can give different columns for specified actors with this notetag:
  175.  *
  176.  * <STATUS MENU COL x param param param>
  177.  *
  178.  * You need to specify column from 1 to 3 that will be replaced and
  179.  * params are separated by spaces.
  180.  * Allow param, nparam, pparam, xparam, sparam, evals, percents, gauges and
  181.  * cparam basic or counter.
  182.  *
  183.  * <EQUIP STATUS MENU COL param param param>
  184.  *
  185.  * Replace shown params in equip menu. Params are separated by spaces.
  186.  * Allow param, nparam, pparam, xparam, sparam, evals, percents and cparams.
  187.  *
  188.  * <STATUS MENU GAUGES x param param param>
  189.  *
  190.  * Replace shown gauges in small info area from status menu. Params are
  191.  * separated by spaces. Allow hp, mp, tp, cparam counter and gauges.
  192.  *
  193.  * <MAIN MENU INFO GAUGES x param param param>
  194.  *
  195.  * Replace shown gauges in small info area from main menu. Params are
  196.  * separated by spaces. Allow hp, mp, tp, cparam counter and gauges.
  197.  *
  198.  * More features will be added in the future.
  199.  *
  200.  * ============================================================================
  201.  * Parameters
  202.  * ============================================================================
  203.  *
  204.  * Main menu gaugesX: Place the gauge names that will be shown in row separated
  205.  * by spaces. You can use up to 3 rows.
  206.  *
  207.  * Status menu gaugesX: Place the gauge names that will be shown in row
  208.  * separated by spaces. You can use up to 2 rows.
  209.  *
  210.  * ColumnX: Place the param names that will be shown in comlumn separated by
  211.  * spaces. You can use up to 3 columns sharing width with equips.
  212.  * It works with param, nparam, pparam, evals, percents and gauges.
  213.  *
  214.  * Equip Column: Place the param names that will be shown in equip menu comlumn
  215.  * separated by spaces.
  216.  * It doesn't use gauges.
  217.  *
  218.  * Percentage params: Tell what params will be used as percentages.
  219.  * It works with pparam.
  220.  *
  221.  * You can create all evals and gauges you'll need with indexes starfing from 0.
  222.  *
  223.  * Evaluables: A name and a formula to determine a status slot.
  224.  * Use eval0, eval1, eval2 ... etc.
  225.  *
  226.  * Percentages: A name and a formula to determine a status slot as a percentage.
  227.  * Use percentage0, percentage1, percentage2 ... etc.
  228.  *
  229.  * Gauges: Place a gauge in a status slot. You can configure name, formulas for
  230.  * current and max values, gauge colors and if you want to show both current
  231.  * and max values or only current.
  232.  * Use gauge0, gauge1, gauge2 ... etc.
  233.  *
  234.  * ============================================================================
  235.  * Incompatibilities
  236.  * ============================================================================
  237.  *
  238.  * Can be incompatible or interfere with some similar plugins.
  239.  *
  240.  * ============================================================================
  241.  * Known isues
  242.  * ============================================================================
  243.  *
  244.  * Can interfere with some similar plugins or enhace them.
  245.  *
  246.  * ============================================================================
  247.  * Changelog
  248.  * ============================================================================
  249.  *
  250.  * Version 1.04:
  251.  * - Added use of cparams.
  252.  * - Allow editing gauge places from small info on main and status menus.
  253.  * - Removed obsolete system.
  254.  *
  255.  * Version 1.03:
  256.  * - Added a column for equipment menu.
  257.  * - Added custom formulas for gauges.
  258.  * - Use of 1.5.0 new plugin parameters.
  259.  *
  260.  * Version 1.02:
  261.  * - Added custom formulas to get values.
  262.  * - Added custom columns for specified actors.
  263.  *
  264.  * Version 1.01:
  265.  * - Allow to show special and extra params.
  266.  *
  267.  * Version 1.00:
  268.  * - Finished plugin!
  269.  *
  270.  * ============================================================================
  271.  *
  272.  * For commercial and non-commercial games.
  273.  * Credit to ICF-Soft.
  274.  * This entire header must be included with plugin.
  275.  *
  276.  * ============================================================================
  277. */
  278. //=============================================================================
  279.  /*:es
  280.  * @plugindesc v1.04b Una ventana de estado que permite mostrar
  281.  * los nparam, los pparam y los cparam.
  282.  * @author ICF-Soft [http://icfsoft.blogspot.com.es/]
  283.  *
  284.  * @param Main menu gauges1
  285.  * @desc Nombre de los medidores separados por espacios.
  286.  * @default hp
  287.  *
  288.  * @param Main menu gauges2
  289.  * @desc Nombre de los medidores separados por espacios.
  290.  * @default mp
  291.  *
  292.  * @param Main menu gauges3
  293.  * @desc Nombre de los medidores separados por espacios.
  294.  * @default tp
  295.  *
  296.  * @param Status menu gauges1
  297.  * @desc Nombre de los medidores separados por espacios.
  298.  * @default hp
  299.  *
  300.  * @param Status menu gauges2
  301.  * @desc Nombre de los medidores separados por espacios.
  302.  * @default mp tp
  303.  *
  304.  * @param Column1
  305.  * @desc Nombres básicos de los parámetros separados por espacios.
  306.  * @default atk def mat mdf agi luk
  307.  *
  308.  * @param Column2
  309.  * @desc Nombres básicos de los parámetros separados por espacios.
  310.  * @default
  311.  *
  312.  * @param Column3
  313.  * @desc Nombres básicos de los parámetros separados por espacios.
  314.  * @default
  315.  *
  316.  * @param Equip Column
  317.  * @desc Nombres básicos de los parámetros separados por espacios.
  318.  * @default atk def mat mdf agi luk
  319.  *
  320.  * @param Percentage params
  321.  * @desc Indica qué parámetros serán tratados como porcentajes.
  322.  * @default
  323.  *
  324.  * @param Evaluables
  325.  * @desc Obteniendo valores a través de fórmulas.
  326.  * @type struct<Evals>[]
  327.  * @default ["{\"Name\":\"Algo aleatorio\",\"Formula\":\"Math.trunc(Math.random() * 100)\"}"]
  328.  *
  329.  * @param Percentages
  330.  * @desc Obteniendo valores porcentuales a través de fórmulas.
  331.  * @type struct<Percents>[]
  332.  * @default ["{\"Name\":\"Algo aleatorio\",\"Formula\":\"Math.random()\"}"]
  333.  *
  334.  * @param Gauges
  335.  * @desc Obteniendo barras de medición a través de fórmulas.
  336.  * @type struct<Gauges>[]
  337.  * @default ["{\"Name\":\"Medidor aleatorio\",\"Current\":\"Math.trunc(Math.random() * 100)\",\"Max\":\"100\",\"Color1\":\"#e99\",\"Color2\":\"17\",\"Show Current and Max\":\"false\"}"]
  338.  *
  339.  * @param XParam0 Full Name
  340.  * @desc Nombre mostrado para este parámetro extra.
  341.  * @default Puntería
  342.  *
  343.  * @param XParam1 Full Name
  344.  * @desc Nombre mostrado para este parámetro extra.
  345.  * @default Evasión
  346.  *
  347.  * @param XParam2 Full Name
  348.  * @desc Nombre mostrado para este parámetro extra.
  349.  * @default Probabilidad de crítico
  350.  *
  351.  * @param XParam3 Full Name
  352.  * @desc Nombre mostrado para este parámetro extra.
  353.  * @default Evadir crítico
  354.  *
  355.  * @param XParam4 Full Name
  356.  * @desc Nombre mostrado para este parámetro extra.
  357.  * @default Evasión mágica
  358.  *
  359.  * @param XParam5 Full Name
  360.  * @desc Nombre mostrado para este parámetro extra.
  361.  * @default Reflejo mágico
  362.  *
  363.  * @param XParam6 Full Name
  364.  * @desc Nombre mostrado para este parámetro extra.
  365.  * @default Contraataque
  366.  *
  367.  * @param XParam7 Full Name
  368.  * @desc Nombre mostrado para este parámetro extra.
  369.  * @default Regenerar vida
  370.  *
  371.  * @param XParam8 Full Name
  372.  * @desc Nombre mostrado para este parámetro extra.
  373.  * @default Regenerar magia
  374.  *
  375.  * @param XParam9 Full Name
  376.  * @desc Nombre mostrado para este parámetro extra.
  377.  * @default Regenerar turbo
  378.  *
  379.  * @param SParam0 Full Name
  380.  * @desc Nombre mostrado para este parámetro especial.
  381.  * @default Ser el objetivo
  382.  *
  383.  * @param SParam1 Full Name
  384.  * @desc Nombre mostrado para este parámetro especial.
  385.  * @default Efecto defensivo
  386.  *
  387.  * @param SParam2 Full Name
  388.  * @desc Nombre mostrado para este parámetro especial.
  389.  * @default Efecto de recuperación
  390.  *
  391.  * @param SParam3 Full Name
  392.  * @desc Nombre mostrado para este parámetro especial.
  393.  * @default Farmacología
  394.  *
  395.  * @param SParam4 Full Name
  396.  * @desc Nombre mostrado para este parámetro especial.
  397.  * @default Coste de mp
  398.  *
  399.  * @param SParam5 Full Name
  400.  * @desc Nombre mostrado para este parámetro especial.
  401.  * @default Coste de tp
  402.  *
  403.  * @param SParam6 Full Name
  404.  * @desc Nombre mostrado para este parámetro especial.
  405.  * @default Daño físico recibido
  406.  *
  407.  * @param SParam7 Full Name
  408.  * @desc Nombre mostrado para este parámetro especial.
  409.  * @default Daño mágico recibido
  410.  *
  411.  * @param SParam8 Full Name
  412.  * @desc Nombre mostrado para este parámetro especial.
  413.  * @default Daño por el terreno
  414.  *
  415.  * @param SParam9 Full Name
  416.  * @desc Nombre mostrado para este parámetro especial.
  417.  * @default Experiencia obtenible
  418.  *
  419.  * @help
  420.  * ============================================================================
  421.  * Introducción
  422.  * ============================================================================
  423.  *
  424.  * Este plugin está hecho para su uso con el ICF-Soft Params Core pero puede
  425.  * usarse solo.
  426.  *
  427.  * Permite mostrar los parámetros en hasta tres columnas aparte del
  428.  * equipamiento aprovechando todo el ancho.
  429.  * Además permite mostrar medidores de hp, mp, tp y los nuevos cparams
  430.  * status menu and main menu.
  431.  *
  432.  * Puedes utilizar código javascript que se ejecutará para obtener un valor
  433.  * y además cambiar columnas para personajes específicos.
  434.  *
  435.  * Iré añadiendo más características.
  436.  *
  437.  * ============================================================================
  438.  * Uso
  439.  * ============================================================================
  440.  *
  441.  * Puedes alterar las columnas para personajes específicos con la
  442.  * siguiente etiqueta:
  443.  *
  444.  * <STATUS MENU COL x param param param>
  445.  *
  446.  * Debes especificar una columna entre la 1 y la 3 que será reemplazada
  447.  * y los parámetros separados por espacios.
  448.  * Permite param, nparam, pparam, xparam, sparam, evaluables, porcentajes y
  449.  * barras.
  450.  *
  451.  * <EQUIP STATUS MENU COL param param param>
  452.  *
  453.  * Reemplaza los parámetros a mostrar en el menú de equipamiento.
  454.  * Permite param, nparam, pparam, xparam, sparam, evaluables y porcentajes.
  455.  *
  456.  * <STATUS MENU GAUGES x param param param>
  457.  *
  458.  * 3 Filas disponibles.
  459.  * Reemplaza los medidores a mostrar en el menú de estado.
  460.  * Permite hp, mp, tp, barras de medición y los nuevos cparam.
  461.  *
  462.  * <MAIN MENU INFO GAUGES x param param param>
  463.  *
  464.  * 3 Filas disponibles.
  465.  * Reemplaza los medidores a mostrar en distintos menús.
  466.  * Permite hp, mp, tp, barras de medición y los nuevos cparam.
  467.  *
  468.  * ============================================================================
  469.  * Parámetros
  470.  * ============================================================================
  471.  *
  472.  * Main menu gaugesX: Para colocar los nombres básicos de los parámetros de
  473.  * medición separados por espacios. Hay hasta 3 filas que ocupan el ancho
  474.  * disponible de la ventana. Sólo parámetros de medición.
  475.  *
  476.  * Status menu gaugesX: Para colocar los nombres básicos de los parámetros de
  477.  * medición separados por espacios. Hay hasta 2 filas que ocupan el ancho
  478.  * disponible de la ventana. Sólo parámetros de medición.
  479.  *
  480.  * ColumnX: Para colocar los nombres básicos de los parámetros separados por
  481.  * espacios. Hay hasta 3 columnas repartidas entre el ancho de la ventana.
  482.  * Funciona con todos los ya mostrados.
  483.  *
  484.  * Equip Column: Para colocar los nombres básicos de los parámetros en el menú
  485.  * de equipamiento separados por espacios.
  486.  * No usa barras de medición.
  487.  *
  488.  * Percentage params: Indica qué parámetros serán tratados como porcentajes.
  489.  * Usa dos decimales. De momento solo para los pparam.
  490.  *
  491.  * Puedes crear todos los evaluables y medidores que necesites con índices a
  492.  * partir de 0.
  493.  *
  494.  * Evaluables: Nombre y fórmula para obtener un valor.
  495.  * Se utiliza eval0, eval1, eval2 ... etc.
  496.  *
  497.  * Percentages: Nombre y fórmula para obtener un valor porcentual.
  498.  * Se utiliza percentage0, percentage1, percentage2 ... etc.
  499.  *
  500.  * Gauges: Coloca una barra de medición similar a las de vida. Puedes
  501.  * configurar el nómbre, fórmulas para los valores actual y máximo, colores de
  502.  * la barra si mostrar ambos valores o solo el actual.
  503.  * Se utiliza gauge0, gauge1, gauge2 ... etc.
  504.  *
  505.  * ============================================================================
  506.  * Incompatibilidades
  507.  * ============================================================================
  508.  *
  509.  * Puede ser incompatible con otros plugins similares.
  510.  *
  511.  * ============================================================================
  512.  * Problemas conocidos
  513.  * ============================================================================
  514.  *
  515.  * Puede interferir con otros plugins similares. Pero puede combinarse
  516.  * con otros.
  517.  *
  518.  * ============================================================================
  519.  * Historial de versiones
  520.  * ============================================================================
  521.  *
  522.  * Versión 1.04:
  523.  * - Añadido el uso de cparams (parámetros de medición).
  524.  * - Permite la edición de medidores de distintos menús.
  525.  * - Se ha eliminado el antiguo sistema obsoleto.
  526.  *
  527.  * Versión 1.03:
  528.  * - Añadida columna para el menú de equipamiento.
  529.  * - Añadidas fórmulas personalizadas para obtener valores de medición.
  530.  * - Uso del sistema de parámetros del 1.5.0.
  531.  *
  532.  * Versión 1.02:
  533.  * - Añadidas fórmulas personalizadas para obtener valores.
  534.  * - Añadidas columnas personalizadas para personajes específicos.
  535.  *
  536.  * Versión 1.01:
  537.  * - Permite mostrar los parámetros especiales y extra.
  538.  *
  539.  * Versión 1.00:
  540.  * - Complemento terminado.
  541.  *
  542.  * ============================================================================
  543.  *
  544.  * Para juegos comerciales y no comerciales.
  545.  * Se debe incluir a ICF-Soft en los créditos.
  546.  * Esta cabecera debe incluirse íntegramente con el plugin.
  547.  *
  548.  * ============================================================================
  549. */
  550. /*~struct~Evals:
  551.  * @param Name
  552.  * @desc A name to show inside status menu.
  553.  * @default
  554.  *
  555.  * @param Formula
  556.  * @desc Custom formula to show a value.
  557.  * @default
  558.  *
  559.  */
  560. /*~struct~Percents:
  561.  * @param Name
  562.  * @desc A name to show inside status menu.
  563.  * @default
  564.  *
  565.  * @param Formula
  566.  * @desc Custom formula to show a percentage value.
  567.  * @default
  568.  *
  569.  */
  570. /*~struct~Gauges:
  571.  * @param Name
  572.  * @desc A name to show inside status menu.
  573.  * @default
  574.  *
  575.  * @param Current
  576.  * @desc Custom formula to show a percentage value.
  577.  * @default
  578.  *
  579.  * @param Max
  580.  * @desc Custom formula to show a percentage value.
  581.  * @default
  582.  *
  583.  * @param Color1
  584.  * @desc First color for gauge. Can be a html code or a number.
  585.  * @default
  586.  *
  587.  * @param Color2
  588.  * @desc Second color for gauge. Can be a html code or a number.
  589.  * @default
  590.  *
  591.  * @param Show Current and Max
  592.  * @desc When true it shows current and max values.
  593.  * @default true
  594.  *
  595.  */
  596. /*~struct~Evals:es
  597.  * @param Name
  598.  * @desc Nombre a mostrar en el menú de estado.
  599.  * @default
  600.  *
  601.  * @param Formula
  602.  * @desc Fórmula personalizada para obtener un valor.
  603.  * @default
  604.  *
  605.  */
  606. /*~struct~Percents:es
  607.  * @param Name
  608.  * @desc Nombre a mostrar en el menú de estado.
  609.  * @default
  610.  *
  611.  * @param Formula
  612.  * @desc Fórmula personalizada para obtener un valor porcentual.
  613.  * @default
  614.  *
  615.  */
  616. /*~struct~Gauges:es
  617.  * @param Name
  618.  * @desc Nombre a mostrar en el menú de estado.
  619.  * @default
  620.  *
  621.  * @param Current
  622.  * @desc Fórmula personalizada para obtener un valor actual.
  623.  * @default
  624.  *
  625.  * @param Max
  626.  * @desc Fórmula personalizada para obtener un valor máximo.
  627.  * @default
  628.  *
  629.  * @param Color1
  630.  * @desc Primer color de la barra. Se puede usar un color html o un número.
  631.  * @default
  632.  *
  633.  * @param Color2
  634.  * @desc Segundo color de la barra. Se puede usar un color html o un número.
  635.  * @default
  636.  *
  637.  * @param Show Current and Max
  638.  * @desc Si está activado mostrará los valores actual y máximo.
  639.  * @default true
  640.  *
  641.  */
  642. //=============================================================================
  643.  
  644. //=============================================================================
  645. // Parameter Variables
  646. //=============================================================================
  647.  
  648. ICF.Parameters = PluginManager.parameters('ICFSoft_StatusMenu');
  649. ICF.Param = ICF.Param || {};
  650.  
  651. ICF.Param.MainMenuGauge1 = ICF.Parameters['Main menu gauges1'].toLowerCase().trim().split(/\s+/);
  652. ICF.Param.MainMenuGauge2 = ICF.Parameters['Main menu gauges2'].toLowerCase().trim().split(/\s+/);
  653. ICF.Param.MainMenuGauge3 = ICF.Parameters['Main menu gauges3'].toLowerCase().trim().split(/\s+/);
  654. ICF.Param.StatusMenuGauge1 = ICF.Parameters['Status menu gauges1'].toLowerCase().trim().split(/\s+/);
  655. ICF.Param.StatusMenuGauge2 = ICF.Parameters['Status menu gauges2'].toLowerCase().trim().split(/\s+/);
  656. ICF.Param.StatusMenuCol1 = ICF.Parameters['Column1'].toLowerCase().trim().split(/\s+/);
  657. ICF.Param.StatusMenuCol2 = ICF.Parameters['Column2'].toLowerCase().trim().split(/\s+/);
  658. ICF.Param.StatusMenuCol3 = ICF.Parameters['Column3'].toLowerCase().trim().split(/\s+/);
  659. ICF.Param.EquipStatusMenuCol = ICF.Parameters['Equip Column'].toLowerCase().trim().split(/\s+/);
  660. ICF.Param.PercentageParams = ICF.Parameters['Percentage params'].toLowerCase().split(/\s+/);
  661.  
  662. if (ICF.Param.StatusMenuCol1[0] == "") ICF.Param.StatusMenuCol1.shift();
  663. if (ICF.Param.StatusMenuCol2[0] == "") ICF.Param.StatusMenuCol2.shift();
  664. if (ICF.Param.StatusMenuCol3[0] == "") ICF.Param.StatusMenuCol3.shift();
  665. if (ICF.Param.StatusMenuGauge1[0] == "") ICF.Param.StatusMenuGauge1.shift();
  666. if (ICF.Param.StatusMenuGauge2[0] == "") ICF.Param.StatusMenuGauge2.shift();
  667. if (ICF.Param.MainMenuGauge1[0] == "") ICF.Param.MainMenuGauge1.shift();
  668. if (ICF.Param.MainMenuGauge2[0] == "") ICF.Param.MainMenuGauge2.shift();
  669. if (ICF.Param.MainMenuGauge3[0] == "") ICF.Param.MainMenuGauge3.shift();
  670. if (ICF.Param.EquipStatusMenuCol[0] == "") ICF.Param.EquipStatusMenuCol.shift();
  671.  
  672. if (!Imported.ICFSoft_ParamCore) {
  673.     ICF.Param.NParams = [];
  674.     ICF.Param.PParams = [];
  675.     ICF.Param.CParams = [];
  676.     ICF.Param.CParamsMax = [];
  677.     ICF.Param.BParams = ["mhp", "mmp", "atk", "def", "mat", "mdf", "agi", "luk"];
  678.     ICF.Param.XParamsFullName = [];
  679.     ICF.Param.XParams = ["hit", "eva", "cri", "cev", "mev", "mrf", "cnt", "hrg", "mrg", "trg"];
  680.     ICF.Param.SParamsFullName = [];
  681.     ICF.Param.SParams = ["tgr", "grd", "rec", "pha", "mcr", "tcr", "pdr", "mdr", "fdr", "exr"];
  682.  
  683.     for (var i = 0; i < 10; i++) {
  684.         ICF.Param.XParamsFullName[i] = String(ICF.Parameters['XParam' + i + ' Full Name']);
  685.         ICF.Param.SParamsFullName[i] = String(ICF.Parameters['SParam' + i + ' Full Name']);
  686.     }
  687.  
  688. }
  689.  
  690. ICF.Param.EvalParams = [];
  691. ICF.Param.EvalPercentParams = [];
  692. ICF.Param.EvalGauges = [];
  693.  
  694. ICF.MainUtility.validateColor = function(color) {
  695.     if (!isNaN(Number(color))) return Number(color);
  696.     try {
  697.         var btm = new Bitmap(2,2);
  698.         var gra = btm._context.createLinearGradient(1,1,1,2);
  699.         gra.addColorStop(1,color);
  700.             return color;
  701.     } catch (e) {
  702.         return "rgba(0,0,0,0)";
  703.     }
  704.     return "rgba(0,0,0,0)";
  705. }
  706.  
  707. ICF.temp = JSON.parse(ICF.Parameters['Evaluables']);
  708. for (var i = 0; i < ICF.temp.length; i++) {
  709.     ICF.temp[i] = JSON.parse(ICF.temp[i]);
  710.     ICF.Param.EvalParams[i] = [];
  711.     ICF.Param.EvalParams[i][0] = ICF.temp[i]['Name'];
  712.     ICF.Param.EvalParams[i][1] = ICF.temp[i]['Formula'];
  713. }
  714. ICF.temp = JSON.parse(ICF.Parameters['Percentages']);
  715. for (var i = 0; i < ICF.temp.length; i++) {
  716.     ICF.temp[i] = JSON.parse(ICF.temp[i]);
  717.     ICF.Param.EvalPercentParams[i] = [];
  718.     ICF.Param.EvalPercentParams[i][0] = ICF.temp[i]['Name'];
  719.     ICF.Param.EvalPercentParams[i][1] = ICF.temp[i]['Formula'];
  720. }
  721. ICF.temp = JSON.parse(ICF.Parameters['Gauges']);
  722. for (var i = 0; i < ICF.temp.length; i++) {
  723.     ICF.temp[i] = JSON.parse(ICF.temp[i]);
  724.     ICF.Param.EvalGauges[i] = [];
  725.     ICF.Param.EvalGauges[i][0] = ICF.temp[i]['Name'];
  726.     ICF.Param.EvalGauges[i][1] = ICF.temp[i]['Current'];
  727.     ICF.Param.EvalGauges[i][2] = ICF.temp[i]['Max'];
  728.     ICF.Param.EvalGauges[i][3] = ICF.MainUtility.validateColor(ICF.temp[i]['Color1']);
  729.     ICF.Param.EvalGauges[i][4] = ICF.MainUtility.validateColor(ICF.temp[i]['Color2']);
  730.     ICF.Param.EvalGauges[i][5] = ICF.temp[i]['Show Current and Max'].toLowerCase() === "true";
  731. }
  732.  
  733. //=============================================================================
  734. // DataManager
  735. //=============================================================================
  736.  
  737. ICF.StatusMenu.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
  738. DataManager.isDatabaseLoaded = function() {
  739.     if (!ICF.StatusMenu.DataManager_isDatabaseLoaded.call(this)) return false;
  740.     if (!ICF.StatusMenu.Procesed) {
  741.     ICF.NotetagsProcessor.statusMenu($dataActors);
  742.     ICF.StatusMenu.Procesed = true;
  743.     }
  744.     return true;
  745. };
  746.  
  747. ICF.NotetagsProcessor.statusMenu = function(group) {
  748.     var note1 = /<(?:STATUS[-_ ]MENU[-_ ]COL[-_ ])(\d)[ ]+((?:[\w-_]+\s*)+)>/i;
  749.     var note2 = /<(?:EQUIP[-_ ]STATUS[-_ ]MENU[-_ ]COL)[ ]+((?:[\w-_]+\s*)+)>/i;
  750.     var note3 = /<(?:STATUS[-_ ]MENU[-_ ]GAUGES[-_ ])(\d)[ ]+((?:[\w-_]+\s*)+)>/i;
  751.     var note4 = /<(?:MAIN[-_ ]MENU[-_ ]INFO[-_ ]GAUGES[-_ ])(\d)[ ]+((?:[\w-_]+\s*)+)>/i;
  752.  
  753.     for (var n = 1; n < group.length; n++) {
  754.     var obj = group[n];
  755.     var notedata = obj.note.split(/[\r\n]+/);
  756.  
  757.     obj.StatusMenuCols = [];
  758.     obj.StatusMenuGauges = [];
  759.     obj.EquipStatusMenuCol = [];
  760.     obj.MainMenuGauges = [];
  761.  
  762.         for (var i = 0; i < notedata.length; i++) {
  763.         var line = notedata[i];
  764.         if (line.match(note1)) {
  765.             obj.StatusMenuCols[Number(RegExp.$1)] = RegExp.$2.toLowerCase().trim().split(/\s+/);
  766.         } else if (line.match(note2)) {
  767.             obj.EquipStatusMenuCol = RegExp.$1.toLowerCase().trim().split(/\s+/);
  768.         } else if (line.match(note3)) {
  769.             obj.StatusMenuGauges[Number(RegExp.$1)] = RegExp.$2.toLowerCase().trim().split(/\s+/);
  770.         } else if (line.match(note4)) {
  771.             obj.MainMenuGauges[Number(RegExp.$1)] = RegExp.$2.toLowerCase().trim().split(/\s+/);
  772.         }
  773.         }
  774.     }
  775. };
  776.  
  777. //=============================================================================
  778. // Game_Actor
  779. //=============================================================================
  780.  
  781. Game_Actor.prototype.statusMenuCols = function() {
  782.     var st0 = $dataActors[this._actorId].StatusMenuCols;
  783.     var st1 = [];
  784.     st1[1] = st0[1] || ICF.Param.StatusMenuCol1;
  785.     st1[2] = st0[2] || ICF.Param.StatusMenuCol2;
  786.     st1[3] = st0[3] || ICF.Param.StatusMenuCol3;
  787.     return st1;
  788. };
  789.  
  790. Game_Actor.prototype.statusMenuInfo = function() {
  791.     var st0 = $dataActors[this._actorId].StatusMenuGauges;
  792.     var st1 = [];
  793.     st1[1] = st0[1] || ICF.Param.StatusMenuGauge1;
  794.     st1[2] = st0[2] || ICF.Param.StatusMenuGauge2;
  795.     return st1;
  796. };
  797.  
  798. Game_Actor.prototype.mainMenuInfo = function() {
  799.     var st0 = $dataActors[this._actorId].MainMenuGauges;
  800.     var st1 = [];
  801.     st1[1] = st0[1] || ICF.Param.MainMenuGauge1;
  802.     st1[2] = st0[2] || ICF.Param.MainMenuGauge2;
  803.     st1[3] = st0[3] || ICF.Param.MainMenuGauge3;
  804.     return st1;
  805. };
  806.  
  807. Game_Actor.prototype.eqStatusMenuCols = function() {
  808.     var st0 = $dataActors[this._actorId].EquipStatusMenuCol;
  809.     var st1 = (st0.length > 0)? st0 : ICF.Param.EquipStatusMenuCol;
  810.     return st1;
  811. };
  812.  
  813. //=============================================================================
  814. // Window_Base
  815. //=============================================================================
  816.  
  817. Window_Base.prototype.drawActorSimpleStatus = function(actor, x, y, width) {
  818.     var st = actor.mainMenuInfo();
  819.     var lineHeight = this.lineHeight();
  820.     var x2 = x + 180;
  821.     var width2 = Math.min(200, width - 180 - this.textPadding());
  822.     this.drawActorName(actor, x, y);
  823.     this.drawActorLevel(actor, x, y + lineHeight * 1);
  824.     this.drawActorIcons(actor, x, y + lineHeight * 2);
  825.     this.drawActorClass(actor, x2, y);
  826.     this.drawGaugesLine(actor, x2, y + lineHeight * 1, st[1], 0);
  827.     this.drawGaugesLine(actor, x2, y + lineHeight * 2, st[2], 0);
  828.     this.drawGaugesLine(actor, x2, y + lineHeight * 3, st[3], 0);
  829. };
  830.  
  831. if (Imported.YEP_CoreEngine) { Window_Base.prototype.drawActorSimpleStatus = function(actor, x, y, width) {
  832.     var st = actor.mainMenuInfo();
  833.     var lineHeight = this.lineHeight();
  834.     var xpad = Window_Base._faceWidth + (2 * Yanfly.Param.TextPadding);
  835.     var x2 = x + xpad;
  836.     var width2 = Math.max(180, width - xpad - this.textPadding());
  837.     this.drawActorName(actor, x, y);
  838.     this.drawActorLevel(actor, x, y + lineHeight * 1);
  839.     this.drawActorIcons(actor, x, y + lineHeight * 2);
  840.     this.drawActorClass(actor, x2, y, width2);
  841.     this.drawGaugesLine(actor, x2, y + lineHeight * 1, st[1], 0);
  842.     this.drawGaugesLine(actor, x2, y + lineHeight * 2, st[2], 0);
  843.     this.drawGaugesLine(actor, x2, y + lineHeight * 3, st[3], 0);
  844. }; }
  845.  
  846. Window_Base.prototype.drawCParamGauge = function(actor, param, x, y, width) {
  847.     width = width || 186;
  848.     var color1 = ICF.Param.CParamColor1[param];
  849.     var color2 = ICF.Param.CParamColor2[param];
  850.     color1 = isNaN(color1)? color1 : this.textColor(color1);
  851.     color2 = isNaN(color2)? color2 : this.textColor(color2);
  852.     var rate = actor.CParamValue(param) / actor.CParam(param);
  853.     this.drawGauge(x, y, width, rate, color1, color2);
  854.     this.changeTextColor(this.systemColor());
  855.     this.drawText(ICF.Param.CParamsFullName[param], x, y, 44);
  856.     this.drawCurrentAndMax(actor.CParamValue(param), actor.CParam(param), x, y, width,
  857.                            this.normalColor(), this.normalColor());
  858. };
  859.  
  860. Window_Base.prototype.drawEvalGauge = function(actor, gauge, x, y, width) {
  861.     width = width || 186;
  862.     var color1 = gauge[3];
  863.     var color2 = gauge[4];
  864.     color1 = isNaN(color1)? color1 : this.textColor(color1);
  865.     color2 = isNaN(color2)? color2 : this.textColor(color2);
  866.     var rate = gauge[1] / gauge[2];
  867.     this.drawGauge(x, y, width, rate, color1, color2);
  868.     this.changeTextColor(this.systemColor());
  869.     this.drawText(gauge[0], x, y, 44);
  870.     this.drawCurrentAndMax(gauge[1], gauge[2], x, y, width,
  871.                            this.normalColor(), this.normalColor());
  872. };
  873.  
  874. Window_Base.prototype.drawGaugesLine = function(actor, x, y, st, margin) {
  875.     if (!st || st.length < 1) return;
  876.     width = this.contentsWidth() - x - this.textPadding() - margin;
  877.     var max = Math.trunc(Math.min(width / 100, st.length));
  878.     var width2 = Math.trunc(width / max);
  879.     for (var i = 0; i < max; i++) {
  880.     if (st[i] == "hp") this.drawActorHp(actor, x + width2 * i, y, width2 - this.textPadding());
  881.     else if (st[i] == "mp") this.drawActorMp(actor, x + width2 * i, y, width2 - this.textPadding());
  882.     else if (st[i] == "tp") this.drawActorTp(actor, x + width2 * i, y, width2 - this.textPadding());
  883.     else if (ICF.Param.CParams.contains(st[i])) {
  884.         var param = ICF.Param.CParams.indexOf(st[i]);
  885.         this.drawCParamGauge(actor, param, x + width2 * i, y, width2 - this.textPadding());
  886.     }
  887.     if (st[i].match(/(?:gauge)(\d+)/i)) {
  888.         var paramId = ICF.Param.EvalGauges[RegExp.$1];
  889.         var gauge = [];
  890.         gauge.push(paramId[0]);
  891.         gauge.push(eval(paramId[1]));
  892.         gauge.push(eval(paramId[2]));
  893.         gauge.push(paramId[3]);
  894.         gauge.push(paramId[4]);
  895.         gauge.push(paramId[5]);
  896.         this.drawEvalGauge(actor, gauge, x + width2 * i, y, width2 - this.textPadding());
  897.     }
  898.     }
  899. };
  900.  
  901. //=============================================================================
  902. // Window_Status
  903. //=============================================================================
  904.  
  905. Window_Status.prototype.drawBlock2 = function(y) {
  906.     var st = this._actor.statusMenuInfo();
  907.     this.drawActorFace(this._actor, 12, y);
  908.     this.drawBasicInfo(204, y, st);
  909.     this.drawExpInfo(this.contentsWidth() - 270 - this.textPadding(), y);
  910. };
  911.  
  912. ICF.StatusMenu.drawBasicInfoOldStyle = Window_Status.prototype.drawBasicInfo;
  913. Window_Status.prototype.drawBasicInfo = function(x, y, st) {
  914.     if (st == undefined) {
  915.     ICF.StatusMenu.drawBasicInfoOldStyle.call(this, x, y);
  916.     return;
  917.     }
  918.     var lineHeight = this.lineHeight();
  919.     this.drawActorLevel(this._actor, x, y + lineHeight * 0);
  920.     this.drawActorIcons(this._actor, x, y + lineHeight * 1);
  921.     this.drawGaugesLine(this._actor, x, y + lineHeight * 2, st[1], 290);
  922.     this.drawGaugesLine(this._actor, x, y + lineHeight * 3, st[2], 290);
  923. };
  924.  
  925. Window_Status.prototype.drawBlock3 = function(y) {
  926.     var st = this._actor.statusMenuCols();
  927.  
  928.     if (st[1].length == 0) {
  929.     this.drawEquipments(this.contentsWidth()/2, y);
  930.     } else if (st[2].length == 0) {
  931.     var width = this.contentsWidth() / 2 - this.textPadding() * 3;
  932.     this.drawParameters(this.textPadding(), y, width, st[1]);
  933.     this.drawEquipments(this.contentsWidth()/2 + this.textPadding(), y);
  934.     } else if (st[3].length == 0) {
  935.     var width = this.contentsWidth() / 3 - this.textPadding() * 4;
  936.     this.drawParameters(this.textPadding(), y, width, st[1]);
  937.     this.drawParameters(this.contentsWidth()/3 + this.textPadding(), y, width, st[2]);
  938.     this.drawEquipments(this.contentsWidth()*2/3 + this.textPadding(), y);
  939.     } else {
  940.     var width = this.contentsWidth() / 4 - this.textPadding() * 5;
  941.     this.drawParameters(this.textPadding(), y, width, st[1]);
  942.     this.drawParameters(this.contentsWidth()/4 + this.textPadding(), y, width, st[2]);
  943.     this.drawParameters(this.contentsWidth()*2/4 + this.textPadding(), y, width, st[3]);
  944.     this.drawEquipments(this.contentsWidth()*3/4 + this.textPadding(), y);
  945.     }
  946. };
  947.  
  948. ICF.StatusMenu.drawParamsOldStyle = Window_Status.prototype.drawParameters;
  949. Window_Status.prototype.drawParameters = function(x, y, width, ary) {
  950.     if ((width == undefined)||(ary == undefined)) {
  951.     ICF.StatusMenu.drawParamsOldStyle.call(this, x, y);
  952.     return;
  953.     }
  954.     var lineHeight = this.lineHeight();
  955.     var y2 = y;
  956.     var actor = this._actor;
  957.     for (var i = 0; i < ary.length; i++) {
  958.         var param = [];
  959.         var gauge = false;
  960.     if (ICF.Param.NParams.indexOf(ary[i]) > -1) {
  961.         var paramId = ICF.Param.NParams.indexOf(ary[i]);
  962.         param.push(ICF.Param.NParamsFullName[paramId]);
  963.         param.push(actor.NParam(paramId));
  964.     } else if (ICF.Param.PParams.indexOf(ary[i]) > -1) {
  965.         var paramId = ICF.Param.PParams.indexOf(ary[i]);
  966.         param.push(ICF.Param.PParamsFullName[paramId]);
  967.         if ((ICF.Param.PercentageParams.indexOf(ary[i]) > -1) || (ICF.Param.PParamIsPercent[paramId])) {
  968.             param.push((actor.PParam(paramId)*100).toFixed(2) + "%");
  969.         } else {
  970.             param.push(Math.trunc(actor.PParam(paramId)));
  971.         }
  972.     } else if (ICF.Param.CParams.indexOf(ary[i]) > -1) {
  973.         var paramId = ICF.Param.CParams.indexOf(ary[i]);
  974.         param.push(ICF.Param.CParamsFullName[paramId]);
  975.         param.push(actor.CParamValue(paramId));
  976.         param.push(actor.CParam(paramId));
  977.         param.push(ICF.Param.CParamColor1[paramId]);
  978.         param.push(ICF.Param.CParamColor2[paramId]);
  979.         gauge = true;
  980.     } else if (ICF.Param.CParamsMax.indexOf(ary[i]) > -1) {
  981.         var paramId = ICF.Param.CParamsMax.indexOf(ary[i]);
  982.         param.push(ICF.Param.CParamsMaxFullName[paramId]);
  983.         param.push(actor.CParam(paramId));
  984.     } else if (ICF.Param.BParams.indexOf(ary[i]) > -1) {
  985.         var paramId = ICF.Param.BParams.indexOf(ary[i]);
  986.         param.push(TextManager.param(paramId));
  987.         param.push(actor.param(paramId));
  988.     } else if (ICF.Param.XParams.indexOf(ary[i]) > -1) {
  989.         var paramId = ICF.Param.XParams.indexOf(ary[i]);
  990.         param.push(ICF.Param.XParamsFullName[paramId]);
  991.         param.push((actor.xparam(paramId)*100).toFixed(2) + "%");
  992.     } else if (ICF.Param.SParams.indexOf(ary[i]) > -1) {
  993.         var paramId = ICF.Param.SParams.indexOf(ary[i]);
  994.         param.push(ICF.Param.SParamsFullName[paramId]);
  995.         param.push((actor.sparam(paramId)*100).toFixed(2) + "%");
  996.     } else if (ary[i].match(/(?:eval)(\d+)/i)) {
  997.         var paramId = ICF.Param.EvalParams[RegExp.$1];
  998.         param.push(paramId[0]);
  999.         param.push(eval(paramId[1]));
  1000.     } else if (ary[i].match(/(?:percentage)(\d+)/i)) {
  1001.         var paramId = ICF.Param.EvalPercentParams[RegExp.$1];
  1002.         param.push(paramId[0]);
  1003.         param.push((eval(paramId[1])*100).toFixed(2) + "%");
  1004.     } else if (ary[i].match(/(?:gauge)(\d+)/i)) {
  1005.         var paramId = ICF.Param.EvalGauges[RegExp.$1];
  1006.         param.push(paramId[0]);
  1007.         param.push(eval(paramId[1]));
  1008.         param.push(eval(paramId[2]));
  1009.         param.push(paramId[3]);
  1010.         param.push(paramId[4]);
  1011.         param.push(paramId[5]);
  1012.         gauge = true;
  1013.     }
  1014.     if (gauge) {
  1015.         var color1 = isNaN(param[3])? param[3] : this.textColor(param[3]);
  1016.         var color2 = isNaN(param[4])? param[4] : this.textColor(param[4]);
  1017.         this.drawGauge(x, y2, width, (param[1] / param[2]).clamp(0.0, 1.0), color1, color2);
  1018.         if (param[5]) {
  1019.             var wd = this.textWidth(param[1] + '/' + param[2]);
  1020.             this.changeTextColor(this.systemColor());
  1021.             this.drawText(param[0], x, y2, width - wd);
  1022.             this.drawCurrentAndMax(param[1], param[2], x + wd, y2,
  1023.                            width - wd, this.normalColor(), this.normalColor());
  1024.         } else {
  1025.             this.changeTextColor(this.systemColor());
  1026.             this.drawText(param[0], x, y2, width * 2 / 3);
  1027.             this.resetTextColor();
  1028.             this.drawText(param[1], x + width * 2 / 3, y2, width / 3, 'right');
  1029.         }
  1030.     } else if (param.length > 0) {
  1031.         this.changeTextColor(this.systemColor());
  1032.         this.drawText(param[0], x, y2, width * 2 / 3);
  1033.         this.resetTextColor();
  1034.         this.drawText(param[1], x + width * 2 / 3, y2, width / 3, 'right');
  1035.     }
  1036.     y2 += lineHeight;
  1037.     }
  1038. };
  1039.  
  1040. //=============================================================================
  1041. // Window_EquipStatus
  1042. //=============================================================================
  1043.  
  1044. Window_EquipStatus.prototype.refresh = function() {
  1045.     this.contents.clear();
  1046.     var st = [];
  1047.     if (this._actor) st = this._actor.eqStatusMenuCols();
  1048.     if (st.length > 0) {
  1049.         this.drawActorName(this._actor, this.textPadding(), 0);
  1050.         for (var i = 0; i < st.length; i++) {
  1051.         var param = null;
  1052.         var paramId = null;
  1053.         var percentage = false;
  1054.         var evaluate = null;
  1055.         if (ICF.Param.NParams.indexOf(st[i]) > -1) {
  1056.         paramId = ICF.Param.NParams.indexOf(st[i]);
  1057.         param = ICF.Param.NParams[paramId];
  1058.         paramId = ICF.Param.NParamsFullName[paramId];
  1059.         } else if (ICF.Param.PParams.indexOf(st[i]) > -1) {
  1060.         paramId = ICF.Param.PParams.indexOf(st[i]);
  1061.         param = ICF.Param.PParams[paramId];
  1062.         if ((ICF.Param.PercentageParams.indexOf(st[i]) > -1) || (ICF.Param.PParamIsPercent[paramId])) percentage = true;
  1063.         paramId = ICF.Param.PParamsFullName[paramId];
  1064.         } else if (ICF.Param.CParamsMax.indexOf(st[i]) > -1) {
  1065.         paramId = ICF.Param.CParamsMax.indexOf(st[i]);
  1066.         param = ICF.Param.CParamsMax[paramId];
  1067.         paramId = ICF.Param.CParamsMaxFullName[paramId];
  1068.         } else if (ICF.Param.BParams.indexOf(st[i]) > -1) {
  1069.         paramId = ICF.Param.BParams.indexOf(st[i]);
  1070.         param = ICF.Param.BParams[paramId];
  1071.         paramId = TextManager.param(paramId);
  1072.         } else if (ICF.Param.XParams.indexOf(st[i]) > -1) {
  1073.         paramId = ICF.Param.XParams.indexOf(st[i]);
  1074.         param = ICF.Param.XParams[paramId];
  1075.         paramId = ICF.Param.XParamsFullName[paramId];
  1076.         percentage = true;
  1077.         } else if (ICF.Param.SParams.indexOf(st[i]) > -1) {
  1078.         paramId = ICF.Param.SParams.indexOf(st[i]);
  1079.         param = ICF.Param.SParams[paramId];
  1080.         paramId = ICF.Param.SParamsFullName[paramId];
  1081.         percentage = true;
  1082.         } else if (st[i].match(/(?:eval)(\d+)/i)) {
  1083.         paramId = ICF.Param.EvalParams[RegExp.$1];
  1084.         param = paramId[0];
  1085.         evaluate = paramId[1];
  1086.         paramId = param;
  1087.         } else if (st[i].match(/(?:percentage)(\d+)/i)) {
  1088.         paramId = ICF.Param.EvalPercentParams[RegExp.$1];
  1089.         param = paramId[0];
  1090.         evaluate = paramId[1];
  1091.         paramId = param;
  1092.         percentage = true;
  1093.         }
  1094.         if (param !== null) {
  1095.         this.drawItem(0, this.lineHeight() * (1 + i), paramId, param, percentage, evaluate);
  1096.         }
  1097.         }
  1098.     }
  1099.     this.resetTextColor();
  1100. };
  1101.  
  1102. Window_EquipStatus.prototype.drawItem = function(x, y, paramId, paramName, percentage, evaluate) {
  1103.     this.changeTextColor(this.systemColor());
  1104.     this.drawText(paramId, x + this.textPadding(), y, 120);
  1105.     this.resetTextColor();
  1106.     if (this._actor) {
  1107.         this.drawCurrentParam(x + 140, y, paramId, paramName, percentage, evaluate);
  1108.     }
  1109.     this.drawRightArrow(x + 188, y);
  1110.     if (this._tempActor) {
  1111.         this.drawNewParam(x + 222, y, paramId, paramName, percentage, evaluate);
  1112.     }
  1113. };
  1114.  
  1115. Window_EquipStatus.prototype.drawCurrentParam = function(x, y, paramId, paramName, percentage, evaluate) {
  1116.     this.resetTextColor();
  1117.     var actor = this._actor;
  1118.     var text = (evaluate !== null)? eval(evaluate) : this._actor[paramName];
  1119.     if (percentage) text = (text * 100).toFixed((text < 0.10)? 2 : (text < 0.50)? 1 : 0) + "%";
  1120.     else text = Math.trunc(text);
  1121.     this.drawText(text, x, y, 48, 'right');
  1122. };
  1123.  
  1124. Window_EquipStatus.prototype.drawNewParam = function(x, y, paramId, paramName, percentage, evaluate) {
  1125.     var actor = this._tempActor;
  1126.     var newValue = (evaluate !== null)? eval(evaluate) : this._tempActor[paramName];
  1127.     actor = this._actor;
  1128.     var oldValue = (evaluate !== null)? eval(evaluate) : this._actor[paramName];
  1129.     this.changeTextColor(this.paramchangeTextColor(newValue - oldValue));
  1130.     if (percentage) newValue = (newValue * 100).toFixed((newValue < 0.10)? 2 : (newValue < 0.50)? 1 : 0) + "%";
  1131.     else newValue = Math.trunc(newValue);
  1132.     this.drawText(newValue, x, y, 48, 'right');
  1133. };
  1134.  
  1135. //=============================================================================
  1136. // End of File
  1137. //=============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement