2022-12-24 06:13:42 +01:00
|
|
|
#include "global.h"
|
2023-08-12 21:00:15 +02:00
|
|
|
#include "test/battle.h"
|
2022-12-24 06:13:42 +01:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|