pokeemerald/test/battle/ability/scrappy.c
2023-08-12 20:00:15 +01:00

67 lines
2.0 KiB
C

#include "global.h"
#include "test/battle.h"
SINGLE_BATTLE_TEST("Scrappy prevents intimidate")
{
s16 turnOneHit;
s16 turnTwoHit;
GIVEN {
ASSUME(B_UPDATED_INTIMIDATE >= GEN_8);
PLAYER(SPECIES_EKANS) { Ability(ABILITY_SHED_SKIN); };
PLAYER(SPECIES_EKANS) { Ability(ABILITY_INTIMIDATE); };
OPPONENT(SPECIES_KANGASKHAN) { Ability(ABILITY_SCRAPPY); };
} WHEN {
TURN { MOVE(opponent, MOVE_TACKLE); }
TURN { SWITCH(player, 1); MOVE(opponent, MOVE_TACKLE); }
} SCENE {
HP_BAR(player, captureDamage: &turnOneHit);
ABILITY_POPUP(player, ABILITY_INTIMIDATE);
NONE_OF { ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); }
ABILITY_POPUP(opponent, ABILITY_SCRAPPY);
MESSAGE("Foe Kangaskhan's Attack was not lowered!");
HP_BAR(player, captureDamage: &turnTwoHit);
} THEN {
EXPECT_EQ(turnOneHit, turnTwoHit);
}
}
SINGLE_BATTLE_TEST("Scrappy allows to hit Ghost-type Pokémon with Normal- and Fighting-type moves")
{
u32 move;
PARAMETRIZE { move = MOVE_TACKLE; }
PARAMETRIZE { move = MOVE_KARATE_CHOP; }
GIVEN {
PLAYER(SPECIES_KANGASKHAN) { Ability(ABILITY_SCRAPPY); };
OPPONENT(SPECIES_GASTLY);
} WHEN {
TURN { MOVE(player, move); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, move, player);
HP_BAR(opponent);
}
}
SINGLE_BATTLE_TEST("Scrappy doesn't bypass a Ghost-type's Wonder Guard")
{
u32 move;
PARAMETRIZE { move = MOVE_TACKLE; }
PARAMETRIZE { move = MOVE_KARATE_CHOP; }
GIVEN {
PLAYER(SPECIES_KANGASKHAN) { Ability(ABILITY_SCRAPPY); };
OPPONENT(SPECIES_SHEDINJA) { Ability(ABILITY_WONDER_GUARD); };
} WHEN {
TURN { MOVE(player, move); }
} SCENE {
NONE_OF {
ANIMATION(ANIM_TYPE_MOVE, move, player);
HP_BAR(opponent);
}
ABILITY_POPUP(opponent, ABILITY_WONDER_GUARD);
MESSAGE("Foe Shedinja avoided damage with Wonder Guard!");
}
}