sovereignx/test/battle/move_effect/psychic_terrain.c
Eduardo Quezada 55f0d3aad5
Added missing Move Effect TODO tests - Volume E (#5915)
Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
2025-01-01 16:06:20 +01:00

144 lines
4.5 KiB
C

#include "global.h"
#include "test/battle.h"
SINGLE_BATTLE_TEST("Psychic Terrain protects grounded battlers from priority moves")
{
GIVEN {
PLAYER(SPECIES_CLAYDOL) { Ability(ABILITY_LEVITATE); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_PSYCHIC_TERRAIN); }
TURN { MOVE(player, MOVE_QUICK_ATTACK); MOVE(opponent, MOVE_QUICK_ATTACK); }
} SCENE {
MESSAGE("Claydol used Psychic Terrain!");
MESSAGE("Claydol cannot use Quick Attack!");
NOT { HP_BAR(opponent); }
MESSAGE("The opposing Wobbuffet used Quick Attack!");
HP_BAR(player);
}
}
SINGLE_BATTLE_TEST("Psychic Terrain increases power of Psychic-type moves by 30/50 percent", s16 damage)
{
bool32 terrain;
PARAMETRIZE { terrain = FALSE; }
PARAMETRIZE { terrain = TRUE; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
if (terrain)
TURN { MOVE(player, MOVE_PSYCHIC_TERRAIN); }
TURN { MOVE(player, MOVE_CONFUSION); }
} SCENE {
MESSAGE("Wobbuffet used Confusion!");
HP_BAR(opponent, captureDamage: &results[i].damage);
} FINALLY {
if (B_TERRAIN_TYPE_BOOST >= GEN_8)
EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.3), results[1].damage);
else
EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.5), results[1].damage);
}
}
SINGLE_BATTLE_TEST("Psychic Terrain doesn't block priority moves that target the user")
{
GIVEN {
PLAYER(SPECIES_SABLEYE) { Ability(ABILITY_PRANKSTER); HP(1); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_PSYCHIC_TERRAIN); }
TURN { MOVE(player, MOVE_RECOVER); }
} SCENE {
MESSAGE("Sableye used Psychic Terrain!");
MESSAGE("Sableye used Recover!");
HP_BAR(player);
}
}
SINGLE_BATTLE_TEST("Psychic Terrain doesn't block priority moves that target all battlers")
{
GIVEN {
PLAYER(SPECIES_SABLEYE) { Ability(ABILITY_PRANKSTER); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_PSYCHIC_TERRAIN); }
TURN { MOVE(player, MOVE_HAZE); }
} SCENE {
MESSAGE("Sableye used Psychic Terrain!");
MESSAGE("Sableye used Haze!");
}
}
SINGLE_BATTLE_TEST("Psychic Terrain doesn't block priority moves that target all opponents")
{
GIVEN {
PLAYER(SPECIES_SABLEYE) { Ability(ABILITY_PRANKSTER); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_PSYCHIC_TERRAIN); }
TURN { MOVE(player, MOVE_SPIKES); }
} SCENE {
MESSAGE("Sableye used Psychic Terrain!");
MESSAGE("Sableye used Spikes!");
}
}
DOUBLE_BATTLE_TEST("Psychic Terrain doesn't block priority moves that target allies")
{
GIVEN {
PLAYER(SPECIES_SABLEYE) { Ability(ABILITY_PRANKSTER); }
PLAYER(SPECIES_WOBBUFFET) { HP(1); }
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(playerLeft, MOVE_PSYCHIC_TERRAIN); }
TURN { MOVE(playerLeft, MOVE_HEAL_PULSE, target: playerRight); }
} SCENE {
MESSAGE("Sableye used Psychic Terrain!");
MESSAGE("Sableye used Heal Pulse!");
}
}
SINGLE_BATTLE_TEST("Psychic Terrain doesn't block priority field moves")
{
GIVEN {
PLAYER(SPECIES_SABLEYE) { Ability(ABILITY_PRANKSTER); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_PSYCHIC_TERRAIN); }
TURN { MOVE(player, MOVE_SUNNY_DAY); }
} SCENE {
MESSAGE("Sableye used Psychic Terrain!");
MESSAGE("Sableye used Sunny Day!");
}
}
SINGLE_BATTLE_TEST("Psychic Terrain lasts for 5 turns")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_CELEBRATE); MOVE(player, MOVE_PSYCHIC_TERRAIN); }
TURN {}
TURN {}
TURN {}
TURN {}
} SCENE {
MESSAGE("The opposing Wobbuffet used Celebrate!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_PSYCHIC_TERRAIN, player);
MESSAGE("The battlefield got weird!");
MESSAGE("Wobbuffet used Celebrate!");
MESSAGE("The opposing Wobbuffet used Celebrate!");
MESSAGE("Wobbuffet used Celebrate!");
MESSAGE("The opposing Wobbuffet used Celebrate!");
MESSAGE("Wobbuffet used Celebrate!");
MESSAGE("The opposing Wobbuffet used Celebrate!");
MESSAGE("The weirdness disappeared from the battlefield!");
}
}