diff --git a/Makefile b/Makefile index f107a09d4..3787bbe5d 100644 --- a/Makefile +++ b/Makefile @@ -450,7 +450,7 @@ $(OBJ_DIR)/sym_ewram.ld: sym_ewram.txt # NOTE: Based on C_DEP above, but without NODEP and KEEP_TEMPS handling. define TEST_DEP -$1: $2 $$(shell $(SCANINC) -I include -I tools/agbcc/include -I gflib -I test $2) +$1: $2 $$(shell $(SCANINC) -I include -I tools/agbcc/include -I gflib $2) @echo "$$(CC1) -o $$@ $$<" @$$(CPP) $$(CPPFLAGS) $$< | $$(PREPROC) $$< charmap.txt -i | $$(CC1) $$(CFLAGS) -o - - | cat - <(echo -e ".text\n\t.align\t2, 0") | $$(AS) $$(ASFLAGS) -o $$@ - endef diff --git a/test/test_battle.h b/include/test/battle.h similarity index 99% rename from test/test_battle.h rename to include/test/battle.h index 74a3bc2e8..f5be6b4e6 100644 --- a/test/test_battle.h +++ b/include/test/battle.h @@ -447,13 +447,13 @@ #ifndef GUARD_TEST_BATTLE_H #define GUARD_TEST_BATTLE_H +#include "global.h" #include "battle.h" #include "battle_anim.h" #include "data.h" #include "item.h" #include "random.h" #include "recorded_battle.h" -#include "test.h" #include "util.h" #include "constants/abilities.h" #include "constants/battle_anim.h" @@ -462,6 +462,7 @@ #include "constants/items.h" #include "constants/moves.h" #include "constants/species.h" +#include "test/test.h" // NOTE: If the stack is too small the test runner will probably crash // or loop. diff --git a/test/test.h b/include/test/test.h similarity index 100% rename from test/test.h rename to include/test/test.h diff --git a/test/ability_fluffy.c b/test/ability_fluffy.c index 238045e25..6c76aeed5 100644 --- a/test/ability_fluffy.c +++ b/test/ability_fluffy.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/ability_bad_dreams.c b/test/battle/ability/bad_dreams.c similarity index 99% rename from test/ability_bad_dreams.c rename to test/battle/ability/bad_dreams.c index 9bf800534..42ac3f04a 100644 --- a/test/ability_bad_dreams.c +++ b/test/battle/ability/bad_dreams.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/ability_beads_of_ruin.c b/test/battle/ability/beads_of_ruin.c similarity index 98% rename from test/ability_beads_of_ruin.c rename to test/battle/ability/beads_of_ruin.c index 28b39a430..1c6f740e8 100644 --- a/test/ability_beads_of_ruin.c +++ b/test/battle/ability/beads_of_ruin.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/ability_blaze.c b/test/battle/ability/blaze.c similarity index 95% rename from test/ability_blaze.c rename to test/battle/ability/blaze.c index 1e12c6b29..12ccced93 100644 --- a/test/ability_blaze.c +++ b/test/battle/ability/blaze.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Blaze boosts Fire-type moves in a pinch", s16 damage) { diff --git a/test/ability_clear_body.c b/test/battle/ability/clear_body.c similarity index 98% rename from test/ability_clear_body.c rename to test/battle/ability/clear_body.c index 11789aaf6..7f167c9fe 100644 --- a/test/ability_clear_body.c +++ b/test/battle/ability/clear_body.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Clear Body prevents intimidate") { diff --git a/test/ability_cloud_nine.c b/test/battle/ability/cloud_nine.c similarity index 94% rename from test/ability_cloud_nine.c rename to test/battle/ability/cloud_nine.c index 02da15ee1..e8de0fd8a 100644 --- a/test/ability_cloud_nine.c +++ b/test/battle/ability/cloud_nine.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Cloud Nine prevents weather effects") { diff --git a/test/ability_compound_eyes.c b/test/battle/ability/compound_eyes.c similarity index 97% rename from test/ability_compound_eyes.c rename to test/battle/ability/compound_eyes.c index 6bdb15fa7..cc005943b 100644 --- a/test/ability_compound_eyes.c +++ b/test/battle/ability/compound_eyes.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Compound Eyes raises accuracy") { diff --git a/test/ability_contrary.c b/test/battle/ability/contrary.c similarity index 99% rename from test/ability_contrary.c rename to test/battle/ability/contrary.c index 799cb1116..4e4417e19 100644 --- a/test/ability_contrary.c +++ b/test/battle/ability/contrary.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/ability_cute_charm.c b/test/battle/ability/cute_charm.c similarity index 98% rename from test/ability_cute_charm.c rename to test/battle/ability/cute_charm.c index 5ec6ca7c4..9bef66b19 100644 --- a/test/ability_cute_charm.c +++ b/test/battle/ability/cute_charm.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Cute Charm inflicts infatuation on contact") { diff --git a/test/ability_damp.c b/test/battle/ability/damp.c similarity index 98% rename from test/ability_damp.c rename to test/battle/ability/damp.c index fc4580daa..46e378c5f 100644 --- a/test/ability_damp.c +++ b/test/battle/ability/damp.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Damp prevents explosion-like moves from enemies") { diff --git a/test/primal_weather.c b/test/battle/ability/desolate_land.c similarity index 51% rename from test/primal_weather.c rename to test/battle/ability/desolate_land.c index 650a79921..ca52c9cd6 100644 --- a/test/primal_weather.c +++ b/test/battle/ability/desolate_land.c @@ -1,72 +1,12 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { - ASSUME(gBattleMoves[MOVE_EMBER].power != 0); - ASSUME(gBattleMoves[MOVE_EMBER].type == TYPE_FIRE); ASSUME(gBattleMoves[MOVE_WATER_GUN].power != 0); ASSUME(gBattleMoves[MOVE_WATER_GUN].type == TYPE_WATER); } -SINGLE_BATTLE_TEST("Primordial Sea blocks damaging Fire-type moves") -{ - GIVEN { - PLAYER(SPECIES_KYOGRE) {Item(ITEM_BLUE_ORB);} - OPPONENT(SPECIES_WOBBUFFET); - } WHEN { - TURN { MOVE(opponent, MOVE_EMBER); } - TURN { MOVE(opponent, MOVE_EMBER); } - } SCENE { - MESSAGE("Foe Wobbuffet used Ember!"); - NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, opponent); - MESSAGE("The Fire-type attack fizzled out\nin the heavy rain!"); - NOT HP_BAR(player); - MESSAGE("Foe Wobbuffet used Ember!"); - NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, opponent); - MESSAGE("The Fire-type attack fizzled out\nin the heavy rain!"); - NOT HP_BAR(player); - } THEN { - EXPECT_EQ(player->hp, player->maxHP); - } -} - -DOUBLE_BATTLE_TEST("Primordial Sea blocks damaging Fire-type moves and prints the message only once with moves hitting multiple targets") -{ - GIVEN { - ASSUME(gBattleMoves[MOVE_ERUPTION].power != 0); - ASSUME(gBattleMoves[MOVE_ERUPTION].type == TYPE_FIRE); - ASSUME(gBattleMoves[MOVE_ERUPTION].target == MOVE_TARGET_BOTH); - PLAYER(SPECIES_KYOGRE) {Item(ITEM_BLUE_ORB); {Speed(5);}} - PLAYER(SPECIES_WOBBUFFET) {Speed(5);} - OPPONENT(SPECIES_WOBBUFFET) {Speed(10);} - OPPONENT(SPECIES_WOBBUFFET) {Speed(8);} - } WHEN { - TURN { MOVE(opponentLeft, MOVE_ERUPTION); } - } SCENE { - MESSAGE("Foe Wobbuffet used Eruption!"); - NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_ERUPTION, opponentLeft); - MESSAGE("The Fire-type attack fizzled out\nin the heavy rain!"); - NOT MESSAGE("The Fire-type attack fizzled out\nin the heavy rain!"); - } THEN { - EXPECT_EQ(playerLeft->hp, playerLeft->maxHP); - EXPECT_EQ(playerRight->hp, playerRight->maxHP); - } -} - -SINGLE_BATTLE_TEST("Primordial Sea does not block a move if pokemon is asleep and uses a Fire-type move") // Sleep/confusion/paralysis all happen before the check for primal weather -{ - GIVEN { - PLAYER(SPECIES_KYOGRE) {Item(ITEM_BLUE_ORB);} - OPPONENT(SPECIES_WOBBUFFET) {Status1(STATUS1_SLEEP);} - } WHEN { - TURN { MOVE(opponent, MOVE_EMBER); } - } SCENE { - NOT MESSAGE("The Fire-type attack fizzled out\nin the heavy rain!"); - MESSAGE("Foe Wobbuffet is fast asleep."); - } -} - SINGLE_BATTLE_TEST("Desolate Land blocks damaging Water-type moves") { GIVEN { diff --git a/test/ability_download.c b/test/battle/ability/download.c similarity index 99% rename from test/ability_download.c rename to test/battle/ability/download.c index ee03f6911..5b59e37f0 100644 --- a/test/ability_download.c +++ b/test/battle/ability/download.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/ability_drizzle.c b/test/battle/ability/drizzle.c similarity index 96% rename from test/ability_drizzle.c rename to test/battle/ability/drizzle.c index fd0d42616..ce0fc9514 100644 --- a/test/ability_drizzle.c +++ b/test/battle/ability/drizzle.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Drizzle summons rain", s16 damage) { diff --git a/test/ability_dry_skin.c b/test/battle/ability/dry_skin.c similarity index 99% rename from test/ability_dry_skin.c rename to test/battle/ability/dry_skin.c index 59f99760c..db0b61f2d 100644 --- a/test/ability_dry_skin.c +++ b/test/battle/ability/dry_skin.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Dry Skin causes 1/8th Max HP damage in Sun") { diff --git a/test/ability_electromorphosis.c b/test/battle/ability/electromorphosis.c similarity index 98% rename from test/ability_electromorphosis.c rename to test/battle/ability/electromorphosis.c index 25d33aac0..9111fa328 100644 --- a/test/ability_electromorphosis.c +++ b/test/battle/ability/electromorphosis.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Electromorphosis sets up Charge when hit by any move") { diff --git a/test/ability_flame_body.c b/test/battle/ability/flame_body.c similarity index 97% rename from test/ability_flame_body.c rename to test/battle/ability/flame_body.c index 6d0823062..959b583f8 100644 --- a/test/ability_flame_body.c +++ b/test/battle/ability/flame_body.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Flame Body inflicts burn on contact") { diff --git a/test/ability_flower_gift.c b/test/battle/ability/flower_gift.c similarity index 99% rename from test/ability_flower_gift.c rename to test/battle/ability/flower_gift.c index 58d4bf2e1..e02f90dc6 100644 --- a/test/ability_flower_gift.c +++ b/test/battle/ability/flower_gift.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Flower Gift transforms Cherrim in harsh sunlight") { diff --git a/test/ability_forecast.c b/test/battle/ability/forecast.c similarity index 99% rename from test/ability_forecast.c rename to test/battle/ability/forecast.c index d2d36c1ab..66793ebfb 100644 --- a/test/ability_forecast.c +++ b/test/battle/ability/forecast.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Forecast transforms Castform in weather from an opponent's move") { diff --git a/test/ability_full_metal_body.c b/test/battle/ability/full_metal_body.c similarity index 98% rename from test/ability_full_metal_body.c rename to test/battle/ability/full_metal_body.c index c47ce9d4d..d00714d52 100644 --- a/test/ability_full_metal_body.c +++ b/test/battle/ability/full_metal_body.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Full Metal Body prevents intimidate") { diff --git a/test/ability_hunger_switch.c b/test/battle/ability/hunger_switch.c similarity index 96% rename from test/ability_hunger_switch.c rename to test/battle/ability/hunger_switch.c index 336c2c160..c0802d664 100644 --- a/test/ability_hunger_switch.c +++ b/test/battle/ability/hunger_switch.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Hunger Switch switches Morpeko's forms at the end of the turn") { diff --git a/test/ability_hydration.c b/test/battle/ability/hydration.c similarity index 95% rename from test/ability_hydration.c rename to test/battle/ability/hydration.c index 45689b212..2dca490c0 100644 --- a/test/ability_hydration.c +++ b/test/battle/ability/hydration.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Hydration cures non-volatile Status conditions if it is raining") { diff --git a/test/ability_hyper_cutter.c b/test/battle/ability/hyper_cutter.c similarity index 98% rename from test/ability_hyper_cutter.c rename to test/battle/ability/hyper_cutter.c index 67dac4c66..ac942039b 100644 --- a/test/ability_hyper_cutter.c +++ b/test/battle/ability/hyper_cutter.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Hyper Cutter prevents intimidate") { diff --git a/test/ability_ice_body.c b/test/battle/ability/ice_body.c similarity index 96% rename from test/ability_ice_body.c rename to test/battle/ability/ice_body.c index 0658ace81..aca84532a 100644 --- a/test/ability_ice_body.c +++ b/test/battle/ability/ice_body.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Ice Body prevents damage from hail") { diff --git a/test/ability_immunity.c b/test/battle/ability/immunity.c similarity index 98% rename from test/ability_immunity.c rename to test/battle/ability/immunity.c index fea2eb522..3c6c4afa6 100644 --- a/test/ability_immunity.c +++ b/test/battle/ability/immunity.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Immunity prevents Poison Sting poison") { diff --git a/test/ability_inner_focus.c b/test/battle/ability/inner_focus.c similarity index 98% rename from test/ability_inner_focus.c rename to test/battle/ability/inner_focus.c index 5b713475d..574c860a7 100644 --- a/test/ability_inner_focus.c +++ b/test/battle/ability/inner_focus.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Inner Focus prevents intimidate") { diff --git a/test/ability_insomnia.c b/test/battle/ability/insomnia.c similarity index 98% rename from test/ability_insomnia.c rename to test/battle/ability/insomnia.c index 2fcb6a97e..cb22be925 100644 --- a/test/ability_insomnia.c +++ b/test/battle/ability/insomnia.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Insomnia prevents sleep") { diff --git a/test/ability_intimidate.c b/test/battle/ability/intimidate.c similarity index 99% rename from test/ability_intimidate.c rename to test/battle/ability/intimidate.c index f9681493b..a0a23cc13 100644 --- a/test/ability_intimidate.c +++ b/test/battle/ability/intimidate.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/ability_leaf_guard.c b/test/battle/ability/leaf_guard.c similarity index 99% rename from test/ability_leaf_guard.c rename to test/battle/ability/leaf_guard.c index 92727175a..2c052b5a6 100644 --- a/test/ability_leaf_guard.c +++ b/test/battle/ability/leaf_guard.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Leaf Guard prevents non-volatile status conditions in sun") { diff --git a/test/ability_limber.c b/test/battle/ability/limber.c similarity index 94% rename from test/ability_limber.c rename to test/battle/ability/limber.c index ff701b663..87d4177ff 100644 --- a/test/ability_limber.c +++ b/test/battle/ability/limber.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Limber prevents paralysis") { diff --git a/test/ability_magic_bounce.c b/test/battle/ability/magic_bounce.c similarity index 99% rename from test/ability_magic_bounce.c rename to test/battle/ability/magic_bounce.c index 466677efa..80ff40f2e 100644 --- a/test/ability_magic_bounce.c +++ b/test/battle/ability/magic_bounce.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Magic Bounce bounces back status moves") diff --git a/test/ability_mirror_armor.c b/test/battle/ability/mirror_armor.c similarity index 99% rename from test/ability_mirror_armor.c rename to test/battle/ability/mirror_armor.c index 7e15e029b..2b0a59044 100644 --- a/test/ability_mirror_armor.c +++ b/test/battle/ability/mirror_armor.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/ability_oblivious.c b/test/battle/ability/oblivious.c similarity index 98% rename from test/ability_oblivious.c rename to test/battle/ability/oblivious.c index 9d9aeeb29..51d27bb16 100644 --- a/test/ability_oblivious.c +++ b/test/battle/ability/oblivious.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Oblivious prevents Infatuation") { diff --git a/test/battle/ability/overcoat.c b/test/battle/ability/overcoat.c new file mode 100644 index 000000000..6673c0cee --- /dev/null +++ b/test/battle/ability/overcoat.c @@ -0,0 +1,21 @@ +#include "global.h" +#include "test/battle.h" + +SINGLE_BATTLE_TEST("Overcoat blocks powder and spore moves") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_STUN_SPORE].powderMove); + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_PINECO) { Ability(ABILITY_OVERCOAT); } + } WHEN { + TURN { MOVE(player, MOVE_STUN_SPORE); } + } SCENE { + ABILITY_POPUP(opponent, ABILITY_OVERCOAT); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_STUN_SPORE, player); + MESSAGE("It doesn't affect Foe Pineco…"); + } +} + +TO_DO_BATTLE_TEST("Overcoat blocks damage from hail"); +TO_DO_BATTLE_TEST("Overcoat blocks damage from sandstorm"); +TO_DO_BATTLE_TEST("Overcoat blocks Effect Spore's effect"); diff --git a/test/ability_overgrow.c b/test/battle/ability/overgrow.c similarity index 96% rename from test/ability_overgrow.c rename to test/battle/ability/overgrow.c index 82d8dd467..548dc9bb3 100644 --- a/test/ability_overgrow.c +++ b/test/battle/ability/overgrow.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Overgrow boosts Grass-type moves in a pinch", s16 damage) { diff --git a/test/ability_own_tempo.c b/test/battle/ability/own_tempo.c similarity index 99% rename from test/ability_own_tempo.c rename to test/battle/ability/own_tempo.c index 2440ac779..4c6a3167f 100644 --- a/test/ability_own_tempo.c +++ b/test/battle/ability/own_tempo.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Own Tempo prevents intimidate") { diff --git a/test/ability_pastel_veil.c b/test/battle/ability/pastel_veil.c similarity index 99% rename from test/ability_pastel_veil.c rename to test/battle/ability/pastel_veil.c index 363c018c1..74d764fc3 100644 --- a/test/ability_pastel_veil.c +++ b/test/battle/ability/pastel_veil.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Pastel Veil prevents Poison Sting poison") { diff --git a/test/ability_poison_point.c b/test/battle/ability/poison_point.c similarity index 97% rename from test/ability_poison_point.c rename to test/battle/ability/poison_point.c index 262871398..7d2fcd518 100644 --- a/test/ability_poison_point.c +++ b/test/battle/ability/poison_point.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Poison Point inflicts poison on contact") { diff --git a/test/battle/ability/primordial_sea.c b/test/battle/ability/primordial_sea.c new file mode 100644 index 000000000..37fbb1b23 --- /dev/null +++ b/test/battle/ability/primordial_sea.c @@ -0,0 +1,66 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_EMBER].power != 0); + ASSUME(gBattleMoves[MOVE_EMBER].type == TYPE_FIRE); +} + +SINGLE_BATTLE_TEST("Primordial Sea blocks damaging Fire-type moves") +{ + GIVEN { + PLAYER(SPECIES_KYOGRE) {Item(ITEM_BLUE_ORB);} + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_EMBER); } + TURN { MOVE(opponent, MOVE_EMBER); } + } SCENE { + MESSAGE("Foe Wobbuffet used Ember!"); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, opponent); + MESSAGE("The Fire-type attack fizzled out\nin the heavy rain!"); + NOT HP_BAR(player); + MESSAGE("Foe Wobbuffet used Ember!"); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_EMBER, opponent); + MESSAGE("The Fire-type attack fizzled out\nin the heavy rain!"); + NOT HP_BAR(player); + } THEN { + EXPECT_EQ(player->hp, player->maxHP); + } +} + +DOUBLE_BATTLE_TEST("Primordial Sea blocks damaging Fire-type moves and prints the message only once with moves hitting multiple targets") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_ERUPTION].power != 0); + ASSUME(gBattleMoves[MOVE_ERUPTION].type == TYPE_FIRE); + ASSUME(gBattleMoves[MOVE_ERUPTION].target == MOVE_TARGET_BOTH); + PLAYER(SPECIES_KYOGRE) {Item(ITEM_BLUE_ORB); {Speed(5);}} + PLAYER(SPECIES_WOBBUFFET) {Speed(5);} + OPPONENT(SPECIES_WOBBUFFET) {Speed(10);} + OPPONENT(SPECIES_WOBBUFFET) {Speed(8);} + } WHEN { + TURN { MOVE(opponentLeft, MOVE_ERUPTION); } + } SCENE { + MESSAGE("Foe Wobbuffet used Eruption!"); + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_ERUPTION, opponentLeft); + MESSAGE("The Fire-type attack fizzled out\nin the heavy rain!"); + NOT MESSAGE("The Fire-type attack fizzled out\nin the heavy rain!"); + } THEN { + EXPECT_EQ(playerLeft->hp, playerLeft->maxHP); + EXPECT_EQ(playerRight->hp, playerRight->maxHP); + } +} + +SINGLE_BATTLE_TEST("Primordial Sea does not block a move if pokemon is asleep and uses a Fire-type move") // Sleep/confusion/paralysis all happen before the check for primal weather +{ + GIVEN { + PLAYER(SPECIES_KYOGRE) {Item(ITEM_BLUE_ORB);} + OPPONENT(SPECIES_WOBBUFFET) {Status1(STATUS1_SLEEP);} + } WHEN { + TURN { MOVE(opponent, MOVE_EMBER); } + } SCENE { + NOT MESSAGE("The Fire-type attack fizzled out\nin the heavy rain!"); + MESSAGE("Foe Wobbuffet is fast asleep."); + } +} \ No newline at end of file diff --git a/test/ability_protosynthesis.c b/test/battle/ability/protosynthesis.c similarity index 99% rename from test/ability_protosynthesis.c rename to test/battle/ability/protosynthesis.c index 9f794e00a..0ed74d4f6 100644 --- a/test/ability_protosynthesis.c +++ b/test/battle/ability/protosynthesis.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/ability_quark_drive.c b/test/battle/ability/quark_drive.c similarity index 99% rename from test/ability_quark_drive.c rename to test/battle/ability/quark_drive.c index b004c760c..bce6795ca 100644 --- a/test/ability_quark_drive.c +++ b/test/battle/ability/quark_drive.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/ability_rain_dish.c b/test/battle/ability/rain_dish.c similarity index 94% rename from test/ability_rain_dish.c rename to test/battle/ability/rain_dish.c index 04009507c..dd647f0eb 100644 --- a/test/ability_rain_dish.c +++ b/test/battle/ability/rain_dish.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Rain Dish recovers 1/16th of Max HP in Rain") { diff --git a/test/ability_rattled.c b/test/battle/ability/rattled.c similarity index 99% rename from test/ability_rattled.c rename to test/battle/ability/rattled.c index 493e3cfca..e936ed7de 100644 --- a/test/ability_rattled.c +++ b/test/battle/ability/rattled.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/ability_sand_veil.c b/test/battle/ability/sand_veil.c similarity index 96% rename from test/ability_sand_veil.c rename to test/battle/ability/sand_veil.c index 50abad51c..c2f6440c3 100644 --- a/test/ability_sand_veil.c +++ b/test/battle/ability/sand_veil.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Sand Veil prevents damage from sandstorm") { diff --git a/test/ability_schooling.c b/test/battle/ability/schooling.c similarity index 99% rename from test/ability_schooling.c rename to test/battle/ability/schooling.c index 87f69ea31..448e37261 100644 --- a/test/ability_schooling.c +++ b/test/battle/ability/schooling.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Schooling switches Level 20+ Wishiwashi's form when HP is 25-percent or less at the end of the turn") { diff --git a/test/ability_scrappy.c b/test/battle/ability/scrappy.c similarity index 98% rename from test/ability_scrappy.c rename to test/battle/ability/scrappy.c index b4f83afcf..df4ededa4 100644 --- a/test/ability_scrappy.c +++ b/test/battle/ability/scrappy.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Scrappy prevents intimidate") { diff --git a/test/ability_snow_cloak.c b/test/battle/ability/snow_cloak.c similarity index 96% rename from test/ability_snow_cloak.c rename to test/battle/ability/snow_cloak.c index 8a95a8ea0..88fe6e509 100644 --- a/test/ability_snow_cloak.c +++ b/test/battle/ability/snow_cloak.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Snow Cloak prevents damage from hail") { diff --git a/test/ability_snow_warning.c b/test/battle/ability/snow_warning.c similarity index 96% rename from test/ability_snow_warning.c rename to test/battle/ability/snow_warning.c index 5e8b13d54..17f18814b 100644 --- a/test/ability_snow_warning.c +++ b/test/battle/ability/snow_warning.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" #if B_SNOW_WARNING < GEN_9 SINGLE_BATTLE_TEST("Snow Warning summons hail") diff --git a/test/ability_speed_boost.c b/test/battle/ability/speed_boost.c similarity index 96% rename from test/ability_speed_boost.c rename to test/battle/ability/speed_boost.c index 78aa876e6..0cc82e806 100644 --- a/test/ability_speed_boost.c +++ b/test/battle/ability/speed_boost.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Speed Boost gradually boosts Speed") { diff --git a/test/ability_stamina.c b/test/battle/ability/stamina.c similarity index 99% rename from test/ability_stamina.c rename to test/battle/ability/stamina.c index 70cf3cdc0..3470cce51 100644 --- a/test/ability_stamina.c +++ b/test/battle/ability/stamina.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" #define STAMINA_STAT_RAISE(target, msg) \ { \ diff --git a/test/ability_static.c b/test/battle/ability/static.c similarity index 97% rename from test/ability_static.c rename to test/battle/ability/static.c index 083540d5b..e0d91aa0d 100644 --- a/test/ability_static.c +++ b/test/battle/ability/static.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Static inflicts paralysis on contact") { diff --git a/test/ability_stench.c b/test/battle/ability/stench.c similarity index 97% rename from test/ability_stench.c rename to test/battle/ability/stench.c index 33964c355..4153e6b15 100644 --- a/test/ability_stench.c +++ b/test/battle/ability/stench.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Stench has a 10% chance to flinch") { diff --git a/test/ability_sturdy.c b/test/battle/ability/sturdy.c similarity index 98% rename from test/ability_sturdy.c rename to test/battle/ability/sturdy.c index 42cdab11f..7a7fdf39f 100644 --- a/test/ability_sturdy.c +++ b/test/battle/ability/sturdy.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Sturdy prevents OHKO moves") { diff --git a/test/ability_swarm.c b/test/battle/ability/swarm.c similarity index 97% rename from test/ability_swarm.c rename to test/battle/ability/swarm.c index 7e4211119..b49bd225f 100644 --- a/test/ability_swarm.c +++ b/test/battle/ability/swarm.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Swarm boosts Bug-type moves in a pinch", s16 damage) { diff --git a/test/ability_sword_of_ruin.c b/test/battle/ability/sword_of_ruin.c similarity index 98% rename from test/ability_sword_of_ruin.c rename to test/battle/ability/sword_of_ruin.c index 6ec4f8fe8..2abc0c04f 100644 --- a/test/ability_sword_of_ruin.c +++ b/test/battle/ability/sword_of_ruin.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/ability_tablets_of_ruin.c b/test/battle/ability/tablets_of_ruin.c similarity index 98% rename from test/ability_tablets_of_ruin.c rename to test/battle/ability/tablets_of_ruin.c index 38dcfc856..ca12b6813 100644 --- a/test/ability_tablets_of_ruin.c +++ b/test/battle/ability/tablets_of_ruin.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/ability_torrent.c b/test/battle/ability/torrent.c similarity index 95% rename from test/ability_torrent.c rename to test/battle/ability/torrent.c index e5c701775..673e21b79 100644 --- a/test/ability_torrent.c +++ b/test/battle/ability/torrent.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Torrent boosts Water-type moves in a pinch", s16 damage) { diff --git a/test/ability_vessel_of_ruin.c b/test/battle/ability/vessel_of_ruin.c similarity index 98% rename from test/ability_vessel_of_ruin.c rename to test/battle/ability/vessel_of_ruin.c index 6c7b2664f..4f8408795 100644 --- a/test/ability_vessel_of_ruin.c +++ b/test/battle/ability/vessel_of_ruin.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/ability_volt_absorb.c b/test/battle/ability/volt_absorb.c similarity index 99% rename from test/ability_volt_absorb.c rename to test/battle/ability/volt_absorb.c index f9af7e17b..2f69a287b 100644 --- a/test/ability_volt_absorb.c +++ b/test/battle/ability/volt_absorb.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Volt Absorb heals 25% when hit by electric type moves") { diff --git a/test/ability_water_absorb.c b/test/battle/ability/water_absorb.c similarity index 99% rename from test/ability_water_absorb.c rename to test/battle/ability/water_absorb.c index 50547d13d..cda319603 100644 --- a/test/ability_water_absorb.c +++ b/test/battle/ability/water_absorb.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Water Absorb heals 25% when hit by water type moves") { diff --git a/test/ability_white_smoke.c b/test/battle/ability/white_smoke.c similarity index 98% rename from test/ability_white_smoke.c rename to test/battle/ability/white_smoke.c index 9689aee6c..7bedbca24 100644 --- a/test/ability_white_smoke.c +++ b/test/battle/ability/white_smoke.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("White Smoke prevents intimidate") { diff --git a/test/ability_wind_power.c b/test/battle/ability/wind_power.c similarity index 99% rename from test/ability_wind_power.c rename to test/battle/ability/wind_power.c index e9cb082a9..4616a69fb 100644 --- a/test/ability_wind_power.c +++ b/test/battle/ability/wind_power.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/ability_zen_mode.c b/test/battle/ability/zen_mode.c similarity index 99% rename from test/ability_zen_mode.c rename to test/battle/ability/zen_mode.c index e0e72471f..37bb4160f 100644 --- a/test/ability_zen_mode.c +++ b/test/battle/ability/zen_mode.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Zen Mode switches Darmanitan's form when HP is half or less at the end of the turn") { diff --git a/test/battle/form_change/battle_switch.c b/test/battle/form_change/battle_switch.c new file mode 100644 index 000000000..bd18e0ccf --- /dev/null +++ b/test/battle/form_change/battle_switch.c @@ -0,0 +1,23 @@ +#include "global.h" +#include "test/battle.h" + +SINGLE_BATTLE_TEST("Aegislash reverts to Shield Form upon switching out") +{ + GIVEN { + ASSUME(P_GEN_6_POKEMON == TRUE); + PLAYER(SPECIES_AEGISLASH); + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_TACKLE); } + TURN { SWITCH(player, 1); } + TURN { SWITCH(player, 0); } + } SCENE { + ABILITY_POPUP(player, ABILITY_STANCE_CHANGE); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); + MESSAGE("Aegislash used Tackle!"); + MESSAGE("Foe Wobbuffet used Celebrate!"); + } THEN { + EXPECT_EQ(player->species, SPECIES_AEGISLASH); + } +} diff --git a/test/form_change.c b/test/battle/form_change/begin_battle.c similarity index 68% rename from test/form_change.c rename to test/battle/form_change/begin_battle.c index 43497101c..328db756d 100644 --- a/test/form_change.c +++ b/test/battle/form_change/begin_battle.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Xerneas changes into Active Form upon battle start") { @@ -79,41 +79,3 @@ SINGLE_BATTLE_TEST("Zamazenta's Iron Head becomes Behemoth Bash upon form change EXPECT_EQ(player->moves[0], MOVE_BEHEMOTH_BASH); } } - -SINGLE_BATTLE_TEST("Aegislash reverts to Shield Form upon switching out") -{ - GIVEN { - ASSUME(P_GEN_6_POKEMON == TRUE); - PLAYER(SPECIES_AEGISLASH); - PLAYER(SPECIES_WOBBUFFET); - OPPONENT(SPECIES_WOBBUFFET); - } WHEN { - TURN { MOVE(player, MOVE_TACKLE); } - TURN { SWITCH(player, 1); } - TURN { SWITCH(player, 0); } - } SCENE { - ABILITY_POPUP(player, ABILITY_STANCE_CHANGE); - ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); - MESSAGE("Aegislash used Tackle!"); - MESSAGE("Foe Wobbuffet used Celebrate!"); - } THEN { - EXPECT_EQ(player->species, SPECIES_AEGISLASH); - } -} - -SINGLE_BATTLE_TEST("Aegislash reverts to Shield Form upon fainting") -{ - GIVEN { - ASSUME(P_GEN_6_POKEMON == TRUE); - PLAYER(SPECIES_AEGISLASH) { HP(1); } - PLAYER(SPECIES_WOBBUFFET); - OPPONENT(SPECIES_WOBBUFFET); - } WHEN { - TURN { MOVE(opponent, MOVE_GUST); SEND_OUT(player, 1); } - } SCENE { - MESSAGE("Foe Wobbuffet used Gust!"); - MESSAGE("Aegislash fainted!"); - } THEN { - EXPECT_EQ(GetMonData(&PLAYER_PARTY[0], MON_DATA_SPECIES), SPECIES_AEGISLASH); - } -} diff --git a/test/battle/form_change/faint.c b/test/battle/form_change/faint.c new file mode 100644 index 000000000..f4baa2894 --- /dev/null +++ b/test/battle/form_change/faint.c @@ -0,0 +1,19 @@ +#include "global.h" +#include "test/battle.h" + +SINGLE_BATTLE_TEST("Aegislash reverts to Shield Form upon fainting") +{ + GIVEN { + ASSUME(P_GEN_6_POKEMON == TRUE); + PLAYER(SPECIES_AEGISLASH) { HP(1); } + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_GUST); SEND_OUT(player, 1); } + } SCENE { + MESSAGE("Foe Wobbuffet used Gust!"); + MESSAGE("Aegislash fainted!"); + } THEN { + EXPECT_EQ(GetMonData(&PLAYER_PARTY[0], MON_DATA_SPECIES), SPECIES_AEGISLASH); + } +} diff --git a/test/mega_evolution.c b/test/battle/form_change/mega_evolution.c similarity index 99% rename from test/mega_evolution.c rename to test/battle/form_change/mega_evolution.c index 5597f5396..32cfb2c59 100644 --- a/test/mega_evolution.c +++ b/test/battle/form_change/mega_evolution.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Venusaur can Mega Evolve holding Venusaurite") { diff --git a/test/primal_reversion.c b/test/battle/form_change/primal_reversion.c similarity index 99% rename from test/primal_reversion.c rename to test/battle/form_change/primal_reversion.c index f888d17f7..3e271f67c 100644 --- a/test/primal_reversion.c +++ b/test/battle/form_change/primal_reversion.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Primal reversion happens for Groudon only when holding Red Orb") { diff --git a/test/hold_effect_air_balloon.c b/test/battle/hold_effect/air_balloon.c similarity index 99% rename from test/hold_effect_air_balloon.c rename to test/battle/hold_effect/air_balloon.c index ba740948a..1ed8a89e4 100644 --- a/test/hold_effect_air_balloon.c +++ b/test/battle/hold_effect/air_balloon.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/hold_effect_berserk_gene.c b/test/battle/hold_effect/berserk_gene.c similarity index 99% rename from test/hold_effect_berserk_gene.c rename to test/battle/hold_effect/berserk_gene.c index 981881e74..6fd0f8a85 100644 --- a/test/hold_effect_berserk_gene.c +++ b/test/battle/hold_effect/berserk_gene.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/hold_effect_clear_amulet.c b/test/battle/hold_effect/clear_amulet.c similarity index 99% rename from test/hold_effect_clear_amulet.c rename to test/battle/hold_effect/clear_amulet.c index 83c887b2d..39e6c22a6 100644 --- a/test/hold_effect_clear_amulet.c +++ b/test/battle/hold_effect/clear_amulet.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/hold_effect_eject_button.c b/test/battle/hold_effect/eject_button.c similarity index 99% rename from test/hold_effect_eject_button.c rename to test/battle/hold_effect/eject_button.c index 7e6312656..4409f5d5b 100644 --- a/test/hold_effect_eject_button.c +++ b/test/battle/hold_effect/eject_button.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/hold_effect_gems.c b/test/battle/hold_effect/gems.c similarity index 99% rename from test/hold_effect_gems.c rename to test/battle/hold_effect/gems.c index 9a90b81f9..c98718313 100644 --- a/test/hold_effect_gems.c +++ b/test/battle/hold_effect/gems.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/hold_effect_leftovers.c b/test/battle/hold_effect/leftovers.c similarity index 98% rename from test/hold_effect_leftovers.c rename to test/battle/hold_effect/leftovers.c index 01b0655a5..7e51a3bd7 100644 --- a/test/hold_effect_leftovers.c +++ b/test/battle/hold_effect/leftovers.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/hold_effect_mirror_herb.c b/test/battle/hold_effect/mirror_herb.c similarity index 98% rename from test/hold_effect_mirror_herb.c rename to test/battle/hold_effect/mirror_herb.c index 22f564b85..1e9058b08 100644 --- a/test/hold_effect_mirror_herb.c +++ b/test/battle/hold_effect/mirror_herb.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/hold_effect_red_card.c b/test/battle/hold_effect/red_card.c similarity index 99% rename from test/hold_effect_red_card.c rename to test/battle/hold_effect/red_card.c index 0a8bb3460..aad7fea64 100644 --- a/test/hold_effect_red_card.c +++ b/test/battle/hold_effect/red_card.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/battle/hold_effect/safety_goggles.c b/test/battle/hold_effect/safety_goggles.c new file mode 100644 index 000000000..3deeeb810 --- /dev/null +++ b/test/battle/hold_effect/safety_goggles.c @@ -0,0 +1,26 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + gItems[ITEM_SAFETY_GOGGLES].holdEffect == HOLD_EFFECT_SAFETY_GOGGLES; +}; + +SINGLE_BATTLE_TEST("Safety Goggles block powder and spore moves") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_STUN_SPORE].powderMove); + ASSUME(gItems[ITEM_SAFETY_GOGGLES].holdEffect == HOLD_EFFECT_SAFETY_GOGGLES); + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_ABRA) { Item(ITEM_SAFETY_GOGGLES); } + } WHEN { + TURN { MOVE(player, MOVE_STUN_SPORE); } + } SCENE { + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_STUN_SPORE, player); + MESSAGE("Foe Abra is not affected thanks to its SafetyGoggles!"); + } +} + +TO_DO_BATTLE_TEST("Safety Goggles blocks damage from hail"); +TO_DO_BATTLE_TEST("Safety Goggles blocks damage from sandstorm"); +TO_DO_BATTLE_TEST("Safety Goggles blocks Effect Spore's effect"); diff --git a/test/hold_effect_utility_umbrella.c b/test/battle/hold_effect/utility_umbrella.c similarity index 99% rename from test/hold_effect_utility_umbrella.c rename to test/battle/hold_effect/utility_umbrella.c index 6716ee72f..837bacc90 100644 --- a/test/hold_effect_utility_umbrella.c +++ b/test/battle/hold_effect/utility_umbrella.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" // Please add Utility Umbrella interactions with move, item and ability effects on their respective files. ASSUMPTIONS diff --git a/test/item_effect_cure_status.c b/test/battle/item_effect/cure_status.c similarity index 99% rename from test/item_effect_cure_status.c rename to test/battle/item_effect/cure_status.c index 1f7c9d7a2..c8b16dfdb 100644 --- a/test/item_effect_cure_status.c +++ b/test/battle/item_effect/cure_status.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Paralyze Heal heals a battler from being paralyzed") { diff --git a/test/item_effect_heal_and_cure_status.c b/test/battle/item_effect/heal_and_cure_status.c similarity index 98% rename from test/item_effect_heal_and_cure_status.c rename to test/battle/item_effect/heal_and_cure_status.c index 1f81ad922..de6a459a1 100644 --- a/test/item_effect_heal_and_cure_status.c +++ b/test/battle/item_effect/heal_and_cure_status.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Full Restore restores a battler's HP and cures any primary status") { diff --git a/test/item_effect_increase_stat.c b/test/battle/item_effect/increase_stat.c similarity index 99% rename from test/item_effect_increase_stat.c rename to test/battle/item_effect/increase_stat.c index ab4113064..3aeb8d525 100644 --- a/test/item_effect_increase_stat.c +++ b/test/battle/item_effect/increase_stat.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("X Attack sharply raises battler's Attack stat", s16 damage) { diff --git a/test/item_effect_restore_hp.c b/test/battle/item_effect/restore_hp.c similarity index 98% rename from test/item_effect_restore_hp.c rename to test/battle/item_effect/restore_hp.c index a469b21ff..b9e4be034 100644 --- a/test/item_effect_restore_hp.c +++ b/test/battle/item_effect/restore_hp.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Items can restore a battler's HP by a fixed amount") { diff --git a/test/item_effect_restore_pp.c b/test/battle/item_effect/restore_pp.c similarity index 98% rename from test/item_effect_restore_pp.c rename to test/battle/item_effect/restore_pp.c index 7194efbbb..e998ef3d9 100644 --- a/test/item_effect_restore_pp.c +++ b/test/battle/item_effect/restore_pp.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Ether restores the PP of one of a battler's moves by 10 ") { diff --git a/test/item_effect_revive.c b/test/battle/item_effect/revive.c similarity index 98% rename from test/item_effect_revive.c rename to test/battle/item_effect/revive.c index c2a22f80a..2be2ac4a6 100644 --- a/test/item_effect_revive.c +++ b/test/battle/item_effect/revive.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Revive restores a fainted battler's HP to half") { diff --git a/test/item_effect_set_focus_energy.c b/test/battle/item_effect/set_focus_energy.c similarity index 96% rename from test/item_effect_set_focus_energy.c rename to test/battle/item_effect/set_focus_energy.c index 95648465e..da326bbe3 100644 --- a/test/item_effect_set_focus_energy.c +++ b/test/battle/item_effect/set_focus_energy.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Dire Hit increases a battler's critical hit chance by 2 stages") { diff --git a/test/item_effect_set_mist.c b/test/battle/item_effect/set_mist.c similarity index 96% rename from test/item_effect_set_mist.c rename to test/battle/item_effect/set_mist.c index e01775ec4..a369e70d9 100644 --- a/test/item_effect_set_mist.c +++ b/test/battle/item_effect/set_mist.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Guard Spec. sets Mist effect on the battlers side") { diff --git a/test/move.c b/test/battle/move.c similarity index 99% rename from test/move.c rename to test/battle/move.c index 06a0abc7c..03ed84f53 100644 --- a/test/move.c +++ b/test/battle/move.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Accuracy controls the proportion of misses") { diff --git a/test/move_effect_absorb.c b/test/battle/move_effect/absorb.c similarity index 97% rename from test/move_effect_absorb.c rename to test/battle/move_effect/absorb.c index 2ea49ef9e..d46dbd9c5 100644 --- a/test/move_effect_absorb.c +++ b/test/battle/move_effect/absorb.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_accuracy_down.c b/test/battle/move_effect/accuracy_down.c similarity index 96% rename from test/move_effect_accuracy_down.c rename to test/battle/move_effect/accuracy_down.c index a6a79d8db..a30430a28 100644 --- a/test/move_effect_accuracy_down.c +++ b/test/battle/move_effect/accuracy_down.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_after_you.c b/test/battle/move_effect/after_you.c similarity index 98% rename from test/move_effect_after_you.c rename to test/battle/move_effect/after_you.c index a488d7a8c..576267cb4 100644 --- a/test/move_effect_after_you.c +++ b/test/battle/move_effect/after_you.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_assist.c b/test/battle/move_effect/assist.c similarity index 96% rename from test/move_effect_assist.c rename to test/battle/move_effect/assist.c index 28ae78572..ed2f43dc1 100644 --- a/test/move_effect_assist.c +++ b/test/battle/move_effect/assist.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_attack_down.c b/test/battle/move_effect/attack_down.c similarity index 97% rename from test/move_effect_attack_down.c rename to test/battle/move_effect/attack_down.c index 0df14f701..2149624c8 100644 --- a/test/move_effect_attack_down.c +++ b/test/battle/move_effect/attack_down.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_attack_up.c b/test/battle/move_effect/attack_up.c similarity index 97% rename from test/move_effect_attack_up.c rename to test/battle/move_effect/attack_up.c index 4978d03f9..7cd8f953c 100644 --- a/test/move_effect_attack_up.c +++ b/test/battle/move_effect/attack_up.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_attack_up_user_ally.c b/test/battle/move_effect/attack_up_user_ally.c similarity index 99% rename from test/move_effect_attack_up_user_ally.c rename to test/battle/move_effect/attack_up_user_ally.c index 3d2ac6bb8..6691b49ed 100644 --- a/test/move_effect_attack_up_user_ally.c +++ b/test/battle/move_effect/attack_up_user_ally.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_barb_barrage.c b/test/battle/move_effect/barb_barrage.c similarity index 98% rename from test/move_effect_barb_barrage.c rename to test/battle/move_effect/barb_barrage.c index ad9f1ec2e..89062b3de 100644 --- a/test/move_effect_barb_barrage.c +++ b/test/battle/move_effect/barb_barrage.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_beak_blast.c b/test/battle/move_effect/beak_blast.c similarity index 99% rename from test/move_effect_beak_blast.c rename to test/battle/move_effect/beak_blast.c index 5a8352021..8ecf19611 100644 --- a/test/move_effect_beak_blast.c +++ b/test/battle/move_effect/beak_blast.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_bide.c b/test/battle/move_effect/bide.c similarity index 97% rename from test/move_effect_bide.c rename to test/battle/move_effect/bide.c index 0b0e18408..4dfdc3430 100644 --- a/test/move_effect_bide.c +++ b/test/battle/move_effect/bide.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_burn_hit.c b/test/battle/move_effect/burn_hit.c similarity index 97% rename from test/move_effect_burn_hit.c rename to test/battle/move_effect/burn_hit.c index 88fef17cb..3f257dfcb 100644 --- a/test/move_effect_burn_hit.c +++ b/test/battle/move_effect/burn_hit.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_burn_up.c b/test/battle/move_effect/burn_up.c similarity index 98% rename from test/move_effect_burn_up.c rename to test/battle/move_effect/burn_up.c index a53b1afa8..d24e47992 100644 --- a/test/move_effect_burn_up.c +++ b/test/battle/move_effect/burn_up.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_court_change.c b/test/battle/move_effect/court_change.c similarity index 99% rename from test/move_effect_court_change.c rename to test/battle/move_effect/court_change.c index 9d03efddf..4aa2e9d36 100644 --- a/test/move_effect_court_change.c +++ b/test/battle/move_effect/court_change.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_defense_down.c b/test/battle/move_effect/defense_down.c similarity index 97% rename from test/move_effect_defense_down.c rename to test/battle/move_effect/defense_down.c index 9ecd1c25f..8a8c69ec3 100644 --- a/test/move_effect_defense_down.c +++ b/test/battle/move_effect/defense_down.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_defense_up.c b/test/battle/move_effect/defense_up.c similarity index 97% rename from test/move_effect_defense_up.c rename to test/battle/move_effect/defense_up.c index 492ce7bc9..b4c7cb4db 100644 --- a/test/move_effect_defense_up.c +++ b/test/battle/move_effect/defense_up.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_defog.c b/test/battle/move_effect/defog.c similarity index 99% rename from test/move_effect_defog.c rename to test/battle/move_effect/defog.c index 055f3f61a..1cd78fb50 100644 --- a/test/move_effect_defog.c +++ b/test/battle/move_effect/defog.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_dire_claw.c b/test/battle/move_effect/dire_claw.c similarity index 99% rename from test/move_effect_dire_claw.c rename to test/battle/move_effect/dire_claw.c index 712b6ea25..421ba201d 100644 --- a/test/move_effect_dire_claw.c +++ b/test/battle/move_effect/dire_claw.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_double_shock.c b/test/battle/move_effect/double_shock.c similarity index 98% rename from test/move_effect_double_shock.c rename to test/battle/move_effect/double_shock.c index c3651c403..89f758681 100644 --- a/test/move_effect_double_shock.c +++ b/test/battle/move_effect/double_shock.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_dream_eater.c b/test/battle/move_effect/dream_eater.c similarity index 98% rename from test/move_effect_dream_eater.c rename to test/battle/move_effect/dream_eater.c index fa17b94a6..047fe7898 100644 --- a/test/move_effect_dream_eater.c +++ b/test/battle/move_effect/dream_eater.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_encore.c b/test/battle/move_effect/encore.c similarity index 98% rename from test/move_effect_encore.c rename to test/battle/move_effect/encore.c index f8a178512..eff6c33b2 100644 --- a/test/move_effect_encore.c +++ b/test/battle/move_effect/encore.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_evasion_up.c b/test/battle/move_effect/evasion_up.c similarity index 96% rename from test/move_effect_evasion_up.c rename to test/battle/move_effect/evasion_up.c index 4a4e99db7..ecb6429cd 100644 --- a/test/move_effect_evasion_up.c +++ b/test/battle/move_effect/evasion_up.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_explosion.c b/test/battle/move_effect/explosion.c similarity index 99% rename from test/move_effect_explosion.c rename to test/battle/move_effect/explosion.c index 41e74044b..ef6dba6c0 100644 --- a/test/move_effect_explosion.c +++ b/test/battle/move_effect/explosion.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_focus_punch.c b/test/battle/move_effect/focus_punch.c similarity index 99% rename from test/move_effect_focus_punch.c rename to test/battle/move_effect/focus_punch.c index 2bd1e52e5..e97deef43 100644 --- a/test/move_effect_focus_punch.c +++ b/test/battle/move_effect/focus_punch.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_freeze_hit.c b/test/battle/move_effect/freeze_hit.c similarity index 97% rename from test/move_effect_freeze_hit.c rename to test/battle/move_effect/freeze_hit.c index bb0878d0d..5d99311ce 100644 --- a/test/move_effect_freeze_hit.c +++ b/test/battle/move_effect/freeze_hit.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_haze.c b/test/battle/move_effect/haze.c similarity index 97% rename from test/move_effect_haze.c rename to test/battle/move_effect/haze.c index bd43c6947..f1e4456aa 100644 --- a/test/move_effect_haze.c +++ b/test/battle/move_effect/haze.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_healing_wish.c b/test/battle/move_effect/healing_wish.c similarity index 99% rename from test/move_effect_healing_wish.c rename to test/battle/move_effect/healing_wish.c index 00ee76561..fd25b8489 100644 --- a/test/move_effect_healing_wish.c +++ b/test/battle/move_effect/healing_wish.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_hex.c b/test/battle/move_effect/hex.c similarity index 97% rename from test/move_effect_hex.c rename to test/battle/move_effect/hex.c index 2847aeb17..e0a924906 100644 --- a/test/move_effect_hex.c +++ b/test/battle/move_effect/hex.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_hit_escape.c b/test/battle/move_effect/hit_escape.c similarity index 99% rename from test/move_effect_hit_escape.c rename to test/battle/move_effect/hit_escape.c index fb5ff2dd5..f2d513095 100644 --- a/test/move_effect_hit_escape.c +++ b/test/battle/move_effect/hit_escape.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_hit_set_entry_hazardss.c b/test/battle/move_effect/hit_set_entry_hazardss.c similarity index 99% rename from test/move_effect_hit_set_entry_hazardss.c rename to test/battle/move_effect/hit_set_entry_hazardss.c index 23f0f0b28..caf75ed49 100644 --- a/test/move_effect_hit_set_entry_hazardss.c +++ b/test/battle/move_effect/hit_set_entry_hazardss.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_hit_switch_target.c b/test/battle/move_effect/hit_switch_target.c similarity index 98% rename from test/move_effect_hit_switch_target.c rename to test/battle/move_effect/hit_switch_target.c index 5af3062a4..683b005fd 100644 --- a/test/move_effect_hit_switch_target.c +++ b/test/battle/move_effect/hit_switch_target.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_hydro_steam.c b/test/battle/move_effect/hydro_steam.c similarity index 98% rename from test/move_effect_hydro_steam.c rename to test/battle/move_effect/hydro_steam.c index 487449159..f86da07ac 100644 --- a/test/move_effect_hydro_steam.c +++ b/test/battle/move_effect/hydro_steam.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_metronome.c b/test/battle/move_effect/metronome.c similarity index 98% rename from test/move_effect_metronome.c rename to test/battle/move_effect/metronome.c index 5b2fb0bab..390c834be 100644 --- a/test/move_effect_metronome.c +++ b/test/battle/move_effect/metronome.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_mind_blown.c b/test/battle/move_effect/mind_blown.c similarity index 99% rename from test/move_effect_mind_blown.c rename to test/battle/move_effect/mind_blown.c index 19179f990..485f2abd6 100644 --- a/test/move_effect_mind_blown.c +++ b/test/battle/move_effect/mind_blown.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_mirror_move.c b/test/battle/move_effect/mirror_move.c similarity index 99% rename from test/move_effect_mirror_move.c rename to test/battle/move_effect/mirror_move.c index ec7772124..96d5280c5 100644 --- a/test/move_effect_mirror_move.c +++ b/test/battle/move_effect/mirror_move.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_paralyze_hit.c b/test/battle/move_effect/paralyze_hit.c similarity index 97% rename from test/move_effect_paralyze_hit.c rename to test/battle/move_effect/paralyze_hit.c index 8e7d259f7..4efe6746c 100644 --- a/test/move_effect_paralyze_hit.c +++ b/test/battle/move_effect/paralyze_hit.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_poison_hit.c b/test/battle/move_effect/poison_hit.c similarity index 97% rename from test/move_effect_poison_hit.c rename to test/battle/move_effect/poison_hit.c index b1a154810..91d700466 100644 --- a/test/move_effect_poison_hit.c +++ b/test/battle/move_effect/poison_hit.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_rampage.c b/test/battle/move_effect/rampage.c similarity index 99% rename from test/move_effect_rampage.c rename to test/battle/move_effect/rampage.c index aa4a002fb..a1a271b37 100644 --- a/test/move_effect_rampage.c +++ b/test/battle/move_effect/rampage.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_recoil_if_miss.c b/test/battle/move_effect/recoil_if_miss.c similarity index 99% rename from test/move_effect_recoil_if_miss.c rename to test/battle/move_effect/recoil_if_miss.c index 26ddee622..f7d5cf242 100644 --- a/test/move_effect_recoil_if_miss.c +++ b/test/battle/move_effect/recoil_if_miss.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_reflect.c b/test/battle/move_effect/reflect.c similarity index 99% rename from test/move_effect_reflect.c rename to test/battle/move_effect/reflect.c index 4ea875f35..dd8738f72 100644 --- a/test/move_effect_reflect.c +++ b/test/battle/move_effect/reflect.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_revival_blessing.c b/test/battle/move_effect/revival_blessing.c similarity index 99% rename from test/move_effect_revival_blessing.c rename to test/battle/move_effect/revival_blessing.c index 3cb4d4ca4..a5dd32c19 100644 --- a/test/move_effect_revival_blessing.c +++ b/test/battle/move_effect/revival_blessing.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" // Note: Since these tests are recorded battle, they don't test the right battle controller // behaviors. These have been tested in-game, in double, in multi, and in link battles. AI will always diff --git a/test/move_effect_roar.c b/test/battle/move_effect/roar.c similarity index 98% rename from test/move_effect_roar.c rename to test/battle/move_effect/roar.c index 99256b298..20f934808 100644 --- a/test/move_effect_roar.c +++ b/test/battle/move_effect/roar.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_shell_trap.c b/test/battle/move_effect/shell_trap.c similarity index 99% rename from test/move_effect_shell_trap.c rename to test/battle/move_effect/shell_trap.c index 2498e12f2..7fb80210e 100644 --- a/test/move_effect_shell_trap.c +++ b/test/battle/move_effect/shell_trap.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_sleep.c b/test/battle/move_effect/sleep.c similarity index 97% rename from test/move_effect_sleep.c rename to test/battle/move_effect/sleep.c index c34e1248e..d2cac0af9 100644 --- a/test/move_effect_sleep.c +++ b/test/battle/move_effect/sleep.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_special_attack_down.c b/test/battle/move_effect/special_attack_down.c similarity index 97% rename from test/move_effect_special_attack_down.c rename to test/battle/move_effect/special_attack_down.c index 0511692d4..6e7a84f0a 100644 --- a/test/move_effect_special_attack_down.c +++ b/test/battle/move_effect/special_attack_down.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_special_attack_up_3.c b/test/battle/move_effect/special_attack_up_3.c similarity index 97% rename from test/move_effect_special_attack_up_3.c rename to test/battle/move_effect/special_attack_up_3.c index ad53bedb9..340c59360 100644 --- a/test/move_effect_special_attack_up_3.c +++ b/test/battle/move_effect/special_attack_up_3.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_spikes.c b/test/battle/move_effect/spikes.c similarity index 99% rename from test/move_effect_spikes.c rename to test/battle/move_effect/spikes.c index 0c84a5fb1..bfc0f39b5 100644 --- a/test/move_effect_spikes.c +++ b/test/battle/move_effect/spikes.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_sticky_web.c b/test/battle/move_effect/sticky_web.c similarity index 99% rename from test/move_effect_sticky_web.c rename to test/battle/move_effect/sticky_web.c index f0a6eb8d8..e12cc8090 100644 --- a/test/move_effect_sticky_web.c +++ b/test/battle/move_effect/sticky_web.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_stockpile.c b/test/battle/move_effect/stockpile.c similarity index 99% rename from test/move_effect_stockpile.c rename to test/battle/move_effect/stockpile.c index b16408d49..0e540bb5d 100644 --- a/test/move_effect_stockpile.c +++ b/test/battle/move_effect/stockpile.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" // These tests cover all 3 effects: Stockpile, Spit up and Swallow. ASSUMPTIONS diff --git a/test/move_effect_tailwind.c b/test/battle/move_effect/tailwind.c similarity index 98% rename from test/move_effect_tailwind.c rename to test/battle/move_effect/tailwind.c index 7dfffdbe0..2e9ee5ade 100644 --- a/test/move_effect_tailwind.c +++ b/test/battle/move_effect/tailwind.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_teleport.c b/test/battle/move_effect/teleport.c similarity index 98% rename from test/move_effect_teleport.c rename to test/battle/move_effect/teleport.c index 9c8a16d4b..7544ae8a4 100644 --- a/test/move_effect_teleport.c +++ b/test/battle/move_effect/teleport.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_torment.c b/test/battle/move_effect/torment.c similarity index 98% rename from test/move_effect_torment.c rename to test/battle/move_effect/torment.c index 43f05e29f..dbef1d983 100644 --- a/test/move_effect_torment.c +++ b/test/battle/move_effect/torment.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_toxic.c b/test/battle/move_effect/toxic.c similarity index 98% rename from test/move_effect_toxic.c rename to test/battle/move_effect/toxic.c index f71d2a972..78d978b26 100644 --- a/test/move_effect_toxic.c +++ b/test/battle/move_effect/toxic.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_toxic_spikes.c b/test/battle/move_effect/toxic_spikes.c similarity index 99% rename from test/move_effect_toxic_spikes.c rename to test/battle/move_effect/toxic_spikes.c index 44780da21..3be2d1627 100644 --- a/test/move_effect_toxic_spikes.c +++ b/test/battle/move_effect/toxic_spikes.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_tri_attack.c b/test/battle/move_effect/tri_attack.c similarity index 99% rename from test/move_effect_tri_attack.c rename to test/battle/move_effect/tri_attack.c index 91b465067..aec711aab 100644 --- a/test/move_effect_tri_attack.c +++ b/test/battle/move_effect/tri_attack.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_triple_kick.c b/test/battle/move_effect/triple_kick.c similarity index 97% rename from test/move_effect_triple_kick.c rename to test/battle/move_effect/triple_kick.c index 4e47d6cc6..fef571cb4 100644 --- a/test/move_effect_triple_kick.c +++ b/test/battle/move_effect/triple_kick.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_venoshock.c b/test/battle/move_effect/venoshock.c similarity index 97% rename from test/move_effect_venoshock.c rename to test/battle/move_effect/venoshock.c index 134982a60..b2b8fcda2 100644 --- a/test/move_effect_venoshock.c +++ b/test/battle/move_effect/venoshock.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_flag_strike_count.c b/test/battle/move_flags/strike_count.c similarity index 98% rename from test/move_flag_strike_count.c rename to test/battle/move_flags/strike_count.c index 0c71d6731..d134e58c8 100644 --- a/test/move_flag_strike_count.c +++ b/test/battle/move_flags/strike_count.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Two strike count turns a move into a 2-hit move") { diff --git a/test/battle/status1/bad_poison.c b/test/battle/status1/bad_poison.c new file mode 100644 index 000000000..7a430086b --- /dev/null +++ b/test/battle/status1/bad_poison.c @@ -0,0 +1,39 @@ +#include "global.h" +#include "test/battle.h" + +SINGLE_BATTLE_TEST("Bad poison deals 1/16th cumulative damage per turn") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_TOXIC_POISON); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + for (i = 0; i < 4; i++) + TURN {} + } SCENE { + s32 maxHP = GetMonData(&PLAYER_PARTY[0], MON_DATA_MAX_HP); + for (i = 0; i < 4; i++) + HP_BAR(player, damage: maxHP / 16 * (i + 1)); + } +} + +SINGLE_BATTLE_TEST("Bad poison cumulative damage resets on switch") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_TOXIC_POISON); } + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN {} + TURN {} + TURN { SWITCH(player, 1); } + TURN { SWITCH(player, 0); } + TURN {} + TURN {} + } SCENE { + s32 maxHP = GetMonData(&PLAYER_PARTY[0], MON_DATA_MAX_HP); + for (i = 0; i < 2; i++) + HP_BAR(player, damage: maxHP / 16 * (i + 1)); + for (i = 0; i < 2; i++) + HP_BAR(player, damage: maxHP / 16 * (i + 1)); + } +} diff --git a/test/battle/status1/burn.c b/test/battle/status1/burn.c new file mode 100644 index 000000000..84439ec9e --- /dev/null +++ b/test/battle/status1/burn.c @@ -0,0 +1,35 @@ +#include "global.h" +#include "test/battle.h" + +SINGLE_BATTLE_TEST("Burn deals 1/16th damage per turn") +{ + GIVEN { + ASSUME(B_BURN_DAMAGE >= GEN_LATEST); + PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_BURN); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + for (i = 0; i < 4; i++) + TURN {} + } SCENE { + s32 maxHP = GetMonData(&PLAYER_PARTY[0], MON_DATA_MAX_HP); + for (i = 0; i < 4; i++) + HP_BAR(player, damage: maxHP / 16); + } +} + +SINGLE_BATTLE_TEST("Burn reduces Attack by 50%", s16 damage) +{ + bool32 burned; + PARAMETRIZE { burned = FALSE; } + PARAMETRIZE { burned = TRUE; } + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { if (burned) Status1(STATUS1_BURN); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_TACKLE); } + } SCENE { + HP_BAR(opponent, captureDamage: &results[i].damage); + } FINALLY { + EXPECT_MUL_EQ(results[0].damage, Q_4_12(0.5), results[1].damage); + } +} diff --git a/test/battle/status1/freeze.c b/test/battle/status1/freeze.c new file mode 100644 index 000000000..28a31efef --- /dev/null +++ b/test/battle/status1/freeze.c @@ -0,0 +1,45 @@ +#include "global.h" +#include "test/battle.h" + +SINGLE_BATTLE_TEST("Freeze has a 20% chance of being thawed") +{ + PASSES_RANDOMLY(20, 100, RNG_FROZEN); + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_FREEZE); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_CELEBRATE); } + } SCENE { + STATUS_ICON(player, none: TRUE); + } +} + +SINGLE_BATTLE_TEST("Freeze is thawed by opponent's Fire-type attacks") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_EMBER].type == TYPE_FIRE); + PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_FREEZE); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(opponent, MOVE_EMBER); MOVE(player, MOVE_CELEBRATE); } + } SCENE { + MESSAGE("Foe Wobbuffet used Ember!"); + MESSAGE("Wobbuffet was defrosted!"); + STATUS_ICON(player, none: TRUE); + } +} + +SINGLE_BATTLE_TEST("Freeze is thawed by user's Flame Wheel") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_FLAME_WHEEL].thawsUser); + PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_FREEZE); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_FLAME_WHEEL); } + } SCENE { + MESSAGE("Wobbuffet was defrosted by Flame Wheel!"); + STATUS_ICON(player, none: TRUE); + MESSAGE("Wobbuffet used Flame Wheel!"); + } +} diff --git a/test/status_frostbite.c b/test/battle/status1/frostbite.c similarity index 99% rename from test/status_frostbite.c rename to test/battle/status1/frostbite.c index d2bfa6bba..2b61c4d65 100644 --- a/test/status_frostbite.c +++ b/test/battle/status1/frostbite.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Frostbite reduces the special attack by 50 percent") { diff --git a/test/battle/status1/paralysis.c b/test/battle/status1/paralysis.c new file mode 100644 index 000000000..b6edaf263 --- /dev/null +++ b/test/battle/status1/paralysis.c @@ -0,0 +1,44 @@ +#include "global.h" +#include "test/battle.h" + +SINGLE_BATTLE_TEST("Paralysis reduces Speed by 50%") +{ + u16 playerSpeed; + bool32 playerFirst; + PARAMETRIZE { playerSpeed = 98; playerFirst = FALSE; } + PARAMETRIZE { playerSpeed = 102; playerFirst = TRUE; } + GIVEN { + ASSUME(B_PARALYSIS_SPEED >= GEN_7); + PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_PARALYSIS); Speed(playerSpeed); } + OPPONENT(SPECIES_WOBBUFFET) { Speed(50); } + } WHEN { + TURN { MOVE(player, MOVE_CELEBRATE); MOVE(opponent, MOVE_CELEBRATE); } + } SCENE { + if (playerFirst) { + ONE_OF { + MESSAGE("Wobbuffet used Celebrate!"); + MESSAGE("Wobbuffet is paralyzed! It can't move!"); + } + MESSAGE("Foe Wobbuffet used Celebrate!"); + } else { + MESSAGE("Foe Wobbuffet used Celebrate!"); + ONE_OF { + MESSAGE("Wobbuffet used Celebrate!"); + MESSAGE("Wobbuffet is paralyzed! It can't move!"); + } + } + } +} + +SINGLE_BATTLE_TEST("Paralysis has a 25% chance of skipping the turn") +{ + PASSES_RANDOMLY(25, 100, RNG_PARALYSIS); + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_PARALYSIS); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_CELEBRATE); } + } SCENE { + MESSAGE("Wobbuffet is paralyzed! It can't move!"); + } +} diff --git a/test/battle/status1/poison.c b/test/battle/status1/poison.c new file mode 100644 index 000000000..771d0d2ec --- /dev/null +++ b/test/battle/status1/poison.c @@ -0,0 +1,17 @@ +#include "global.h" +#include "test/battle.h" + +SINGLE_BATTLE_TEST("Poison deals 1/8th damage per turn") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_POISON); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + for (i = 0; i < 4; i++) + TURN {} + } SCENE { + s32 maxHP = GetMonData(&PLAYER_PARTY[0], MON_DATA_MAX_HP); + for (i = 0; i < 4; i++) + HP_BAR(player, damage: maxHP / 8); + } +} diff --git a/test/battle/status1/sleep.c b/test/battle/status1/sleep.c new file mode 100644 index 000000000..8ef6137d3 --- /dev/null +++ b/test/battle/status1/sleep.c @@ -0,0 +1,23 @@ +#include "global.h" +#include "test/battle.h" + +SINGLE_BATTLE_TEST("Sleep prevents the battler from using a move") +{ + u32 turns; + PARAMETRIZE { turns = 1; } + PARAMETRIZE { turns = 2; } + PARAMETRIZE { turns = 3; } + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_SLEEP_TURN(turns)); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + for (i = 0; i < turns; i++) + TURN { MOVE(player, MOVE_CELEBRATE); } + } SCENE { + for (i = 0; i < turns - 1; i++) + MESSAGE("Wobbuffet is fast asleep."); + MESSAGE("Wobbuffet woke up!"); + STATUS_ICON(player, none: TRUE); + MESSAGE("Wobbuffet used Celebrate!"); + } +} diff --git a/test/terrain_electric.c b/test/battle/terrain/electric.c similarity index 99% rename from test/terrain_electric.c rename to test/battle/terrain/electric.c index 78f490c42..cebb0cb75 100644 --- a/test/terrain_electric.c +++ b/test/battle/terrain/electric.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Electric Terrain protects grounded battlers from falling asleep") { diff --git a/test/terrain_grassy.c b/test/battle/terrain/grassy.c similarity index 99% rename from test/terrain_grassy.c rename to test/battle/terrain/grassy.c index 21d64f61e..893a30528 100644 --- a/test/terrain_grassy.c +++ b/test/battle/terrain/grassy.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Grassy Terrain recovers 1/16th HP at end of turn") { diff --git a/test/terrain_misty.c b/test/battle/terrain/misty.c similarity index 99% rename from test/terrain_misty.c rename to test/battle/terrain/misty.c index f60122075..dd6489af6 100644 --- a/test/terrain_misty.c +++ b/test/battle/terrain/misty.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Misty Terrain protects grounded battlers from non-volatile status conditions") { diff --git a/test/terrain_psychic.c b/test/battle/terrain/psychic.c similarity index 99% rename from test/terrain_psychic.c rename to test/battle/terrain/psychic.c index f9f95a47d..c810af340 100644 --- a/test/terrain_psychic.c +++ b/test/battle/terrain/psychic.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Psychic Terrain protects grounded battlers from priority moves") { diff --git a/test/trainer_control.c b/test/battle/trainer_control.c similarity index 99% rename from test/trainer_control.c rename to test/battle/trainer_control.c index 2a21dcdf6..f5ca68e36 100644 --- a/test/trainer_control.c +++ b/test/battle/trainer_control.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test.h" +#include "test/test.h" #include "battle.h" #include "battle_main.h" #include "data.h" diff --git a/test/battle/type/grass.c b/test/battle/type/grass.c new file mode 100644 index 000000000..6bb016c58 --- /dev/null +++ b/test/battle/type/grass.c @@ -0,0 +1,17 @@ +#include "global.h" +#include "test/battle.h" + +SINGLE_BATTLE_TEST("Grass-type Pokémon block powder and spore moves") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_STUN_SPORE].powderMove); + ASSUME(gSpeciesInfo[SPECIES_ODDISH].types[0] == TYPE_GRASS); + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_ODDISH); + } WHEN { + TURN { MOVE(player, MOVE_STUN_SPORE); } + } SCENE { + NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_STUN_SPORE, player); + MESSAGE("It doesn't affect Foe Oddish…"); + } +} diff --git a/test/weather_rain.c b/test/battle/weather/rain.c similarity index 98% rename from test/weather_rain.c rename to test/battle/weather/rain.c index b99681495..00ac26304 100644 --- a/test/weather_rain.c +++ b/test/battle/weather/rain.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" // Please add Rain interactions with move, item and ability effects on their respective files. ASSUMPTIONS diff --git a/test/weather_snow.c b/test/battle/weather/snow.c similarity index 99% rename from test/weather_snow.c rename to test/battle/weather/snow.c index bee4759eb..21b7a5565 100644 --- a/test/weather_snow.c +++ b/test/battle/weather/snow.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/weather_sunlight.c b/test/battle/weather/sunlight.c similarity index 98% rename from test/weather_sunlight.c rename to test/battle/weather/sunlight.c index beba0e9b6..9d471332a 100644 --- a/test/weather_sunlight.c +++ b/test/battle/weather/sunlight.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" // Please add Sunlight interactions with move, item and ability effects on their respective files. ASSUMPTIONS diff --git a/test/damage_formula.c b/test/damage_formula.c index 73d919330..98aa197ca 100644 --- a/test/damage_formula.c +++ b/test/damage_formula.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" // From https://bulbapedia.bulbagarden.net/wiki/Damage#Example diff --git a/test/fpmath.c b/test/fpmath.c index 3f583d063..063d938e0 100644 --- a/test/fpmath.c +++ b/test/fpmath.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test.h" +#include "test/test.h" TEST("uq4_12_add adds 4.12 numbers") { EXPECT_EQ(uq4_12_add(UQ_4_12(3.5), UQ_4_12(2.5)), UQ_4_12(6.0)); diff --git a/test/move_effect_axe_kick.c b/test/move_effect_axe_kick.c index cf04e601e..e8674579f 100644 --- a/test/move_effect_axe_kick.c +++ b/test/move_effect_axe_kick.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_collision_course.c b/test/move_effect_collision_course.c index bcf3cdd72..734095038 100644 --- a/test/move_effect_collision_course.c +++ b/test/move_effect_collision_course.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_corrosive_gas.c b/test/move_effect_corrosive_gas.c index 097646cee..e4b6a958e 100644 --- a/test/move_effect_corrosive_gas.c +++ b/test/move_effect_corrosive_gas.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_infernal_parade.c b/test/move_effect_infernal_parade.c index 5b951eca1..38cfc9733 100644 --- a/test/move_effect_infernal_parade.c +++ b/test/move_effect_infernal_parade.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_make_it_rain.c b/test/move_effect_make_it_rain.c index ae8149b19..42046c145 100644 --- a/test/move_effect_make_it_rain.c +++ b/test/move_effect_make_it_rain.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_mortal_spin.c b/test/move_effect_mortal_spin.c index c3dd04527..0ac8403e2 100644 --- a/test/move_effect_mortal_spin.c +++ b/test/move_effect_mortal_spin.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_multi_hit.c b/test/move_effect_multi_hit.c index d3a265ebb..67515c7d5 100644 --- a/test/move_effect_multi_hit.c +++ b/test/move_effect_multi_hit.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_population_bomb.c b/test/move_effect_population_bomb.c index 1305f456c..e4fad6976 100644 --- a/test/move_effect_population_bomb.c +++ b/test/move_effect_population_bomb.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" SINGLE_BATTLE_TEST("Population Bomb can hit ten times") { diff --git a/test/move_effect_spin_out.c b/test/move_effect_spin_out.c index 060f3545e..7966882c6 100644 --- a/test/move_effect_spin_out.c +++ b/test/move_effect_spin_out.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_take_heart.c b/test/move_effect_take_heart.c index 82745957f..c2dfc90a8 100644 --- a/test/move_effect_take_heart.c +++ b/test/move_effect_take_heart.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_teatime.c b/test/move_effect_teatime.c index 561a5d987..7995937fa 100644 --- a/test/move_effect_teatime.c +++ b/test/move_effect_teatime.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/move_effect_triple_arrows.c b/test/move_effect_triple_arrows.c index 0e45521e4..eb8e1c666 100644 --- a/test/move_effect_triple_arrows.c +++ b/test/move_effect_triple_arrows.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { diff --git a/test/powder_moves.c b/test/powder_moves.c deleted file mode 100644 index fea64f821..000000000 --- a/test/powder_moves.c +++ /dev/null @@ -1,47 +0,0 @@ -#include "global.h" -#include "test_battle.h" - -SINGLE_BATTLE_TEST("Powder Moves are blocked by Grass Types") -{ - GIVEN { - ASSUME(gBattleMoves[MOVE_STUN_SPORE].powderMove); - ASSUME(gSpeciesInfo[SPECIES_ODDISH].types[0] == TYPE_GRASS); - PLAYER(SPECIES_WYNAUT); - OPPONENT(SPECIES_ODDISH); - } WHEN { - TURN { MOVE(player, MOVE_STUN_SPORE); } - } SCENE { - NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_STUN_SPORE, player); - MESSAGE("It doesn't affect Foe Oddish…"); - } -} - -SINGLE_BATTLE_TEST("Powder Moves are blocked by Ability Overcoat") -{ - GIVEN { - ASSUME(gBattleMoves[MOVE_STUN_SPORE].powderMove); - PLAYER(SPECIES_WYNAUT); - OPPONENT(SPECIES_PINECO) { Ability(ABILITY_OVERCOAT); } - } WHEN { - TURN { MOVE(player, MOVE_STUN_SPORE); } - } SCENE { - ABILITY_POPUP(opponent, ABILITY_OVERCOAT); - NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_STUN_SPORE, player); - MESSAGE("It doesn't affect Foe Pineco…"); - } -} - -SINGLE_BATTLE_TEST("Powder Moves are blocked by Item Safety Goggles") -{ - GIVEN { - ASSUME(gBattleMoves[MOVE_STUN_SPORE].powderMove); - ASSUME(gItems[ITEM_SAFETY_GOGGLES].holdEffect == HOLD_EFFECT_SAFETY_GOGGLES); - PLAYER(SPECIES_WYNAUT); - OPPONENT(SPECIES_ABRA) { Item(ITEM_SAFETY_GOGGLES); } - } WHEN { - TURN { MOVE(player, MOVE_STUN_SPORE); } - } SCENE { - NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_STUN_SPORE, player); - MESSAGE("Foe Abra is not affected thanks to its SafetyGoggles!"); - } -} diff --git a/test/random.c b/test/random.c index 9e88035e0..5ca4b814d 100644 --- a/test/random.c +++ b/test/random.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test.h" +#include "test/test.h" #include "random.h" // We expect each element to have an indexSum of 3.5 * 1024. diff --git a/test/sprite.c b/test/sprite.c index f488929d5..51d4873be 100644 --- a/test/sprite.c +++ b/test/sprite.c @@ -1,9 +1,9 @@ #include "global.h" -#include "test.h" #include "main.h" #include "malloc.h" #include "random.h" #include "sprite.h" +#include "test/test.h" #define OAM_MATRIX_COUNT 32 diff --git a/test/status1.c b/test/status1.c deleted file mode 100644 index 3c19d01c1..000000000 --- a/test/status1.c +++ /dev/null @@ -1,193 +0,0 @@ -#include "global.h" -#include "test_battle.h" - -SINGLE_BATTLE_TEST("Sleep prevents the battler from using a move") -{ - u32 turns; - PARAMETRIZE { turns = 1; } - PARAMETRIZE { turns = 2; } - PARAMETRIZE { turns = 3; } - GIVEN { - PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_SLEEP_TURN(turns)); } - OPPONENT(SPECIES_WOBBUFFET); - } WHEN { - for (i = 0; i < turns; i++) - TURN { MOVE(player, MOVE_CELEBRATE); } - } SCENE { - for (i = 0; i < turns - 1; i++) - MESSAGE("Wobbuffet is fast asleep."); - MESSAGE("Wobbuffet woke up!"); - STATUS_ICON(player, none: TRUE); - MESSAGE("Wobbuffet used Celebrate!"); - } -} - -SINGLE_BATTLE_TEST("Poison deals 1/8th damage per turn") -{ - GIVEN { - PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_POISON); } - OPPONENT(SPECIES_WOBBUFFET); - } WHEN { - for (i = 0; i < 4; i++) - TURN {} - } SCENE { - s32 maxHP = GetMonData(&PLAYER_PARTY[0], MON_DATA_MAX_HP); - for (i = 0; i < 4; i++) - HP_BAR(player, damage: maxHP / 8); - } -} - -SINGLE_BATTLE_TEST("Burn deals 1/16th damage per turn") -{ - GIVEN { - ASSUME(B_BURN_DAMAGE >= GEN_LATEST); - PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_BURN); } - OPPONENT(SPECIES_WOBBUFFET); - } WHEN { - for (i = 0; i < 4; i++) - TURN {} - } SCENE { - s32 maxHP = GetMonData(&PLAYER_PARTY[0], MON_DATA_MAX_HP); - for (i = 0; i < 4; i++) - HP_BAR(player, damage: maxHP / 16); - } -} - -SINGLE_BATTLE_TEST("Burn reduces Attack by 50%", s16 damage) -{ - bool32 burned; - PARAMETRIZE { burned = FALSE; } - PARAMETRIZE { burned = TRUE; } - GIVEN { - PLAYER(SPECIES_WOBBUFFET) { if (burned) Status1(STATUS1_BURN); } - OPPONENT(SPECIES_WOBBUFFET); - } WHEN { - TURN { MOVE(player, MOVE_TACKLE); } - } SCENE { - HP_BAR(opponent, captureDamage: &results[i].damage); - } FINALLY { - EXPECT_MUL_EQ(results[0].damage, Q_4_12(0.5), results[1].damage); - } -} - -SINGLE_BATTLE_TEST("Freeze has a 20% chance of being thawed") -{ - PASSES_RANDOMLY(20, 100, RNG_FROZEN); - GIVEN { - PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_FREEZE); } - OPPONENT(SPECIES_WOBBUFFET); - } WHEN { - TURN { MOVE(player, MOVE_CELEBRATE); } - } SCENE { - STATUS_ICON(player, none: TRUE); - } -} - -SINGLE_BATTLE_TEST("Freeze is thawed by opponent's Fire-type attacks") -{ - GIVEN { - ASSUME(gBattleMoves[MOVE_EMBER].type == TYPE_FIRE); - PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_FREEZE); } - OPPONENT(SPECIES_WOBBUFFET); - } WHEN { - TURN { MOVE(opponent, MOVE_EMBER); MOVE(player, MOVE_CELEBRATE); } - } SCENE { - MESSAGE("Foe Wobbuffet used Ember!"); - MESSAGE("Wobbuffet was defrosted!"); - STATUS_ICON(player, none: TRUE); - } -} - -SINGLE_BATTLE_TEST("Freeze is thawed by user's Flame Wheel") -{ - GIVEN { - ASSUME(gBattleMoves[MOVE_FLAME_WHEEL].thawsUser); - PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_FREEZE); } - OPPONENT(SPECIES_WOBBUFFET); - } WHEN { - TURN { MOVE(player, MOVE_FLAME_WHEEL); } - } SCENE { - MESSAGE("Wobbuffet was defrosted by Flame Wheel!"); - STATUS_ICON(player, none: TRUE); - MESSAGE("Wobbuffet used Flame Wheel!"); - } -} - -SINGLE_BATTLE_TEST("Paralysis reduces Speed by 50%") -{ - u16 playerSpeed; - bool32 playerFirst; - PARAMETRIZE { playerSpeed = 98; playerFirst = FALSE; } - PARAMETRIZE { playerSpeed = 102; playerFirst = TRUE; } - GIVEN { - ASSUME(B_PARALYSIS_SPEED >= GEN_7); - PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_PARALYSIS); Speed(playerSpeed); } - OPPONENT(SPECIES_WOBBUFFET) { Speed(50); } - } WHEN { - TURN { MOVE(player, MOVE_CELEBRATE); MOVE(opponent, MOVE_CELEBRATE); } - } SCENE { - if (playerFirst) { - ONE_OF { - MESSAGE("Wobbuffet used Celebrate!"); - MESSAGE("Wobbuffet is paralyzed! It can't move!"); - } - MESSAGE("Foe Wobbuffet used Celebrate!"); - } else { - MESSAGE("Foe Wobbuffet used Celebrate!"); - ONE_OF { - MESSAGE("Wobbuffet used Celebrate!"); - MESSAGE("Wobbuffet is paralyzed! It can't move!"); - } - } - } -} - -SINGLE_BATTLE_TEST("Paralysis has a 25% chance of skipping the turn") -{ - PASSES_RANDOMLY(25, 100, RNG_PARALYSIS); - GIVEN { - PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_PARALYSIS); } - OPPONENT(SPECIES_WOBBUFFET); - } WHEN { - TURN { MOVE(player, MOVE_CELEBRATE); } - } SCENE { - MESSAGE("Wobbuffet is paralyzed! It can't move!"); - } -} - -SINGLE_BATTLE_TEST("Bad poison deals 1/16th cumulative damage per turn") -{ - GIVEN { - PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_TOXIC_POISON); } - OPPONENT(SPECIES_WOBBUFFET); - } WHEN { - for (i = 0; i < 4; i++) - TURN {} - } SCENE { - s32 maxHP = GetMonData(&PLAYER_PARTY[0], MON_DATA_MAX_HP); - for (i = 0; i < 4; i++) - HP_BAR(player, damage: maxHP / 16 * (i + 1)); - } -} - -SINGLE_BATTLE_TEST("Bad poison cumulative damage resets on switch") -{ - GIVEN { - PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_TOXIC_POISON); } - PLAYER(SPECIES_WYNAUT); - OPPONENT(SPECIES_WOBBUFFET); - } WHEN { - TURN {} - TURN {} - TURN { SWITCH(player, 1); } - TURN { SWITCH(player, 0); } - TURN {} - TURN {} - } SCENE { - s32 maxHP = GetMonData(&PLAYER_PARTY[0], MON_DATA_MAX_HP); - for (i = 0; i < 2; i++) - HP_BAR(player, damage: maxHP / 16 * (i + 1)); - for (i = 0; i < 2; i++) - HP_BAR(player, damage: maxHP / 16 * (i + 1)); - } -} diff --git a/test/status3.c b/test/status3.c index 0331883bd..c8a438451 100644 --- a/test/status3.c +++ b/test/status3.c @@ -1,5 +1,5 @@ #include "global.h" -#include "test_battle.h" +#include "test/battle.h" ASSUMPTIONS { ASSUME(gBattleMoves[MOVE_MINIMIZE].effect == EFFECT_MINIMIZE); diff --git a/test/test_runner.c b/test/test_runner.c index 3f1352e5a..637ff0ed8 100644 --- a/test/test_runner.c +++ b/test/test_runner.c @@ -6,8 +6,8 @@ #include "main.h" #include "malloc.h" #include "random.h" -#include "test.h" #include "test_runner.h" +#include "test/test.h" #define TIMEOUT_SECONDS 55 diff --git a/test/test_runner_battle.c b/test/test_runner_battle.c index 4de144c38..e65066a84 100644 --- a/test/test_runner_battle.c +++ b/test/test_runner_battle.c @@ -7,7 +7,7 @@ #include "main.h" #include "malloc.h" #include "random.h" -#include "test_battle.h" +#include "test/battle.h" #include "window.h" #if defined(__INTELLISENSE__)