Advertisement
Double_X

DoubleX RMMV Popularized ATB Cooldown v101c

Feb 9th, 2016 (edited)
746
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 Popularized ATB Cooldown                                
  6.  *----------------------------------------------------------------------------
  7.  *    # Terms Of Use                                                          
  8.  *      You shall keep this plugin's Plugin Info part's contents intact      
  9.  *      You shalln't claim that this plugin's written by anyone other than    
  10.  *      DoubleX or his aliases                                                
  11.  *      None of the above applies to DoubleX or his aliases                  
  12.  *----------------------------------------------------------------------------
  13.  *    # Prerequisites                                                        
  14.  *      Plugins:                                                              
  15.  *      1. DoubleX RMMV Popularized ATB Core                                  
  16.  *      Abilities:                                                            
  17.  *      1. Little Javascript coding proficiency to fully utilize this plugin  
  18.  *----------------------------------------------------------------------------
  19.  *    # Links                                                                
  20.  *      This plugin:                                                          
  21.  *      1. http://pastebin.com/USwE5Au0                                      
  22.  *      Video:                                                                
  23.  *      1. https://www.youtube.com/watch?v=tjR2RdGZ5Uw                        
  24.  *      Mentioned Patreon Supporters:
  25.  *      https://www.patreon.com/posts/71738797
  26.  *----------------------------------------------------------------------------
  27.  *    # Author                                                                
  28.  *      DoubleX                                                              
  29.  *----------------------------------------------------------------------------
  30.  *    # Changelog                                                            
  31.  *      v1.01b(GMT 1500 11-8-2016):                                          
  32.  *      1. In sync with the latest DoubleX RMMV Popularized ATB Core version  
  33.  *      v1.01a(GMT 0200 20-2-2016):                                          
  34.  *      1. Lets users set the cooldown bar description text via notetags      
  35.  *      2. Lets users trigger a common event upon battler cooldown finish    
  36.  *      3. Fixed not refreshing the battler upon finishing cooldown bug      
  37.  *      4. Fixed a compatibility issue with charge addon upon cooldown finish
  38.  *      v1.00a(GMT 1100 9-2-2016):                                            
  39.  *      1. 1st testing version of this plugin finished                        
  40.  *============================================================================*/
  41. /*:
  42.  * @plugindesc Lets users set skills/items causing user to cooldown after user
  43.  * @author DoubleX
  44.  *
  45.  * @param cooldown_c1
  46.  * @desc Sets the 1st atb cooldown bar color as text color cooldown_c1
  47.  *       cooldown_c1 must return a valid text color code
  48.  *       cooldown_c1 should return the same value during the same battle to
  49.  *       ensure proper atb cooldown bar color displays
  50.  * @default 19
  51.  *
  52.  * @param cooldown_c2
  53.  * @desc Sets the 2nd atb cooldown bar color as text color cooldown_c2
  54.  *       cooldown_c2 must return a valid text color code
  55.  *       cooldown_c2 should return the same value during the same battle to
  56.  *       ensure proper atb cooldown bar color displays
  57.  * @default 26
  58.  *
  59.  * @param cooldown_bar_text
  60.  * @desc Sets the code of the cooldown bar description text as cooldown_bar_text
  61.  *       It'll only be used if no <patb cooldown text: text> notetag's used
  62.  *       Available cooldown_bar_text code:
  63.  *       item - The skill/item name causing the cooldown will be the cooldown
  64.  *              bar description text
  65.  *       Setting cooldown_bar_text as an unavailable code means atb_bar_text
  66.  *       will be the cooldown bar description text
  67.  *       cooldown_bar_text should return the same code during the same battle to
  68.  *       ensure proper cooldown bar text displays
  69.  * @default item
  70.  *
  71.  * @param post_cooldown_common_event_id
  72.  * @desc Sets the common event with id post_cooldown_common_event_id to be
  73.  *       called right after a battler has finished cooling down
  74.  *       post_cooldown_common_event_id must return a Number
  75.  *       If post_cooldown_common_event_id doesn't return the id of an existing
  76.  *       common event, no common event will be called with this timing
  77.  * @default 0
  78.  *
  79.  * @help
  80.  * Battlers using skills/items without the <patb cooldown: scale, code>
  81.  * notetag will be fully cooled down in 1 frame
  82.  * The default plugin file name is DoubleX RMMV Popularized ATB Cooldown v101b
  83.  * If you want to change that, you must edit the value of
  84.  * DoubleX_RMMV.PATB_Cooldown_File, which must be done via opening this plugin
  85.  * js file directly
  86.  *============================================================================
  87.  *    ## Notetag Info                                                        
  88.  *----------------------------------------------------------------------------
  89.  *    # Skill/Item Notetags:                                                  
  90.  *      1. <patb cooldown: scale, code>                                      
  91.  *         - Sets the cooldown rate to use the skill/item's invocation speed,
  92.  *           which will be multiplied by scale                                
  93.  *         - code can be either of the below:                                
  94.  *           set - The cooldown value per frame will be the skill/item's      
  95.  *                 invocation speed * scale, which should be nonnegative      
  96.  *           add - The cooldown value per frame will be the absolute value of
  97.  *                 the battler atb gain value per frame + the skill/item's    
  98.  *                 invocation speed * scale                                  
  99.  *           multiply - If the skill/item's invocation speed * scale is      
  100.  *                      positive, the cooldown value per frame will be the    
  101.  *                      battler atb gain value per frame * the skill/item's  
  102.  *                      invocation speed * scale                              
  103.  *                      If the skill/item's invocation speed * scale is      
  104.  *                      negative, the cooldown value per frame will be the    
  105.  *                      battler atb gain value per frame / (the skill/item's  
  106.  *                      invocation speed * scale)                            
  107.  *                      If the skill/item's invocation speed * scale is 0, the
  108.  *                      battler using the skill/item will be fully cooled down
  109.  *                      in 1 frame                                            
  110.  *      2. <patb cooldown colors: text color 1, text color 2>                
  111.  *         - Changes the atb cooldown bar color 1 and 2 to text color 1 and 2
  112.  *           respectively when this notetag's used                            
  113.  *      3. <patb cooldown text: text>                                        
  114.  *         - Changes the atb cooldown bar description text as text when this  
  115.  *           notetag's used                                                  
  116.  *============================================================================
  117.  *    ## Plugin Call Info                                                    
  118.  *----------------------------------------------------------------------------
  119.  *    # Data Skill/Item manipulations                                        
  120.  *      1. meta.patb_cooldown                                                
  121.  *         - Returns the skill/item invocation speed scale and cooldown rate  
  122.  *           code in the form of { scale: scale, code: code }                
  123.  *      2. meta.patb_cooldown = { scale: scale, code: code }                  
  124.  *         - Sets the skill/item invocation speed scale and cooldown rate code
  125.  *           in the form of { scale: scale, code: code }                      
  126.  *         - All meta.patb_cooldown changes can be saved if                  
  127.  *           DoubleX RMMV Dynamic Data is used                                
  128.  *      3. meta.patb_cooldown_colors                                          
  129.  *         - Returns the text colors stored in                                
  130.  *           <patb cooldown colors: text color 1, text color 2> in the form of
  131.  *           [text color 1, text color 2]                                    
  132.  *      4. meta.patb_cooldown_colors = [text color 1, text color 2]          
  133.  *         - Sets the text colors stored in                                  
  134.  *           <patb cooldown colors: text color 1, text color 2> as text color
  135.  *           1 and 2                                                          
  136.  *         - All meta.patb_cooldown_colors changes can be saved if            
  137.  *           DoubleX RMMV Dynamic Data is used                                
  138.  *      5. meta.patb_cooldown_text                                            
  139.  *         - Returns the text stored in <patb cooldown text: text>            
  140.  *      6. meta.patb_cooldown_text = text                                    
  141.  *         - Sets the text stored in <patb cooldown text: text> as text      
  142.  *         - All meta.patb_cooldown_text changes can be saved if              
  143.  *           DoubleX RMMV Dynamic Data is used                                
  144.  *    # Battler manipulations                                                
  145.  *      1. patb_val.cooldown                                                  
  146.  *         - Returns the battler's cooldown value                            
  147.  *      2. patb_val.cooldown = val                                            
  148.  *         - Set the battler's cooldown value as val                          
  149.  *      3. patb_rate.cooldown                                                
  150.  *         - Returns the battler's cooldown rate                              
  151.  *      4. patb_rate.cooldown = rate                                          
  152.  *         - Set the battler's cooldown rate as rate                          
  153.  *         - It'll be reevaluated if it can be changed without plugin calls  
  154.  *      5. patb_val_change.cooldown = true                                    
  155.  *         - Notifies that the cooldown value's changed                      
  156.  *         - It must be used right after the atb bar length changed          
  157.  *============================================================================
  158.  */
  159.  
  160. "use strict";
  161. var DoubleX_RMMV = DoubleX_RMMV || {};
  162. DoubleX_RMMV["PATB Cooldown"] = "v1.01b";
  163.  
  164. // The plugin file name must be the same as DoubleX_RMMV.PATB_Cooldown_File
  165. DoubleX_RMMV.PATB_Cooldown_File = "DoubleX RMMV Popularized ATB Cooldown v101b";
  166.  
  167. /*============================================================================
  168.  *    ## Plugin Implementations                                              
  169.  *       You need not edit this part as it's about how this plugin works      
  170.  *----------------------------------------------------------------------------
  171.  *    # Plugin Support Info:                                                  
  172.  *      1. Prerequisites                                                      
  173.  *         - Basic knowledge of this plugin on the user level, the default    
  174.  *           battle system implementations and the atb system concepts        
  175.  *         - Some Javascript coding proficiency to fully comprehend this      
  176.  *           plugin                                                          
  177.  *      2. Function documentation                                            
  178.  *         - The 1st part describes why this function's rewritten/extended for
  179.  *           rewritten/extended functions or what the function does for new  
  180.  *           functions                                                        
  181.  *         - The 2nd part describes what the arguments of the function are    
  182.  *         - The 3rd part informs which version rewritten, extended or created
  183.  *           this function                                                    
  184.  *         - The 4th part informs whether the function's rewritten or new    
  185.  *         - The 5th part informs whether the function's a real or potential  
  186.  *           hotspot                                                          
  187.  *         - The 6th part describes how this function works for new functions
  188.  *           only, and describes the parts added, removed or rewritten for    
  189.  *           rewritten or extended functions only                            
  190.  *         Example:                                                          
  191.  * /*----------------------------------------------------------------------
  192.  *  *    Why rewrite/extended/What this function does                      
  193.  *  *----------------------------------------------------------------------*/
  194. /* // arguments: What these arguments are                                    
  195.  * function_name = function(arguments) { // Version X+; Rewrite/New; Hotspot  
  196.  *     // Added/Removed/Rewritten to do something/How this function works    
  197.  *     function_name_code;                                                    
  198.  *     //                                                                    
  199.  * } // function_name                                                        
  200.  *----------------------------------------------------------------------------*/
  201.  
  202. if (DoubleX_RMMV["PATB Core"]) {
  203.  
  204. /*----------------------------------------------------------------------------*/
  205.  
  206. /*----------------------------------------------------------------------------
  207.  *    # Edit class: DataManager                                              
  208.  *----------------------------------------------------------------------------*/
  209.  
  210. // data: The data to have its notetags read
  211. DataManager.load_all_patb_cooldown_notes = DataManager.load_all_patb_notes;
  212. DataManager.load_all_patb_notes = function() {
  213.     // Added
  214.     [$dataSkills, $dataItems].forEach(function(type) {
  215.         type.forEach(function(data) {
  216.             if (data) { this.load_patb_cooldown_notes(data); }
  217.         }, this);
  218.     }, this);
  219.     //
  220.     return this.load_all_patb_cooldown_notes();
  221. }; // DataManager.load_all_patb_notes
  222.  
  223. // data: The data to have its notetags read
  224. DataManager.load_patb_cooldown_notes = function(data) { // New
  225.     var cooldown = /< *patb +cooldown *: *(\d+) *, *(\w+) *>/i;
  226.     var color = /< *patb +cooldown +colors *: *(\d+) *, *(\d+) *>/i;
  227.     var text = /< *patb +cooldown +text *: *(\w+) *>/i, meta = data.meta;
  228.     data.note.split(/[\r\n]+/).forEach(function(line) {
  229.         if (line.match(cooldown)) {
  230.             return meta.patb_cooldown = { scale: +RegExp.$1, code: RegExp.$2 };
  231.         } else if (line.match(color)) {
  232.             return meta.patb_cooldown_colors = [+RegExp.$1, +RegExp.$2];
  233.         }
  234.         if (line.match(text)) { meta.patb_cooldown_text = RegExp.$1; }
  235.     });
  236.     // Sets the default to be fully cooled down in 1 frame
  237.     meta.patb_cooldown = meta.patb_cooldown || { scale: 0, code: "multiply" };
  238.     //
  239. }; // DataManager.load_patb_cooldown_notes
  240.  
  241. /*----------------------------------------------------------------------------
  242.  *    # Edit class: BattleManager                                            
  243.  *----------------------------------------------------------------------------*/
  244.  
  245. BattleManager.endActionPatbCooldown = BattleManager.endAction;
  246. BattleManager.endAction = function() {
  247.     // Added to initialize the cooldown right after using the skill/item
  248.     if ($gameSystem.is_patb()) { this._subject.set_patb_cooldown(); }
  249.     //
  250.     this.endActionPatbCooldown();
  251.     // Added to ensure the action execution subject won't be cooling down
  252.     if ($gameSystem.is_patb()) { this._subject = null; }
  253.     //
  254. }; // BattleManager.endAction
  255.  
  256. /*----------------------------------------------------------------------------
  257.  *    # (v1.01a+)Edit class: Game_Temp                                        
  258.  *----------------------------------------------------------------------------*/
  259.  
  260. // timing: The common event trigger timing
  261. Game_Temp.prototype.call_patb_event = function(timing) { // New
  262.     var id = $gameSystem.patb[timing + "_common_event_id"];
  263.     if ($dataCommonEvents[id]) { this.reserveCommonEvent(id); }
  264. }; // Game_Temp.prototype.call_patb_event
  265.  
  266. /*----------------------------------------------------------------------------
  267.  *    # Edit class: Game_System                                              
  268.  *      - Stores the values of all configurations listed in the plugin manager
  269.  *----------------------------------------------------------------------------*/
  270.  
  271. Game_System.prototype.init_patb_cooldown_params =
  272. Game_System.prototype.init_patb_params;
  273. Game_System.prototype.init_patb_params = function() {
  274.     this.init_patb_cooldown_params();
  275.     // Added
  276.     var params = PluginManager.parameters(DoubleX_RMMV.PATB_Cooldown_File), val;
  277.     Object.keys(params).forEach(function(param) {
  278.         val = +params[param];
  279.         this._patb[param] = isNaN(val) ? params[param] : val;
  280.     }, this);
  281.     //
  282. }; // Game_System.prototype.init_patb_params
  283.  
  284. /*----------------------------------------------------------------------------
  285.  *    # Edit class: Game_Battler                                              
  286.  *----------------------------------------------------------------------------*/
  287.  
  288. /*----------------------------------------------------------------------------
  289.  *    New private instance variables                                          
  290.  *----------------------------------------------------------------------------*/
  291. /* _patb_cooldown_item: The cached skill/item to read its name and notetags
  292.  * _patb_cooldown_text: The cached cooldown bar description text
  293.  */
  294.  
  295. Game_Battler.prototype.init_patb_cooldown = Game_Battler.prototype.init_patb;
  296. Game_Battler.prototype.init_patb = function() {
  297.     this.init_patb_cooldown();
  298.     // Added
  299.     this._patb_colors.cooldown = [];
  300.     this._patb_rate.cooldown = 0;
  301.     this.mark_patb_cooldown_change();
  302.     if ($gameSystem.patb.atb_fill_code === "delay") {
  303.         return this._patb_val.cooldown = this._max_patb_val;
  304.     }
  305.     this._patb_val.cooldown = 0;
  306.     //
  307. }; // Game_Battler.prototype.init_patb
  308.  
  309. Game_Battler.prototype.update_patb_cooldown_val =
  310. Game_Battler.prototype.update_patb_val;
  311. Game_Battler.prototype.update_patb_val = function(cap, sign) { // Hotspot
  312.     // Added
  313.     if (this.is_patb_cooldown()) {
  314.         return this.update_patb_cooldown(cap, sign);
  315.     }
  316.     //
  317.     this.update_patb_cooldown_val(cap, sign);
  318. }; // Game_Battler.prototype.update_patb_val
  319.  
  320. Game_Battler.prototype.set_patb_colors_cooldown =
  321. Game_Battler.prototype.set_patb_colors;
  322. Game_Battler.prototype.set_patb_colors = function(type) { // Potential Hotspot
  323.     // Added
  324.     if (type === "cooldown") {
  325.         return this.set_patb_cooldown_colors();
  326.     }
  327.     //
  328.     this.set_patb_colors_cooldown(type);
  329. }; // Game_Battler.prototype.set_patb_colors
  330.  
  331. Game_Battler.prototype.reset_patb_cooldown = Game_Battler.prototype.reset_patb;
  332. Game_Battler.prototype.reset_patb = function() { // New
  333.     this.reset_patb_cooldown_val(); // Added
  334.     this.reset_patb_cooldown();
  335. }; // Game_Battler.prototype.reset_patb
  336.  
  337. Game_Battler.prototype.can_patb_act_cooldown =
  338. Game_Battler.prototype.can_patb_act;
  339. Game_Battler.prototype.can_patb_act = function() { // Hotspot
  340.     // Rewritten
  341.     return this.can_patb_act_cooldown() && this.has_empty_patb_cooldown();
  342.     //
  343. }; // Game_Battler.prototype.can_patb_act
  344.  
  345. Game_Battler.prototype.patb_type_cooldown = Game_Battler.prototype.patb_type;
  346. Game_Battler.prototype.patb_type = function() { // Hotspot
  347.     // Rewritten
  348.     return this.is_patb_cooldown() ? "cooldown" : this.patb_type_cooldown();
  349.     //
  350. }; // Game_Battler.prototype.patb_type_cooldown
  351.  
  352. Game_Battler.prototype.patb_bar_text_cooldown =
  353. Game_Battler.prototype.patb_bar_text;
  354. Game_Battler.prototype.patb_bar_text = function() { // v1.01a+; Hotspot
  355.     // Added
  356.     if (this.is_patb_cooldown()) { return this.patb_cooldown_bar_text(); }
  357.     //
  358.     return this.patb_bar_text_cooldown();
  359. }; // Game_Battler.prototype.patb_bar_text
  360.  
  361. /* cap: The atb value cap stopping further atb value updates
  362.  * sign: The atb value update direction sign
  363.  */
  364. Game_Battler.prototype.update_patb_cooldown = function(cap, sign) {
  365. // New; Hotspot
  366.     var last_val = this._patb_val.cooldown;
  367.     this._patb_val.cooldown -= this.get_patb_cooldown_rate() * sign;
  368.     this._patb_val_change.cooldown = last_val !== this._patb_val.cooldown;
  369.     if (this._patb_val.cooldown * sign <= (this._max_patb_val - cap) * sign) {
  370.         this.process_post_patb_cooldown(cap, sign);
  371.     }
  372. }; // Game_Battler.prototype.update_patb_cooldown
  373.  
  374. Game_Battler.prototype.get_patb_cooldown_rate = function() {
  375. // New; Hotspot
  376.     if (this.can_patb_cooldown_rate_change()) {
  377.         this._patb_rate.cooldown = this.set_patb_cooldown_rate();
  378.     }
  379.     return this._patb_rate.cooldown;
  380. }; // Game_Battler.prototype.get_patb_cooldown_rate
  381.  
  382. Game_Battler.prototype.can_patb_cooldown_rate_change = function() {
  383. // New; Hotspot
  384.     if (this._patb_rate.atb !== this.get_patb_rate()) { return true; }
  385.     return this.are_patb_battler_changed("cooldown_rate");
  386. }; // Game_Battler.prototype.can_patb_cooldown_rate_change
  387.  
  388. Game_Battler.prototype.set_patb_cooldown_rate = function() {
  389. // New; Potential Hotspot
  390.     var c = this._patb_cooldown_item.meta.patb_cooldown;
  391.     var r = this._patb_rate.atb, s = this._patb_cooldown_item.speed * c.scale;
  392.     switch (c.code) {
  393.         case "set": return s;
  394.         case "add": return Math.abs(r + s);
  395.         case "multiply":
  396.             return s > 0 ? r * s : s < 0 ? r / -s : this._max_patb_val;
  397.         default:
  398.             console.log("Invalid code " + c.code + " as notetag values");
  399.             return this._max_patb_val;
  400.     }
  401. }; // Game_Battler.prototype.set_patb_cooldown_rate
  402.  
  403. /* cap: The atb value cap stopping further atb value updates
  404.  * sign: The atb value update direction sign
  405.  */
  406. Game_Battler.prototype.process_post_patb_cooldown = function(cap, sign) {
  407. // v1.01a+; New
  408.     this._patb_val.cooldown = this._max_patb_val - cap;
  409.     $gameTemp.call_patb_event("post_cooldown");
  410.     this.set_patb_refresh();
  411.     // Caches the next action if there's any or process all actions end
  412.     if (!this._actions[0]) { return this.onAllActionsEnd(); }
  413.     this._patb_cooldown_item = this._actions[0].item();
  414.     //
  415. }; // Game_Battler.prototype.process_post_patb_cooldown
  416.  
  417. Game_Battler.prototype.reset_patb_cooldown_val = function() { // New
  418.     this._patb_cooldown_item = null;
  419.     this._patb_val_change.cooldown = true;
  420.     if ($gameSystem.patb.atb_fill_code === "delay") {
  421.         return this._patb_val.cooldown = this._max_patb_val;
  422.     }
  423.     this._patb_val.cooldown = 0;
  424. }; // Game_Battler.prototype.reset_patb_cooldown_val
  425.  
  426. Game_Battler.prototype.has_empty_patb_cooldown = function() { // New; Hotspot
  427.     if ($gameSystem.patb.atb_fill_code === "delay") {
  428.         return this._patb_val.cooldown >= this._max_patb_val;
  429.     }
  430.     return this._patb_val.cooldown <= 0;
  431. }; // Game_Battler.prototype.has_empty_patb_cooldown
  432.  
  433. Game_Battler.prototype.is_patb_cooldown = function() { // New; Hotspot
  434.     if ($gameSystem.patb.atb_fill_code === "delay") {
  435.         return this._patb_val.cooldown < this._max_patb_val;
  436.     }
  437.     return this._patb_val.cooldown > 0;
  438. }; // Game_Battler.prototype.is_patb_cooldown
  439.  
  440. Game_Battler.prototype.set_patb_cooldown_colors = function() {
  441. // New; Potential Hotspot
  442.     if (this._patb_cooldown_item) {
  443.         var colors = this._patb_cooldown_item.meta.patb_cooldown_colors;
  444.         this._patb_colors.cooldown = colors;
  445.     }
  446.     if (this._patb_colors.cooldown) { return; }
  447.     var patb = $gameSystem.patb;
  448.     this._patb_colors.cooldown = [patb.cooldown_c1, patb.cooldown_c2];
  449. }; // Game_Battler.prototype.set_patb_cooldown_colors
  450.  
  451. Game_Battler.prototype.set_patb_cooldown = function() { // New
  452.     this.set_patb_refresh();
  453.     this.mark_patb_cooldown_change();
  454.     if ($gameSystem.patb.atb_fill_code === "delay") {
  455.         return this._patb_val.cooldown = 0;
  456.     }
  457.     this._patb_val.cooldown = this._max_patb_val;
  458. }; // Game_Battler.prototype.set_patb_cooldown
  459.  
  460. Game_Battler.prototype.set_patb_cooldown_meta = function() { // New
  461.     this.mark_patb_cooldown_change();
  462.     this._patb_cooldown_item = this._actions[0].item();
  463. }; // Game_Battler.prototype.set_patb_cooldown_meta
  464.  
  465. Game_Battler.prototype.mark_patb_cooldown_change = function() { // v1.01a+; New
  466.     this._patb_note_change.cooldown_color = true;
  467.     this._patb_note_change.cooldown_rate = true;
  468.     this._patb_note_change.cooldown_text = true;
  469.     this._patb_val_change.cooldown = true;
  470. }; // Game_Battler.prototype.mark_patb_cooldown_change
  471.  
  472. Game_Battler.prototype.patb_cooldown_bar_text = function() {
  473. // v1.01a+; New; Hotspot
  474.     if (this.are_patb_battler_changed("cooldown_text")) {
  475.         this.set_patb_cooldown_bar_text();
  476.     }
  477.     return this._patb_cooldown_text;
  478. }; // Game_Battler.prototype.patb_cooldown_bar_text
  479.  
  480. Game_Battler.prototype.set_patb_cooldown_bar_text = function() {
  481. // v1.01a+; New; Potential Hotspot
  482.     if (this._patb_cooldown_item) {
  483.         var text = this._patb_cooldown_item.meta.patb_cooldown_text;
  484.         if (text) { return this._patb_cooldown_text = text; }
  485.         if ($gameSystem.patb.cooldown_bar_text === "item") {
  486.             return this._patb_cooldown_text = this._patb_cooldown_item.name;
  487.         }
  488.     }
  489.     this._patb_cooldown_text = $gameSystem.patb.atb_bar_text;
  490. }; // Game_Battler.prototype.set_patb_cooldown_bar_text
  491.  
  492. /*----------------------------------------------------------------------------
  493.  *    # Edit class: Game_Actor                                                
  494.  *----------------------------------------------------------------------------*/
  495.  
  496. Game_Actor.prototype.confirm_patb_cooldown_act =
  497. Game_Actor.prototype.confirm_patb_act;
  498. Game_Actor.prototype.confirm_patb_act = function() { // v1.01b+
  499.     this.confirm_patb_cooldown_act();
  500.     this.set_patb_cooldown_meta(); // Added
  501. }; // Game_Actor.prototype.confirm_patb_act
  502.  
  503. Game_Actor.prototype.confirm_patb_cooldown_acts =
  504. Game_Actor.prototype.confirm_patb_acts;
  505. Game_Actor.prototype.confirm_patb_acts = function() {
  506.     this.confirm_patb_cooldown_acts();
  507.     this.set_patb_cooldown_meta(); // Added
  508. }; // Game_Actor.prototype.confirm_patb_acts
  509.  
  510. /*----------------------------------------------------------------------------
  511.  *    # Edit class: Game_Enemy                                                
  512.  *----------------------------------------------------------------------------*/
  513.  
  514. Game_Enemy.prototype.makeActionsPatbCooldown = Game_Enemy.prototype.makeActions;
  515. Game_Enemy.prototype.makeActions = function() {
  516.     this.makeActionsPatbCooldown();
  517.     if ($gameSystem.is_patb()) { this.set_patb_cooldown_meta(); } // Added
  518. }; // Game_Enemy.prototype.makeActions
  519.  
  520. /*----------------------------------------------------------------------------*/
  521.  
  522. } else {
  523.     alert("To use PATB Cooldown, place it below PATB Core.");
  524. }
  525.  
  526. /*============================================================================*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement