2023-02-02 23:22:02 +00:00
|
|
|
#include "global.h"
|
2023-08-12 20:00:15 +01:00
|
|
|
#include "test/battle.h"
|
2023-02-02 23:22:02 +00:00
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Stench has a 10% chance to flinch")
|
|
|
|
{
|
2023-02-20 20:06:01 +00:00
|
|
|
PASSES_RANDOMLY(1, 10, RNG_STENCH);
|
2023-02-02 23:22:02 +00:00
|
|
|
GIVEN {
|
2024-01-29 11:51:32 +00:00
|
|
|
ASSUME(gMovesInfo[MOVE_TACKLE].power > 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("Foe Wobbuffet flinched!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Stench does not stack with King's Rock")
|
|
|
|
{
|
2023-02-20 20:06:01 +00:00
|
|
|
PASSES_RANDOMLY(1, 10, RNG_STENCH);
|
2023-02-02 23:22:02 +00:00
|
|
|
GIVEN {
|
2024-01-26 18:25:52 +00:00
|
|
|
ASSUME(gItemsInfo[ITEM_KINGS_ROCK].holdEffect == HOLD_EFFECT_FLINCH);
|
2024-01-29 11:51:32 +00:00
|
|
|
ASSUME(gMovesInfo[MOVE_TACKLE].power > 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("Foe Wobbuffet flinched!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-09 14:35:40 +00:00
|
|
|
DOUBLE_BATTLE_TEST("Stench only triggers if target takes damage")
|
|
|
|
{
|
|
|
|
GIVEN {
|
2024-02-09 20:02:56 +00:00
|
|
|
ASSUME(gMovesInfo[MOVE_TACKLE].power > 0);
|
2024-02-26 05:21:38 +00:00
|
|
|
ASSUME(MoveHasAdditionalEffectWithChance(MOVE_FAKE_OUT, MOVE_EFFECT_FLINCH, 100));
|
2024-02-09 14:35:40 +00:00
|
|
|
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!"); }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
DOUBLE_BATTLE_TEST("Stench doesn't trigger if partner uses a move")
|
|
|
|
{
|
|
|
|
GIVEN {
|
2024-02-09 20:02:56 +00:00
|
|
|
ASSUME(gMovesInfo[MOVE_TACKLE].power > 0);
|
2024-02-26 05:21:38 +00:00
|
|
|
ASSUME(MoveHasAdditionalEffectWithChance(MOVE_FAKE_OUT, MOVE_EFFECT_FLINCH, 100));
|
2024-02-09 14:35:40 +00:00
|
|
|
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("Foe Grimer flinched!");
|
|
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponentRight);
|
|
|
|
NOT MESSAGE("Wynaut flinched!");
|
|
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, playerRight);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-02 23:22:02 +00:00
|
|
|
// TODO: Test against interaction with multi hits
|