From 8e656927eb7b6e4b93b732ebee0343f4708b0baf Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Thu, 26 Dec 2024 08:49:06 -0300 Subject: [PATCH 1/2] Belch tests --- test/battle/move_effect/belch.c | 60 ++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 4 deletions(-) diff --git a/test/battle/move_effect/belch.c b/test/battle/move_effect/belch.c index 2a732e0e4587..6f90be8d1437 100644 --- a/test/battle/move_effect/belch.c +++ b/test/battle/move_effect/belch.c @@ -21,7 +21,7 @@ AI_SINGLE_BATTLE_TEST("AI: Belch has nonzero score after eating a berry") TURN { MOVE(player, MOVE_MUD_SHOT); EXPECT_MOVE(opponent, MOVE_TACKLE); } TURN { MOVE(player, MOVE_TACKLE); EXPECT_MOVE(opponent, MOVE_BELCH);} } SCENE { - ANIMATION(ANIM_TYPE_MOVE, MOVE_BELCH, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BELCH, opponent); } } @@ -53,6 +53,58 @@ SINGLE_BATTLE_TEST("Belch cannot be used if the user has not eaten a berry") } } -TO_DO_BATTLE_TEST("Belch can still be used after switching out"); -TO_DO_BATTLE_TEST("Belch can still be used after fainting"); -TO_DO_BATTLE_TEST("Belch can still be used after restoring the consumed berry"); +SINGLE_BATTLE_TEST("Belch can still be used after switching out") +{ + GIVEN { + PLAYER(SPECIES_GREEDENT) { Item(ITEM_ORAN_BERRY); } + PLAYER(SPECIES_SKWOVET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_STUFF_CHEEKS); } + TURN { SWITCH(player, 1); } + TURN { SWITCH(player, 0); } + TURN { MOVE(player, MOVE_BELCH); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_STUFF_CHEEKS, player); + SWITCH_OUT_MESSAGE("Greedent"); + SWITCH_OUT_MESSAGE("Skwovet"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BELCH, player); + } +} + +SINGLE_BATTLE_TEST("Belch can still be used after fainting") +{ + GIVEN { + PLAYER(SPECIES_GREEDENT) { Item(ITEM_ORAN_BERRY); } + PLAYER(SPECIES_SKWOVET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_STUFF_CHEEKS); MOVE(opponent, MOVE_FISSURE); SEND_OUT(player, 1); } + TURN { MOVE(player, MOVE_REVIVAL_BLESSING, partyIndex: 0); } + TURN { SWITCH(player, 0); } + TURN { MOVE(player, MOVE_BELCH); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_STUFF_CHEEKS, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_FISSURE, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_REVIVAL_BLESSING, player); + SWITCH_OUT_MESSAGE("Skwovet"); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BELCH, player); + } +} + +SINGLE_BATTLE_TEST("Belch can still be used after restoring the consumed berry") +{ + GIVEN { + PLAYER(SPECIES_GREEDENT) { Item(ITEM_ORAN_BERRY); } + PLAYER(SPECIES_SKWOVET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_STUFF_CHEEKS); } + TURN { MOVE(player, MOVE_RECYCLE); } + TURN { MOVE(player, MOVE_BELCH); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_STUFF_CHEEKS, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_RECYCLE, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BELCH, player); + } +} From dbd8f22a3289d7e70cfe9f2ed046a8a4e2d34f31 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Thu, 26 Dec 2024 21:32:03 -0300 Subject: [PATCH 2/2] Apply suggestions from code review --- test/battle/move_effect/belch.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/battle/move_effect/belch.c b/test/battle/move_effect/belch.c index 6f90be8d1437..f8e28929f963 100644 --- a/test/battle/move_effect/belch.c +++ b/test/battle/move_effect/belch.c @@ -56,6 +56,7 @@ SINGLE_BATTLE_TEST("Belch cannot be used if the user has not eaten a berry") SINGLE_BATTLE_TEST("Belch can still be used after switching out") { GIVEN { + ASSUME(gMovesInfo[MOVE_STUFF_CHEEKS].effect == EFFECT_STUFF_CHEEKS); PLAYER(SPECIES_GREEDENT) { Item(ITEM_ORAN_BERRY); } PLAYER(SPECIES_SKWOVET); OPPONENT(SPECIES_WOBBUFFET); @@ -75,6 +76,9 @@ SINGLE_BATTLE_TEST("Belch can still be used after switching out") SINGLE_BATTLE_TEST("Belch can still be used after fainting") { GIVEN { + ASSUME(gMovesInfo[MOVE_STUFF_CHEEKS].effect == EFFECT_STUFF_CHEEKS); + ASSUME(gMovesInfo[MOVE_FISSURE].effect == EFFECT_OHKO); + ASSUME(gMovesInfo[MOVE_REVIVAL_BLESSING].effect == EFFECT_REVIVAL_BLESSING); PLAYER(SPECIES_GREEDENT) { Item(ITEM_ORAN_BERRY); } PLAYER(SPECIES_SKWOVET); OPPONENT(SPECIES_WOBBUFFET); @@ -95,6 +99,8 @@ SINGLE_BATTLE_TEST("Belch can still be used after fainting") SINGLE_BATTLE_TEST("Belch can still be used after restoring the consumed berry") { GIVEN { + ASSUME(gMovesInfo[MOVE_STUFF_CHEEKS].effect == EFFECT_STUFF_CHEEKS); + ASSUME(gMovesInfo[MOVE_RECYCLE].effect == EFFECT_RECYCLE); PLAYER(SPECIES_GREEDENT) { Item(ITEM_ORAN_BERRY); } PLAYER(SPECIES_SKWOVET); OPPONENT(SPECIES_WOBBUFFET);