mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-27 12:14:20 +01:00
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);
|
|
}
|
|
}
|