sovereignx/test/battle/move_effects_combined/triple_arrows.c

93 lines
3 KiB
C
Raw Permalink Normal View History

2023-03-29 12:01:20 +01:00
#include "global.h"
#include "test/battle.h"
2023-03-29 12:01:20 +01:00
ASSUMPTIONS
{
2024-02-26 05:21:38 +00:00
ASSUME(MoveHasAdditionalEffect(MOVE_TRIPLE_ARROWS, MOVE_EFFECT_DEF_MINUS_1) == TRUE);
ASSUME(MoveHasAdditionalEffect(MOVE_TRIPLE_ARROWS, MOVE_EFFECT_FLINCH) == TRUE);
2023-03-29 12:01:20 +01:00
}
SINGLE_BATTLE_TEST("Triple Arrows may lower Defense by one stage")
2023-03-29 12:01:20 +01:00
{
u32 ability;
u32 chance;
PARAMETRIZE { ability = ABILITY_HUSTLE; chance = 50; }
PARAMETRIZE { ability = ABILITY_SERENE_GRACE; chance = 100; }
2023-11-20 10:39:13 +00:00
PASSES_RANDOMLY(chance, 100, RNG_SECONDARY_EFFECT);
2023-03-29 12:01:20 +01:00
GIVEN {
PLAYER(SPECIES_TOGEPI) { Ability(ability); }
2023-03-29 12:01:20 +01:00
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_TRIPLE_ARROWS); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_TRIPLE_ARROWS, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
MESSAGE("The opposing Wobbuffet's Defense fell!");
2023-03-29 12:01:20 +01:00
}
}
SINGLE_BATTLE_TEST("Triple Arrows makes the foe flinch 30% of the time")
2023-03-29 12:01:20 +01:00
{
u32 ability;
u32 chance;
PARAMETRIZE { ability = ABILITY_HUSTLE; chance = 30; }
PARAMETRIZE { ability = ABILITY_SERENE_GRACE; chance = 60; }
2023-11-20 10:39:13 +00:00
PASSES_RANDOMLY(chance, 100, RNG_SECONDARY_EFFECT_2);
2023-03-29 12:01:20 +01:00
GIVEN {
PLAYER(SPECIES_TOGEPI) { Ability(ability); }
2023-03-29 12:01:20 +01:00
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_TRIPLE_ARROWS); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_TRIPLE_ARROWS, player);
MESSAGE("The opposing Wobbuffet flinched and couldn't move!");
2023-03-29 12:01:20 +01:00
}
}
SINGLE_BATTLE_TEST("Triple Arrows lands a critical hit")
{
PASSES_RANDOMLY(1, 8, RNG_CRITICAL_HIT);
GIVEN {
ASSUME(B_CRIT_CHANCE >= GEN_7);
ASSUME(gMovesInfo[MOVE_TRIPLE_ARROWS].criticalHitStage == 1);
2023-03-29 12:01:20 +01:00
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_TRIPLE_ARROWS); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_TRIPLE_ARROWS, player);
MESSAGE("A critical hit!");
}
}
SINGLE_BATTLE_TEST("Triple Arrows can lower Defense and cause flinch at the time")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_TRIPLE_ARROWS); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_TRIPLE_ARROWS, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
MESSAGE("The opposing Wobbuffet's Defense fell!");
MESSAGE("The opposing Wobbuffet flinched and couldn't move!");
}
}
SINGLE_BATTLE_TEST("Triple Arrows's flinching is prevented by Inner Focus")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_RIOLU) { Ability(ABILITY_INNER_FOCUS); }
} WHEN {
TURN { MOVE(player, MOVE_TRIPLE_ARROWS);
MOVE(opponent, MOVE_TACKLE);
}
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_TRIPLE_ARROWS, player);
NONE_OF { MESSAGE("The opposing Wobbuffet flinched and couldn't move!"); }
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent);
}
}