Fixes Wandering Spirit overwriting battlers (#7407)

This commit is contained in:
Alex 2025-07-25 19:26:12 +02:00 committed by GitHub
parent 845838bbc0
commit 38964e4f0a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 0 deletions

View File

@ -8189,6 +8189,8 @@ BattleScript_MummyActivates::
return
BattleScript_WanderingSpiritActivates::
saveattacker
savetarget
.if B_ABILITY_POP_UP == TRUE
copybyte gBattlerAbility, gBattlerTarget
sethword sABILITY_OVERWRITE, ABILITY_WANDERING_SPIRIT
@ -8205,6 +8207,8 @@ BattleScript_WanderingSpiritActivates::
jumpiffainted BS_TARGET, TRUE, BattleScript_WanderingSpiritActivatesRet
switchinabilities BS_TARGET
BattleScript_WanderingSpiritActivatesRet:
restoreattacker
restoretarget
return
BattleScript_TargetsStatWasMaxedOut::

View File

@ -232,3 +232,21 @@ DOUBLE_BATTLE_TEST("Eject Button activation will not trigger an attack from the
}
}
}
SINGLE_BATTLE_TEST("Eject Button activates after Wandring Spirit")
{
GIVEN {
PLAYER(SPECIES_EKANS) { Ability(ABILITY_INTIMIDATE); }
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_YAMASK_GALAR) { Item(ITEM_EJECT_BUTTON); Ability(ABILITY_WANDERING_SPIRIT); }
} WHEN {
TURN {
SWITCH(opponent, 1);
MOVE(player, MOVE_DRAGON_CLAW);
SEND_OUT(opponent, 0);
}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAGON_CLAW, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, opponent);
}
}