pokeemerald/test/terrain_electric.c
Alex 76d0d8a94e
Fix battle message strings for stats (#2927)
* Fix battle message strings for stats
2023-04-18 22:02:51 +01:00

64 lines
2.3 KiB
C

#include "global.h"
#include "test_battle.h"
SINGLE_BATTLE_TEST("Electric Terrain protects grounded battlers from falling asleep")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_CLAYDOL) { Ability(ABILITY_LEVITATE); }
} WHEN {
TURN { MOVE(player, MOVE_ELECTRIC_TERRAIN); MOVE(opponent, MOVE_SPORE); }
TURN { MOVE(player, MOVE_SPORE); }
} SCENE {
MESSAGE("Wobbuffet used ElctrcTrrain!");
MESSAGE("Foe Claydol used Spore!");
MESSAGE("Wobbuffet surrounds itself with electrified terrain!");
MESSAGE("Wobbuffet used Spore!");
MESSAGE("Foe Claydol fell asleep!");
STATUS_ICON(opponent, sleep: TRUE);
}
}
SINGLE_BATTLE_TEST("Electric Terrain activates Electric Seed and Mimicry")
{
GIVEN {
ASSUME(P_GEN_8_POKEMON == TRUE);
ASSUME(gItems[ITEM_ELECTRIC_SEED].holdEffect == HOLD_EFFECT_SEEDS);
ASSUME(gItems[ITEM_ELECTRIC_SEED].holdEffectParam == HOLD_EFFECT_PARAM_ELECTRIC_TERRAIN);
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_ELECTRIC_SEED); }
OPPONENT(SPECIES_STUNFISK_GALARIAN) { Ability(ABILITY_MIMICRY); }
} WHEN {
TURN { MOVE(player, MOVE_ELECTRIC_TERRAIN); }
} SCENE {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Using Electric Seed, the Defense of Wobbuffet rose!");
ABILITY_POPUP(opponent);
MESSAGE("Foe Stunfisk's type changed to Electr!");
} FINALLY {
EXPECT_EQ(gBattleMons[B_POSITION_OPPONENT_LEFT].type1, TYPE_ELECTRIC);
}
}
SINGLE_BATTLE_TEST("Electric Terrain increases power of Electric-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_ELECTRIC_TERRAIN); }
TURN { MOVE(player, MOVE_THUNDER_SHOCK); }
} SCENE {
MESSAGE("Wobbuffet used ThunderShock!");
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);
}
}