Skip to content

Commit

Permalink
Fix Salt Cure script (#5895)
Browse files Browse the repository at this point in the history
Co-authored-by: ghoulslash <[email protected]>
  • Loading branch information
ghoulslash and ghoulslash authored Dec 29, 2024
1 parent 433058e commit ca31145
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
11 changes: 3 additions & 8 deletions data/battle_scripts_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -407,13 +407,13 @@ BattleScript_SaltCureExtraDamage::
call BattleScript_HurtTarget_NoString
printstring STRINGID_TARGETISHURTBYSALTCURE
waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_TARGET
end2

BattleScript_HurtTarget_NoString:
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
tryfaintmon BS_TARGET
return

BattleScript_EffectCorrosiveGas::
Expand Down Expand Up @@ -7582,13 +7582,8 @@ BattleScript_AbilityPopUp:
return

BattleScript_AbilityPopUpScripting:
.if B_ABILITY_POP_UP == TRUE
showabilitypopup BS_SCRIPTING
pause 40
.endif
recordability BS_SCRIPTING
sethword sABILITY_OVERWRITE, 0
return
copybyte gBattlerAbility, sBATTLER
goto BattleScript_AbilityPopUp

BattleScript_AbilityPopUpOverwriteThenNormal:
setbyte sFIXED_ABILITY_POPUP, TRUE
Expand Down
15 changes: 15 additions & 0 deletions test/battle/move_effect/salt_cure.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,18 @@ SINGLE_BATTLE_TEST("Salt Cure residual damage does not inflict any damage agains
}
}
}

SINGLE_BATTLE_TEST("If Salt Cure faints the target, messages will be applied in the correct order")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET) { HP(25); }
} WHEN {
TURN { MOVE(player, MOVE_SALT_CURE); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_SALT_CURE, player);
MESSAGE("The opposing Wobbuffet is being salt cured!");
MESSAGE("The opposing Wobbuffet is hurt by Salt Cure!");
MESSAGE("The opposing Wobbuffet fainted!");
}
}

0 comments on commit ca31145

Please sign in to comment.