Fixes Eject Pack softlocking the game (#4387)
This commit is contained in:
parent
a8a8344ba2
commit
5bf6a252b5
@ -7260,6 +7260,7 @@ u8 ItemBattleEffects(u8 caseID, u32 battler, bool32 moveTurn)
|
||||
case HOLD_EFFECT_EJECT_PACK:
|
||||
if (gProtectStructs[battler].statFell
|
||||
&& gProtectStructs[battler].disableEjectPack == 0
|
||||
&& CountUsablePartyMons(battler) > 0
|
||||
&& !(gCurrentMove == MOVE_PARTING_SHOT && CanBattlerSwitch(gBattlerAttacker))) // Does not activate if attacker used Parting Shot and can switch out
|
||||
{
|
||||
gProtectStructs[battler].statFell = FALSE;
|
||||
|
||||
@ -24,3 +24,20 @@ SINGLE_BATTLE_TEST("Eject Pack does not cause the new pokemon to lose hp due to
|
||||
NOT MESSAGE("Wynaut was hurt by its Life Orb!");
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Eject Pack does not activate if there are no pokemon left to battle")
|
||||
{
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_EJECT_PACK); }
|
||||
PLAYER(SPECIES_WOBBUFFET) { HP(0); }
|
||||
OPPONENT(SPECIES_EKANS) { Ability(ABILITY_INTIMIDATE); }
|
||||
} WHEN {
|
||||
TURN { }
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
|
||||
NONE_OF {
|
||||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
|
||||
MESSAGE("Wobbuffet is switched out with the Eject Pack!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user