pokeemerald/test/ability_intimidate.c
2023-02-09 23:25:25 +01:00

51 lines
1.6 KiB
C

#include "global.h"
#include "test_battle.h"
ASSUMPTIONS
{
ASSUME(gBattleMoves[MOVE_TACKLE].split == SPLIT_PHYSICAL);
}
SINGLE_BATTLE_TEST("Intimidate (opponent) lowers player's attack after switch out", s16 damage)
{
u32 ability;
PARAMETRIZE { ability = ABILITY_INTIMIDATE; }
PARAMETRIZE { ability = ABILITY_RECKLESS; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_STARAPTOR) { Ability(ability); };
} WHEN {
TURN { SWITCH(opponent, 1); }
TURN { MOVE(player, MOVE_TACKLE); }
} SCENE {
if (ability == ABILITY_INTIMIDATE)
ABILITY_POPUP(opponent, ABILITY_INTIMIDATE);
HP_BAR(opponent, captureDamage: &results[i].damage);
} FINALLY {
EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.5), results[1].damage);
}
}
SINGLE_BATTLE_TEST("Intimidate (opponent) lowers player's attack after KO", s16 damage)
{
u32 ability;
KNOWN_FAILING;
PARAMETRIZE { ability = ABILITY_INTIMIDATE; }
PARAMETRIZE { ability = ABILITY_RECKLESS; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Speed(2); };
OPPONENT(SPECIES_WOBBUFFET) { HP(1); Speed(1); };
OPPONENT(SPECIES_STARAPTOR) { Ability(ABILITY_INTIMIDATE); Speed(1); };
} WHEN {
TURN { MOVE(player, MOVE_TACKLE); SEND_OUT(opponent, 1); }
TURN { MOVE(player, MOVE_TACKLE); }
} SCENE {
if (ability == ABILITY_INTIMIDATE)
ABILITY_POPUP(opponent, ABILITY_INTIMIDATE);
HP_BAR(opponent, captureDamage: &results[i].damage);
} FINALLY {
EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.5), results[1].damage);
}
}