sovereignx/test/battle/move_effect/defense_up_2.c

32 lines
1 KiB
C

#include "global.h"
#include "test/battle.h"
ASSUMPTIONS
{
ASSUME(gMovesInfo[MOVE_IRON_DEFENSE].effect == EFFECT_DEFENSE_UP_2);
}
SINGLE_BATTLE_TEST("Iron Defense raises Defense by 2 stages", s16 damage)
{
bool32 raiseDefense;
PARAMETRIZE { raiseDefense = FALSE; }
PARAMETRIZE { raiseDefense = TRUE; }
GIVEN {
ASSUME(gMovesInfo[MOVE_TACKLE].category == DAMAGE_CATEGORY_PHYSICAL);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
if (raiseDefense) TURN { MOVE(player, MOVE_IRON_DEFENSE); }
TURN { MOVE(opponent, MOVE_TACKLE); }
} SCENE {
if (raiseDefense) {
ANIMATION(ANIM_TYPE_MOVE, MOVE_IRON_DEFENSE, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Wobbuffet's Defense sharply rose!");
}
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent);
HP_BAR(player, captureDamage: &results[i].damage);
} FINALLY {
EXPECT_MUL_EQ(results[1].damage, Q_4_12(2.0), results[0].damage);
}
}