Fixes Gulp Missile freezing the game if when attacker fainted

This commit is contained in:
AlexOn1ine 2025-04-17 19:46:16 +02:00
parent 4528bbe01d
commit 2d1b2f28c4
3 changed files with 12 additions and 0 deletions

View File

@ -17993,6 +17993,7 @@ void BS_TryActivateGulpMissile(void)
if (!(gBattleStruct->moveResultFlags[gBattlerTarget] & MOVE_RESULT_NO_EFFECT)
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg
&& IsBattlerAlive(gBattlerAttacker)
&& IsBattlerTurnDamaged(gBattlerTarget)
&& gBattleMons[gBattlerTarget].species != SPECIES_CRAMORANT
&& GetBattlerAbility(gBattlerTarget) == ABILITY_GULP_MISSILE)

View File

@ -6092,6 +6092,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg
&& IsBattlerTurnDamaged(gBattlerTarget)
&& IsBattlerAlive(battler)
&& IsBattlerAlive(gBattlerAttacker)
&& gBattleMons[gBattlerTarget].species != SPECIES_CRAMORANT)
{
if (GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD)

View File

@ -190,3 +190,13 @@ SINGLE_BATTLE_TEST("(Gulp Missile) Transformed Cramorant Gulping lowers defense
HP_BAR(opponent);
}
}
SINGLE_BATTLE_TEST("Gulp Missile triggered by explosion doesn't freeze the game")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_CRAMORANT);
} WHEN {
TURN { MOVE(opponent, MOVE_SURF); MOVE(player, MOVE_EXPLOSION); }
}
}