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

Tests for Corrosion, Acrobatics, Hone Claws, Hurricane #4708

Merged
merged 6 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
68 changes: 65 additions & 3 deletions test/battle/ability/corrosion.c
Pawkkie marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,68 @@ SINGLE_BATTLE_TEST("If a Poison- or Steel-type Pokémon with Corrosion poisons a
}
}

TO_DO_BATTLE_TEST("Corrosion cannot bypass moves or Abilities that prevent poisoning, such as Safeguard or Immunity");
TO_DO_BATTLE_TEST("If the Pokémon with this Ability uses Magic Coat to reflect a status move that inflicts poison, the reflected move will be able to poison Poison- or Steel-type Pokémon.");
TO_DO_BATTLE_TEST("Moves used by a Pokémon with Corrosion that are reflected by Magic Coat or Magic Bounce do not retain the ability to poison Poison- or Steel-type Pokémon.")
SINGLE_BATTLE_TEST("Corrosion cannot bypass moves that prevent poisoning such as Safeguard")
{
GIVEN {
ASSUME(gMovesInfo[MOVE_TOXIC].effect == EFFECT_TOXIC);
PLAYER(SPECIES_SALANDIT) { Ability(ABILITY_CORROSION); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_SAFEGUARD); MOVE(player, MOVE_TOXIC); }
} SCENE {
NONE_OF {
ANIMATION(ANIM_TYPE_MOVE, MOVE_TOXIC, player);
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_PSN, opponent);
STATUS_ICON(opponent, badPoison: TRUE);
}
}
}

SINGLE_BATTLE_TEST("Corrosion cannot bypass abilities that prevent poisoning such as Immunity")
{
GIVEN {
ASSUME(gMovesInfo[MOVE_TOXIC].effect == EFFECT_TOXIC);
PLAYER(SPECIES_SALANDIT) { Ability(ABILITY_CORROSION); }
OPPONENT(SPECIES_SNORLAX) { Ability(ABILITY_IMMUNITY); }
} WHEN {
TURN { MOVE(player, MOVE_TOXIC); }
} SCENE {
NONE_OF {
ANIMATION(ANIM_TYPE_MOVE, MOVE_TOXIC, player);
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_PSN, opponent);
STATUS_ICON(opponent, badPoison: TRUE);
}
}
}

SINGLE_BATTLE_TEST("If the Pokémon with this Ability uses Magic Coat to reflect a status move that inflicts poison, the reflected move will be able to poison Poison- or Steel-type Pokémon.")
Pawkkie marked this conversation as resolved.
Show resolved Hide resolved
{
GIVEN {
ASSUME(gMovesInfo[MOVE_TOXIC].effect == EFFECT_TOXIC);
ASSUME(gMovesInfo[MOVE_MAGIC_COAT].effect == EFFECT_MAGIC_COAT);
PLAYER(SPECIES_SALANDIT) { Ability(ABILITY_CORROSION); }
OPPONENT(SPECIES_BELDUM);
} WHEN {
TURN { MOVE(player, MOVE_MAGIC_COAT); MOVE(opponent, MOVE_TOXIC); }
} SCENE {
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_PSN, opponent);
Pawkkie marked this conversation as resolved.
Show resolved Hide resolved
STATUS_ICON(opponent, badPoison: TRUE);
}
}

SINGLE_BATTLE_TEST("Moves used by a Pokémon with Corrosion that are reflected by Magic Coat or Magic Bounce do not retain the ability to poison Poison- or Steel-type Pokémon.")
Pawkkie marked this conversation as resolved.
Show resolved Hide resolved
{
GIVEN {
ASSUME(gMovesInfo[MOVE_TOXIC].effect == EFFECT_TOXIC);
ASSUME(gMovesInfo[MOVE_MAGIC_COAT].effect == EFFECT_MAGIC_COAT);
PLAYER(SPECIES_SALANDIT) { Ability(ABILITY_CORROSION); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_MAGIC_COAT); MOVE(player, MOVE_TOXIC); }
} SCENE {
NONE_OF {
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_PSN, player);
Pawkkie marked this conversation as resolved.
Show resolved Hide resolved
STATUS_ICON(player, badPoison: TRUE);
}
}
}
44 changes: 42 additions & 2 deletions test/battle/move_effect/acrobatics.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@
#include "global.h"
#include "test/battle.h"

TO_DO_BATTLE_TEST("Acrobatics doubles in power if the user has no held item");
TO_DO_BATTLE_TEST("Acrobatics still doubles in power when Flying Gem is consumed");
ASSUMPTIONS
{
ASSUME(gMovesInfo[MOVE_ACROBATICS].effect == EFFECT_ACROBATICS);
ASSUME(gMovesInfo[MOVE_ACROBATICS].type == TYPE_FLYING);
}

SINGLE_BATTLE_TEST("Acrobatics doubles in power if the user has no held item", s16 damage)
{
u16 heldItem;
PARAMETRIZE{ heldItem = ITEM_POTION; }
Pawkkie marked this conversation as resolved.
Show resolved Hide resolved
PARAMETRIZE{ heldItem = ITEM_NONE; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET) { Item(heldItem); }
} WHEN {
TURN { MOVE(opponent, MOVE_ACROBATICS); }
} SCENE {
HP_BAR(player, captureDamage: &results[i].damage);
} FINALLY {
EXPECT_MUL_EQ(results[0].damage, Q_4_12(2), results[1].damage);
}
}

SINGLE_BATTLE_TEST("Acrobatics still doubles in power when Flying Gem is consumed", s16 damage)
{
u16 heldItem;
PARAMETRIZE{ heldItem = ITEM_NONE; }
PARAMETRIZE{ heldItem = ITEM_FLYING_GEM; }
GIVEN {
ASSUME(I_GEM_BOOST_POWER >= GEN_6);
ASSUME(gItemsInfo[ITEM_FLYING_GEM].holdEffect == HOLD_EFFECT_GEMS);
ASSUME(gItemsInfo[ITEM_FLYING_GEM].secondaryId == TYPE_FLYING);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET) { Item(heldItem); }
} WHEN {
TURN { MOVE(opponent, MOVE_ACROBATICS); }
} SCENE {
HP_BAR(player, captureDamage: &results[i].damage);
} FINALLY {
EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.3), (results[1].damage));
Pawkkie marked this conversation as resolved.
Show resolved Hide resolved
}
}
16 changes: 15 additions & 1 deletion test/battle/move_effect/attack_accuracy_up.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
#include "global.h"
#include "test/battle.h"

TO_DO_BATTLE_TEST("Hone Claws increases Attack and Accuracy by one stage each");
SINGLE_BATTLE_TEST("Hone Claws increases Attack and Accuracy by one stage each")
Bassoonian marked this conversation as resolved.
Show resolved Hide resolved
{
GIVEN {
ASSUME(gMovesInfo[MOVE_HONE_CLAWS].effect == EFFECT_ATTACK_ACCURACY_UP);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_HONE_CLAWS); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_HONE_CLAWS, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Wobbuffet's Attack rose!");
MESSAGE("Wobbuffet's accuracy rose!");
}
}
23 changes: 22 additions & 1 deletion test/battle/move_effects_combined/hurricane.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,25 @@ SINGLE_BATTLE_TEST("Hurricane bypasses accuracy checks in Rain")
NONE_OF { MESSAGE("Wobbuffet's attack missed!"); }
}
}
TO_DO_BATTLE_TEST("Hurricane Veil can hit airborne targets") // Fly, Bounce, Sky Drop

SINGLE_BATTLE_TEST("Hurricane can hit airborne targets")
{
u16 move;
PARAMETRIZE{ move = MOVE_FLY; }
PARAMETRIZE{ move = MOVE_BOUNCE; }
PARAMETRIZE{ move = MOVE_SKY_DROP; }
GIVEN {
ASSUME(gMovesInfo[MOVE_FLY].effect == EFFECT_SEMI_INVULNERABLE);
ASSUME(UNCOMPRESS_BITS(HIHALF(gMovesInfo[MOVE_FLY].argument)) == STATUS3_ON_AIR);
ASSUME(gMovesInfo[MOVE_BOUNCE].effect == EFFECT_SEMI_INVULNERABLE);
ASSUME(UNCOMPRESS_BITS(HIHALF(gMovesInfo[MOVE_BOUNCE].argument)) == STATUS3_ON_AIR);
ASSUME(gMovesInfo[MOVE_SKY_DROP].effect == EFFECT_SKY_DROP);
ASSUME(UNCOMPRESS_BITS(HIHALF(gMovesInfo[MOVE_SKY_DROP].argument)) == STATUS3_ON_AIR);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET) { Moves(move); }
} WHEN {
TURN { MOVE(opponent, move); MOVE(player, MOVE_HURRICANE); }
} SCENE {
NONE_OF { MESSAGE("Wobbuffet's attack missed!"); }
Pawkkie marked this conversation as resolved.
Show resolved Hide resolved
}
}
Loading