Deprecate decision.targetSide/targetPosition

These are no longer used; we now only use targetLoc.
This commit is contained in:
Guangcong Luo
2016-12-26 17:02:11 -05:00
parent b931969e11
commit bf4e3df3b8
5 changed files with 6 additions and 9 deletions

View File

@@ -4166,10 +4166,9 @@ class Battle extends Tools.BattleDex {
if (decision.move) {
let target;
if (!decision.targetPosition) {
if (!decision.targetLoc) {
target = this.resolveTarget(decision.pokemon, decision.move);
decision.targetSide = target.side;
decision.targetPosition = target.position;
decision.targetLoc = this.getTargetLoc(target, decision.pokemon);
}
decision.move = this.getMoveCopy(decision.move);

View File

@@ -419,8 +419,6 @@ exports.BattleAbilities = {
const decision = this.willMove(target);
if (decision && decision.move.id === 'curse') {
decision.targetLoc = -1;
decision.targetSide = target.side;
decision.targetPosition = 0;
}
}
}

View File

@@ -17659,8 +17659,6 @@ exports.BattleMovedex = {
const decision = this.willMove(target);
if (decision && decision.move.id === 'curse') {
decision.targetLoc = -1;
decision.targetSide = target.side;
decision.targetPosition = 0;
}
}
},

View File

@@ -70,7 +70,8 @@ exports.BattleScripts = {
// It deals with the beforeMove and AfterMoveSelf events.
// This leads with partial trapping moves shennanigans after the move has been used.
// It also deals with how PP reduction works on gen 1.
runMove: function (move, pokemon, target, sourceEffect) {
runMove: function (move, pokemon, targetLoc, sourceEffect) {
let target = this.getTarget(pokemon, move, targetLoc);
move = this.getMove(move);
if (!target) target = this.resolveTarget(pokemon, move);
if (target.subFainted) delete target.subFainted;

View File

@@ -62,7 +62,8 @@ exports.BattleScripts = {
},
},
// Battle scripts.
runMove: function (move, pokemon, target, sourceEffect) {
runMove: function (move, pokemon, targetLoc, sourceEffect) {
let target = this.getTarget(pokemon, move, targetLoc);
if (!sourceEffect && toId(move) !== 'struggle') {
let changedMove = this.runEvent('OverrideDecision', pokemon, target, move);
if (changedMove && changedMove !== true) {