Skip to content

Commit

Permalink
Small Battle Test reorganization (#4504)
Browse files Browse the repository at this point in the history
* Fixed test folders + Chud Chew test name fixes

* Adjusted file names + merged Burn Up and Double Shock files

* Added Spit Up/Swallow files that point to Stockpile's file

* Multiple changes (see description)

- Moved secondary effect files to their own folder.
- Split hit_set_entry_hazards.c to separate files for Spikes/Stealth Rock.
- Grouped Hex/Venoshock to the same file
  • Loading branch information
AsparagusEduardo authored May 6, 2024
1 parent e20cb62 commit 5ec08ee
Show file tree
Hide file tree
Showing 45 changed files with 311 additions and 295 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "global.h"
#include "test/battle.h"

SINGLE_BATTLE_TEST("Cud Chuw will activate Kee Berry effect again on the next turn")
SINGLE_BATTLE_TEST("Cud Chew will activate Kee Berry effect again on the next turn")
{
GIVEN {
ASSUME(gItemsInfo[ITEM_KEE_BERRY].holdEffect == HOLD_EFFECT_KEE_BERRY);
Expand All @@ -23,7 +23,7 @@ SINGLE_BATTLE_TEST("Cud Chuw will activate Kee Berry effect again on the next tu
}
}

SINGLE_BATTLE_TEST("Cud Chuw will activate Oran Berry effect again on the next turn")
SINGLE_BATTLE_TEST("Cud Chew will activate Oran Berry effect again on the next turn")
{
GIVEN {
ASSUME(gItemsInfo[ITEM_ORAN_BERRY].holdEffect == HOLD_EFFECT_RESTORE_HP);
Expand Down
File renamed without changes.
54 changes: 0 additions & 54 deletions test/battle/move_effect/burn_up.c

This file was deleted.

File renamed without changes.
54 changes: 0 additions & 54 deletions test/battle/move_effect/double_shock.c

This file was deleted.

112 changes: 112 additions & 0 deletions test/battle/move_effect/fail_if_not_arg_type.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
#include "global.h"
#include "test/battle.h"

SINGLE_BATTLE_TEST("Burn Up user loses its Fire-type")
{
GIVEN {
ASSUME(gMovesInfo[MOVE_BURN_UP].effect == EFFECT_FAIL_IF_NOT_ARG_TYPE);
ASSUME(MoveHasAdditionalEffectSelfArg(MOVE_BURN_UP, MOVE_EFFECT_REMOVE_ARG_TYPE, TYPE_FIRE) == TRUE);
ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[0] != TYPE_FIRE || gSpeciesInfo[SPECIES_WOBBUFFET].types[1] != TYPE_FIRE);
ASSUME(gSpeciesInfo[SPECIES_CYNDAQUIL].types[0] == TYPE_FIRE || gSpeciesInfo[SPECIES_CYNDAQUIL].types[1] == TYPE_FIRE);
PLAYER(SPECIES_CYNDAQUIL);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_BURN_UP); }
TURN { MOVE(player, MOVE_BURN_UP); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_BURN_UP, player);
MESSAGE("Cyndaquil burned itself out!");
MESSAGE("Cyndaquil used Burn Up!");
MESSAGE("But it failed!");
}
}

SINGLE_BATTLE_TEST("Burn Up fails if the user isn't a Fire-type")
{
GIVEN {
ASSUME(gMovesInfo[MOVE_BURN_UP].effect == EFFECT_FAIL_IF_NOT_ARG_TYPE);
ASSUME(MoveHasAdditionalEffectSelfArg(MOVE_BURN_UP, MOVE_EFFECT_REMOVE_ARG_TYPE, TYPE_FIRE) == TRUE);
ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[0] != TYPE_FIRE || gSpeciesInfo[SPECIES_WOBBUFFET].types[1] != TYPE_FIRE);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_BURN_UP); }
} SCENE {
NONE_OF { ANIMATION(ANIM_TYPE_MOVE, MOVE_BURN_UP, player); }
MESSAGE("Wobbuffet used Burn Up!");
MESSAGE("But it failed!");
}
}

SINGLE_BATTLE_TEST("Burn Up user loses its Fire-type if enemy faints")
{
GIVEN {
ASSUME(gMovesInfo[MOVE_BURN_UP].effect == EFFECT_FAIL_IF_NOT_ARG_TYPE);
ASSUME(MoveHasAdditionalEffectSelfArg(MOVE_BURN_UP, MOVE_EFFECT_REMOVE_ARG_TYPE, TYPE_FIRE) == TRUE);
ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[0] != TYPE_FIRE || gSpeciesInfo[SPECIES_WOBBUFFET].types[1] != TYPE_FIRE);
ASSUME(gSpeciesInfo[SPECIES_CYNDAQUIL].types[0] == TYPE_FIRE || gSpeciesInfo[SPECIES_CYNDAQUIL].types[1] == TYPE_FIRE);
PLAYER(SPECIES_CYNDAQUIL);
OPPONENT(SPECIES_WOBBUFFET) { HP(1); }
} WHEN {
TURN { MOVE(player, MOVE_BURN_UP); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_BURN_UP, player);
HP_BAR(opponent, hp: 0);
MESSAGE("Cyndaquil burned itself out!");
}
}

SINGLE_BATTLE_TEST("Double Shock user loses its Electric-type")
{
GIVEN {
ASSUME(gMovesInfo[MOVE_DOUBLE_SHOCK].effect == EFFECT_FAIL_IF_NOT_ARG_TYPE);
ASSUME(MoveHasAdditionalEffectSelfArg(MOVE_DOUBLE_SHOCK, MOVE_EFFECT_REMOVE_ARG_TYPE, TYPE_ELECTRIC) == TRUE);
ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[0] != TYPE_ELECTRIC || gSpeciesInfo[SPECIES_WOBBUFFET].types[1] != TYPE_ELECTRIC);
ASSUME(gSpeciesInfo[SPECIES_PIKACHU].types[0] == TYPE_ELECTRIC || gSpeciesInfo[SPECIES_PIKACHU].types[1] == TYPE_ELECTRIC);
PLAYER(SPECIES_PIKACHU);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_DOUBLE_SHOCK); }
TURN { MOVE(player, MOVE_DOUBLE_SHOCK); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_DOUBLE_SHOCK, player);
MESSAGE("Pikachu used up all of its electricity!");
MESSAGE("Pikachu used Double Shock!");
MESSAGE("But it failed!");
}
}

SINGLE_BATTLE_TEST("Double Shock fails if the user isn't an Electric-type")
{
GIVEN {
ASSUME(gMovesInfo[MOVE_DOUBLE_SHOCK].effect == EFFECT_FAIL_IF_NOT_ARG_TYPE);
ASSUME(MoveHasAdditionalEffectSelfArg(MOVE_DOUBLE_SHOCK, MOVE_EFFECT_REMOVE_ARG_TYPE, TYPE_ELECTRIC) == TRUE);
ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[0] != TYPE_ELECTRIC || gSpeciesInfo[SPECIES_WOBBUFFET].types[1] != TYPE_ELECTRIC);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_DOUBLE_SHOCK); }
} SCENE {
NONE_OF { ANIMATION(ANIM_TYPE_MOVE, MOVE_DOUBLE_SHOCK, player); }
MESSAGE("Wobbuffet used Double Shock!");
MESSAGE("But it failed!");
}
}

SINGLE_BATTLE_TEST("Double Shock user loses its Electric-type if enemy faints")
{
GIVEN {
ASSUME(gMovesInfo[MOVE_DOUBLE_SHOCK].effect == EFFECT_FAIL_IF_NOT_ARG_TYPE);
ASSUME(MoveHasAdditionalEffectSelfArg(MOVE_DOUBLE_SHOCK, MOVE_EFFECT_REMOVE_ARG_TYPE, TYPE_ELECTRIC) == TRUE);
ASSUME(gSpeciesInfo[SPECIES_WOBBUFFET].types[0] != TYPE_ELECTRIC || gSpeciesInfo[SPECIES_WOBBUFFET].types[1] != TYPE_ELECTRIC);
ASSUME(gSpeciesInfo[SPECIES_PIKACHU].types[0] == TYPE_ELECTRIC || gSpeciesInfo[SPECIES_PIKACHU].types[1] == TYPE_ELECTRIC);
PLAYER(SPECIES_PIKACHU);
OPPONENT(SPECIES_WOBBUFFET) { HP(1); }
} WHEN {
TURN { MOVE(player, MOVE_DOUBLE_SHOCK); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_DOUBLE_SHOCK, player);
HP_BAR(opponent, hp: 0);
MESSAGE("Pikachu used up all of its electricity!");
}
}
File renamed without changes.
34 changes: 0 additions & 34 deletions test/battle/move_effect/hex.c

This file was deleted.

117 changes: 0 additions & 117 deletions test/battle/move_effect/hit_set_entry_hazardss.c

This file was deleted.

File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions test/battle/move_effect/spit_up.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include "global.h"
#include "test/battle.h"

// Go to test/battle/move_effect/stockpile.c for Spit Up's tests
Loading

0 comments on commit 5ec08ee

Please sign in to comment.