mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-27 12:14:20 +01:00
152 lines
5.0 KiB
C
152 lines
5.0 KiB
C
#include "global.h"
|
|
#include "test_battle.h"
|
|
|
|
ASSUMPTIONS
|
|
{
|
|
ASSUME(gBattleMoves[MOVE_SNOWSCAPE].effect == EFFECT_SNOWSCAPE);
|
|
ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[0] != TYPE_ICE && gSpeciesInfo[SPECIES_WOBBUFFET].types[1] != TYPE_ICE);
|
|
ASSUME(gSpeciesInfo[SPECIES_GLALIE].types[0] == TYPE_ICE || gSpeciesInfo[SPECIES_GLALIE].types[1] == TYPE_ICE);
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Snow increases the defense of Ice types by 50 %", s16 damage)
|
|
{
|
|
u16 move;
|
|
PARAMETRIZE{ move = MOVE_SNOWSCAPE; }
|
|
PARAMETRIZE{ move = MOVE_CELEBRATE; }
|
|
GIVEN {
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_GLALIE);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, move); }
|
|
TURN { MOVE(player, MOVE_TACKLE); }
|
|
} SCENE {
|
|
HP_BAR(opponent, captureDamage: &results[i].damage);
|
|
} FINALLY {
|
|
EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.5), results[1].damage);
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Snow turns Weather Ball to an Ice-type move and doubles its power", s16 damage)
|
|
{
|
|
u16 move;
|
|
PARAMETRIZE{ move = MOVE_CELEBRATE; }
|
|
PARAMETRIZE{ move = MOVE_SNOWSCAPE; }
|
|
GIVEN {
|
|
ASSUME(gBattleMoves[MOVE_WEATHER_BALL].effect == EFFECT_WEATHER_BALL);
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_DRAGONAIR);
|
|
} WHEN {
|
|
TURN { MOVE(player, move); }
|
|
TURN { MOVE(player, MOVE_WEATHER_BALL); }
|
|
} SCENE {
|
|
HP_BAR(opponent, captureDamage: &results[i].damage);
|
|
} FINALLY {
|
|
EXPECT_MUL_EQ(results[0].damage, Q_4_12(4.0), results[1].damage); // double base power + type effectiveness.
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Snow allows Blizzard to bypass accuracy checks")
|
|
{
|
|
PASSES_RANDOMLY(100, 100, RNG_ACCURACY);
|
|
GIVEN {
|
|
ASSUME(gBattleMoves[MOVE_BLIZZARD].accuracy == 70);
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_SNOWSCAPE); MOVE(player, MOVE_BLIZZARD); }
|
|
} SCENE {
|
|
NONE_OF { MESSAGE("Wobbuffet's attack missed!"); }
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Snow halves the power of Solar Beam", s16 damage)
|
|
{
|
|
u16 move;
|
|
PARAMETRIZE{ move = MOVE_CELEBRATE; }
|
|
PARAMETRIZE{ move = MOVE_SNOWSCAPE; }
|
|
GIVEN {
|
|
ASSUME(gBattleMoves[MOVE_SOLAR_BEAM].effect == EFFECT_SOLAR_BEAM);
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, move); MOVE(player, MOVE_SOLAR_BEAM); }
|
|
TURN { SKIP_TURN(player); }
|
|
} SCENE {
|
|
HP_BAR(opponent, captureDamage: &results[i].damage);
|
|
} FINALLY {
|
|
EXPECT_MUL_EQ(results[0].damage, Q_4_12(0.5), results[1].damage);
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Snow halves the power of Solar Blade", s16 damage)
|
|
{
|
|
u16 move;
|
|
KNOWN_FAILING; // fails bc the bp of solar blade gets rounded up which leads to slightly incorrect calcs down the line
|
|
PARAMETRIZE{ move = MOVE_CELEBRATE; }
|
|
PARAMETRIZE{ move = MOVE_SNOWSCAPE; }
|
|
GIVEN {
|
|
ASSUME(gBattleMoves[MOVE_SOLAR_BLADE].effect == EFFECT_SOLAR_BEAM);
|
|
PLAYER(SPECIES_WOBBUFFET);
|
|
OPPONENT(SPECIES_WYNAUT);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, move); MOVE(player, MOVE_SOLAR_BLADE); }
|
|
TURN { SKIP_TURN(player); }
|
|
} SCENE {
|
|
HP_BAR(opponent, captureDamage: &results[i].damage);
|
|
} FINALLY {
|
|
EXPECT_MUL_EQ(results[0].damage, Q_4_12(0.5), results[1].damage);
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Snow causes Moonlight to recover 1/4 of the user's max HP")
|
|
{
|
|
GIVEN {
|
|
ASSUME(gBattleMoves[MOVE_MOONLIGHT].effect == EFFECT_MOONLIGHT);
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(400); }
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_SNOWSCAPE); MOVE(player, MOVE_MOONLIGHT); }
|
|
} SCENE {
|
|
HP_BAR(player, damage: -(400 / 4));
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Snow causes Moonlight to recover 1/4 of the user's max HP")
|
|
{
|
|
GIVEN {
|
|
ASSUME(gBattleMoves[MOVE_MOONLIGHT].effect == EFFECT_MOONLIGHT);
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(400); }
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_SNOWSCAPE); MOVE(player, MOVE_MOONLIGHT); }
|
|
} SCENE {
|
|
HP_BAR(player, damage: -(400 / 4));
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Snow causes Synthesis to recover 1/4 of the user's max HP")
|
|
{
|
|
GIVEN {
|
|
ASSUME(gBattleMoves[MOVE_SYNTHESIS].effect == EFFECT_SYNTHESIS);
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(400); }
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_SNOWSCAPE); MOVE(player, MOVE_SYNTHESIS); }
|
|
} SCENE {
|
|
HP_BAR(player, damage: -(400 / 4));
|
|
}
|
|
}
|
|
|
|
SINGLE_BATTLE_TEST("Snow causes Morning Sun to recover 1/4 of the user's max HP")
|
|
{
|
|
GIVEN {
|
|
ASSUME(gBattleMoves[MOVE_MORNING_SUN].effect == EFFECT_MORNING_SUN);
|
|
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(400); }
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
} WHEN {
|
|
TURN { MOVE(opponent, MOVE_SNOWSCAPE); MOVE(player, MOVE_MORNING_SUN); }
|
|
} SCENE {
|
|
HP_BAR(player, damage: -(400 / 4));
|
|
}
|
|
}
|