sovereignx/test/battle/ability/stench.c

83 lines
3 KiB
C
Raw Normal View History

2023-02-02 23:22:02 +00:00
#include "global.h"
#include "test/battle.h"
2023-02-02 23:22:02 +00:00
SINGLE_BATTLE_TEST("Stench has a 10% chance to flinch")
{
PASSES_RANDOMLY(1, 10, RNG_STENCH);
2023-02-02 23:22:02 +00:00
GIVEN {
2025-01-01 19:34:33 +00:00
ASSUME(GetMovePower(MOVE_TACKLE) > 0);
2023-06-23 10:38:18 +01:00
PLAYER(SPECIES_GRIMER) { Ability(ABILITY_STENCH); }
2023-02-02 23:22:02 +00:00
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_TACKLE); MOVE(opponent, MOVE_CELEBRATE); }
} SCENE {
MESSAGE("The opposing Wobbuffet flinched and couldn't move!");
2023-02-02 23:22:02 +00:00
}
}
SINGLE_BATTLE_TEST("Stench does not stack with King's Rock")
{
PASSES_RANDOMLY(1, 10, RNG_STENCH);
2023-02-02 23:22:02 +00:00
GIVEN {
ASSUME(gItemsInfo[ITEM_KINGS_ROCK].holdEffect == HOLD_EFFECT_FLINCH);
2025-01-01 19:34:33 +00:00
ASSUME(GetMovePower(MOVE_TACKLE) > 0);
2023-02-02 23:22:02 +00:00
2023-06-23 10:38:18 +01:00
PLAYER(SPECIES_GRIMER) { Ability(ABILITY_STENCH); Item(ITEM_KINGS_ROCK); }
2023-02-02 23:22:02 +00:00
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_TACKLE); MOVE(opponent, MOVE_CELEBRATE); }
} SCENE {
MESSAGE("The opposing Wobbuffet flinched and couldn't move!");
2023-02-02 23:22:02 +00:00
}
}
DOUBLE_BATTLE_TEST("Stench only triggers if target takes damage")
{
GIVEN {
2025-01-01 19:34:33 +00:00
ASSUME(GetMovePower(MOVE_TACKLE) > 0);
2024-02-26 05:21:38 +00:00
ASSUME(MoveHasAdditionalEffectWithChance(MOVE_FAKE_OUT, MOVE_EFFECT_FLINCH, 100));
PLAYER(SPECIES_WOBBUFFET);
PLAYER(SPECIES_WYNAUT);
OPPONENT(SPECIES_GRIMER) { Ability(ABILITY_STENCH); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN {
MOVE(playerLeft, MOVE_FAKE_OUT, target: opponentLeft);
MOVE(opponentLeft, MOVE_TACKLE, WITH_RNG(RNG_STENCH, TRUE), target: playerRight);
MOVE(playerRight, MOVE_TACKLE, target: opponentRight);
}
TURN {
MOVE(opponentLeft, MOVE_SCARY_FACE, WITH_RNG(RNG_STENCH, TRUE), target: playerRight);
MOVE(playerRight, MOVE_TACKLE, target: opponentRight);
}
} SCENE {
NONE_OF { MESSAGE("Wynaut flinched and couldn't move!"); }
}
}
DOUBLE_BATTLE_TEST("Stench doesn't trigger if partner uses a move")
{
GIVEN {
2025-01-01 19:34:33 +00:00
ASSUME(GetMovePower(MOVE_TACKLE) > 0);
2024-02-26 05:21:38 +00:00
ASSUME(MoveHasAdditionalEffectWithChance(MOVE_FAKE_OUT, MOVE_EFFECT_FLINCH, 100));
PLAYER(SPECIES_WOBBUFFET) { Speed(20); }
PLAYER(SPECIES_WYNAUT) { Speed(10); }
OPPONENT(SPECIES_GRIMER) { Speed(100); Ability(ABILITY_STENCH); }
OPPONENT(SPECIES_WOBBUFFET) {Speed(50); }
} WHEN {
TURN {
MOVE(playerLeft, MOVE_FAKE_OUT, target: opponentLeft);
MOVE(opponentRight, MOVE_TACKLE, target: playerRight);
MOVE(playerRight, MOVE_TACKLE, target: opponentRight);
}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_FAKE_OUT, playerLeft);
MESSAGE("The opposing Grimer flinched and couldn't move!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentRight);
NOT MESSAGE("Wynaut flinched and couldn't move!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, playerRight);
}
}
2023-02-02 23:22:02 +00:00
// TODO: Test against interaction with multi hits