/*: @target MZ @plugindesc v1.0.0 - Stack the same state @author TheoAllen @url https://github.com/theoallen/RMMZ/tree/master/Plugins @help ♦ About: Stack the same state multiple times ♦ How to use: Tag the state with n = maximum stack you can place. ♦ Terms of Use: - https://github.com/theoallen/RMMZ/blob/master/README.md */ // v1.0.1 - Fixed bug that makes the state stack indefinitely. var Theo = Theo || {} Theo.StackingStates = function(){ const $ = Theo.StackingStates $._version = '1.0.1' // Remove duplicates if(!Array.prototype.uniq){ Array.prototype.uniq = function() { const copy = this.concat(); const len = copy.length for(var i=0; i { return id === stateId}).length } // Overwrite Game_Battler.prototype.updateStateTurns = function() { const updated = [] for (const stateId of this._states) { if (this._stateTurns[stateId] > 0 && !updated.includes(stateId)) { this._stateTurns[stateId]--; updated.push(stateId) } } }; } Theo.StackingStates()