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

Added multiple missing ability TODO tests #5163

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
46 changes: 46 additions & 0 deletions test/battle/ability/adaptability.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#include "global.h"
#include "test/battle.h"

TO_DO_BATTLE_TEST("Adaptability increases same-type attack bonus from x1.5 to x2");

SINGLE_BATTLE_TEST("(TERA) Terastallizing into a different type with Adaptability gives 2.0x STAB", s16 damage)
AlexOn1ine marked this conversation as resolved.
Show resolved Hide resolved
{
bool32 tera;
PARAMETRIZE { tera = GIMMICK_NONE; }
PARAMETRIZE { tera = GIMMICK_TERA; }
GIVEN {
PLAYER(SPECIES_CRAWDAUNT) { Ability(ABILITY_ADAPTABILITY); TeraType(TYPE_NORMAL); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_HEADBUTT, gimmick: tera); }
} SCENE {
MESSAGE("Crawdaunt used Headbutt!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_HEADBUTT, player);
HP_BAR(opponent, captureDamage: &results[i].damage);
} FINALLY {
// The jump from no STAB to 2.0x STAB is a 2.0x boost.
EXPECT_MUL_EQ(results[0].damage, Q_4_12(2.0), results[1].damage);
}
}

SINGLE_BATTLE_TEST("(TERA) Terastallizing into the same type with Adaptability gives 2.25x STAB", s16 damage)
{
bool32 tera;
PARAMETRIZE { tera = GIMMICK_NONE; }
PARAMETRIZE { tera = GIMMICK_TERA; }
GIVEN {
PLAYER(SPECIES_CRAWDAUNT) { Ability(ABILITY_ADAPTABILITY); TeraType(TYPE_WATER); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_WATER_PULSE, gimmick: tera); }
} SCENE {
MESSAGE("Crawdaunt used Water Pulse!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_WATER_PULSE, player);
HP_BAR(opponent, captureDamage: &results[i].damage);
} FINALLY {
// The jump from 2x STAB to 2.25x STAB is a 1.125x boost.
EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.125), results[1].damage);
}
}

TO_DO_BATTLE_TEST("Adaptability does not affect Stellar-type moves");
33 changes: 33 additions & 0 deletions test/battle/ability/aerilate.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include "global.h"
#include "test/battle.h"

ASSUMPTIONS
{
ASSUME(gMovesInfo[MOVE_TACKLE].type == TYPE_NORMAL);
ASSUME(gMovesInfo[MOVE_TACKLE].power > 0);
}

SINGLE_BATTLE_TEST("Aerilate turns a Normal-type move into Flying-type move")
{
GIVEN {
PLAYER(SPECIES_MEGANIUM);
OPPONENT(SPECIES_SALAMENCE) { Item(ITEM_SALAMENCITE); }
} WHEN {
TURN { MOVE(opponent, MOVE_TACKLE, gimmick: GIMMICK_MEGA); }
} SCENE {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_MEGA_EVOLUTION, opponent);
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent);
MESSAGE("It's super effective!");
}
}

TO_DO_BATTLE_TEST("Aerilate can not turn certain moves into Flying type moves");
TO_DO_BATTLE_TEST("Aerilate boosts power of affected moves by 20% (Gen7+)");
TO_DO_BATTLE_TEST("Aerilate boosts power of affected moves by 30% (Gen6)");

// Gen 6-7
TO_DO_BATTLE_TEST("Aerilate overrides Electrify (Gen6-7)");
TO_DO_BATTLE_TEST("Aerilate overrides Ion Deluge (Gen6-7)");
// Gen 8+
//TO_DO_BATTLE_TEST("Aerilate doesn't override Electrify (Gen8+)"); // No mon with Aerilate exists in Gen8+, but probably behaves similar to Pixilate, which does.
//TO_DO_BATTLE_TEST("Aerilate doesn't override Ion Deluge (Gen8+)"); // Ion Deluge doesn't exist in Gen 8+, but we probably could assume it behaves similar to under Electrify. TODO: Test by hacking SV.
4 changes: 4 additions & 0 deletions test/battle/ability/aftermath.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include "global.h"
#include "test/battle.h"

TO_DO_BATTLE_TEST("Aftermath damages the attacker by 1/4th of its max HP if they faint the target has this ability by a contact move");
4 changes: 4 additions & 0 deletions test/battle/ability/air_lock.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include "global.h"
#include "test/battle.h"

// Tests for Air Lock are handled in test/battle/ability/cloud_nine.c
11 changes: 11 additions & 0 deletions test/battle/ability/analytic.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "global.h"
#include "test/battle.h"

TO_DO_BATTLE_TEST("Analytic increases the power of moves by 30% if it's the last one that uses its move");
TO_DO_BATTLE_TEST("Analytic takes into account modifications to speeed an priority (Gen 5-8)"); //Eg. Paralysis, Power Weight, Stall
TO_DO_BATTLE_TEST("Analytic does not take into account modifications to speeed an priority (Gen 8)"); //Eg. Paralysis, Power Weight, Stall
TO_DO_BATTLE_TEST("Analytic takes into account the turn order of what fainted Pokémon would've moved");

// Triple Battles needed to test
//TO_DO_BATTLE_TEST("If the Pokémon with Analytic is targeting a Pokémon in a flank position that chooses to switch with its ally in the middle, its move's power will always be normal when it attacks the Pokémon that is shifted into the flank position");
//TO_DO_BATTLE_TEST("If the Pokémon with Analytic targets a Pokémon in the middle whose ally on a flank chooses to shift into the middle position, its move's power still depends on whether the Pokémon that was in the middle (and is now on a flank) has acted when the Pokémon with Analytic uses its move");
4 changes: 3 additions & 1 deletion test/battle/ability/anger_point.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ SINGLE_BATTLE_TEST("Anger Point does not trigger when already at maximum Attack
}
}

SINGLE_BATTLE_TEST("Anger Point does not trigger when a substitute takes the hit")
TO_DO_BATTLE_TEST("Anger Point triggers when a substitute takes the hit (Gen4)");

SINGLE_BATTLE_TEST("Anger Point does not trigger when a substitute takes the hit (Gen5+)")
{
ASSUME(gMovesInfo[MOVE_FROST_BREATH].alwaysCriticalHit);
ASSUME(gMovesInfo[MOVE_SUBSTITUTE].effect == EFFECT_SUBSTITUTE);
Expand Down
2 changes: 1 addition & 1 deletion test/battle/ability/anger_shell.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "global.h"
#include "test/battle.h"

SINGLE_BATTLE_TEST("Anger Shell activates only if the target had more than 50% of its hp")
SINGLE_BATTLE_TEST("Anger Shell activates only if the target had more than 50% of its HP")
{
bool32 activates = FALSE;
u16 maxHp = 500, hp = 0;
Expand Down
24 changes: 24 additions & 0 deletions test/battle/ability/anticipation.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include "global.h"
#include "test/battle.h"

TO_DO_BATTLE_TEST("Anticipation causes notifies if an opponent has a super-effective move");
TO_DO_BATTLE_TEST("Anticipation causes notifies if an opponent has a One-hit KO move");
TO_DO_BATTLE_TEST("Anticipation causes notifies if an opponent has a Self-Destruct or Explosion (Gen4)");
TO_DO_BATTLE_TEST("Anticipation treats Self-Destruct and Explosion like all other Normal types (Gen5+)");

TO_DO_BATTLE_TEST("Anticipation considers Scrappy and Normalize into their effectiveness (Gen4)");
TO_DO_BATTLE_TEST("Anticipation doesn't consider Scrappy and Normalize into their effectiveness (Gen5+)");
TO_DO_BATTLE_TEST("Anticipation considers Gravity into their effectiveness (Gen4)");
TO_DO_BATTLE_TEST("Anticipation doesn't consider Gravity into their effectiveness (Gen5+)");
TO_DO_BATTLE_TEST("Anticipation doesn't trigger from Counter, Metal Burst or Mirror Coat (Gen4)");
TO_DO_BATTLE_TEST("Anticipation counts Counter, Metal Burst or Mirror Coat as attacking moves of their types (Gen5+)");
TO_DO_BATTLE_TEST("Anticipation considers Synchronoise as an ordinary Psychic-type move");
TO_DO_BATTLE_TEST("Anticipation considers Freeze-Dry as an ordinary Ice-type move");
TO_DO_BATTLE_TEST("Anticipation considers Flying Press as an ordinary Fighting-type move");
TO_DO_BATTLE_TEST("Anticipation considers Aura Wheel as an ordinary Electric-type move");
TO_DO_BATTLE_TEST("Anticipation considers Inverse Battle types"); //Check with Normal-type moves
TO_DO_BATTLE_TEST("Anticipation treats dynamic move types as their base type (Normal)"); // Judgment, Weather Ball, Natural Gift, Techno Blast, Revelation Dance, Multi Attack
TO_DO_BATTLE_TEST("Anticipation treats Hidden Power as Normal Type (Gen4-5)");
TO_DO_BATTLE_TEST("Anticipation treats Hidden Power as its dynamic type (Gen6+)");
TO_DO_BATTLE_TEST("Anticipation does not consider Strong Winds on type matchups");
TO_DO_BATTLE_TEST("Anticipation does not consider ate-abilities");
11 changes: 11 additions & 0 deletions test/battle/ability/arena_trap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "global.h"
#include "test/battle.h"

TO_DO_BATTLE_TEST("Arena Trap prevents grounded adjacent opponents from switching out");
TO_DO_BATTLE_TEST("Arena Trap doesn't prevent switch outs if the Pokémon is switched in the same turn the opponent decided to switch out");
TO_DO_BATTLE_TEST("Arena Trap doesn't prevent switch outs via moves that switch out"); // Baton Pass, U-Turn, Volt Switch, Flip Turn, Parting Shot
TO_DO_BATTLE_TEST("Arena Trap doesn't prevent switch outs via Shed Shell, but not via Teleport");
TO_DO_BATTLE_TEST("Arena Trap doesn't prevent switch outs via Run Away");
TO_DO_BATTLE_TEST("Arena Trap doesn't prevent switch outs via Smoke Ball");
TO_DO_BATTLE_TEST("Arena Trap prevents switch outs from Ghost-type Pokémon (Gen3-5)");
TO_DO_BATTLE_TEST("Arena Trap doesn't prevent switch outs from Ghost-type Pokémon (Gen6+)");
15 changes: 15 additions & 0 deletions test/battle/ability/aroma_veil.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include "global.h"
#include "test/battle.h"

TO_DO_BATTLE_TEST("Aroma Veil protects the Pokémon's side from Taunt");
TO_DO_BATTLE_TEST("Aroma Veil protects the Pokémon's side from Torment");
TO_DO_BATTLE_TEST("Aroma Veil protects the Pokémon's side from Encore");
TO_DO_BATTLE_TEST("Aroma Veil protects the Pokémon's side from Disable");
TO_DO_BATTLE_TEST("Aroma Veil protects the Pokémon's side from Cursed Body");
TO_DO_BATTLE_TEST("Aroma Veil protects the Pokémon's side from Heal Block");
TO_DO_BATTLE_TEST("Aroma Veil protects the Pokémon's side from Infatuation");
TO_DO_BATTLE_TEST("Aroma Veil does not protect the Pokémon's side from Imprison");

// Marked in Bulbapedia as need of research
//TO_DO_BATTLE_TEST("Aroma Veil prevents G-Max Meltdown's effect");
//TO_DO_BATTLE_TEST("Aroma Veil prevents Psychic Noise's effect");
7 changes: 7 additions & 0 deletions test/battle/ability/as_one.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "global.h"
#include "test/battle.h"

// Tests for the individual ability effects are handled in the following times:
// - Unnerve: test/battle/ability/unnerve.c
// - Chilling Neigh: test/battle/ability/chilling_neigh.c
// - Grim Neigh: test/battle/ability/grim_neigh.c
6 changes: 6 additions & 0 deletions test/battle/ability/aura_break.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "global.h"
#include "test/battle.h"

TO_DO_BATTLE_TEST("Aura Break inverts Fairy Aura's effect");
TO_DO_BATTLE_TEST("Aura Break inverts Dark Aura's effect");
TO_DO_BATTLE_TEST("Aura Break ignores Mold Breaker abilities");
4 changes: 4 additions & 0 deletions test/battle/ability/chilling_neigh.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include "global.h"
#include "test/battle.h"

// Tests for Chilling Neigh are handled in test/battle/ability/moxie.c
6 changes: 6 additions & 0 deletions test/battle/ability/chlorophyll.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "global.h"
#include "test/battle.h"

TO_DO_BATTLE_TEST("Chlorophyll doubles speed if it's sunny");
TO_DO_BATTLE_TEST("Chlorophyll doesn't double speed if Cloud Nine/Air Lock is on the field");
TO_DO_BATTLE_TEST("Chlorophyll doesn't double speed if they have an Utility Umbrella");
31 changes: 28 additions & 3 deletions test/battle/ability/cloud_nine.c
Original file line number Diff line number Diff line change
@@ -1,16 +1,41 @@
#include "global.h"
#include "test/battle.h"

SINGLE_BATTLE_TEST("Cloud Nine prevents weather effects")
SINGLE_BATTLE_TEST("Cloud Nine/Air Lock prevent basic weather effects, but without them disappearing - Sandstorm")
{
u32 species = 0, ability = 0;
PARAMETRIZE { species = SPECIES_PSYDUCK; ability = ABILITY_CLOUD_NINE; }
PARAMETRIZE { species = SPECIES_RAYQUAZA; ability = ABILITY_AIR_LOCK; }
GIVEN {
ASSUME(gMovesInfo[MOVE_SANDSTORM].effect == EFFECT_SANDSTORM);
PLAYER(SPECIES_PSYDUCK) { Ability(ABILITY_CLOUD_NINE); }
PLAYER(species) { Ability(ability); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_SANDSTORM); }
TURN {}
} SCENE {
NONE_OF { HP_BAR(player); }
ABILITY_POPUP(player, ability);
MESSAGE("The effects of weather disappeared.");
MESSAGE("Foe Wobbuffet used Sandstorm!");
MESSAGE("The sandstorm rages.");
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SANDSTORM_CONTINUES);
NONE_OF {
HP_BAR(player);
HP_BAR(opponent);
MESSAGE("Foe Wobbuffet is buffeted by the sandstorm!");
}
MESSAGE("The sandstorm rages.");
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_SANDSTORM_CONTINUES);
}
}

TO_DO_BATTLE_TEST("Cloud Nine/Air Lock prevent basic weather effects, but without them disappearing - Sun");
TO_DO_BATTLE_TEST("Cloud Nine/Air Lock prevent basic weather effects, but without them disappearing - Rain");
TO_DO_BATTLE_TEST("Cloud Nine/Air Lock prevent basic weather effects, but without them disappearing - Hail");
TO_DO_BATTLE_TEST("Cloud Nine/Air Lock prevent basic weather effects, but without them disappearing - Snow");
TO_DO_BATTLE_TEST("Cloud Nine/Air Lock prevent basic weather effects, but without them disappearing - Fog");
TO_DO_BATTLE_TEST("Cloud Nine/Air Lock prevent basic weather effects, but without them disappearing - Primal Sun");
TO_DO_BATTLE_TEST("Cloud Nine/Air Lock prevent basic weather effects, but without them disappearing - Primal Rain");
TO_DO_BATTLE_TEST("Cloud Nine/Air Lock prevent basic weather effects, but without them disappearing - Strong Winds");

// Moves and abilities that are affected by weather should have new tests that check for Clould Nine/Air Lock, like Mold-Breaker Abilities
2 changes: 1 addition & 1 deletion test/battle/ability/damp.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ SINGLE_BATTLE_TEST("Damp prevents explosion-like moves from self")
}
}

SINGLE_BATTLE_TEST("Damp prevents damage from aftermath")
SINGLE_BATTLE_TEST("Damp prevents damage from Aftermath")
{
GIVEN {
ASSUME(gMovesInfo[MOVE_TACKLE].makesContact);
Expand Down
5 changes: 5 additions & 0 deletions test/battle/ability/drought.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "global.h"
#include "test/battle.h"

TO_DO_BATTLE_TEST("Drought sets up sun for 5 turns (Gen6+)");
TO_DO_BATTLE_TEST("Drought sets up permanent sun (Gen3-5)");
4 changes: 4 additions & 0 deletions test/battle/ability/dry_skin.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ SINGLE_BATTLE_TEST("Dry Skin causes 1/8th Max HP damage in Sun")
}
}

TO_DO_BATTLE_TEST("Dry Skin doesn't get damaged in Sun if Cloud Nine/Air Lock is on the field");

SINGLE_BATTLE_TEST("Dry Skin heals 1/8th Max HP in Rain")
{
GIVEN {
Expand All @@ -29,6 +31,8 @@ SINGLE_BATTLE_TEST("Dry Skin heals 1/8th Max HP in Rain")
}
}

TO_DO_BATTLE_TEST("Dry Skin doesn't heal in Rain if Cloud Nine/Air Lock is on the field");

SINGLE_BATTLE_TEST("Dry Skin increases damage taken from Fire-type moves by 25%", s16 damage)
{
u32 ability;
Expand Down
4 changes: 4 additions & 0 deletions test/battle/ability/flower_gift.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ SINGLE_BATTLE_TEST("Flower Gift transforms Cherrim in harsh sunlight")
}
}

TO_DO_BATTLE_TEST("Flower Gift doesn't transform Cherrim if Cloud Nine/Air Lock is on the field");

SINGLE_BATTLE_TEST("Flower Gift transforms Cherrim back to normal when weather changes")
{
GIVEN {
Expand Down Expand Up @@ -61,6 +63,8 @@ SINGLE_BATTLE_TEST("Flower Gift transforms Cherrim back to normal when its abili
}
}

TO_DO_BATTLE_TEST("Forecast transforms Castform back to normal under Cloud Nine/Air Lock");

DOUBLE_BATTLE_TEST("Flower Gift increases the attack of Cherrim and its allies by 1.5x", s16 damageL, s16 damageR)
{
bool32 sunny;
Expand Down
9 changes: 6 additions & 3 deletions test/battle/ability/forecast.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,15 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal when Sandstorm i
}
}

SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal under Air Lock")
SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal under Cloud Nine/Air Lock")
{
u32 species = 0, ability = 0;
PARAMETRIZE { species = SPECIES_PSYDUCK; ability = ABILITY_CLOUD_NINE; }
PARAMETRIZE { species = SPECIES_RAYQUAZA; ability = ABILITY_AIR_LOCK; }
GIVEN {
PLAYER(SPECIES_CASTFORM_NORMAL) { Ability(ABILITY_FORECAST); }
OPPONENT(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_RAYQUAZA);
OPPONENT(species) { Ability(ability); }
} WHEN {
TURN { MOVE(player, MOVE_RAIN_DANCE); }
TURN { SWITCH(opponent, 1); }
Expand All @@ -279,7 +282,7 @@ SINGLE_BATTLE_TEST("Forecast transforms Castform back to normal under Air Lock")
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
MESSAGE("Castform transformed!");
// back to normal
ABILITY_POPUP(opponent, ABILITY_AIR_LOCK);
ABILITY_POPUP(opponent, ability);
ABILITY_POPUP(player, ABILITY_FORECAST);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player);
MESSAGE("Castform transformed!");
Expand Down
Loading
Loading