2023-03-29 13:01:20 +02:00
|
|
|
#include "global.h"
|
|
|
|
#include "test_battle.h"
|
|
|
|
|
|
|
|
ASSUMPTIONS
|
|
|
|
{
|
|
|
|
ASSUME(gBattleMoves[MOVE_TRIPLE_ARROWS].effect == EFFECT_TRIPLE_ARROWS);
|
|
|
|
}
|
|
|
|
|
2023-06-13 11:29:39 +02:00
|
|
|
SINGLE_BATTLE_TEST("Triple Arrows may lower Defense by one stage")
|
2023-03-29 13:01:20 +02:00
|
|
|
{
|
2023-04-18 16:26:43 +02:00
|
|
|
u32 ability;
|
|
|
|
u32 chance;
|
|
|
|
PARAMETRIZE { ability = ABILITY_HUSTLE; chance = 50; }
|
|
|
|
PARAMETRIZE { ability = ABILITY_SERENE_GRACE; chance = 100; }
|
|
|
|
PASSES_RANDOMLY(chance, 100, RNG_TRIPLE_ARROWS_DEFENSE_DOWN);
|
2023-03-29 13:01:20 +02:00
|
|
|
GIVEN {
|
2023-04-18 16:26:43 +02:00
|
|
|
PLAYER(SPECIES_TOGEPI) { Ability(ability); }
|
2023-03-29 13:01:20 +02: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);
|
2023-06-13 11:29:39 +02:00
|
|
|
MESSAGE("Foe Wobbuffet's Defense fell!");
|
2023-03-29 13:01:20 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-13 10:51:32 +02:00
|
|
|
SINGLE_BATTLE_TEST("Triple Arrows makes the foe flinch 30% of the time")
|
2023-03-29 13:01:20 +02:00
|
|
|
{
|
2023-04-18 16:26:43 +02:00
|
|
|
u32 ability;
|
|
|
|
u32 chance;
|
|
|
|
PARAMETRIZE { ability = ABILITY_HUSTLE; chance = 30; }
|
|
|
|
PARAMETRIZE { ability = ABILITY_SERENE_GRACE; chance = 60; }
|
|
|
|
PASSES_RANDOMLY(chance, 100, RNG_TRIPLE_ARROWS_FLINCH);
|
2023-03-29 13:01:20 +02:00
|
|
|
GIVEN {
|
2023-04-18 16:26:43 +02:00
|
|
|
PLAYER(SPECIES_TOGEPI) { Ability(ability); }
|
2023-03-29 13:01:20 +02:00
|
|
|
OPPONENT(SPECIES_WOBBUFFET);
|
|
|
|
} WHEN {
|
|
|
|
TURN { MOVE(player, MOVE_TRIPLE_ARROWS); }
|
|
|
|
} SCENE {
|
|
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TRIPLE_ARROWS, player);
|
|
|
|
MESSAGE("Foe Wobbuffet flinched!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SINGLE_BATTLE_TEST("Triple Arrows lands a critical hit")
|
|
|
|
{
|
|
|
|
ASSUME(B_CRIT_CHANCE >= GEN_7);
|
2023-07-03 10:01:59 +02:00
|
|
|
ASSUME(gBattleMoves[MOVE_TRIPLE_ARROWS].highCritRatio == TRUE);
|
2023-03-29 13:01:20 +02:00
|
|
|
PASSES_RANDOMLY(1, 8, RNG_CRITICAL_HIT);
|
|
|
|
GIVEN {
|
|
|
|
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!");
|
|
|
|
}
|
2023-04-02 10:30:26 +02:00
|
|
|
}
|
2023-04-19 06:52:23 +02:00
|
|
|
|
|
|
|
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);
|
2023-06-13 11:29:39 +02:00
|
|
|
MESSAGE("Foe Wobbuffet's Defense fell!");
|
2023-04-19 06:52:23 +02:00
|
|
|
MESSAGE("Foe Wobbuffet flinched!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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("Foe Wobbuffet flinched!"); }
|
|
|
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent);
|
|
|
|
}
|
|
|
|
}
|