Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More weather and type-specific tests #3260

Merged
merged 24 commits into from
Oct 15, 2023
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e2fa4b8
Weather and type specific tests
kittenchilly Aug 28, 2023
8403b16
Restructure some things
kittenchilly Aug 28, 2023
a876d27
More tests
kittenchilly Aug 28, 2023
5bc687c
Formatting
kittenchilly Aug 28, 2023
5cf8a4b
Add new line at the end of tests
kittenchilly Aug 28, 2023
0158614
Merge branch 'master' into moretests
kittenchilly Aug 30, 2023
d58e8c5
Merge branch 'master' into moretests
kittenchilly Aug 31, 2023
eacbc7f
Merge branch 'master' into moretests
kittenchilly Sep 7, 2023
90f4506
Delete agbcc
kittenchilly Sep 7, 2023
ce16a75
Change steel type poison immunity test
kittenchilly Sep 7, 2023
bf92514
Merge branch 'master' into moretests
kittenchilly Sep 8, 2023
90a4e45
Merge branch 'master' into moretests
kittenchilly Sep 10, 2023
68d71fe
Apply suggestions from code review
kittenchilly Sep 25, 2023
215f099
Merge branch 'master' into moretests
kittenchilly Sep 25, 2023
1cd85c8
Merge branch 'master' into moretests
kittenchilly Oct 2, 2023
0a1414f
Update solar_beam.c
kittenchilly Oct 2, 2023
a8d3128
Apply suggestions from code review
kittenchilly Oct 11, 2023
dfd80c4
Merge branch 'master' into moretests
kittenchilly Oct 11, 2023
ccd2cd4
Apply some changes from code review
kittenchilly Oct 11, 2023
a0eaa75
Harvest
kittenchilly Oct 11, 2023
5947631
Merge branch 'master' into moretests
kittenchilly Oct 13, 2023
9beca4f
Update sandstorm.c
kittenchilly Oct 13, 2023
e90d08b
Merge branch 'master' into moretests
kittenchilly Oct 14, 2023
95150f5
Actually finish addressing everything
kittenchilly Oct 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions test/battle/ability/prankster.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include "global.h"
#include "test/battle.h"

SINGLE_BATTLE_TEST("Prankster-affected moves don't affect Dark-type Pokémon")
{
GIVEN {
ASSUME(gSpeciesInfo[SPECIES_UMBREON].types[0] == TYPE_DARK);
PLAYER(SPECIES_UMBREON);
OPPONENT(SPECIES_MURKROW) { Ability(ABILITY_PRANKSTER); }
} WHEN {
TURN { MOVE(opponent, MOVE_CONFUSE_RAY); }
} SCENE {
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_CONFUSE_RAY, player);
MESSAGE("It doesn't affect Umbreon…");
}
}
AsparagusEduardo marked this conversation as resolved.
Show resolved Hide resolved
TO_DO_BATTLE_TEST("Prankster-affected moves affect Ally Dark-type Pokémon")
TO_DO_BATTLE_TEST("Prankster-affected moves called via Assist don't affect Dark-type Pokémon");
TO_DO_BATTLE_TEST("Prankster-affected moves called via Nature Power don't affect Dark-type Pokémon");
TO_DO_BATTLE_TEST("Prankster-affected moves called via Instruct affect Dark-type Pokémon");
TO_DO_BATTLE_TEST("Prankster-affected moves called via After you affect Dark-type Pokémon");
TO_DO_BATTLE_TEST("Prankster-affected moves that are bounced back by Magic Bounce/Coat can affect Dark-type Pokémon");
TO_DO_BATTLE_TEST("Prankster-affected moves that are bounced back by Magic Coat from a Pokémon with Prankster can't affect Dark-type Pokémon");
TO_DO_BATTLE_TEST("Prankster-affected moves that target all Pokémon are successful regardless of the presence of Dark-type Pokémon");
TO_DO_BATTLE_TEST("Prankster-affected moves that target all Pokémon are successful regardless of the presence of Dark-type Pokémon");
TO_DO_BATTLE_TEST("Prankster-affected move effects don't affect Dark-type Pokémon");
TO_DO_BATTLE_TEST("Prankster increases the priority of moves by 1");
TO_DO_BATTLE_TEST("Prankster increases the priority of status Z-Moves by 1");
TO_DO_BATTLE_TEST("Prankster increases the priority of Extreme Evoboost by 1");
TO_DO_BATTLE_TEST("Prankster is blocked by Quick Guard in Gen5+");
27 changes: 24 additions & 3 deletions test/battle/hold_effect/safety_goggles.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ 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 {
Expand All @@ -21,6 +20,28 @@ SINGLE_BATTLE_TEST("Safety Goggles block powder and spore moves")
}
}

TO_DO_BATTLE_TEST("Safety Goggles blocks damage from hail");
TO_DO_BATTLE_TEST("Safety Goggles blocks damage from sandstorm");
SINGLE_BATTLE_TEST("Safety Goggles blocks damage from Hail")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_SAFETY_GOGGLES); };
} WHEN {
TURN { MOVE(player, MOVE_HAIL); }
} SCENE {
NOT MESSAGE("Foe Wobbuffet is pelted by HAIL!");
}
}

SINGLE_BATTLE_TEST("Safety Goggles blocks damage from Sandstorm")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_SAFETY_GOGGLES); };
} WHEN {
TURN { MOVE(player, MOVE_SANDSTORM); }
} SCENE {
NOT MESSAGE("Foe Wobbuffet is buffeted by the sandstorm!");
}
}

TO_DO_BATTLE_TEST("Safety Goggles blocks Effect Spore's effect");
49 changes: 49 additions & 0 deletions test/battle/move_effect/aurora_veil.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#include "global.h"
#include "test/battle.h"

ASSUMPTIONS
{
ASSUME(gBattleMoves[MOVE_AURORA_VEIL].effect == EFFECT_AURORA_VEIL);
}

SINGLE_BATTLE_TEST("Aurora Veil cannot be used without Hail or Snow")
AsparagusEduardo marked this conversation as resolved.
Show resolved Hide resolved
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_AURORA_VEIL); }
} SCENE {
MESSAGE("But it failed!");
}
}

SINGLE_BATTLE_TEST("Aurora Veil can be used in Hail")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_HAIL); MOVE(player, MOVE_AURORA_VEIL); }
} SCENE {
NOT MESSAGE("But it failed!");
}
}

SINGLE_BATTLE_TEST("Aurora Veil can be used in Snow")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_SNOWSCAPE); MOVE(player, MOVE_AURORA_VEIL); }
} SCENE {
NOT MESSAGE("But it failed!");
}
}
kittenchilly marked this conversation as resolved.
Show resolved Hide resolved
TO_DO_BATTLE_TEST("Aurora Veil reduces damage done to the user by half in singles")
TO_DO_BATTLE_TEST("Aurora Veil reduces damage done to the user by roughly a third in doubles")
TO_DO_BATTLE_TEST("Aurora Veil's damage reduction is ignored by Critical Hits")
TO_DO_BATTLE_TEST("Aurora Veil's damage reduction doesn't stack with Reflect or Light Screen")
TO_DO_BATTLE_TEST("Aurora Veil doesn't reduce confusion damage")
TO_DO_BATTLE_TEST("Aurora Veil doesn't reduce damage done by moves that do direct damage") // Bide, Counter, Endeavor, Final Gambit, Metal Burst, Mirror Coat, Psywave, Seismic Toss, Sonic Boom, Super Fang
2 changes: 1 addition & 1 deletion test/battle/move_effect/burn_hit.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SINGLE_BATTLE_TEST("Ember inflicts burn")
}
}

SINGLE_BATTLE_TEST("Ember cannot burn a Fire-type")
SINGLE_BATTLE_TEST("Burn cannot be inflicted on Fire-type Pokémon")
kittenchilly marked this conversation as resolved.
Show resolved Hide resolved
{
GIVEN {
ASSUME(gSpeciesInfo[SPECIES_CHARMANDER].types[0] == TYPE_FIRE);
Expand Down
43 changes: 40 additions & 3 deletions test/battle/move_effect/freeze_hit.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
ASSUMPTIONS
{
ASSUME(gBattleMoves[MOVE_POWDER_SNOW].effect == EFFECT_FREEZE_HIT);
ASSUME(gBattleMoves[MOVE_BLIZZARD].accuracy == 70);
}

SINGLE_BATTLE_TEST("Powder Snow inflicts freeze")
Expand All @@ -21,12 +22,12 @@ SINGLE_BATTLE_TEST("Powder Snow inflicts freeze")
}
}

SINGLE_BATTLE_TEST("Powder Snow cannot freeze an Ice-type")
SINGLE_BATTLE_TEST("Freeze cannot be inflicted on Ice-type Pokémon")
{
GIVEN {
ASSUME(gSpeciesInfo[SPECIES_SNORUNT].types[0] == TYPE_ICE);
ASSUME(gSpeciesInfo[SPECIES_GLALIE].types[0] == TYPE_ICE);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_SNORUNT);
OPPONENT(SPECIES_GLALIE);
kittenchilly marked this conversation as resolved.
Show resolved Hide resolved
} WHEN {
TURN { MOVE(player, MOVE_POWDER_SNOW); }
} SCENE {
Expand All @@ -36,3 +37,39 @@ SINGLE_BATTLE_TEST("Powder Snow cannot freeze an Ice-type")
NOT STATUS_ICON(opponent, freeze: TRUE);
}
}

SINGLE_BATTLE_TEST("Freeze cannot be inflicted in Sunlight")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_SUNNY_DAY); MOVE(player, MOVE_ICE_BEAM); }
} SCENE {
NOT MESSAGE("Wobbuffet was frozen solid!");
}
}

SINGLE_BATTLE_TEST("Blizzard bypasses accuracy checks in Hail")
kittenchilly marked this conversation as resolved.
Show resolved Hide resolved
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_HAIL); MOVE(player, MOVE_BLIZZARD); }
} SCENE {
NONE_OF { MESSAGE("Wobbuffet's attack missed!"); }
}
}

SINGLE_BATTLE_TEST("Blizzard bypasses accuracy checks in Snow")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_SNOWSCAPE); MOVE(player, MOVE_BLIZZARD); }
} SCENE {
NONE_OF { MESSAGE("Wobbuffet's attack missed!"); }
}
}
34 changes: 34 additions & 0 deletions test/battle/move_effect/hurricane.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#include "global.h"
#include "test/battle.h"

ASSUMPTIONS
{
ASSUME(gBattleMoves[MOVE_HURRICANE].effect == EFFECT_HURRICANE);
ASSUME(gBattleMoves[MOVE_HURRICANE].accuracy == 70);
}

SINGLE_BATTLE_TEST("Hurricane's accuracy is lowered to 50% in Sunlight")
{
PASSES_RANDOMLY(50, 100, RNG_ACCURACY);
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_SUNNY_DAY); MOVE(opponent, MOVE_HURRICANE); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_HURRICANE, opponent);
}
}

SINGLE_BATTLE_TEST("Hurricane bypasses accuracy checks in Rain")
{
PASSES_RANDOMLY(100, 100, RNG_ACCURACY);
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_RAIN_DANCE); MOVE(player, MOVE_HURRICANE); }
} SCENE {
NONE_OF { MESSAGE("Wobbuffet's attack missed!"); }
}
}
kittenchilly marked this conversation as resolved.
Show resolved Hide resolved
22 changes: 22 additions & 0 deletions test/battle/move_effect/leech_seed.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include "global.h"
#include "test/battle.h"

ASSUMPTIONS
{
ASSUME(gBattleMoves[MOVE_LEECH_SEED].effect == EFFECT_LEECH_SEED);
}

SINGLE_BATTLE_TEST("Leech Seed doesn't affect Grass-type Pokémon")
{
PASSES_RANDOMLY(90, 100, RNG_ACCURACY);
GIVEN {
ASSUME(gSpeciesInfo[SPECIES_ODDISH].types[0] == TYPE_GRASS);
PLAYER(SPECIES_WYNAUT);
OPPONENT(SPECIES_ODDISH);
} WHEN {
TURN { MOVE(player, MOVE_LEECH_SEED); }
} SCENE {
NOT ANIMATION(ANIM_TYPE_MOVE, MOVE_LEECH_SEED, player);
MESSAGE("It doesn't affect Foe Oddish…");
}
}
kittenchilly marked this conversation as resolved.
Show resolved Hide resolved
79 changes: 79 additions & 0 deletions test/battle/move_effect/moonlight.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#include "global.h"
#include "test/battle.h"

ASSUMPTIONS
{
ASSUME(gBattleMoves[MOVE_MOONLIGHT].effect == EFFECT_MOONLIGHT);
}

SINGLE_BATTLE_TEST("Moonlight recovers 1/2 of the user's max HP")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(200); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_MOONLIGHT); }
} SCENE {
HP_BAR(player, damage: -(200 / 2));
}
}

SINGLE_BATTLE_TEST("Moonlight recovers 2/3 of the user's max HP in Sunlight")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(300); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_SUNNY_DAY); MOVE(player, MOVE_MOONLIGHT); }
} SCENE {
HP_BAR(player, damage: -(300 / 1.5));
}
}

SINGLE_BATTLE_TEST("Moonlight recovers 1/4 of the user's max HP in Rain")
kittenchilly marked this conversation as resolved.
Show resolved Hide resolved
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_RAIN_DANCE); MOVE(player, MOVE_MOONLIGHT); }
} SCENE {
HP_BAR(player, damage: -(400 / 4));
}
}

SINGLE_BATTLE_TEST("Moonlight recovers 1/4 of the user's max HP in a Sandstorm")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_SANDSTORM); MOVE(player, MOVE_MOONLIGHT); }
} SCENE {
HP_BAR(player, damage: -(400 / 4));
}
}

SINGLE_BATTLE_TEST("Moonlight recovers 1/4 of the user's max HP in Hail")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_HAIL); MOVE(player, MOVE_MOONLIGHT); }
} SCENE {
HP_BAR(player, damage: -(400 / 4));
}
}

SINGLE_BATTLE_TEST("Moonlight recovers 1/4 of the user's max HP in Snow")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { HP(1); MaxHP(400); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_SNOWSCAPE); MOVE(player, MOVE_MOONLIGHT); }
} SCENE {
HP_BAR(player, damage: -(400 / 4));
}
}
Loading
Loading