sovereignx/test/battle/ability/ice_body.c
hedara90 b641c6f4fa
Fixed incorrect weather damage rounding when maxHP <16 (#5183)
Co-authored-by: Hedara <hedara90@gmail.com>
2024-08-16 23:02:49 +02:00

54 lines
1.6 KiB
C

#include "global.h"
#include "test/battle.h"
ASSUMPTIONS {
ASSUME(gMovesInfo[MOVE_HAIL].effect == EFFECT_HAIL);
ASSUME(gMovesInfo[MOVE_SNOWSCAPE].effect == EFFECT_SNOWSCAPE);
}
SINGLE_BATTLE_TEST("Ice Body prevents damage from hail")
{
u32 move;
PARAMETRIZE { move = MOVE_HAIL; }
PARAMETRIZE { move = MOVE_SNOWSCAPE; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_GLALIE) { Ability(ABILITY_ICE_BODY); }
} WHEN {
TURN { MOVE(player, move); MOVE(opponent, MOVE_SKILL_SWAP); }
} SCENE {
NONE_OF { HP_BAR(player); }
}
}
SINGLE_BATTLE_TEST("Ice Body recovers 1/16th of Max HP in hail.")
{
u32 move;
PARAMETRIZE { move = MOVE_HAIL; }
PARAMETRIZE { move = MOVE_SNOWSCAPE; }
GIVEN {
PLAYER(SPECIES_GLALIE) { Ability(ABILITY_ICE_BODY); HP(1); MaxHP(100); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, move); }
} SCENE {
ABILITY_POPUP(player, ABILITY_ICE_BODY);
HP_BAR(player, damage: -(100 / 16));
MESSAGE("Glalie's Ice Body healed it a little bit!");
}
}
SINGLE_BATTLE_TEST("Ice Body doesn't recover HP if Cloud Nine/Air Lock is on the field")
{
u32 move;
PARAMETRIZE { move = MOVE_HAIL; }
PARAMETRIZE { move = MOVE_SNOWSCAPE; }
GIVEN {
PLAYER(SPECIES_GLALIE) { Ability(ABILITY_ICE_BODY); HP(1); MaxHP(100); }
OPPONENT(SPECIES_GOLDUCK) { Ability(ABILITY_CLOUD_NINE); }
} WHEN {
TURN { MOVE(opponent, move); }
} SCENE {
NOT ABILITY_POPUP(player, ABILITY_ICE_BODY);
}
}