sovereignx/test/battle/move_effect/dream_eater.c

60 lines
1.7 KiB
C

#include "global.h"
#include "test/battle.h"
ASSUMPTIONS
{
ASSUME(gMovesInfo[MOVE_DREAM_EATER].effect == EFFECT_DREAM_EATER);
}
SINGLE_BATTLE_TEST("Dream Eater recovers 50% of the damage dealt")
{
s16 damage;
s16 healed;
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { HP(1); }
OPPONENT(SPECIES_WOBBUFFET) { Status1(STATUS1_SLEEP); }
} WHEN {
TURN { MOVE(player, MOVE_DREAM_EATER); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_DREAM_EATER, player);
HP_BAR(opponent, captureDamage: &damage);
HP_BAR(player, captureDamage: &healed);
} THEN {
EXPECT_MUL_EQ(damage, Q_4_12(-1.0/2.0), healed);
}
}
SINGLE_BATTLE_TEST("Dream Eater fails on awake targets")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_DREAM_EATER); }
} SCENE {
MESSAGE("Wobbuffet used Dream Eater!");
MESSAGE("The opposing Wobbuffet wasn't affected!");
}
}
SINGLE_BATTLE_TEST("Dream Eater fails if Heal Block applies")
{
GIVEN {
ASSUME(B_HEAL_BLOCKING >= GEN_6);
PLAYER(SPECIES_WOBBUFFET) { HP(1); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_HEAL_BLOCK); MOVE(player, MOVE_DREAM_EATER); }
} SCENE {
MESSAGE("Wobbuffet was prevented from healing!");
NONE_OF {
ANIMATION(ANIM_TYPE_MOVE, MOVE_DREAM_EATER, player);
HP_BAR(opponent);
HP_BAR(player);
}
}
}
TO_DO_BATTLE_TEST("Dream Eater works on targets with Comatose");
TO_DO_BATTLE_TEST("Dream Eater fails if the target is behind a Substitute (Gen 1-4)");
TO_DO_BATTLE_TEST("Dream Eater works if the target is behind a Substitute (Gen 5+)");