//============================================================================= // Continuumg - Set All Self Switches Snippet // ContinuumSASS.js //============================================================================= /*: * @plugindesc Use the Plugin Command 'setallselfswitches x y' where x is A B C or D and y is true or false. * @author continuumg */ (function() { Game_SelfSwitches.prototype.deactivateAllKeys = function(key) { Object.keys(this._data).forEach(function(swch) { if (swch[swch.length-1] === key) { $gameSelfSwitches.setValue(swch,false) } }) this.onChange(); }; Game_SelfSwitches.prototype.activateAllKeys = function(key) { for (var mapId = 1; mapId < 999; mapId++) { for (var eventId = 1; eventId < 999; eventId++) { $gameSelfSwitches.setValue([mapId, eventId, key], true); } } this.onChange(); }; continuum_setAllSwitch_plug = Game_Interpreter.prototype.pluginCommand; Game_Interpreter.prototype.pluginCommand = function(command, args) { continuum_setAllSwitch_plug.call(this, command, args); if (command.toUpperCase() === 'SETALLSELFSWITCHES') { var key = String(args[0]).toUpperCase(); var value = eval(args[1]); if (value) { $gameSelfSwitches.activateAllKeys(key); } else { $gameSelfSwitches.deactivateAllKeys(key); } } }; })(); // dont touch this.