I'm working on a small snippet to allow custom targeting scopes for individual skills.
However, I haven't been able to figure out how to evaluate if a specific skill is in use.
Game_Unit.prototype.scopeMembers = function() { // This works return this.members().filter(function(member) { return member.isStateAffected(80); });};Game_Action.prototype.targetsForOpponents = function() { var targets = []; var unit = this.opponentsUnit(); if (this.isForRandom()) { for (var i = 0; i < this.numTargets(); i++) { targets.push(unit.randomTarget()); } } else if (this.isForOne()) { if (this._targetIndex < 0) { targets.push(unit.randomTarget()); } else { targets.push(unit.smoothTarget(this._targetIndex)); } // This doesn't run because I'm not correctly identifying the skill } else if (this.item === $dataSkills[165]) { console.log("Test"); targets = unit.scopeMembers(); } else { targets = unit.aliveMembers(); } return targets;};Edit: figured this out.
However, I haven't been able to figure out how to evaluate if a specific skill is in use.
Game_Unit.prototype.scopeMembers = function() { // This works return this.members().filter(function(member) { return member.isStateAffected(80); });};Game_Action.prototype.targetsForOpponents = function() { var targets = []; var unit = this.opponentsUnit(); if (this.isForRandom()) { for (var i = 0; i < this.numTargets(); i++) { targets.push(unit.randomTarget()); } } else if (this.isForOne()) { if (this._targetIndex < 0) { targets.push(unit.randomTarget()); } else { targets.push(unit.smoothTarget(this._targetIndex)); } // This doesn't run because I'm not correctly identifying the skill } else if (this.item === $dataSkills[165]) { console.log("Test"); targets = unit.scopeMembers(); } else { targets = unit.aliveMembers(); } return targets;};Edit: figured this out.