Added Soundproof and Bulletproof tests (#8189)

This commit is contained in:
Eduardo Quezada 2025-11-10 11:58:42 -03:00 committed by GitHub
parent 625f67be33
commit ffc2c04ea6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 77 additions and 2 deletions

View File

@ -1,4 +1,20 @@
#include "global.h"
#include "test/battle.h"
TO_DO_BATTLE_TEST("Bulletproof makes ballistic moves fail against the ability user");
SINGLE_BATTLE_TEST("Bulletproof makes ballistic moves fail against the ability user")
{
GIVEN {
ASSUME(IsBallisticMove(MOVE_ELECTRO_BALL));
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_CHESPIN) { Ability(ABILITY_BULLETPROOF); }
} WHEN {
TURN { MOVE(player, MOVE_ELECTRO_BALL); }
} SCENE {
ABILITY_POPUP(opponent, ABILITY_BULLETPROOF);
MESSAGE("The opposing Chespin's Bulletproof blocks Electro Ball!");
NONE_OF {
ANIMATION(ANIM_TYPE_MOVE, MOVE_ELECTRO_BALL, player);
HP_BAR(opponent);
}
}
}

View File

@ -1,4 +1,20 @@
#include "global.h"
#include "test/battle.h"
TO_DO_BATTLE_TEST("TODO: Write Soundproof (Ability) test titles")
SINGLE_BATTLE_TEST("Soundproof makes sound moves fail against the ability user")
{
GIVEN {
ASSUME(IsSoundMove(MOVE_BOOMBURST));
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_EXPLOUD) { Ability(ABILITY_SOUNDPROOF); }
} WHEN {
TURN { MOVE(player, MOVE_BOOMBURST); }
} SCENE {
ABILITY_POPUP(opponent, ABILITY_SOUNDPROOF);
MESSAGE("The opposing Exploud's Soundproof blocks Boomburst!");
NONE_OF {
ANIMATION(ANIM_TYPE_MOVE, MOVE_BOOMBURST, player);
HP_BAR(opponent);
}
}
}

View File

@ -0,0 +1,43 @@
#include "global.h"
#include "test/battle.h"
#include "constants/item_effects.h"
DOUBLE_BATTLE_TEST("Poke Flute heals all battlers from being asleep")
{
GIVEN {
ASSUME(gItemsInfo[ITEM_POKE_FLUTE].battleUsage == EFFECT_ITEM_USE_POKE_FLUTE);
PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_SLEEP); }
PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_SLEEP); }
OPPONENT(SPECIES_WOBBUFFET) { Status1(STATUS1_SLEEP); }
OPPONENT(SPECIES_WOBBUFFET) { Status1(STATUS1_SLEEP); }
} WHEN {
TURN { USE_ITEM(playerLeft, ITEM_POKE_FLUTE, partyIndex: 0); }
} SCENE {
MESSAGE("The Pokémon hearing the flute awoke!");
} THEN {
EXPECT_EQ(playerLeft->status1, STATUS1_NONE);
EXPECT_EQ(playerRight->status1, STATUS1_NONE);
EXPECT_EQ(opponentLeft->status1, STATUS1_NONE);
EXPECT_EQ(opponentRight->status1, STATUS1_NONE);
}
}
DOUBLE_BATTLE_TEST("Poke Flute does not heal battlers with Soundproof from being asleep")
{
GIVEN {
ASSUME(gItemsInfo[ITEM_POKE_FLUTE].battleUsage == EFFECT_ITEM_USE_POKE_FLUTE);
PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_SLEEP); }
PLAYER(SPECIES_EXPLOUD) { Ability(ABILITY_SOUNDPROOF); Status1(STATUS1_SLEEP); }
OPPONENT(SPECIES_WOBBUFFET) { Status1(STATUS1_SLEEP); }
OPPONENT(SPECIES_EXPLOUD) { Ability(ABILITY_SOUNDPROOF); Status1(STATUS1_SLEEP); }
} WHEN {
TURN { USE_ITEM(playerLeft, ITEM_POKE_FLUTE, partyIndex: 0); }
} SCENE {
MESSAGE("The Pokémon hearing the flute awoke!");
} THEN {
EXPECT_EQ(playerLeft->status1, STATUS1_NONE);
EXPECT_NE(playerRight->status1, STATUS1_NONE);
EXPECT_EQ(opponentLeft->status1, STATUS1_NONE);
EXPECT_NE(opponentRight->status1, STATUS1_NONE);
}
}