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

Replace mons for gen9 abilities #3740

Merged
merged 2 commits into from
Dec 22, 2023
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
50 changes: 14 additions & 36 deletions test/battle/ability/beads_of_ruin.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,28 @@
ASSUMPTIONS
{
ASSUME(gBattleMoves[MOVE_WATER_GUN].category == BATTLE_CATEGORY_SPECIAL);
ASSUME(gBattleMoves[MOVE_ROLE_PLAY].effect == EFFECT_ROLE_PLAY);
}

SINGLE_BATTLE_TEST("Beads of Ruin reduces Sp. Def", s16 damage)
SINGLE_BATTLE_TEST("Beads of Ruin reduces Sp. Def if opposing mon's ability doesn't match")
{
u32 ability;

PARAMETRIZE { ability = ABILITY_SHADOW_TAG; }
PARAMETRIZE { ability = ABILITY_BEADS_OF_RUIN; }
s16 damage[2];

GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Ability(ability); }
PLAYER(SPECIES_CHI_YU) { Ability(ABILITY_BEADS_OF_RUIN); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_WATER_GUN); MOVE(opponent, MOVE_ROLE_PLAY); }
TURN { MOVE(player, MOVE_WATER_GUN); }
} SCENE {
if (ability == ABILITY_BEADS_OF_RUIN) {
ABILITY_POPUP(player, ABILITY_BEADS_OF_RUIN);
MESSAGE("Wobbuffet's Beads of Ruin weakened the Sp. Def of all surrounding Pokémon!");
}
HP_BAR(opponent, captureDamage: &results[i].damage);
} FINALLY {
EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.33), results[1].damage);
}
}

SINGLE_BATTLE_TEST("Beads of Ruin does not reduce Sp. Def if opposing mon has the same ability", s16 damage)
{
u32 ability;

PARAMETRIZE { ability = ABILITY_SHADOW_TAG; }
PARAMETRIZE { ability = ABILITY_BEADS_OF_RUIN; }

GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Ability(ability); }
OPPONENT(SPECIES_WOBBUFFET) { Ability(ABILITY_BEADS_OF_RUIN); }
} WHEN {
TURN { MOVE(player, MOVE_WATER_GUN); }
} SCENE {
if (ability == ABILITY_BEADS_OF_RUIN) {
ABILITY_POPUP(player, ABILITY_BEADS_OF_RUIN);
MESSAGE("Wobbuffet's Beads of Ruin weakened the Sp. Def of all surrounding Pokémon!");
}
HP_BAR(opponent, captureDamage: &results[i].damage);
} FINALLY {
EXPECT_EQ(results[0].damage, results[1].damage);
ABILITY_POPUP(player, ABILITY_BEADS_OF_RUIN);
MESSAGE("Chi-Yu's Beads of Ruin weakened the Sp. Def of all surrounding Pokémon!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_WATER_GUN, player);
HP_BAR(opponent, captureDamage: &damage[0]);
ANIMATION(ANIM_TYPE_MOVE, MOVE_ROLE_PLAY, opponent);
ANIMATION(ANIM_TYPE_MOVE, MOVE_WATER_GUN, player);
HP_BAR(opponent, captureDamage: &damage[1]);
} THEN {
EXPECT_MUL_EQ(damage[1], Q_4_12(1.33), damage[0]);
}
}
69 changes: 18 additions & 51 deletions test/battle/ability/protosynthesis.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ ASSUMPTIONS
SINGLE_BATTLE_TEST("Protosynthesis boosts the highest stat")
{
GIVEN {
PLAYER(SPECIES_ABRA) { Ability(ABILITY_PROTOSYNTHESIS); }
PLAYER(SPECIES_WALKING_WAKE) { Ability(ABILITY_PROTOSYNTHESIS); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_SUNNY_DAY); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_SUNNY_DAY, player);
ABILITY_POPUP(player, ABILITY_PROTOSYNTHESIS);
MESSAGE("The harsh sunlight activated Abra's Protosynthesis!");
MESSAGE("Abra's Sp. Atk was heightened!");
MESSAGE("The harsh sunlight activated WalkngWake's Protosynthesis!");
MESSAGE("WalkngWake's Sp. Atk was heightened!");
}
}

Expand All @@ -28,11 +28,11 @@ SINGLE_BATTLE_TEST("Protosynthesis boosts either Attack or Special Attack, not b
u32 move;
s16 damage[2];

PARAMETRIZE { species = SPECIES_BELLSPROUT; move = MOVE_TACKLE; }
PARAMETRIZE { species = SPECIES_BELLSPROUT; move = MOVE_ROUND; }
PARAMETRIZE { species = SPECIES_ROARING_MOON; move = MOVE_TACKLE; }
PARAMETRIZE { species = SPECIES_ROARING_MOON; move = MOVE_ROUND; }

PARAMETRIZE { species = SPECIES_ABRA; move = MOVE_TACKLE; }
PARAMETRIZE { species = SPECIES_ABRA; move = MOVE_ROUND; }
PARAMETRIZE { species = SPECIES_WALKING_WAKE; move = MOVE_TACKLE; }
PARAMETRIZE { species = SPECIES_WALKING_WAKE; move = MOVE_ROUND; }

GIVEN {
PLAYER(species) { Ability(ABILITY_PROTOSYNTHESIS); }
Expand All @@ -47,51 +47,19 @@ SINGLE_BATTLE_TEST("Protosynthesis boosts either Attack or Special Attack, not b
ANIMATION(ANIM_TYPE_MOVE, move, player);
HP_BAR(opponent, captureDamage: &damage[1]);
} THEN {
if ((move == MOVE_TACKLE && species == SPECIES_BELLSPROUT) || (move == MOVE_ROUND && species == SPECIES_ABRA))
if ((move == MOVE_TACKLE && species == SPECIES_ROARING_MOON) || (move == MOVE_ROUND && species == SPECIES_WALKING_WAKE))
EXPECT_MUL_EQ(damage[0], Q_4_12(1.3), damage[1]);
else
EXPECT_EQ(damage[0], damage[1]);
}
}

SINGLE_BATTLE_TEST("Protosynthesis either boosts Defense or Special Defense, not both")
{
u16 species;
u32 move;
s16 damage[2];

PARAMETRIZE { species = SPECIES_ONIX; move = MOVE_TACKLE; }
PARAMETRIZE { species = SPECIES_ONIX; move = MOVE_ROUND; }

PARAMETRIZE { species = SPECIES_BLASTOISE; move = MOVE_TACKLE; }
PARAMETRIZE { species = SPECIES_BLASTOISE; move = MOVE_ROUND; }

GIVEN {
PLAYER(species) { Ability(ABILITY_PROTOSYNTHESIS); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, move); }
TURN { MOVE(player, MOVE_SUNNY_DAY); MOVE(opponent, move); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, move, opponent);
HP_BAR(player, captureDamage: &damage[0]);
ANIMATION(ANIM_TYPE_MOVE, MOVE_SUNNY_DAY, player);
ANIMATION(ANIM_TYPE_MOVE, move, opponent);
HP_BAR(player, captureDamage: &damage[1]);
} THEN {
if ((move == MOVE_TACKLE && species == SPECIES_ONIX) || (move == MOVE_ROUND && species == SPECIES_BLASTOISE))
EXPECT_MUL_EQ(damage[0], Q_4_12(0.7), damage[1]);
else
EXPECT_EQ(damage[0], damage[1]);
}
}

SINGLE_BATTLE_TEST("Protosynthesis ability pop up activates only once during the duration of sunny day")
{
u16 turns;

GIVEN {
PLAYER(SPECIES_BELLSPROUT) { Ability(ABILITY_PROTOSYNTHESIS); }
PLAYER(SPECIES_WALKING_WAKE) { Ability(ABILITY_PROTOSYNTHESIS); }
OPPONENT(SPECIES_NINETALES) { Ability(ABILITY_DROUGHT); };
} WHEN {
for (turns = 0; turns < 5; turns++)
Expand All @@ -100,35 +68,34 @@ SINGLE_BATTLE_TEST("Protosynthesis ability pop up activates only once during the
} SCENE {
ABILITY_POPUP(opponent, ABILITY_DROUGHT);
ABILITY_POPUP(player, ABILITY_PROTOSYNTHESIS);
MESSAGE("The harsh sunlight activated Bellsprout's Protosynthesis!");
MESSAGE("Bellsprout's Attack was heightened!");
MESSAGE("The harsh sunlight activated WalkngWake's Protosynthesis!");
MESSAGE("WalkngWake's Sp. Atk was heightened!");
NONE_OF {
for (turns = 0; turns < 4; turns++) {
ABILITY_POPUP(player, ABILITY_PROTOSYNTHESIS);
MESSAGE("The harsh sunlight activated Bellsprout's Protosynthesis!");
MESSAGE("Bellsprout's Attack was heightened!");
MESSAGE("The harsh sunlight activated WalkngWake's Protosynthesis!");
MESSAGE("WalkngWake's Sp. Atk was heightened!");
}
}
ANIMATION(ANIM_TYPE_MOVE, MOVE_SUNNY_DAY, opponent);
ABILITY_POPUP(player, ABILITY_PROTOSYNTHESIS);
MESSAGE("The harsh sunlight activated Bellsprout's Protosynthesis!");
MESSAGE("Bellsprout's Attack was heightened!");
MESSAGE("The harsh sunlight activated WalkngWake's Protosynthesis!");
MESSAGE("WalkngWake's Sp. Atk was heightened!");
}
}

SINGLE_BATTLE_TEST("Protosynthesis activates on switch-in")
{
KNOWN_FAILING; // Fails because of wrong species
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
PLAYER(SPECIES_BELLSPROUT) { Ability(ABILITY_PROTOSYNTHESIS); }
PLAYER(SPECIES_ROARING_MOON) { Ability(ABILITY_PROTOSYNTHESIS); }
OPPONENT(SPECIES_NINETALES) { Ability(ABILITY_DROUGHT); };
} WHEN {
TURN { SWITCH(player, 1); }
} SCENE {
ABILITY_POPUP(opponent, ABILITY_DROUGHT);
ABILITY_POPUP(player, ABILITY_PROTOSYNTHESIS);
MESSAGE("The harsh sunlight activated Bellsprout's Protosynthesis!");
MESSAGE("Bellsprout's Attack was heightened!");
MESSAGE("The harsh sunlight activated RoarngMoon's Protosynthesis!");
MESSAGE("RoarngMoon's Attack was heightened!");
}
}
77 changes: 22 additions & 55 deletions test/battle/ability/quark_drive.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ ASSUMPTIONS
SINGLE_BATTLE_TEST("Quark Drive boosts the highest stat")
{
GIVEN {
PLAYER(SPECIES_ABRA) { Ability(ABILITY_QUARK_DRIVE); }
PLAYER(SPECIES_IRON_MOTH) { Ability(ABILITY_QUARK_DRIVE); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_ELECTRIC_TERRAIN); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_ELECTRIC_TERRAIN, player);
ABILITY_POPUP(player, ABILITY_QUARK_DRIVE);
MESSAGE("The Electric Terrain activated Abra's Quark Drive!");
MESSAGE("Abra's Sp. Atk was heightened!");
MESSAGE("The Electric Terrain activated Iron Moth's Quark Drive!");
MESSAGE("Iron Moth's Sp. Atk was heightened!");
}
}

Expand All @@ -28,11 +28,11 @@ SINGLE_BATTLE_TEST("Quark Drive boosts either Attack or Special Attack, not both
u32 move;
s16 damage[2];

PARAMETRIZE { species = SPECIES_BELLSPROUT; move = MOVE_TACKLE; }
PARAMETRIZE { species = SPECIES_BELLSPROUT; move = MOVE_ROUND; }
PARAMETRIZE { species = SPECIES_IRON_VALIANT; move = MOVE_TACKLE; }
PARAMETRIZE { species = SPECIES_IRON_VALIANT; move = MOVE_ROUND; }

PARAMETRIZE { species = SPECIES_ABRA; move = MOVE_TACKLE; }
PARAMETRIZE { species = SPECIES_ABRA; move = MOVE_ROUND; }
PARAMETRIZE { species = SPECIES_IRON_MOTH; move = MOVE_TACKLE; }
PARAMETRIZE { species = SPECIES_IRON_MOTH; move = MOVE_ROUND; }

GIVEN {
PLAYER(species) { Ability(ABILITY_QUARK_DRIVE); }
Expand All @@ -47,89 +47,56 @@ SINGLE_BATTLE_TEST("Quark Drive boosts either Attack or Special Attack, not both
ANIMATION(ANIM_TYPE_MOVE, move, player);
HP_BAR(opponent, captureDamage: &damage[1]);
} THEN {
if ((move == MOVE_TACKLE && species == SPECIES_BELLSPROUT) || (move == MOVE_ROUND && species == SPECIES_ABRA))
if ((move == MOVE_TACKLE && species == SPECIES_IRON_VALIANT) || (move == MOVE_ROUND && species == SPECIES_IRON_MOTH))
EXPECT_MUL_EQ(damage[0], Q_4_12(1.3), damage[1]);
else
EXPECT_EQ(damage[0], damage[1]);
}
}

SINGLE_BATTLE_TEST("Quark Drive either boosts Defense or Special Defense, not both")
{
u16 species;
u32 move;
s16 damage[2];

PARAMETRIZE { species = SPECIES_ONIX; move = MOVE_TACKLE; }
PARAMETRIZE { species = SPECIES_ONIX; move = MOVE_ROUND; }

PARAMETRIZE { species = SPECIES_BLASTOISE; move = MOVE_TACKLE; }
PARAMETRIZE { species = SPECIES_BLASTOISE; move = MOVE_ROUND; }

GIVEN {
PLAYER(species) { Ability(ABILITY_QUARK_DRIVE); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, move); }
TURN { MOVE(player, MOVE_ELECTRIC_TERRAIN); MOVE(opponent, move); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, move, opponent);
HP_BAR(player, captureDamage: &damage[0]);
ANIMATION(ANIM_TYPE_MOVE, MOVE_ELECTRIC_TERRAIN, player);
ANIMATION(ANIM_TYPE_MOVE, move, opponent);
HP_BAR(player, captureDamage: &damage[1]);
} THEN {
if ((move == MOVE_TACKLE && species == SPECIES_ONIX) || (move == MOVE_ROUND && species == SPECIES_BLASTOISE))
EXPECT_MUL_EQ(damage[0], Q_4_12(0.7), damage[1]);
else
EXPECT_EQ(damage[0], damage[1]);
}
}

SINGLE_BATTLE_TEST("Quark Drive ability pop up activates only once during the duration of electric terrain")
{
u16 turns;

GIVEN {
PLAYER(SPECIES_BELLSPROUT) { Ability(ABILITY_QUARK_DRIVE); }
PLAYER(SPECIES_IRON_MOTH) { Ability(ABILITY_QUARK_DRIVE); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_ELECTRIC_TERRAIN); }
TURN { MOVE(player, MOVE_ELECTRIC_TERRAIN); }
for (turns = 0; turns < 4; turns++)
TURN {}
TURN { MOVE(opponent, MOVE_ELECTRIC_TERRAIN); }
TURN { MOVE(player, MOVE_ELECTRIC_TERRAIN); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_ELECTRIC_TERRAIN, opponent);
ANIMATION(ANIM_TYPE_MOVE, MOVE_ELECTRIC_TERRAIN, player);
ABILITY_POPUP(player, ABILITY_QUARK_DRIVE);
MESSAGE("The Electric Terrain activated Bellsprout's Quark Drive!");
MESSAGE("Bellsprout's Attack was heightened!");
MESSAGE("The Electric Terrain activated Iron Moth's Quark Drive!");
MESSAGE("Iron Moth's Sp. Atk was heightened!");
NONE_OF {
for (turns = 0; turns < 4; turns++) {
ABILITY_POPUP(player, ABILITY_QUARK_DRIVE);
MESSAGE("The Electric Terrain activated Bellsprout's Quark Drive!");
MESSAGE("Bellsprout's Attack was heightened!");
MESSAGE("The Electric Terrain activated Iron Moth's Quark Drive!");
MESSAGE("Iron Moth's Sp. Atk was heightened!");
}
}
ANIMATION(ANIM_TYPE_MOVE, MOVE_ELECTRIC_TERRAIN, opponent);
ANIMATION(ANIM_TYPE_MOVE, MOVE_ELECTRIC_TERRAIN, player);
ABILITY_POPUP(player, ABILITY_QUARK_DRIVE);
MESSAGE("The Electric Terrain activated Bellsprout's Quark Drive!");
MESSAGE("Bellsprout's Attack was heightened!");
MESSAGE("The Electric Terrain activated Iron Moth's Quark Drive!");
MESSAGE("Iron Moth's Sp. Atk was heightened!");
}
}

SINGLE_BATTLE_TEST("Quark Drive activates on switch-in")
{
KNOWN_FAILING; // Fails because of wrong species
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
PLAYER(SPECIES_BELLSPROUT) { Ability(ABILITY_QUARK_DRIVE); }
PLAYER(SPECIES_IRON_MOTH) { Ability(ABILITY_QUARK_DRIVE); }
OPPONENT(SPECIES_TAPU_KOKO) { Ability(ABILITY_ELECTRIC_SURGE); };
} WHEN {
TURN { SWITCH(player, 1); }
} SCENE {
ABILITY_POPUP(opponent, ABILITY_ELECTRIC_SURGE);
ABILITY_POPUP(player, ABILITY_QUARK_DRIVE);
MESSAGE("The Electric Terrain activated Bellsprout's Quark Drive!");
MESSAGE("Bellsprout's Attack was heightened!");
MESSAGE("The Electric Terrain activated Iron Moth's Quark Drive!");
MESSAGE("Iron Moth's Sp. Atk was heightened!");
}
}
Loading
Loading