mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-29 05:40:41 +01:00
f1b9872bf0
Thank you to SBird for providing mgba-rom-test binaries and Spikes/Toxic Spikes tests! Co-authored-by: sbird <sbird@no.tld>
48 lines
1.4 KiB
C
48 lines
1.4 KiB
C
#include "global.h"
|
|
#include "test_battle.h"
|
|
|
|
SINGLE_BATTLE_TEST("Sturdy prevents OHKO moves")
|
|
{
|
|
GIVEN {
|
|
ASSUME(gBattleMoves[MOVE_FISSURE].effect == EFFECT_OHKO);
|
|
PLAYER(SPECIES_GEODUDE) { Ability(ABILITY_STURDY); }
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_FISSURE); }
|
|
} SCENE {
|
|
MESSAGE("Foe Wobbuffet used Fissure!");
|
|
ABILITY_POPUP(player, ABILITY_STURDY);
|
|
MESSAGE("Geodude was protected by Sturdy!");
|
|
} THEN {
|
|
EXPECT_EQ(player->hp, player->maxHP);
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Sturdy prevents OHKOs")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_GEODUDE) { Ability(ABILITY_STURDY); MaxHP(100); HP(100); }
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_SEISMIC_TOSS); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_SEISMIC_TOSS, opponent);
|
|
HP_BAR(player, hp: 1);
|
|
ABILITY_POPUP(player, ABILITY_STURDY);
|
|
MESSAGE("Geodude endured the hit using Sturdy!");
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Sturdy does not prevent non-OHKOs")
|
|
{
|
|
GIVEN {
|
|
PLAYER(SPECIES_GEODUDE) { Ability(ABILITY_STURDY); MaxHP(100); HP(99); }
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_SEISMIC_TOSS); }
|
|
} SCENE {
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_SEISMIC_TOSS, opponent);
|
|
HP_BAR(player, hp: 0);
|
|
}
|
|
}
|