Advertisement
ICF-Soft

ICF-Soft Status Menu 1.05 RPG Maker MV

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