pokeemerald/test/battle/move_effect/multi_hit.c
Eduardo Quezada D'Ottone 77e2b0dd2c
Test cleanup and improvements (#3449)
* Fixed duplicated test names

* Test improvements for Jaboca, Kee and Rowap Berries

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>

* Lansat Berry test improvements

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>

* Jaboca Berry/Bug Bite interaction test

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>

---------

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
2023-10-22 21:22:59 +02:00

186 lines
6.3 KiB
C

#include "global.h"
#include "test/battle.h"
ASSUMPTIONS
{
ASSUME(gBattleMoves[MOVE_BULLET_SEED].effect == EFFECT_MULTI_HIT);
}
SINGLE_BATTLE_TEST("Multi hit Moves hit the maximum amount with Skill Link")
{
PASSES_RANDOMLY(100, 100, RNG_HITS);
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_SKILL_LINK); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_BULLET_SEED); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
MESSAGE("Hit 5 time(s)!");
}
}
SINGLE_BATTLE_TEST("Multi hit Moves hit twice 35% of the time")
{
PASSES_RANDOMLY(35, 100, RNG_HITS);
GIVEN {
ASSUME(B_MULTI_HIT_CHANCE >= GEN_5);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_BULLET_SEED); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
MESSAGE("Hit 2 time(s)!");
}
}
SINGLE_BATTLE_TEST("Multi hit Moves hit thrice 35% of the time")
{
PASSES_RANDOMLY(35, 100, RNG_HITS);
GIVEN {
ASSUME(B_MULTI_HIT_CHANCE >= GEN_5);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_BULLET_SEED); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
MESSAGE("Hit 3 time(s)!");
}
}
SINGLE_BATTLE_TEST("Multi hit Moves hit four times 15% of the time")
{
PASSES_RANDOMLY(15, 100, RNG_HITS);
GIVEN {
ASSUME(B_MULTI_HIT_CHANCE >= GEN_5);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_BULLET_SEED); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
MESSAGE("Hit 4 time(s)!");
}
}
SINGLE_BATTLE_TEST("Multi hit Moves hit five times 15% of the time")
{
PASSES_RANDOMLY(15, 100, RNG_HITS);
GIVEN {
ASSUME(B_MULTI_HIT_CHANCE >= GEN_5);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_BULLET_SEED); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
MESSAGE("Hit 5 time(s)!");
}
}
SINGLE_BATTLE_TEST("Multi hit Moves hit at least four times with Loaded Dice")
{
PASSES_RANDOMLY(50, 100, RNG_LOADED_DICE);
GIVEN {
ASSUME(gItems[ITEM_LOADED_DICE].holdEffect == HOLD_EFFECT_LOADED_DICE);
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_LOADED_DICE); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_BULLET_SEED); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
MESSAGE("Hit 4 time(s)!");
}
}
SINGLE_BATTLE_TEST("Multi hit Moves hit five times 50 Percent of the time with Loaded Dice")
{
PASSES_RANDOMLY(50, 100, RNG_LOADED_DICE);
GIVEN {
ASSUME(gItems[ITEM_LOADED_DICE].holdEffect == HOLD_EFFECT_LOADED_DICE);
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_LOADED_DICE); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_BULLET_SEED); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
MESSAGE("Hit 5 time(s)!");
}
}
SINGLE_BATTLE_TEST("Scale Shot decreases defense and increases speed after final hit")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_SCALE_SHOT].effect == EFFECT_MULTI_HIT);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_SCALE_SHOT); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_SCALE_SHOT, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_SCALE_SHOT, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_SCALE_SHOT, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_SCALE_SHOT, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_SCALE_SHOT, player);
MESSAGE("Hit 5 time(s)!");
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Wobbuffet's Defense fell!");
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Wobbuffet's Speed rose!");
}
}
SINGLE_BATTLE_TEST("Endure does not prevent multiple hits and stat changes occur at the end of the turn")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_SCALE_SHOT].effect == EFFECT_MULTI_HIT);
ASSUME(gBattleMoves[MOVE_ENDURE].effect == EFFECT_ENDURE);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET) { HP(1); }
} WHEN {
TURN { MOVE(opponent, MOVE_ENDURE); MOVE(player, MOVE_SCALE_SHOT); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_ENDURE, opponent);
ANIMATION(ANIM_TYPE_MOVE, MOVE_SCALE_SHOT, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_SCALE_SHOT, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_SCALE_SHOT, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_SCALE_SHOT, player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_SCALE_SHOT, player);
MESSAGE("Hit 5 time(s)!");
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Wobbuffet's Defense fell!");
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Wobbuffet's Speed rose!");
}
}