Hakuryo.Parameters = PluginManager.parameters('SwitchEnemyScope');Hakuryo.Param = Hakuryo.Param || {};Hakuryo.SES.defaulScope =[];Hakuryo.SES.newScope;Hakuryo.SES.skills = [];Hakuryo.SES.currentskill = 1;//Hakuryo.Param.Variable = String(Yanfly.Parameters['Variable']);//=============================================================================// DataManager//=============================================================================Hakuryo.SES.canSwitchScope = function(obj) { var notedata = obj.note.split(/[\r\n]+/); for (var i = 0; i < notedata.length; i++) { var line = notedata[i]; if (line.match(/<MULTIPLE>/i)) { return true; } } return false;};//=============================================================================// Plugin Code//=============================================================================Input.keyMapper = { 9: 'tab', // tab 13: 'ok', // enter 16: 'shift', // shift 17: 'control', // control 18: 'control', // alt 27: 'escape', // escape 32: 'ok', // space 33: 'pageup', // pageup 34: 'pagedown', // pagedown 37: 'left', // left arrow 38: 'up', // up arrow 39: 'right', // right arrow 40: 'down', // down arrow 45: 'escape', // insert 66: 'toggleAll',// B 81: 'pageup', // Q 87: 'pagedown', // W 88: 'escape', // X 90: 'ok', // Z 96: 'escape', // numpad 0 98: 'down', // numpad 2 100: 'left', // numpad 4 102: 'right', // numpad 6 104: 'up', // numpad 8 120: 'debug' // F9};Window_Selectable.prototype.processHandling = function () { if (this.isOpenAndActive()) { if (this.isOkEnabled() && this.isOkTriggered()) { this.processOk(); } else if (this.isCancelEnabled() && this.isCancelTriggered()) { this.processCancel(); } else if (this.isHandled('pagedown') && Input.isTriggered('pagedown')) { this.processPagedown(); } else if (this.isHandled('pageup') && Input.isTriggered('pageup')) { this.processPageup(); } else if (this.isSwitchScopeTriggered()) { this.processSwitchToggle(); } }};//set key toggleAll triggerWindow_Selectable.prototype.isSwitchScopeTriggered = function () { return Input.isRepeated('toggleAll');};//process acrion on key input 'toggle all'Window_Selectable.prototype.processSwitchToggle = function () { if (this.isCurrentItemEnabled() && Hakuryo.SES.canSwitchScope($dataSkills[Hakuryo.SES.currentskill])) { if (this.active && this instanceof Window_BattleEnemy) { SoundManager.playCursor(); Hakuryo.SES.defaulScope.push($dataSkills[Hakuryo.SES.currentskill].scope); $dataSkills[Hakuryo.SES.currentskill].scope = $dataSkills[Hakuryo.SES.currentskill].scope === 1 ? 2 : 1; this.refresh(); this.reselect(); } } else { this.playBuzzerSound(); }};Scene_Battle.prototype.onSkillOk = function() { var skill = this._skillWindow.item(); var action = BattleManager.inputtingAction(); // gettting current skill id Hakuryo.SES.skills.push(skill.id); Hakuryo.SES.currentskill = skill.id; action.setSkill(skill.id); BattleManager.actor().setLastBattleSkill(skill); this.onSelectAction();};