Skip to content

Commit

Permalink
update after Pawkkie review
Browse files Browse the repository at this point in the history
  • Loading branch information
wiz1989 committed Oct 3, 2024
1 parent d36f095 commit 529fcae
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 36 deletions.
2 changes: 0 additions & 2 deletions src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -12938,8 +12938,6 @@ static void Cmd_settypetorandomresistance(void)
{
CMD_ARGS(const u8 *failInstr);

//s32 moveType;

// Before Gen 5 Conversion 2 only worked on a move the attacker was actually hit by.
// This changed later to the last move used by the selected target.
if (B_UPDATED_CONVERSION_2 < GEN_5)
Expand Down
54 changes: 20 additions & 34 deletions test/battle/move_effect/conversion_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,26 @@ SINGLE_BATTLE_TEST("Conversion 2 randomly changes the type of the user to a type
}
}
}

SINGLE_BATTLE_TEST("Conversion 2's type change considers Struggle to be Normal type (Gen 3-4)")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_STRUGGLE); }
TURN { MOVE(player, MOVE_CONVERSION_2); }
} SCENE {
// turn 1
MESSAGE("Foe Wobbuffet used Struggle!");
// turn 2
ONE_OF {
MESSAGE("Wobbuffet transformed into the Steel type!");
MESSAGE("Wobbuffet transformed into the Rock type!");
MESSAGE("Wobbuffet transformed into the Ghost type!");
}
}
}
#endif

#if B_UPDATED_CONVERSION_2 >= GEN_5
Expand All @@ -41,9 +61,7 @@ SINGLE_BATTLE_TEST("Conversion 2 randomly changes the type of the user to a type
}
}
}
#endif

#if B_UPDATED_CONVERSION_2 >= GEN_5
SINGLE_BATTLE_TEST("Conversion 2's type change considers status moves (Gen 5+)")
{
GIVEN {
Expand All @@ -62,9 +80,7 @@ SINGLE_BATTLE_TEST("Conversion 2's type change considers status moves (Gen 5+)")
}
}
}
#endif

#if B_UPDATED_CONVERSION_2 >= GEN_5
SINGLE_BATTLE_TEST("Conversion 2's type change considers the type of moves called by other moves")
{
GIVEN {
Expand All @@ -83,9 +99,7 @@ SINGLE_BATTLE_TEST("Conversion 2's type change considers the type of moves calle
}
}
}
#endif

#if B_UPDATED_CONVERSION_2 >= GEN_5
SINGLE_BATTLE_TEST("Conversion 2's type change considers dynamic type moves")
{
GIVEN {
Expand All @@ -106,9 +120,7 @@ SINGLE_BATTLE_TEST("Conversion 2's type change considers dynamic type moves")
}
}
}
#endif

#if B_UPDATED_CONVERSION_2 >= GEN_5
SINGLE_BATTLE_TEST("Conversion 2's type change considers move types changed by Normalize and Electrify")
{
GIVEN {
Expand Down Expand Up @@ -138,31 +150,7 @@ SINGLE_BATTLE_TEST("Conversion 2's type change considers move types changed by N
}
}
}
#endif

#if B_UPDATED_CONVERSION_2 < GEN_5
SINGLE_BATTLE_TEST("Conversion 2's type change considers Struggle to be Normal type (Gen 3-4)")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_STRUGGLE); }
TURN { MOVE(player, MOVE_CONVERSION_2); }
} SCENE {
// turn 1
MESSAGE("Foe Wobbuffet used Struggle!");
// turn 2
ONE_OF {
MESSAGE("Wobbuffet transformed into the Steel type!");
MESSAGE("Wobbuffet transformed into the Rock type!");
MESSAGE("Wobbuffet transformed into the Ghost type!");
}
}
}
#endif

#if B_UPDATED_CONVERSION_2 >= GEN_5
SINGLE_BATTLE_TEST("Conversion 2's type change fails targeting Struggle (Gen 5+)")
{
GIVEN {
Expand All @@ -179,9 +167,7 @@ SINGLE_BATTLE_TEST("Conversion 2's type change fails targeting Struggle (Gen 5+)
MESSAGE("But it failed!");
}
}
#endif

#if B_UPDATED_CONVERSION_2 >= GEN_5
SINGLE_BATTLE_TEST("Conversion 2 fails if the move used is of typeless damage (Gen 5+)")
{
GIVEN {
Expand Down

0 comments on commit 529fcae

Please sign in to comment.