pokeemerald/test/battle/move_flags/strike_count.c

73 lines
2.3 KiB
C
Raw Normal View History

2023-05-02 21:06:21 +02:00
#include "global.h"
#include "test/battle.h"
2023-05-02 21:06:21 +02:00
2023-07-28 13:20:06 +02:00
SINGLE_BATTLE_TEST("Two strike count turns a move into a 2-hit move")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_DOUBLE_KICK].strikeCount == 2);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_DOUBLE_KICK); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_DOUBLE_KICK, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_DOUBLE_KICK, player);
MESSAGE("Hit 2 time(s)!");
}
}
SINGLE_BATTLE_TEST("Three strike count turns a move into a 3-hit move")
2023-05-02 21:06:21 +02:00
{
s16 firstHit;
s16 secondHit;
s16 thirdHit;
GIVEN {
ASSUME(gBattleMoves[MOVE_TRIPLE_DIVE].strikeCount == 3);
2023-05-02 21:06:21 +02:00
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_TRIPLE_DIVE); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_TRIPLE_DIVE, player);
HP_BAR(opponent, captureDamage: &firstHit);
ANIMATION(ANIM_TYPE_MOVE, MOVE_TRIPLE_DIVE, player);
HP_BAR(opponent, captureDamage: &secondHit);
ANIMATION(ANIM_TYPE_MOVE, MOVE_TRIPLE_DIVE, player);
HP_BAR(opponent, captureDamage: &thirdHit);
2023-04-26 12:12:41 +02:00
} THEN {
2023-05-02 21:06:21 +02:00
EXPECT_EQ(firstHit, secondHit);
EXPECT_EQ(secondHit, thirdHit);
EXPECT_EQ(firstHit, thirdHit);
}
}
SINGLE_BATTLE_TEST("Surging Strikes hits 3 times with each hit being a critical hit")
{
s16 firstHit;
s16 secondHit;
s16 thirdHit;
GIVEN {
ASSUME(gBattleMoves[MOVE_SURGING_STRIKES].strikeCount == 3);
2023-05-02 21:06:21 +02:00
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_SURGING_STRIKES); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_SURGING_STRIKES, player);
HP_BAR(opponent, captureDamage: &firstHit);
MESSAGE("A critical hit!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_SURGING_STRIKES, player);
HP_BAR(opponent, captureDamage: &secondHit);
MESSAGE("A critical hit!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_SURGING_STRIKES, player);
HP_BAR(opponent, captureDamage: &thirdHit);
MESSAGE("A critical hit!");
2023-04-26 12:12:41 +02:00
} THEN {
2023-05-02 21:06:21 +02:00
EXPECT_EQ(firstHit, secondHit);
EXPECT_EQ(secondHit, thirdHit);
EXPECT_EQ(firstHit, thirdHit);
}
}