mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-26 08:46:55 +00:00
Adding clause so right Pokemon in double battle cannot target itself with a spread move when left one dies with no replacement (#1370)
This commit is contained in:
parent
93c91bf73a
commit
ae0cd86bc3
@ -2646,8 +2646,14 @@ export class MoveEffectPhase extends PokemonPhase {
|
||||
|
||||
constructor(scene: BattleScene, battlerIndex: BattlerIndex, targets: BattlerIndex[], move: PokemonMove) {
|
||||
super(scene, battlerIndex);
|
||||
|
||||
this.move = move;
|
||||
// In double battles, if the right Pokemon selects a spread move and the left Pokemon dies
|
||||
// with no party members available to switch in, then the right Pokemon takes the index
|
||||
// of the left Pokemon and gets hit unless this is checked.
|
||||
if (targets.includes(battlerIndex) && this.move.getMove().moveTarget === MoveTarget.ALL_NEAR_OTHERS) {
|
||||
const i = targets.indexOf(battlerIndex);
|
||||
targets.splice(i,i+1);
|
||||
}
|
||||
this.targets = targets;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user