sovereignx/test/battle/ability/effect_spore.c
sneed 609754f0f6
Add RandomChance macro and ability trigger chance config (#4829)
* RandomChance macro, contact ability chance config

* Unify config, add shed skin
2024-06-18 20:13:44 +02:00

90 lines
3.1 KiB
C

#include "global.h"
#include "test/battle.h"
SINGLE_BATTLE_TEST("Effect Spore only inflicts status on contact")
{
u32 move;
PARAMETRIZE { move = MOVE_TACKLE; }
PARAMETRIZE { move = MOVE_SWIFT; }
GIVEN {
ASSUME(gMovesInfo[MOVE_TACKLE].makesContact);
ASSUME(!gMovesInfo[MOVE_SWIFT].makesContact);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_BRELOOM) { Ability(ABILITY_EFFECT_SPORE); }
} WHEN {
TURN { MOVE(player, move, WITH_RNG(RNG_EFFECT_SPORE, 1)); }
TURN {}
} SCENE {
if (gMovesInfo[move].makesContact) {
ABILITY_POPUP(opponent, ABILITY_EFFECT_SPORE);
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_PSN, player);
MESSAGE("Wobbuffet was poisoned by Foe Breloom's Effect Spore!");
STATUS_ICON(player, poison: TRUE);
} else {
NONE_OF {
ABILITY_POPUP(opponent, ABILITY_EFFECT_SPORE);
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_PSN, player);
MESSAGE("Wobbuffet was poisoned by Foe Breloom's Effect Spore!");
STATUS_ICON(player, poison: TRUE);
}
}
}
}
SINGLE_BATTLE_TEST("Effect Spore causes poison 9% of the time")
{
PASSES_RANDOMLY(9, 100, RNG_EFFECT_SPORE);
GIVEN {
ASSUME(B_ABILITY_TRIGGER_CHANCE >= GEN_5);
ASSUME(gMovesInfo[MOVE_TACKLE].makesContact);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_BRELOOM) { Ability(ABILITY_EFFECT_SPORE); }
} WHEN {
TURN { MOVE(player, MOVE_TACKLE); }
TURN {}
} SCENE {
ABILITY_POPUP(opponent, ABILITY_EFFECT_SPORE);
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_PSN, player);
MESSAGE("Wobbuffet was poisoned by Foe Breloom's Effect Spore!");
STATUS_ICON(player, poison: TRUE);
}
}
SINGLE_BATTLE_TEST("Effect Spore causes paralysis 10% of the time")
{
PASSES_RANDOMLY(10, 100, RNG_EFFECT_SPORE);
GIVEN {
ASSUME(B_ABILITY_TRIGGER_CHANCE >= GEN_5);
ASSUME(gMovesInfo[MOVE_TACKLE].makesContact);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_BRELOOM) { Ability(ABILITY_EFFECT_SPORE); }
} WHEN {
TURN { MOVE(player, MOVE_TACKLE); }
TURN {}
} SCENE {
ABILITY_POPUP(opponent, ABILITY_EFFECT_SPORE);
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_PRZ, player);
MESSAGE("Foe Breloom's Effect Spore paralyzed Wobbuffet! It may be unable to move!");
STATUS_ICON(player, paralysis: TRUE);
}
}
SINGLE_BATTLE_TEST("Effect Spore causes sleep 11% of the time")
{
PASSES_RANDOMLY(11, 100, RNG_EFFECT_SPORE);
GIVEN {
ASSUME(B_ABILITY_TRIGGER_CHANCE >= GEN_5);
ASSUME(gMovesInfo[MOVE_TACKLE].makesContact);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_BRELOOM) { Ability(ABILITY_EFFECT_SPORE); }
} WHEN {
TURN { MOVE(player, MOVE_TACKLE); }
TURN {}
} SCENE {
ABILITY_POPUP(opponent, ABILITY_EFFECT_SPORE);
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_SLP, player);
MESSAGE("Foe Breloom's Effect Spore made Wobbuffet sleep!");
STATUS_ICON(player, sleep: TRUE);
}
}