2023-04-28 11:38:34 +01:00
|
|
|
#include "global.h"
|
2023-08-12 20:00:15 +01:00
|
|
|
#include "test/battle.h"
|
2023-04-28 11:38:34 +01:00
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Frostbite reduces the special attack by 50 percent")
|
|
|
|
{
|
|
|
|
s16 reducedDamage;
|
|
|
|
s16 normaleDamage;
|
|
|
|
|
|
|
|
GIVEN {
|
2024-01-29 11:51:32 +00:00
|
|
|
ASSUME(gMovesInfo[MOVE_SWIFT].category == DAMAGE_CATEGORY_SPECIAL);
|
2023-04-28 11:38:34 +01:00
|
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET) { Status1(STATUS1_FROSTBITE); }
|
|
|
|
} WHEN {
|
2023-04-28 11:47:30 +01:00
|
|
|
TURN { MOVE(opponent, MOVE_SWIFT); MOVE(player, MOVE_FLAME_WHEEL); }
|
2023-04-28 11:38:34 +01:00
|
|
|
TURN { MOVE(opponent, MOVE_SWIFT); }
|
|
|
|
} SCENE {
|
|
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_SWIFT, opponent);
|
|
|
|
HP_BAR(player, captureDamage: &reducedDamage);
|
2023-04-28 11:47:30 +01:00
|
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_FLAME_WHEEL, player);
|
2023-04-28 11:38:34 +01:00
|
|
|
HP_BAR(opponent);
|
|
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_SWIFT, opponent);
|
|
|
|
HP_BAR(player, captureDamage: &normaleDamage);
|
2023-04-28 11:47:30 +01:00
|
|
|
} THEN { EXPECT_EQ(reducedDamage * 2, normaleDamage); }
|
2023-04-28 11:38:34 +01:00
|
|
|
}
|
|
|
|
|
2024-10-11 22:47:46 +01:00
|
|
|
SINGLE_BATTLE_TEST("Frostbite deals 1/16th (Gen7+) or 1/8th damage to affected pokemon")
|
2023-04-28 11:38:34 +01:00
|
|
|
{
|
|
|
|
s16 frostbiteDamage;
|
|
|
|
|
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET) { Status1(STATUS1_FROSTBITE); }
|
|
|
|
} WHEN {
|
2023-06-23 10:38:18 +01:00
|
|
|
TURN {}
|
2023-04-28 11:38:34 +01:00
|
|
|
} SCENE {
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("The opposing Wobbuffet was hurt by its frostbite!");
|
2023-04-28 11:38:34 +01:00
|
|
|
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_FRZ, opponent);
|
|
|
|
HP_BAR(opponent, captureDamage: &frostbiteDamage);
|
2024-10-11 22:47:46 +01:00
|
|
|
} THEN { EXPECT_EQ(frostbiteDamage, opponent->maxHP / ((B_BURN_DAMAGE >= GEN_7) ? 16 : 8)); }
|
2023-04-28 11:38:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Frostbite is healed if hit with a thawing move")
|
|
|
|
{
|
|
|
|
u32 move;
|
|
|
|
|
|
|
|
PARAMETRIZE { move = MOVE_FLAME_WHEEL; }
|
|
|
|
PARAMETRIZE { move = MOVE_SACRED_FIRE; }
|
|
|
|
PARAMETRIZE { move = MOVE_FLARE_BLITZ; }
|
|
|
|
PARAMETRIZE { move = MOVE_FUSION_FLARE; }
|
|
|
|
PARAMETRIZE { move = MOVE_EMBER; }
|
|
|
|
|
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET) { Status1(STATUS1_FROSTBITE); }
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(player, move); }
|
|
|
|
} SCENE {
|
|
|
|
ANIMATION(ANIM_TYPE_MOVE, move, player);
|
|
|
|
if (move == MOVE_EMBER) {
|
|
|
|
NONE_OF {
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("The opposing Wobbuffet's frostbite was cured!");
|
2023-04-28 11:38:34 +01:00
|
|
|
}
|
|
|
|
} else {
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("The opposing Wobbuffet's frostbite was cured!");
|
2023-04-28 11:38:34 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Frostbite is healed when the user uses a thawing move")
|
|
|
|
{
|
|
|
|
u32 move;
|
|
|
|
|
|
|
|
PARAMETRIZE { move = MOVE_FLAME_WHEEL; }
|
|
|
|
PARAMETRIZE { move = MOVE_SACRED_FIRE; }
|
|
|
|
PARAMETRIZE { move = MOVE_FLARE_BLITZ; }
|
|
|
|
PARAMETRIZE { move = MOVE_FUSION_FLARE; }
|
|
|
|
PARAMETRIZE { move = MOVE_EMBER; }
|
|
|
|
|
|
|
|
GIVEN {
|
|
|
|
PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_FROSTBITE); }
|
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(player, move); }
|
|
|
|
} SCENE {
|
|
|
|
ANIMATION(ANIM_TYPE_MOVE, move, player);
|
|
|
|
HP_BAR(opponent);
|
|
|
|
if (move == MOVE_EMBER) {
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("Wobbuffet was hurt by its frostbite!");
|
2023-04-28 11:38:34 +01:00
|
|
|
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_FRZ, player);
|
|
|
|
} else {
|
|
|
|
NONE_OF {
|
2024-10-21 18:52:45 +01:00
|
|
|
MESSAGE("Wobbuffet was hurt by its frostbite!");
|
2023-04-28 11:38:34 +01:00
|
|
|
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_FRZ, player);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|