Fixes Eject Pack softlocking the game (#4387)
This commit is contained in:
parent
a8a8344ba2
commit
5bf6a252b5
2 changed files with 18 additions and 0 deletions
|
@ -7260,6 +7260,7 @@ u8 ItemBattleEffects(u8 caseID, u32 battler, bool32 moveTurn)
|
||||||
case HOLD_EFFECT_EJECT_PACK:
|
case HOLD_EFFECT_EJECT_PACK:
|
||||||
if (gProtectStructs[battler].statFell
|
if (gProtectStructs[battler].statFell
|
||||||
&& gProtectStructs[battler].disableEjectPack == 0
|
&& 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
|
&& !(gCurrentMove == MOVE_PARTING_SHOT && CanBattlerSwitch(gBattlerAttacker))) // Does not activate if attacker used Parting Shot and can switch out
|
||||||
{
|
{
|
||||||
gProtectStructs[battler].statFell = FALSE;
|
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!");
|
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…
Reference in a new issue