Advertisement
ICF-Soft

ICF-Soft Status Menu 1.01 RPG Maker MV

Jan 13th, 2017
58
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.  
  12. ICF.StatusMenu.Version = 101; // 1.01
  13.  
  14. //=============================================================================
  15.  /*:
  16.  * @plugindesc v1.01 A status menu where you can organize actor params.
  17.  * @author ICF-Soft [http://icfsoft.blogspot.com.es/]
  18.  *
  19.  * @param Column1
  20.  * @desc Param names that will be shown in column.
  21.  * @default atk def mat mdf agi luk
  22.  *
  23.  * @param Column2
  24.  * @desc Param names that will be shown in column.
  25.  * @default
  26.  *
  27.  * @param Column3
  28.  * @desc Param names that will be shown in column.
  29.  * @default
  30.  *
  31.  * @param Percentage params
  32.  * @desc What params will be used as percentages.
  33.  * @default
  34.  *
  35.  * @param XParam0 Full Name
  36.  * @desc Name that will be shown for this extra param.
  37.  * @default Hit rate
  38.  *
  39.  * @param XParam1 Full Name
  40.  * @desc Name that will be shown for this extra param.
  41.  * @default Evasion rate
  42.  *
  43.  * @param XParam2 Full Name
  44.  * @desc Name that will be shown for this extra param.
  45.  * @default Critical rate
  46.  *
  47.  * @param XParam3 Full Name
  48.  * @desc Name that will be shown for this extra param.
  49.  * @default Critical evasion rate
  50.  *
  51.  * @param XParam4 Full Name
  52.  * @desc Name that will be shown for this extra param.
  53.  * @default Magic evasion rate
  54.  *
  55.  * @param XParam5 Full Name
  56.  * @desc Name that will be shown for this extra param.
  57.  * @default Magic reflection rate
  58.  *
  59.  * @param XParam6 Full Name
  60.  * @desc Name that will be shown for this extra param.
  61.  * @default Counter-attack rate
  62.  *
  63.  * @param XParam7 Full Name
  64.  * @desc Name that will be shown for this extra param.
  65.  * @default Hp-regen rate
  66.  *
  67.  * @param XParam8 Full Name
  68.  * @desc Name that will be shown for this extra param.
  69.  * @default Mp-regen rate
  70.  *
  71.  * @param XParam9 Full Name
  72.  * @desc Name that will be shown for this extra param.
  73.  * @default Tp-regen rate
  74.  *
  75.  * @param SParam0 Full Name
  76.  * @desc Name that will be shown for this special param.
  77.  * @default Targeted rate
  78.  *
  79.  * @param SParam1 Full Name
  80.  * @desc Name that will be shown for this special param.
  81.  * @default Guard rate
  82.  *
  83.  * @param SParam2 Full Name
  84.  * @desc Name that will be shown for this special param.
  85.  * @default Recovery rate
  86.  *
  87.  * @param SParam3 Full Name
  88.  * @desc Name that will be shown for this special param.
  89.  * @default Pharmacology
  90.  *
  91.  * @param SParam4 Full Name
  92.  * @desc Name that will be shown for this special param.
  93.  * @default Mp cost rate
  94.  *
  95.  * @param SParam5 Full Name
  96.  * @desc Name that will be shown for this special param.
  97.  * @default Tp cost rate
  98.  *
  99.  * @param SParam6 Full Name
  100.  * @desc Name that will be shown for this special param.
  101.  * @default Phisical damage rate
  102.  *
  103.  * @param SParam7 Full Name
  104.  * @desc Name that will be shown for this special param.
  105.  * @default Magical damage rate
  106.  *
  107.  * @param SParam8 Full Name
  108.  * @desc Name that will be shown for this special param.
  109.  * @default Floor damage rate
  110.  *
  111.  * @param SParam9 Full Name
  112.  * @desc Name that will be shown for this special param.
  113.  * @default Experience rate
  114.  *
  115.  * @help
  116.  * ============================================================================
  117.  * Introduction
  118.  * ============================================================================
  119.  *
  120.  * This plugin is made for use with ICF-Soft Params Core but can work alone.
  121.  *
  122.  * Allows you to show params in up to three columns plus equip, using all
  123.  * window width.
  124.  *
  125.  * More features will be added in the future.
  126.  *
  127.  * ============================================================================
  128.  * Parameters
  129.  * ============================================================================
  130.  *
  131.  * ColumnX: Place the param names that will be shown in comlumn separated by
  132.  * spaces. You can use up to 3 columns sharing width with equips.
  133.  * It works with param, nparam and pparam.
  134.  *
  135.  * Percentage params: Tell what params will be used as percentages.
  136.  * It works with pparam.
  137.  *
  138.  * ============================================================================
  139.  * Incompatibilities
  140.  * ============================================================================
  141.  *
  142.  * Can be incompatible or interfere with some similar plugins.
  143.  *
  144.  * ============================================================================
  145.  * Known isues
  146.  * ============================================================================
  147.  *
  148.  * Can interfere with some similar plugins or enhace them.
  149.  *
  150.  * ============================================================================
  151.  * Changelog
  152.  * ============================================================================
  153.  *
  154.  * Version 1.01:
  155.  * - Allow to show special and extra params.
  156.  *
  157.  * Version 1.00:
  158.  * - Finished plugin!
  159.  *
  160.  * ============================================================================
  161.  *
  162.  * For commercial and non-commercial games.
  163.  * Credit to ICF-Soft.
  164.  * This entire header must be included with plugin.
  165.  *
  166.  * ============================================================================
  167. */
  168. //=============================================================================
  169.  /*:es
  170.  * @plugindesc v1.01 Una ventana de estado que permite mostrar
  171.  * los nparam y los pparam.
  172.  * @author ICF-Soft [http://icfsoft.blogspot.com.es/]
  173.  *
  174.  * @param Column1
  175.  * @desc Nombres básicos de los parámetros separados por espacios.
  176.  * @default atk def mat mdf agi luk
  177.  *
  178.  * @param Column2
  179.  * @desc Nombres básicos de los parámetros separados por espacios.
  180.  * @default
  181.  *
  182.  * @param Column3
  183.  * @desc Nombres básicos de los parámetros separados por espacios.
  184.  * @default
  185.  *
  186.  * @param Percentage params
  187.  * @desc Indica qué parámetros serán tratados como porcentajes.
  188.  * @default
  189.  *
  190.  * @param XParam0 Full Name
  191.  * @desc Nombre mostrado para este parámetro extra.
  192.  * @default Puntería
  193.  *
  194.  * @param XParam1 Full Name
  195.  * @desc Nombre mostrado para este parámetro extra.
  196.  * @default Evasión
  197.  *
  198.  * @param XParam2 Full Name
  199.  * @desc Nombre mostrado para este parámetro extra.
  200.  * @default Probabilidad de crítico
  201.  *
  202.  * @param XParam3 Full Name
  203.  * @desc Nombre mostrado para este parámetro extra.
  204.  * @default Evadir crítico
  205.  *
  206.  * @param XParam4 Full Name
  207.  * @desc Nombre mostrado para este parámetro extra.
  208.  * @default Evasión mágica
  209.  *
  210.  * @param XParam5 Full Name
  211.  * @desc Nombre mostrado para este parámetro extra.
  212.  * @default Reflejo mágico
  213.  *
  214.  * @param XParam6 Full Name
  215.  * @desc Nombre mostrado para este parámetro extra.
  216.  * @default Contraataque
  217.  *
  218.  * @param XParam7 Full Name
  219.  * @desc Nombre mostrado para este parámetro extra.
  220.  * @default Regenerar vida
  221.  *
  222.  * @param XParam8 Full Name
  223.  * @desc Nombre mostrado para este parámetro extra.
  224.  * @default Regenerar magia
  225.  *
  226.  * @param XParam9 Full Name
  227.  * @desc Nombre mostrado para este parámetro extra.
  228.  * @default Regenerar turbo
  229.  *
  230.  * @param SParam0 Full Name
  231.  * @desc Nombre mostrado para este parámetro especial.
  232.  * @default Ser el objetivo
  233.  *
  234.  * @param SParam1 Full Name
  235.  * @desc Nombre mostrado para este parámetro especial.
  236.  * @default Efecto defensivo
  237.  *
  238.  * @param SParam2 Full Name
  239.  * @desc Nombre mostrado para este parámetro especial.
  240.  * @default Efecto de recuperación
  241.  *
  242.  * @param SParam3 Full Name
  243.  * @desc Nombre mostrado para este parámetro especial.
  244.  * @default Farmacología
  245.  *
  246.  * @param SParam4 Full Name
  247.  * @desc Nombre mostrado para este parámetro especial.
  248.  * @default Coste de mp
  249.  *
  250.  * @param SParam5 Full Name
  251.  * @desc Nombre mostrado para este parámetro especial.
  252.  * @default Coste de tp
  253.  *
  254.  * @param SParam6 Full Name
  255.  * @desc Nombre mostrado para este parámetro especial.
  256.  * @default Daño físico recibido
  257.  *
  258.  * @param SParam7 Full Name
  259.  * @desc Nombre mostrado para este parámetro especial.
  260.  * @default Daño mágico recibido
  261.  *
  262.  * @param SParam8 Full Name
  263.  * @desc Nombre mostrado para este parámetro especial.
  264.  * @default Daño por el terreno
  265.  *
  266.  * @param SParam9 Full Name
  267.  * @desc Nombre mostrado para este parámetro especial.
  268.  * @default Experiencia obtenible
  269.  *
  270.  * @help
  271.  * ============================================================================
  272.  * Introducción
  273.  * ============================================================================
  274.  *
  275.  * Este plugin está hecho para su uso con el ICF-Soft Params Core pero puede
  276.  * usarse solo.
  277.  *
  278.  * Permite mostrar los parámetros en hasta tres columnas aparte del
  279.  * equipamiento aprovechando todo el ancho.
  280.  *
  281.  * Iré añadiendo más características.
  282.  *
  283.  * ============================================================================
  284.  * Parámetros
  285.  * ============================================================================
  286.  *
  287.  * ColumnX: Para colocar los nombres básicos de los parámetros separados por
  288.  * espacios. Hay hasta 3 columnas repartidas entre el ancho de la ventana.
  289.  * Por el momento funciona con los param, nparam y pparam.
  290.  *
  291.  * Percentage params: Indica qué parámetros serán tratados como porcentajes.
  292.  * Usa dos decimales. De momento solo para los pparam.
  293.  *
  294.  * ============================================================================
  295.  * Incompatibilidades
  296.  * ============================================================================
  297.  *
  298.  * Puede ser incompatible con otros plugins similares.
  299.  *
  300.  * ============================================================================
  301.  * Problemas conocidos
  302.  * ============================================================================
  303.  *
  304.  * Puede interferir con otros plugins similares. Pero puede combinarse
  305.  * con otros.
  306.  *
  307.  * ============================================================================
  308.  * Historial de versiones
  309.  * ============================================================================
  310.  *
  311.  * Versión 1.01:
  312.  * - Permite mostrar los parámetros especiales y extra.
  313.  *
  314.  * Versión 1.00:
  315.  * - Complemento terminado.
  316.  *
  317.  * ============================================================================
  318.  *
  319.  * Para juegos comerciales y no comerciales.
  320.  * Se debe incluir a ICF-Soft en los créditos.
  321.  * Esta cabecera debe incluirse íntegramente con el plugin.
  322.  *
  323.  * ============================================================================
  324. */
  325. //=============================================================================
  326.  
  327. //=============================================================================
  328. // Parameter Variables
  329. //=============================================================================
  330.  
  331. ICF.Parameters = PluginManager.parameters('ICFSoft_StatusMenu');
  332. ICF.Param = ICF.Param || {};
  333.  
  334. ICF.Param.StatusMenuCol1 = ICF.Parameters['Column1'].toLowerCase().split(/\s+/);
  335. ICF.Param.StatusMenuCol2 = ICF.Parameters['Column2'].toLowerCase().split(/\s+/);
  336. ICF.Param.StatusMenuCol3 = ICF.Parameters['Column3'].toLowerCase().split(/\s+/);
  337. ICF.Param.PercentageParams = ICF.Parameters['Percentage params'].toLowerCase().split(/\s+/);
  338.  
  339. if (ICF.Param.StatusMenuCol1[0] == "") ICF.Param.StatusMenuCol1.shift();
  340. if (ICF.Param.StatusMenuCol2[0] == "") ICF.Param.StatusMenuCol2.shift();
  341. if (ICF.Param.StatusMenuCol3[0] == "") ICF.Param.StatusMenuCol3.shift();
  342.  
  343. if (!Imported.ICFSoft_ParamCore) {
  344.     ICF.Param.NParams = [];
  345.     ICF.Param.PParams = [];
  346.     ICF.Param.BParams = ["mhp", "mmp", "atk", "def", "mat", "mdf", "agi", "luk"];
  347.     ICF.Param.XParamsFullName = [];
  348.     ICF.Param.XParams = ["hit", "eva", "cri", "cev", "mev", "mrf", "cnt", "hrg", "mrg", "trg"];
  349.     ICF.Param.SParamsFullName = [];
  350.     ICF.Param.SParams = ["tgr", "grd", "rec", "pha", "mcr", "tcr", "pdr", "mdr", "fdr", "exr"];
  351.  
  352.     for (var i = 0; i < 10; i++) {
  353.         ICF.Param.XParamsFullName[i] = String(ICF.Parameters['XParam' + i + ' Full Name']);
  354.         ICF.Param.SParamsFullName[i] = String(ICF.Parameters['SParam' + i + ' Full Name']);
  355.     }
  356.  
  357. }
  358.  
  359. //=============================================================================
  360. // Window_Status
  361. //=============================================================================
  362.  
  363. Window_Status.prototype.drawBlock3 = function(y) {
  364.     if (ICF.Param.StatusMenuCol1.length == 0) {
  365.         this.drawEquipments(this.contentsWidth()/2, y);
  366.     } else if (ICF.Param.StatusMenuCol2.length == 0) {
  367.         var width = this.contentsWidth() / 2 - this.textPadding() * 3;
  368.         this.drawParameters(this.textPadding(), y, width, ICF.Param.StatusMenuCol1);
  369.         this.drawEquipments(this.contentsWidth()/2 + this.textPadding(), y);
  370.     } else if (ICF.Param.StatusMenuCol3.length == 0) {
  371.         var width = this.contentsWidth() / 3 - this.textPadding() * 4;
  372.         this.drawParameters(this.textPadding(), y, width, ICF.Param.StatusMenuCol1);
  373.         this.drawParameters(this.contentsWidth()/3 + this.textPadding(), y, width, ICF.Param.StatusMenuCol2);
  374.         this.drawEquipments(this.contentsWidth()*2/3 + this.textPadding(), y);
  375.     } else {
  376.         var width = this.contentsWidth() / 4 - this.textPadding() * 5;
  377.         this.drawParameters(this.textPadding(), y, width, ICF.Param.StatusMenuCol1);
  378.         this.drawParameters(this.contentsWidth()/4 + this.textPadding(), y, width, ICF.Param.StatusMenuCol2);
  379.         this.drawParameters(this.contentsWidth()*2/4 + this.textPadding(), y, width, ICF.Param.StatusMenuCol3);
  380.         this.drawEquipments(this.contentsWidth()*3/4 + this.textPadding(), y);
  381.     }
  382. };
  383.  
  384. ICF.StatusMenu.drawParamsOldStyle = Window_Status.prototype.drawParameters;
  385. Window_Status.prototype.drawParameters = function(x, y, width, ary) {
  386.     if ((width == undefined)||(ary == undefined)) {
  387.     ICF.StatusMenu.drawParamsOldStyle.call(this, x, y);
  388.     return;
  389.     }
  390.     var lineHeight = this.lineHeight();
  391.     var y2 = y;
  392.     for (var i = 0; i < ary.length; i++) {
  393.         var param = [];
  394.     if (ICF.Param.NParams.indexOf(ary[i]) > -1) {
  395.         var paramId = ICF.Param.NParams.indexOf(ary[i]);
  396.         param.push(ICF.Param.NParamsFullName[paramId]);
  397.         param.push(this._actor.NParam(paramId));
  398.     } else if (ICF.Param.PParams.indexOf(ary[i]) > -1) {
  399.         var paramId = ICF.Param.PParams.indexOf(ary[i]);
  400.         param.push(ICF.Param.PParamsFullName[paramId]);
  401.         if (ICF.Param.PercentageParams.indexOf(ary[i]) > -1) {
  402.             param.push((this._actor.PParam(paramId)*100).toFixed(2) + "%");
  403.         } else {
  404.             param.push(Math.trunc(this._actor.PParam(paramId)));
  405.         }
  406.     } else if (ICF.Param.BParams.indexOf(ary[i]) > -1) {
  407.         var paramId = ICF.Param.BParams.indexOf(ary[i]);
  408.         param.push(TextManager.param(paramId));
  409.         param.push(this._actor.param(paramId));
  410.     } else if (ICF.Param.XParams.indexOf(ary[i]) > -1) {
  411.         var paramId = ICF.Param.XParams.indexOf(ary[i]);
  412.         param.push(ICF.Param.XParamsFullName[paramId]);
  413.         param.push((this._actor.xparam(paramId)*100).toFixed(2) + "%");
  414.     } else if (ICF.Param.SParams.indexOf(ary[i]) > -1) {
  415.         var paramId = ICF.Param.SParams.indexOf(ary[i]);
  416.         param.push(ICF.Param.SParamsFullName[paramId]);
  417.         param.push((this._actor.sparam(paramId)*100).toFixed(2) + "%");
  418.     }
  419.     if (param.length > 0) {
  420.         this.changeTextColor(this.systemColor());
  421.         this.drawText(param[0], x, y2, width * 2 / 3);
  422.         this.resetTextColor();
  423.         this.drawText(param[1], x + width * 2 / 3, y2, width / 3, 'right');
  424.     }
  425.     y2 += lineHeight;
  426.     }
  427. };
  428.  
  429. //=============================================================================
  430. // End of File
  431. //=============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement