sovereignx/test/battle/ability/magic_guard.c

47 lines
1.4 KiB
C
Raw Permalink Normal View History

#include "global.h"
#include "test/battle.h"
SINGLE_BATTLE_TEST("Magic Guard prevents recoil damage to the user")
{
GIVEN {
ASSUME(gMovesInfo[MOVE_DOUBLE_EDGE].recoil == 33);
PLAYER(SPECIES_CLEFABLE) { Ability(ABILITY_MAGIC_GUARD); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_DOUBLE_EDGE); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_DOUBLE_EDGE, player);
HP_BAR(opponent);
NOT HP_BAR(player);
}
}
SINGLE_BATTLE_TEST("Magic Guard ignores immobilization that can be caused by paralysis")
{
if (B_MAGIC_GUARD >= GEN_4)
PASSES_RANDOMLY(1, 1, RNG_PARALYSIS);
else
PASSES_RANDOMLY(75, 100, RNG_PARALYSIS);
GIVEN {
PLAYER(SPECIES_CLEFABLE) { Ability(ABILITY_MAGIC_GUARD); Status1(STATUS1_PARALYSIS);}
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_CELEBRATE); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, player);
}
}
SINGLE_BATTLE_TEST("Magic Guard does not ignore speed stat changes caused by paralysis")
{
GIVEN {
PLAYER(SPECIES_CLEFABLE) { Speed(100); Ability(ABILITY_MAGIC_GUARD); Status1(STATUS1_PARALYSIS);}
OPPONENT(SPECIES_WOBBUFFET) { Speed(99); }
} WHEN {
TURN { }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponent);
ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, player);
}
}