diff --git a/battle-engine.js b/battle-engine.js index 08436d788d..8173dec9d9 100644 --- a/battle-engine.js +++ b/battle-engine.js @@ -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); diff --git a/data/abilities.js b/data/abilities.js index 8dae90f1c0..2bd9801d5d 100644 --- a/data/abilities.js +++ b/data/abilities.js @@ -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; } } } diff --git a/data/moves.js b/data/moves.js index 4879855812..882201e939 100644 --- a/data/moves.js +++ b/data/moves.js @@ -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; } } }, diff --git a/mods/gen1/scripts.js b/mods/gen1/scripts.js index 9a815df567..17d24119ce 100644 --- a/mods/gen1/scripts.js +++ b/mods/gen1/scripts.js @@ -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; diff --git a/mods/gen2/scripts.js b/mods/gen2/scripts.js index 813a9c5bd3..b52d67d7ce 100644 --- a/mods/gen2/scripts.js +++ b/mods/gen2/scripts.js @@ -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) {