Merge pull request #2054 from LOuroboros/conversion

Updated Conversion's effect
This commit is contained in:
Eduardo Quezada D'Ottone 2022-02-12 22:08:00 -03:00 committed by GitHub
commit eebe664bfc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 1 deletions

View file

@ -150,6 +150,7 @@
#define B_KINGS_SHIELD_LOWER_ATK GEN_7 // In Gen7+, it lowers Atk by 1 stage instead of 2 of oponents that hit it. #define B_KINGS_SHIELD_LOWER_ATK GEN_7 // In Gen7+, it lowers Atk by 1 stage instead of 2 of oponents that hit it.
#define B_SPEED_BUFFING_RAPID_SPIN GEN_8 // In Gen8, Rapid Spin raises the user's Speed by 1 stage. #define B_SPEED_BUFFING_RAPID_SPIN GEN_8 // In Gen8, Rapid Spin raises the user's Speed by 1 stage.
#define B_RECOIL_IF_MISS_DMG GEN_7 // In Gen5+, Jump Kick and High Jump Kick will always do half of the user's max HP when missing. #define B_RECOIL_IF_MISS_DMG GEN_7 // In Gen5+, Jump Kick and High Jump Kick will always do half of the user's max HP when missing.
#define B_UPDATED_CONVERSION GEN_7 // In Gen6+, Conversion changes the user's type to match their first move's. Before, it would choose a move at random.
// Move accuracy settings // Move accuracy settings
#define B_TOXIC_NEVER_MISS GEN_7 // In Gen6+, if Toxic is used by a Poison-type Pokémon, it will never miss. #define B_TOXIC_NEVER_MISS GEN_7 // In Gen6+, if Toxic is used by a Poison-type Pokémon, it will never miss.

View file

@ -10560,12 +10560,34 @@ static void Cmd_forcerandomswitch(void)
} }
} }
static void Cmd_tryconversiontypechange(void) // randomly changes user's type to one of its moves' type static void Cmd_tryconversiontypechange(void)
{ {
u8 validMoves = 0; u8 validMoves = 0;
u8 moveChecked; u8 moveChecked;
u8 moveType; u8 moveType;
#if B_UPDATED_CONVERSION >= GEN_6
// changes user's type to its first move's type
for (moveChecked = 0; moveChecked < MAX_MON_MOVES; moveChecked++)
{
if (gBattleMons[gBattlerAttacker].moves[moveChecked] != MOVE_NONE)
{
moveType = gBattleMoves[gBattleMons[gBattlerAttacker].moves[moveChecked]].type;
break;
}
}
if (IS_BATTLER_OF_TYPE(gBattlerAttacker, moveType))
{
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
}
else
{
SET_BATTLER_TYPE(gBattlerAttacker, moveType);
PREPARE_TYPE_BUFFER(gBattleTextBuff1, moveType);
gBattlescriptCurrInstr += 5;
}
#else
// randomly changes user's type to one of its moves' type
while (validMoves < MAX_MON_MOVES) while (validMoves < MAX_MON_MOVES)
{ {
if (gBattleMons[gBattlerAttacker].moves[validMoves] == 0) if (gBattleMons[gBattlerAttacker].moves[validMoves] == 0)
@ -10621,6 +10643,7 @@ static void Cmd_tryconversiontypechange(void) // randomly changes user's type to
gBattlescriptCurrInstr += 5; gBattlescriptCurrInstr += 5;
} }
#endif
} }
static void Cmd_givepaydaymoney(void) static void Cmd_givepaydaymoney(void)