Double_X

DoubleX RMMV Status Bars v101c

Sep 16th, 2016 (edited)
1,989
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*============================================================================
  2.  *    ## Plugin Info
  3.  *----------------------------------------------------------------------------
  4.  *    # Plugin Name
  5.  *      DoubleX RMMV Status Bars
  6.  *----------------------------------------------------------------------------
  7.  *    # Terms Of Use
  8.  *      1. Commercial use's always allowed and crediting me's always optional.
  9.  *      2. You shall keep this plugin's Plugin Info part's contents intact.
  10.  *      3. You shalln't claim that this plugin's written by anyone other than
  11.  *         DoubleX or my aliases. I always reserve the right to deny you from
  12.  *         using any of my plugins anymore if you've violated this.
  13.  *      4. CC BY 4.0, except those conflicting with any of the above, applies
  14.  *         to this plugin, unless you've my permissions not needing follow so.
  15.  *      5. I always reserve the right to deny you from using this plugin
  16.  *         anymore if you've violated any of the above.
  17.  *----------------------------------------------------------------------------
  18.  *    # Prerequisites
  19.  *      Abilities:
  20.  *      1. Nothing special for most rudimetary use cases
  21.  *      2. Little RMMV plugin development proficiency for most ordinary uses
  22.  *      3. Some RMMV plugin development proficiency to fully utilize this
  23.  *----------------------------------------------------------------------------
  24.  *    # Links
  25.  *      This plugin:
  26.  *      1. http://pastebin.com/5BMvWPbu
  27.  *      Video:
  28.  *      1. https://www.youtube.com/watch?v=kaGhzueQwUs
  29.  *      Mentioned Patreon Supporters:
  30.  *      https://www.patreon.com/posts/71738797
  31.  *----------------------------------------------------------------------------
  32.  *    # Author
  33.  *      DoubleX
  34.  *----------------------------------------------------------------------------
  35.  *    # Changelog
  36.  *      v1.01c(GMT 1300 21-2-2025):
  37.  *      1. Fixed the stat change processes not working when the values
  38.  *         increase from 0 bug
  39.  *      2. You no longer have to edit the value of
  40.  *         DoubleX_RMMV.Status_Bars_File when changing the plugin file name
  41.  *      v1.01b(GMT 1200 7-7-2019):
  42.  *      1. Fixed the invisible status bars not being able to be visible again
  43.  *      2. Fixed the equips, classes and actors status bar data not being used
  44.  *      v1.01a(GMT 1400 12-8-2017):
  45.  *      1. Lets you set the status bars to show the stat change processes via
  46.  *         showProc, procUpdateRate, procColor1 and procColor2 in SBX
  47.  *      2. Fixed crashes for status bars having the same minimum and maximum
  48.  *      v1.00a(GMT 1700 16-9-2016):
  49.  *      1. 1st version of this plugin finished
  50.  *============================================================================*/
  51. /*:
  52.  * @plugindesc Lets you use bars to show battler statuses on their sprites
  53.  * @author DoubleX
  54.  *
  55.  * @param isEnabled
  56.  * @desc Sets whether this plugin will be enabled
  57.  *       It'll be stored as a boolean, and will be regarded as true if and only
  58.  *       if it's true
  59.  *       Don't change this during the same battle unless you really know what
  60.  *       you're truly foing
  61.  *       E.g.: Setting isEnabled as false will disable this plugin
  62.  * @default true
  63.  *
  64.  * @help
  65.  * You're supposed to open this plugin js file to edit its configurations
  66.  *============================================================================
  67.  *    ## Notetag Info
  68.  *----------------------------------------------------------------------------
  69.  *    # Actor/Class/Weapon/Armor/Enemy/State Notetags:
  70.  *      State notetags take the highest priority, followed by enemy, weapon,
  71.  *      armor, class and actor
  72.  *      1. <status status bar: SBX>
  73.  *         - Sets the battler to setup a status bar of status using
  74.  *           configurations set in function name SBX, which can only be edited
  75.  *           in this plugin js file directly
  76.  *         - status must be included in STATUSES, which can only be edited in
  77.  *           this plugin js file directly
  78.  *         - E.g.:
  79.  *           <hp status bar: HP> will set the battler to setup a hp status bar
  80.  *           using configurations set in HP, which can only be edited in this
  81.  *           plugin js file directly
  82.  *         - Only the 1st effective notetag among all having the same status
  83.  *           will be used(Reference tag: NOTETAG_MONO)
  84.  *============================================================================
  85.  *    ## Plugin Call Info
  86.  *----------------------------------------------------------------------------
  87.  *    # Configuration manipulations
  88.  *      1. $gameSystem.statusBars.param
  89.  *         - Returns the stored value of param listed in the plugin manager
  90.  *         - E.g.:
  91.  *           $gameSystem.statusBars.isEnabled will return a Boolean indicating
  92.  *           whether this plugin's enabled
  93.  *      2. $gameSystem.statusBars.param = val
  94.  *         - Sets the stored value of param listed in plugin manager as val
  95.  *         - E.g.:
  96.  *           $gameSystem.statusBars.isEnabled = false will set the stored
  97.  *           value of parameter isEnabled shown on the plugin manager as false
  98.  *         - All $gameSystem.statusBars.param changes will be saved
  99.  *    # Actor/Class/Weapon/Armor/Enemy/State notetag manipulations
  100.  *      1. meta.statusBars[status]
  101.  *         - Returns the function name SBX for String status specified in
  102.  *           <status status bar: SBX> if there's any
  103.  *         - E.g.:
  104.  *           $dataStates[1].meta.statusBars[hp] will return the function SBX
  105.  *           specified in <hp status bar: SBX> notetag of state with id 1
  106.  *      2. meta.statusBars[status] = SBX
  107.  *         - Sets the String status in <status status bar: SBX> notetag to use
  108.  *           the function with name SBX which is a String
  109.  *         - E.g.:
  110.  *           $dataEnemies[2].meta.statusBars['mp'] = 'MP' will set the SBX
  111.  *           specified in <mp status bar: SBX> notetag of enemy with id 2 as
  112.  *           MP
  113.  *         - All meta.statusBars changes can be saved if
  114.  *           DoubleX RMMV Dynamic Data is used
  115.  *    # Battler manipulations
  116.  *      1. isStatusBarChanged[status] = true
  117.  *         - Notifys the status status bar of the battler to use a new
  118.  *           configuration object
  119.  *         - It'll be reset as false once a new configuration object's used
  120.  *         - E.g.:
  121.  *           $gameParty.aliveMembers()[0].isStatusBarChanged['tp'] = true will
  122.  *           notify the tp status bar of the battler to use a new
  123.  *           configuration object
  124.  *    # Status bar manipulations
  125.  *      1. new Window_Status_Bar(battler, status)
  126.  *         - Creates a new status bar showing the status status of battler
  127.  *           battler
  128.  *         - E.g.:
  129.  *           new Window_Status_Bar($gameTroop.aliveMembers()[0], 'hp') will
  130.  *           create a new status bar showing the hp status of the 1st troop
  131.  *           member
  132.  *============================================================================
  133.  */
  134.  
  135. var DoubleX_RMMV = DoubleX_RMMV || {};
  136. DoubleX_RMMV['Status Bars'] = 'v1.01c';
  137.  
  138. (() => {
  139.  
  140.     "use strict";
  141.  
  142.     var src = document.currentScript.src;
  143.     var name = src.split("/").slice(-1)[0].split(".")[0].replace(/%20/g, " ");
  144.     DoubleX_RMMV.Status_Bars_File = name;
  145.  
  146. })();
  147.  
  148. /*============================================================================
  149.  *    ## Plugin Configurations
  150.  *       You only need to edit this part as it's about what this plugin does
  151.  *----------------------------------------------------------------------------*/
  152.  
  153. DoubleX_RMMV.Status_Bars = {
  154.  
  155.     /* Setups the list of statuses that can have their status bars drawn
  156.      * Each status must be represented by the name of its battler getter
  157.      */
  158.     STATUSES: [
  159.         'hp',
  160.         'mp',
  161.         'tp'
  162.     ],
  163.  
  164.     /*------------------------------------------------------------------------
  165.      *    Status Bar Functions
  166.      *    - Setups SBX used by <status bar: SBX>
  167.      *------------------------------------------------------------------------*/
  168.     /* SBX are used by Window_Status_Bar at this._cfg = SB[this._cfgName](); in
  169.      * _updateCfg
  170.      * SBX are Javascript functions which must return an Object having at least
  171.      * the following:
  172.      * {
  173.      *     visible: function(battler), // Hotspot
  174.      *     opacity: function(battler), // Hotspot
  175.      *     backColor: function(battler), // Hotspot
  176.      *     color1: function(battler), // Hotspot
  177.      *     color2: function(battler), // Hotspot
  178.      *     x: function(battler), // Hotspot
  179.      *     y: function(battler), // Hotspot
  180.      *     w: function(battler), // Hotspot
  181.      *     h, function(battler), // Hotspot
  182.      *     text, function(battler), // Hotspot
  183.      *     textX: function(battler), // Hotspot
  184.      *     textY: function(battler), // Hotspot
  185.      *     textSize: function(battler), // Hotspot
  186.      *     textColor: function(battler), // Hotspot
  187.      *     min: function(battler), // Hotspot
  188.      *     max: function(battler), // Hotspot
  189.      *     (v1.01a+)showProc: function(battler), // Hotspot
  190.      *     (v1.01a+)procUpdateRate: function(battler) // Hotspot
  191.      * }
  192.      * All functions will be bound to the Window_Status_Bar upon its creation
  193.      * and must take the battler and database item using the SBX as their
  194.      * arguments
  195.      *
  196.      * Status bar configuration functions:
  197.      * The function result of visible, which is the status bar visibility, will
  198.      * be interpreted as truthy or falsy only
  199.      * The function of opacity, which is the status bar opacity, must return a
  200.      * Number between 0 and 255
  201.      * The functions of backColor, color1 and color2, which are the status bar
  202.      * back, 1st and 2nd colors respectively, must return a Number between
  203.      * #00000000 and #FFFFFFFF
  204.      * The functions of x and y, which are the status bar x and y offsets from
  205.      * the battler sprites respectively, must return a Number
  206.      * The functions of w and h, which are the status bar width and height
  207.      * respectively, must return a positive Number
  208.      * The function of text, which is the status bar description text, must
  209.      * return a String
  210.      * The functions of textX, textY and textSize, which are the status bar
  211.      * description text x and y offset from the status bar, and size
  212.      * respectively, must return a positive Number
  213.      * The functions of min and max, which are the minimum and maximum value of
  214.      * the status respiectively, must return a Number that must be not greater
  215.      * than and not less than all the possible values of the current value
  216.      * respectively
  217.      * (v1.01a+)The functions of showProc, which is whether the stat change
  218.      * processes will be shown on the status bars, will be interpreted as truthy
  219.      * or falsy only
  220.      * (v1.01a+)The functions of procUpdateRate, which is the rate relative to
  221.      * the max length of the stat bar per second, must return a Number between 0
  222.      * and 1
  223.      * (v1.01a+)The functions of procColor1 and procColor2, which are the status
  224.      * bar 1st and 2nd stat change colors respectively, must return a Number
  225.      * between #00000000 and #FFFFFFFF
  226.      *
  227.      * SBX names can only use alphanumeric characters
  228.      * The below SBX are examples added to help you set your SBX
  229.      * You can freely use, rewrite and/or delete these examples
  230.      *
  231.      * Advanced:
  232.      * The status bar prototype's inherited from Window_Base.prototype
  233.      * All status bar configuration functions are used by Window_Status_Bar
  234.      * visible and opacity are used in _updateBarVisibility
  235.      * backColor, color1, color2, textColor, text, textX and textY are used in
  236.      * _updateSetting
  237.      * x, y, w and h are used in initialize
  238.      * x is also used in _updateX
  239.      * y is also used in _updateY
  240.      * w is also used in _updateW
  241.      * h is also used in _updateH
  242.      * min and max are used in _updateFillW
  243.      * (v1.01a+)showProc
  244.      */
  245.  
  246.     // Sets the status bar to display the battler's hp statuses
  247.     HP: function() { // v1.00a - v1.01a; Potential Hotspot
  248.         return {
  249.             // Sets the hp bar to be always visible only for alive battlers
  250.             visible: function(battler) { return battler.isAlive(); }, // Hotspot
  251.             // Sets the hp bar opacity to be always 255
  252.             opacity: function(battler) { return 255; }, // Hotspot
  253.             // Sets the hp bar color 1 to be always text color 15
  254.             backColor: function(battler) { // Hotspot
  255.                 return this.textColor(15);
  256.             },
  257.             // Sets the hp bar color 1 to be always text color 20
  258.             color1: function(battler) { return this.textColor(20); }, // Hotspot
  259.             // Sets the hp bar color 2 to be always text color 21
  260.             color2: function(battler) { return this.textColor(21); }, // Hotspot
  261.             // Sets the hp bar x offset from battler sprite to be always 0
  262.             x: function(battler) { return 0; }, // Hotspot
  263.             // Sets the hp bar y offset from battler sprite to be always 16
  264.             y: function(battler) { return 16; }, // Hotspot
  265.             // Sets the hp bar width to be always 87
  266.             w: function(battler) { return 87; }, // Hotspot
  267.             // Sets the hp bar height to be always 16
  268.             h: function(battler) { return 16; }, // Hotspot
  269.             // Sets the hp bar description text to be always hp/mhp
  270.             text: function(battler) { // Hotspot
  271.                 return battler.hp.toString() + '/' + battler.mhp.toString();
  272.             },
  273.             // Sets the hp bar description text size to be always 0
  274.             textX: function(battler) { return 0; }, // Hotspot
  275.             // Sets the hp bar description text size to be always 0
  276.             textY: function(battler) { return 0; }, // Hotspot
  277.             // Sets the hp bar description text size to be always 13
  278.             textSize: function(battler) { return 13; }, // Hotspot
  279.             // Sets hp bar description text color to be always text color 0
  280.             textColor: function(battler) { // Hotspot
  281.                 return this.textColor(0);
  282.             },
  283.             // Sets the minimum hp to be shown on the hp bar to be always 0
  284.             min: function(battler) { return 0; }, // Hotspot
  285.             // Sets the maximum hp to be shown on the hp bar to be always mhp
  286.             max: function(battler) { return battler.mhp; }, // Hotspot
  287.             // (v1.01a+)Sets the hp change processes to be always shown
  288.             showProc: function(battler) { return true; }, // Hotspot
  289.             // (v1.01a+)Sets the hp change processes rate to be 100% of the
  290.             // max length of the hp bar per second
  291.             procUpdateRate: function(battler) { return 0.2; }, // Hotspot
  292.             // Sets the hp change process color 1 to be always text color 6
  293.             procColor1: function(battler) { return this.textColor(6); },
  294.             // Hotspot
  295.             // Sets the hp change process color 2 to be always text color 17
  296.             procColor2: function(battler) { return this.textColor(17); }
  297.             // Hotspot
  298.         };
  299.     },
  300.  
  301.     // Sets the status bar to display the battler's mp statuses
  302.     MP: function() { // v1.00a - v1.01a; Potential Hotspot
  303.         return {
  304.             // Sets the mp bar to be always visible only for alive battlers
  305.             visible: function(battler) { return battler.isAlive(); }, // Hotspot
  306.             // Sets the mp bar opacity to be always 255
  307.             opacity: function(battler) { return 255; }, // Hotspot
  308.             // Sets the mp bar color 1 to be always text color 15
  309.             backColor: function(battler) { // Hotspot
  310.                 return this.textColor(15);
  311.             },
  312.             // Sets the mp bar color 1 to be always text color 22
  313.             color1: function(battler) { return this.textColor(22); }, // Hotspot
  314.             // Sets the mp bar color 2 to be always text color 23
  315.             color2: function(battler) { return this.textColor(23); }, // Hotspot
  316.             // Sets the mp bar x offset from battler sprite to be always 0
  317.             x: function(battler) { return 0; }, // Hotspot
  318.             // Sets the mp bar y offset from battler sprite to be always 32
  319.             y: function(battler) { return 32; }, // Hotspot
  320.             // Sets the mp bar width to be always 87
  321.             w: function(battler) { return 87; }, // Hotspot
  322.             // Sets the mp bar height to be always 16
  323.             h: function(battler) { return 16; }, // Hotspot
  324.             // Sets the mp bar description text to be always mp/mmp
  325.             text: function(battler) { // Hotspot
  326.                 return battler.mp.toString() + '/' + battler.mmp.toString();
  327.             },
  328.             // Sets the mp bar description text size to be always 0
  329.             textX: function(battler) { return 0; }, // Hotspot
  330.             // Sets the mp bar description text size to be always 0
  331.             textY: function(battler) { return 0; }, // Hotspot
  332.             // Sets the mp bar description text size to be always 13
  333.             textSize: function(battler) { return 13; }, // Hotspot
  334.             // Sets mp bar description text color to be always text color 0
  335.             textColor: function(battler) { // Hotspot
  336.                 return this.textColor(0);
  337.             },
  338.             // Sets the minimum mp to be shown on the hp bar to be always 0
  339.             min: function(battler) { return 0; }, // Hotspot
  340.             // Sets the maximum mp to be shown on the hp bar to be always mmp
  341.             max: function(battler) { return battler.mmp; }, // Hotspot
  342.             // (v1.01a+)Sets the mp change processes to be always shown
  343.             showProc: function(battler) { return true; }, // Hotspot
  344.             // (v1.01a+)Sets the mp change processes rate to be 100% of the
  345.             // max length of the mp bar per second
  346.             procUpdateRate: function(battler) { return 0.2; }, // Hotspot
  347.             // Sets the mp change process color 1 to be always text color 1
  348.             procColor1: function(battler) { return this.textColor(1); },
  349.             // Hotspot
  350.             // Sets the mp change process color 2 to be always text color 4
  351.             procColor2: function(battler) { return this.textColor(4); }
  352.             // Hotspot
  353.         };
  354.     },
  355.  
  356.     // Sets the status bar to display the battler's tp statuses
  357.     TP: function() { // v1.00a - v1.01a; Potential Hotspot
  358.         return {
  359.             // Sets the tp bar to be always visible
  360.             visible: function(battler) { return battler.isAlive(); }, // Hotspot
  361.             // Sets the tp bar opacity to be always 255
  362.             opacity: function(battler) { return 255; }, // Hotspot
  363.             // Sets the tp bar color 1 to be always text color 15
  364.             backColor: function(battler) { // Hotspot
  365.                 return this.textColor(15);
  366.             },
  367.             // Sets the tp bar color 1 to be always text color 28
  368.             color1: function(battler) { return this.textColor(28); }, // Hotspot
  369.             // Sets the tp bar color 2 to be always text color 29
  370.             color2: function(battler) { return this.textColor(29); }, // Hotspot
  371.             // Sets the tp bar x offset from battler sprite to be always 0
  372.             x: function(battler) { return 0; }, // Hotspot
  373.             // Sets the tp bar y offset from battler sprite to be always 48
  374.             y: function(battler) { return 48; }, // Hotspot
  375.             // Sets the tp bar width to be always 87
  376.             w: function(battler) { return 87; }, // Hotspot
  377.             // Sets the tp bar height to be always 16
  378.             h: function(battler) { return 16; }, // Hotspot
  379.             // Sets the tp bar description text to be always tp/maxTp()
  380.             text: function(battler) { // Hotspot
  381.                 return battler.tp.toString() + '/' + battler.maxTp().toString();
  382.             },
  383.             // Sets the tp bar description text size to be always 0
  384.             textX: function(battler) { return 0; }, // Hotspot
  385.             // Sets the tp bar description text size to be always 0
  386.             textY: function(battler) { return 0; }, // Hotspot
  387.             // Sets the tp bar description text size to be always 13
  388.             textSize: function(battler) { return 13; }, // Hotspot
  389.             // Sets tp bar description text color to be always text color 0
  390.             textColor: function(battler) { // Hotspot
  391.                 return this.textColor(0);
  392.             },
  393.             // Sets the minimum tp to be shown on the hp bar to be always 0
  394.             min: function(battler) { return 0; }, // Hotspot
  395.             // Sets maximum tp to be shown on the hp bar to be always maxTp()
  396.             max: function(battler) { return battler.maxTp(); }, // Hotspot
  397.             // (v1.01a+)Sets the tp change processes to be always shown
  398.             showProc: function(battler) { return true; }, // Hotspot
  399.             // (v1.01a+)Sets the mp change processes rate to be 100% of the
  400.             // max length of the mp bar per second
  401.             procUpdateRate: function(battler) { return 0.2; }, // Hotspot
  402.             // Sets the tp change process color 1 to be always text color 3
  403.             procColor1: function(battler) { return this.textColor(3); },
  404.             // Hotspot
  405.             // Sets the tp change process color 2 to be always text color 24
  406.             procColor2: function(battler) { return this.textColor(24); }
  407.             // Hotspot
  408.         };
  409.     },
  410.  
  411.     // Adds new SBX here
  412.  
  413.  
  414. }; // DoubleX_RMMV.Status_Bars
  415.  
  416. /*============================================================================
  417.  *    ## Plugin Implementations
  418.  *       You need not edit this part as it's about how this plugin works
  419.  *----------------------------------------------------------------------------
  420.  *    # Plugin Support Info:
  421.  *      1. Prerequisites
  422.  *         - Decent RMMV plugin development proficiency to fully comprehend
  423.  *           this
  424.  *----------------------------------------------------------------------------*/
  425.  
  426. DoubleX_RMMV.Is_Status_Bar_Notes_Loaded = false; // v1.00a - v1.00a
  427.  
  428. DoubleX_RMMV.Status_Bars_Params = { // v1.00a - v1.00a
  429.  
  430.     isEnabled: 'Boolean', // Marks that isEnabled is a Boolean
  431.  
  432.     /* Checks whether the passed configuration value's truthy or falsy
  433.      * Functional cohesion/Data coupling/Referentially transperant
  434.      * (String)param: The param to have its boolean value checked
  435.      * Return: The boolean value of the param
  436.      */
  437.     Boolean: function(param) { return param === 'true'; }
  438.  
  439. }; // DoubleX_RMMV.Status_Bars_Params
  440.  
  441. function Window_Status_Bar() { this.initialize.apply(this, arguments); }
  442.  
  443. (function(SB) {
  444.  
  445.     'use strict';
  446.  
  447.     SB.DataManager = {};
  448.     var DM = SB.DataManager;
  449.  
  450.     DM.isDatabaseLoaded = DataManager.isDatabaseLoaded;
  451.     DataManager.isDatabaseLoaded = function() { // v1.00a - v1.00a; Extended
  452.         // Rewritten to read all notetags of this plugin as well
  453.         return DM.isDatabaseLoaded.apply(this, arguments) && DM._loadAllNotes();
  454.         //
  455.     }; // DataManager.isDatabaseLoaded
  456.  
  457.     /* Reads all notetags of this plugin from the database
  458.      * Return: True
  459.      * Functional cohesion/Message coupling/Idempotent
  460.      */
  461.     DM._loadAllNotes = function() { // v1.00a - v1.00a; New
  462.         // Ensures the notetags will only be read exactly once upon game start
  463.         if (DoubleX_RMMV.Is_Status_Bar_Notes_Loaded) return true;
  464.         var types = [$dataActors, $dataClasses, $dataWeapons, $dataArmors];
  465.         types.concat([$dataEnemies, $dataStates]).forEach(function(type) {
  466.             type.forEach(function(data) { if (data) DM._loadNotes(data); });
  467.         });
  468.         DoubleX_RMMV.Is_Status_Bar_Notes_Loaded = true;
  469.         //
  470.         return true;
  471.     }; // DM._loadAllNotes
  472.  
  473.     /* Reads all notetags of this plugin from a dataum of the database
  474.      * (Object)datum: The datum to have its notetags of this plugin read
  475.      * Functional cohesion/Data coupling/Idempotent
  476.      */
  477.     DM._loadNotes = function(datum) { // v1.00a - v1.00a; New
  478.         var statusBars = datum.meta.statusBars = {}; // Plugin call
  479.         var regExp = /< *(\w+) +status +bar *: *(\w+) *>/i, status;
  480.         // Refer to reference tag NOTETAG_MONO
  481.         datum.note.split(/[\r\n]+/).forEach(function(line) {
  482.             if (!line.match(regExp)) return;
  483.             status = RegExp.$1;
  484.             statusBars[status] = statusBars[status] || RegExp.$2;
  485.         });
  486.         //
  487.     }; // DM._loadNotes
  488.  
  489.     SB.Game_System = {};
  490.     var GS = SB.Game_System;
  491.  
  492.     /*------------------------------------------------------------------------
  493.      *    New public instance variable
  494.      *------------------------------------------------------------------------*/
  495.     // (Plugin call)The container of all parameters shown on the plugin manger
  496.     Object.defineProperty(Game_System.prototype, "statusBars", {
  497.         get: function() { /* Hotspot */ return this._statusBars; },
  498.         configurable: true
  499.     });
  500.  
  501.     GS.initialize = Game_System.prototype.initialize;
  502.     Game_System.prototype.initialize = function() { // v1.00a - v1.00a; Extended
  503.         GS.initialize.apply(this, arguments);
  504.         GS._initializeStatusBars.call(this); // Added to setup configurations
  505.     }; // Game_System.prototype.initialize
  506.  
  507.     /* Initializes all parameters of this plugin shown on the plugin manager
  508.      * Functional cohesion/Message coupling/Idempotent
  509.      */
  510.     GS._initializeStatusBars = function() { // v1.00a - v1.00a; New
  511.         this._statusBars = {};
  512.         var params = PluginManager.parameters(DoubleX_RMMV.Status_Bars_File);
  513.         var SBP = DoubleX_RMMV.Status_Bars_Params;
  514.         // Lets parameters to use their strategies to have their desired formats
  515.         Object.keys(params).forEach(function(param) {
  516.             this._statusBars[param] = SBP[SBP[param]](params[param]);
  517.         }, this);
  518.         //
  519.     }; // GS._initializeStatusBars
  520.  
  521.     SB.Game_BattlerBase = {};
  522.     var GBB = SB.Game_BattlerBase;
  523.  
  524.     /*------------------------------------------------------------------------
  525.      *    New public instance variable
  526.      *------------------------------------------------------------------------*/
  527.     // (Plugin call only)Container of all status bar change notification flags
  528.     Object.defineProperty(Game_BattlerBase.prototype, "isStatusBarChanged", {
  529.         get: function() { /* Hotspot */ return this._isStatusBarChanged; },
  530.         configurable: true
  531.     });
  532.  
  533.     /*------------------------------------------------------------------------
  534.      *    New private instance variable
  535.      *------------------------------------------------------------------------*/
  536.     // _statusBars: The container of all status bar configurations
  537.  
  538.     GBB.initMembers = Game_BattlerBase.prototype.initMembers;
  539.     Game_BattlerBase.prototype.initMembers = function() {
  540.     // v1.00a - v1.00a; Extended
  541.         GBB._initStatusBarChanges.call(this); // Added
  542.         GBB.initMembers.apply(this, arguments);
  543.     }; // Game_BattlerBase.prototype.initMembers
  544.  
  545.     GBB.refresh = Game_BattlerBase.prototype.refresh;
  546.     Game_BattlerBase.prototype.refresh = function() {
  547.     // v1.00a - v1.00a; Extended
  548.         GBB.refresh.apply(this, arguments);
  549.         // Added to notify that the status bar configurations might be changed
  550.         if (!$gameSystem.statusBars.isEnabled) return;
  551.         GBB._notifyStatusBarChanges.call(this);
  552.         //
  553.     }; // Game_BattlerBase.prototype.refresh
  554.  
  555.     /* Setups the change notification flags of all statuses for this battler
  556.      * Functional cohesion/Message coupling/Idempotent
  557.      */
  558.     GBB._initStatusBarChanges = function() { // v1.00a - v1.00a; New
  559.         this._statusBars = {};
  560.         this._isStatusBarChanged = {};
  561.         SB.STATUSES.forEach(function(status) {
  562.             this._isStatusBarChanged[status] = true;
  563.         }, this);
  564.     }; // GBB._initStatusBarChanges
  565.  
  566.     /* Marks that a new status bar configuration might need to be used
  567.      * Functional cohesion/Message coupling/Idempotent
  568.      */
  569.     GBB._notifyStatusBarChanges = function() { // v1.00a - v1.00a; New
  570.         // Raises the change notification flags of all statuses for this battler
  571.         Object.keys(this._isStatusBarChanged).forEach(function(status) {
  572.             this._isStatusBarChanged[status] = true;
  573.         }, this);
  574.         //
  575.     }; // GBB._notifyStatusBarChanges
  576.  
  577.     /* Returns the latest status bar configuration object for the given status
  578.      * Sequential cohesion/Data coupling/Idempotent
  579.      * (String)status: The battler status shown by the status bar
  580.      * Return(Object): The status bar configuration object for the given status
  581.      */
  582.     GBB.statusBarCfg = function(status) { // v1.00a - v1.00a; New; Hotspot
  583.         // Setups a new status bar configuration only when it might be needed
  584.         if (!this._statusBars[status] || this._isStatusBarChanged[status]) {
  585.             this._isStatusBarChanged[status] = false;
  586.             this._statusBars[status] = GBB._newStatusBarCfg.call(this, status);
  587.         }
  588.         //
  589.         return this._statusBars[status];
  590.     }; // GBB.statusBarCfg
  591.  
  592.     /* Returns a new status bar configuration object for the given status
  593.      * Functional cohesion/Data coupling/Referentially transperant
  594.      * (String)status: The battler status shown by the status bar
  595.      * Return(Object): A new status bar configuration object for the status
  596.      */
  597.     GBB._newStatusBarCfg = function(status) {
  598.     // v1.00a - v1.00a; New; Potential Hotspot
  599.         // Refer to reference tag NOTETAG_MONO
  600.         var datum = this._statusBarData().filter(function(data) {
  601.             return data.meta.statusBars[status];
  602.         })[0];
  603.         return datum ? datum.meta.statusBars[status] : '';
  604.         //
  605.     }; // GBB._newStatusBarCfg
  606.  
  607.     /* Returns all database items that might have status bar configuration notes
  608.      * Functional cohesion/Message coupling/Referentially transperant
  609.      * Return(Array): An array of database item used by this battler
  610.      */
  611.     GBB._statusBarData = function() { // v1.00a - v1.00a; New; Potential Hotspot
  612.         return this.states(); // Game_BattlerBase is abstract so GBB can be used
  613.     }; // GBB._statusBarData
  614.  
  615.     /* Returns all database items that might have status bar configuration notes
  616.      * Functional cohesion/Message coupling/Referentially transperant
  617.      * Return(Array): An array of database item used by this actor
  618.      */
  619.     Game_Actor.prototype._statusBarData = function() {
  620.     // v1.00a - v1.00a; New; Potential Hotspot
  621.         // Use polymorphism at the cost of not using GA
  622.         var data = GBB._statusBarData.call(this);
  623.         return data.concat(this.equips().filter(function(equip) {
  624.             return equip;
  625.         })).concat([this.currentClass(), this.actor()]);
  626.         //
  627.     }; // Game_Actor.prototype._statusBarData
  628.  
  629.     /* Returns all database items that might have status bar configuration notes
  630.      * Functional cohesion/Message coupling/Referentially transperant
  631.      * Return(Array): An array of database item used by this enemy
  632.      */
  633.     Game_Enemy.prototype._statusBarData = function() {
  634.     // v1.00a - v1.00a; New; Potential Hotspot
  635.         // Use polymorphism at the cost of not using GE
  636.         return GBB._statusBarData.call(this).concat([this.enemy()]);
  637.         //
  638.     }; // Game_Enemy.prototype._statusBarData
  639.  
  640.     SB.Sprite_Battler = {};
  641.     var SBSB = SB.Sprite_Battler;
  642.  
  643.     /*------------------------------------------------------------------------
  644.      *    New private instance variable
  645.      *------------------------------------------------------------------------*/
  646.     // _statusBars: The container of all status bars for the battler
  647.  
  648.     SBSB.setBattler = Sprite_Battler.prototype.setBattler;
  649.     Sprite_Battler.prototype.setBattler = function(battler) {
  650.     // 1.00a - v1.00a; Extended; Hotspot
  651.         // Added to reconfigure the status bars upon battler change
  652.         var change = battler !== this._battler;
  653.         //
  654.         SBSB.setBattler.apply(this, arguments);
  655.         // Added
  656.         if (!$gameSystem.statusBars.isEnabled || !battler || !change) return;
  657.         if (!this._statusBars) return SBSB._initStatusBars.call(this);
  658.         SBSB._setStatusBarBattlers.call(this);
  659.         //
  660.     }; // Sprite_Battler.prototype.setBattler
  661.  
  662.     /* Setups all status bars for this battler
  663.      * Functional cohesion/Message coupling/Idempotent
  664.      */
  665.     SBSB._initStatusBars = function() { // v1.00a - v1.00a; New
  666.         this._statusBars = {};
  667.         SB.STATUSES.forEach(function(status) {
  668.             this._statusBars[status] =
  669.                     new Window_Status_Bar(this._battler, status);
  670.             this.addChild(this._statusBars[status]);
  671.         }, this);
  672.     }; // SBSB._initStatusBars
  673.  
  674.     /* Updates the owner info stored in all status bars
  675.      * Functional cohesion/Message coupling/Idempotent
  676.      */
  677.     SBSB._setStatusBarBattlers = function() { // v1.00a - v1.00a; New
  678.         SB.STATUSES.forEach(function(status) {
  679.             this._statusBars[status].battler = this._battler;
  680.         }, this);
  681.     }; // SBSB._setStatusBarBattlers
  682.  
  683.     /*------------------------------------------------------------------------
  684.      *    # New class: Window_Status_Bar
  685.      *------------------------------------------------------------------------*/
  686.  
  687.     Window_Status_Bar.prototype = Object.create(Window_Base.prototype);
  688.     Window_Status_Bar.prototype.constructor = Window_Status_Bar;
  689.  
  690.     /*------------------------------------------------------------------------
  691.      *    New public instance variable
  692.      *------------------------------------------------------------------------*/
  693.     // battler: The battler owning this status bar
  694.     Object.defineProperty(Window_Status_Bar.prototype, "battler", {
  695.         set: function() { /* Hotspot */ return this._battler; },
  696.         configurable: true
  697.     });
  698.  
  699.     /*------------------------------------------------------------------------
  700.      *    New private instance variables
  701.      *------------------------------------------------------------------------*/
  702.     /* _backColor: The back color of this status bar
  703.      * _cfgName: The name of the configuration object used by this status bar
  704.      * _cfg: The configuration object used by this status bar
  705.      * _color1: The 1st color of this status bar
  706.      * _color2: The 2nd color of this status bar
  707.      * _fillW: The width of the filled portion of the status bar
  708.      * _isRedraw: The flag indicating whether the status bar needs to be redrawn
  709.      * (v1.01a+)_procFillW: The width of the stat change process bar
  710.      * _status: The battler status shown by this status bar
  711.      * _text: The status bar description text
  712.      * _textColor: The color of the status bar description text
  713.      * _textX: The x offset of the status bar description text from this bar
  714.      * _textY: The y offset of the status bar description text from this bar
  715.      */
  716.  
  717.     Window_Status_Bar.prototype.initialize = function(battler, status) {
  718.     // v1.00a - v1.00a
  719.         this._battler = battler;
  720.         this._status = status;
  721.         this._updateCfg(battler, status);
  722.         if (this._cfg) {
  723.             Window_Base.prototype.initialize.call(this, this._cfg.x(battler),
  724.             this._cfg.y(battler), this._cfg.w(battler), this._cfg.h(battler));
  725.         } else {
  726.             Window_Base.prototype.initialize.call(this, 0, 0, 0, 0);
  727.         }
  728.         this.opacity = 0; // Only the status bar needs to be shown
  729.     }; // Window_Status_Bar.prototype.initialize
  730.  
  731.     Window_Status_Bar.prototype.standardFontSize = function() {
  732.     // v1.00a - v1.00a; Hotspot
  733.         if (this._cfg) return this._cfg.textSize(this._battler);
  734.         return Window_Base.prototype.standardFontSize.call(this);
  735.     }; // Window_Status_Bar.prototype.standardFontSize
  736.  
  737.     Window_Status_Bar.prototype.standardPadding = function() {
  738.     // v1.00a - v1.00a; Hotspot
  739.         // The whole window is just the statu bar
  740.         return this._cfg ? 0 : Window_Base.prototype.standardPadding.call(this);
  741.         //
  742.     }; // Window_Status_Bar.prototype.standardPadding
  743.  
  744.     Window_Status_Bar.prototype.resetFontSettings = function() {
  745.     // v1.00a - v1.00a; Hotspot
  746.         if (this.contents.fontSize === this.standardFontSize()) return;
  747.         Window_Base.prototype.resetFontSettings.call(this);
  748.         this._isRedraw = true;
  749.     }; // Window_Status_Bar.prototype.resetFontSettings
  750.  
  751.     Window_Status_Bar.prototype.update = function() {
  752.     // v1.00a - v1.00a; Hotspot
  753.         Window_Base.prototype.update.call(this);
  754.         this._updateBarStatuses(this._battler);
  755.     }; // Window_Status_Bar.prototype.update
  756.  
  757.     /* Updates all statuses of this status bar
  758.      * Sequential cohesion/Data coupling
  759.      * (Game_Battler)battler: The battler owning this bar
  760.      */
  761.     Window_Status_Bar.prototype._updateBarStatuses = function(battler) {
  762.     // v1.00a - v1.00a; Hotspot
  763.         if (!battler) return this.visible = false;
  764.         this._updateCfg(battler, this._status);
  765.         this._updateBarVisibility(battler, this._cfg);
  766.         if (!this.visible || this.contentsOpacity <= 0) return;
  767.         this._updateDimensions(battler, this._cfg, this._status);
  768.         if (!this.visible) return;
  769.         this._updateColorText(battler, this._cfg);
  770.         if (!this.visible || !this._isRedraw) return;
  771.         this._isRedraw = false;
  772.         this._redraw(battler, this._cfg);
  773.     }; // Window_Status_Bar.prototype._updateBarStatuses
  774.  
  775.     /* Updates all configurations used by this status bar
  776.      * Functional cohesion/Data coupling
  777.      * (Game_Battler)battler: The battler owning this bar
  778.      * (String)status: The battler status shown by this status bar
  779.      */
  780.     Window_Status_Bar.prototype._updateCfg = function(battler, status) {
  781.     // v1.00a - v1.00a; Hotspot
  782.         if (!battler) return;
  783.         var lastCfgName = this._cfgName;
  784.         this._cfgName = GBB.statusBarCfg.call(battler, status);
  785.         if (lastCfgName === this._cfgName) return;
  786.         if (this._cfgName.length <= 0) return this._cfg = null;
  787.         this._cfg = SB[this._cfgName]();
  788.         Object.keys(this._cfg).forEach(function(cfg) {
  789.             this._cfg[cfg] = this._cfg[cfg].bind(this);
  790.         }, this);
  791.     }; // Window_Status_Bar.prototype._updateCfg
  792.  
  793.     /* Updates all visibility settings used by this status bar
  794.      * Functional cohesion/Data coupling
  795.      * (Game_Battler)battler: The battler owning this bar
  796.      * (Object)cfg: The configuration object used by this status bar
  797.      */
  798.     Window_Status_Bar.prototype._updateBarVisibility = function(battler, cfg) {
  799.     // v1.00a - v1.01b; Hotspot
  800.         this.visible = battler && cfg && cfg.visible(battler);
  801.         if (this.visible) this.contentsOpacity = cfg.opacity(battler);
  802.     }; // Window_Status_Bar.prototype._updateBarVisibility
  803.  
  804.     /* Updates all dimensional settings of this status bar
  805.      * Sequential cohesion/Data coupling
  806.      * (Game_Battler)battler: The battler owning this bar
  807.      * (Object)cfg: The configuration object used by this status bar
  808.      * (String)status: The battler status shown by this status bar
  809.      */
  810.     Window_Status_Bar.prototype._updateDimensions =
  811.     function(battler, cfg, status) {
  812.     // v1.00a - v1.00a; Hotspot
  813.         this._updateW(battler, cfg);
  814.         this.visible = this.visible && this.width > 0;
  815.         if (!this.visible) return;
  816.         this._updateH(battler, cfg);
  817.         this.visible = this.visible && this.height > 0;
  818.         if (!this.visible) return;
  819.         this._updateX(battler, cfg);
  820.         this._updateY(battler, cfg);
  821.         this._updateFillW(battler, cfg, status);
  822.     }; // Window_Status_Bar.prototype.updateDimensions
  823.  
  824.     /* Updates the width of this status bar and the redraw flag
  825.      * Sequential cohesion/Data coupling
  826.      * (Game_Battler)battler: The battler owning this bar
  827.      * (Object)cfg: The configuration object used by this status bar
  828.      */
  829.     Window_Status_Bar.prototype._updateW = function(battler, cfg) {
  830.     // v1.00a - v1.00a; Hotspot
  831.         var newW = battler && cfg ? cfg.w(battler) : 0;
  832.         if (this.width === newW) return;
  833.         this.width = newW;
  834.         this._isRedraw = true;
  835.     }; // Window_Status_Bar.prototype._updateW
  836.  
  837.     /* Updates the height of this status bar and the redraw flag
  838.      * Sequential cohesion/Data coupling
  839.      * (Game_Battler)battler: The battler owning this bar
  840.      * (Object)cfg: The configuration object used by this status bar
  841.      */
  842.     Window_Status_Bar.prototype._updateH = function(battler, cfg) {
  843.     // v1.00a - v1.00a; Hotspot
  844.         var newH = battler && cfg ? cfg.h(battler) : 0;
  845.         if (this.height === newH) return;
  846.         this.height = newH;
  847.         this._isRedraw = true;
  848.     }; // Window_Status_Bar.prototype._updateH
  849.  
  850.     /* Updates the x offset of this status bar from the battler sprite
  851.      * Functional cohesion/Data coupling
  852.      * (Game_Battler)battler: The battler owning this bar
  853.      * (Object)cfg: The configuration object used by this status bar
  854.      */
  855.     Window_Status_Bar.prototype._updateX = function(battler, cfg) {
  856.     // v1.00a - v1.00a; Hotspot
  857.         if (!battler || !cfg) return;
  858.         var newX = cfg.x(battler);
  859.         if (this.x !== newX) this.x = newX;
  860.     }; // Window_Status_Bar.prototype._updateX
  861.  
  862.     /* Updates the y offset of this status bar from the battler sprite
  863.      * Functional cohesion/Data coupling
  864.      * (Game_Battler)battler: The battler owning this bar
  865.      * (Object)cfg: The configuration object used by this status bar
  866.      */
  867.     Window_Status_Bar.prototype._updateY = function(battler, cfg) {
  868.     // v1.00a - v1.00a; Hotspot
  869.         if (!battler || !cfg) return;
  870.         var newY = cfg.y(battler);
  871.         if (this.y !== newY) this.y = newY;
  872.     }; // Window_Status_Bar.prototype._updateY
  873.  
  874.     /* Updates the fill width of this status bar and the redraw flag
  875.      * Sequential cohesion/Data coupling
  876.      * (Game_Battler)battler: The battler owning this bar
  877.      * (Object)cfg: The configuration object used by this status bar
  878.      * (String)status: The battler status shown by this status bar
  879.      */
  880.     Window_Status_Bar.prototype._updateFillW = function(battler, cfg, status) {
  881.     // v1.00a - v1.01c; Hotspot
  882.         var lastFillW = this._fillW;
  883.         var statusRange = cfg.max(battler) - cfg.min(battler);
  884.         this._fillW = battler && cfg && statusRange > 0 ?
  885.                 this.width * battler[status] / statusRange : 0;
  886.         if (isNaN(this._procFillW)) this._procFillW = this._fillW;
  887.         this._isRedraw = this._isRedraw || lastFillW !== this._fillW ||
  888.                 this._procFillW !== this._fillW;
  889.     }; // Window_Status_Bar.prototype._updateFillW
  890.  
  891.     /* Updates all color and text settings of this status bar
  892.      * Sequential cohesion/Data coupling
  893.      * (Game_Battler)battler: The battler owning this bar
  894.      * (Object)cfg: The configuration object used by this status bar
  895.      */
  896.     Window_Status_Bar.prototype._updateColorText = function(battler, cfg) {
  897.     // v1.00a - v1.01a; Hotspot
  898.         this._updateSetting(battler, cfg, 'backColor');
  899.         this._updateSetting(battler, cfg, 'color1');
  900.         this._updateSetting(battler, cfg, 'color2');
  901.         this._updateSetting(battler, cfg, 'textColor');
  902.         this._updateSetting(battler, cfg, 'text');
  903.         this.visible = this.visible && !this._isTransperant();
  904.         if (!this.visible) return;
  905.         this._updateSetting(battler, cfg, 'textX');
  906.         this._updateSetting(battler, cfg, 'textY');
  907.         this._updateSetting(battler, cfg, 'procColor1');
  908.         this._updateSetting(battler, cfg, 'procColor2');
  909.     }; // Window_Status_Bar.prototype.updateDimensions
  910.  
  911.     /* Updates specified setting of this status bar that can change redraw flag
  912.      * Sequential cohesion/Data coupling
  913.      * (Game_Battler)battler: The battler owning this bar
  914.      * (Object)cfg: The configuration object used by this status bar
  915.      * (String)name: The setting name
  916.      */
  917.     Window_Status_Bar.prototype._updateSetting = function(battler, cfg, name) {
  918.     // v1.00a - v1.00a; Hotspot
  919.         if (!battler || !cfg) return;
  920.         var _name = '_' + name, last = this[_name];
  921.         this[_name] = cfg[name](battler);
  922.         this._isRedraw = this._isRedraw || last !== this[_name];
  923.     }; // Window_Status_Bar.prototype._updateSetting
  924.  
  925.     /* Checks if the whole status bar's transperant
  926.      * Functional cohesion/Message coupling/Referentially transperant
  927.      * Return(Boolean): Whether the whole status bar's transperant
  928.      */
  929.     Window_Status_Bar.prototype._isTransperant = function() {
  930.     // v1.00a - v1.01a; Hotspot
  931.         var opagueColor = 0x01000000;
  932.         if (this._backColor >= opagueColor) return false;
  933.         if (this._color1 >= opagueColor) return false;
  934.         if (this._color2 >= opagueColor) return false;
  935.         if (this._procColor1 >= opagueColor) return false;
  936.         if (this._procColor2 >= opagueColor) return false;
  937.         return this._textColor < opagueColor || this._text.length <= 0;
  938.     }; // Window_Status_Bar.prototype._isTransperant
  939.  
  940.     /* Redraws the whole status bar
  941.      * Functional cohesion/Message coupling
  942.      */
  943.     Window_Status_Bar.prototype._redraw = function() {
  944.     // v1.00a - v1.01a; Hotspot
  945.         if (this._cfg.showProc(this._battler)) return this._redrawWithProc();
  946.         this._redrawWithoutProc();
  947.     }; // Window_Status_Bar.prototype._redraw
  948.  
  949.     /* (v1.01a+)Redraws the whole status bar with the stat change process shown
  950.      * Functional cohesion/Message coupling
  951.      */
  952.     Window_Status_Bar.prototype._redrawWithProc = function() {
  953.     // v1.01a - v1.01a; Hotspot
  954.         if (this._procFillW < this._fillW) return this._redrawWithProcAbove();
  955.         if (this._procFillW > this._fillW) return this._redrawWithProcBelow();
  956.         this._redrawWithoutProc();
  957.     }; // Window_Status_Bar.prototype._redrawWithProc
  958.  
  959.     /* (v1.01a+)Redraws the whole status bar with the stat change process shown
  960.      * Sequential cohesion/Message coupling
  961.      */
  962.     Window_Status_Bar.prototype._redrawWithProcAbove = function() {
  963.     // v1.01a - v1.01a; Hotspot
  964.         this._redrawBack();
  965.         this.contents.gradientFillRect(0, 0, this._fillW, this.height,
  966.                 this._color1, this._color2);
  967.         this.contents.gradientFillRect(0, 0, this._procFillW, this.height,
  968.                 this._procColor1, this._procColor2);
  969.         this._redrawText();
  970.         this._addProcFillW();
  971.         // Otherwise the stat change process bar would show after it's done
  972.         if (this._procFillW >= this._fillW) this._redrawWithoutProc();
  973.         //
  974.     }; // Window_Status_Bar.prototype._redrawWithProcAbove
  975.  
  976.     /* (v1.01a+)Increases the stat change process fill width in the stat bar
  977.      * Functional cohesion/Message coupling
  978.      */
  979.     Window_Status_Bar.prototype._addProcFillW = function() {
  980.     // v1.01a - v1.01a; Hotspot
  981.         // Fps's assumed to be always 60
  982.         this._procFillW = Math.min(this._procFillW + this._cfg.procUpdateRate(
  983.                 this._battler) * this.width / 60, this._fillW);
  984.         //
  985.     }; // Window_Status_Bar.prototype._addProcFillW
  986.  
  987.     /* (v1.01a+)Redraws the whole status bar with the stat change process shown
  988.      * Sequential cohesion/Message coupling
  989.      */
  990.     Window_Status_Bar.prototype._redrawWithProcBelow = function() {
  991.     // v1.01a - v1.01a; Hotspot
  992.         this._redrawBack();
  993.         this.contents.gradientFillRect(0, 0, this._procFillW, this.height,
  994.                 this._procColor1, this._procColor2);
  995.         this.contents.gradientFillRect(0, 0, this._fillW, this.height,
  996.                 this._color1, this._color2);
  997.         this._redrawText();
  998.         this._minusProcFillW();
  999.         // Otherwise the stat change process bar would show after it's done
  1000.         if (this._procFillW <= this._fillW) this._redrawWithoutProc();
  1001.         //
  1002.     }; // Window_Status_Bar.prototype._redrawWithProcBelow
  1003.  
  1004.     /* (v1.01a+)Decreases the stat change process fill width in the stat bar
  1005.      * Functional cohesion/Message coupling
  1006.      */
  1007.     Window_Status_Bar.prototype._minusProcFillW = function() {
  1008.     // v1.01a - v1.01a; Hotspot
  1009.         // Fps's assumed to be always 60
  1010.         this._procFillW = Math.max(this._procFillW - this._cfg.procUpdateRate(
  1011.                 this._battler) * this.width / 60, this._fillW);
  1012.         //
  1013.     }; // Window_Status_Bar.prototype._addProcFillW
  1014.  
  1015.     /* Redraws the whole status bar without showing the stat change processes
  1016.      * Functional cohesion/Message coupling/Idempotent
  1017.      */
  1018.     Window_Status_Bar.prototype._redrawWithoutProc = function() {
  1019.     // v1.01a - v1.01a; Potential Hotspot
  1020.         this._redrawBack();
  1021.         this.contents.gradientFillRect(0, 0, this._fillW, this.height,
  1022.                 this._color1, this._color2);
  1023.         this._redrawText();
  1024.     }; // Window_Status_Bar.prototype._redrawWithoutProc
  1025.  
  1026.     /* Redraws the whole status bar without showing the stat change processes
  1027.      * Functional cohesion/Message coupling/Idempotent
  1028.      */
  1029.     Window_Status_Bar.prototype._redrawBack = function() {
  1030.         this.contents.clear();
  1031.         this.contents.fillRect(0, 0, this.width, this.height, this._backColor);
  1032.     }; // Window_Status_Bar.prototype._redrawBack
  1033.  
  1034.     /* Redraws the whole status bar without showing the stat change processes
  1035.      * Functional cohesion/Message coupling/Idempotent
  1036.      */
  1037.     Window_Status_Bar.prototype._redrawText = function() {
  1038.     // v1.01a - v1.01a; Potential Hotspot
  1039.         this.changeTextColor(this._textColor);
  1040.         var text = this._text;
  1041.         this.contents.drawText(text, this._textX, this._textY,
  1042.                 this.textWidth(text), this.height);
  1043.     }; // Window_Status_Bar.prototype._redrawText
  1044.  
  1045. })(DoubleX_RMMV.Status_Bars);
  1046.  
  1047. /*============================================================================*/
Advertisement
Add Comment
Please, Sign In to add comment