mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-09-07 16:55:29 -05:00
Deprecate decision.targetSide/targetPosition
These are no longer used; we now only use targetLoc.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user