pokeemerald/test/battle/move_effect/salt_cure.c
Alex 36174f12ae
Fixes Salt Cure visual bug if mon fainted by direct attack (#3388)
* Fixes Salt Cure visual bug if mon fainted by direct attack

* Removes duplicate give all tm/hms in the debug menu

* test

* Revert "Removes duplicate give all tm/hms in the debug menu"

This reverts commit 4e80451d6f5898799ef9b887a068dc1e1a3df56e.
2023-10-09 23:40:38 +02:00

87 lines
2.7 KiB
C

#include "global.h"
#include "test/battle.h"
ASSUMPTIONS
{
ASSUME(gBattleMoves[MOVE_SALT_CURE].effect == EFFECT_SALT_CURE);
}
SINGLE_BATTLE_TEST("Salt Cure inflicts 1/8 of the target's maximum HP as damage per turn")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_SALT_CURE); }
for (i = 0; i < 3; i++)
TURN {}
} SCENE {
s32 maxHP = GetMonData(&OPPONENT_PARTY[0], MON_DATA_MAX_HP);
ANIMATION(ANIM_TYPE_MOVE, MOVE_SALT_CURE, player);
MESSAGE("Foe Wobbuffet is being salt cured!");
for (i = 0; i < 4; i++) {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SALT_CURE_DAMAGE, opponent);
HP_BAR(opponent, damage: maxHP / 8);
MESSAGE("Foe Wobbuffet is hurt by Salt Cure!");
}
}
}
SINGLE_BATTLE_TEST("Salt Cure inflicts 1/4 to Water/Steel types of their maximum HP as damage per turn")
{
u32 species;
PARAMETRIZE { species = SPECIES_LAPRAS; };
PARAMETRIZE { species = SPECIES_JIRACHI; };
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(species);
} WHEN {
TURN { MOVE(player, MOVE_SALT_CURE); }
TURN {}
} SCENE {
s32 maxHP = GetMonData(&OPPONENT_PARTY[0], MON_DATA_MAX_HP);
ANIMATION(ANIM_TYPE_MOVE, MOVE_SALT_CURE, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SALT_CURE_DAMAGE, opponent);
HP_BAR(opponent, damage: maxHP / 4);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SALT_CURE_DAMAGE, opponent);
HP_BAR(opponent, damage: maxHP / 4);
}
}
SINGLE_BATTLE_TEST("Salt Cure is removed when the afflicted Pokémon is switched out")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WYNAUT);
} WHEN {
TURN { MOVE(player, MOVE_SALT_CURE); }
TURN { SWITCH(opponent, 1); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_SALT_CURE, player);
MESSAGE("Foe Wobbuffet is being salt cured!");
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SALT_CURE_DAMAGE, opponent);
MESSAGE("Foe Wobbuffet is hurt by Salt Cure!");
NONE_OF {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SALT_CURE_DAMAGE, opponent);
MESSAGE("Foe Wobbuffet is hurt by Salt Cure!");
}
}
}
SINGLE_BATTLE_TEST("If Salt Cure faints the target no status will be applied")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET) { HP(1); }
} WHEN {
TURN { MOVE(player, MOVE_SALT_CURE); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_SALT_CURE, player);
NOT MESSAGE("Foe Wobbuffet is being salt cured!");
MESSAGE("Foe Wobbuffet fainted!");
}
}