implemented max move functionality for dynamic type moves

This commit is contained in:
AgustinGDLV 2023-02-22 14:35:41 -08:00
parent d69de9fb17
commit 07fd952d52
2 changed files with 14 additions and 9 deletions

View file

@ -89,6 +89,11 @@ u16 GetMaxMove(u16 battlerId, u16 baseMove)
{
move = MOVE_MAX_GUARD;
}
else if (gBattleStruct->dynamicMoveType) // unsure of how to deal with Hidden Power
{
move = sMaxMoveTable[gBattleStruct->dynamicMoveType & DYNAMIC_TYPE_MASK];
gBattleStruct->dynamax.splits[battlerId] = gBattleMoves[baseMove].split;
}
else
{
move = sMaxMoveTable[gBattleMoves[baseMove].type];

View file

@ -304,14 +304,6 @@ void HandleAction_UseMove(void)
gCurrentMove = gBattleStruct->zmove.toBeUsed[gBattlerAttacker];
}
// check max move used
if (gBattleStruct->dynamax.usingMaxMove[gBattlerAttacker])
{
gCurrentMove = gChosenMove = GetMaxMove(gBattlerAttacker, gCurrentMove);
gBattleStruct->dynamax.activeSplit = gBattleStruct->dynamax.splits[gBattlerAttacker];
gBattleStruct->moveTarget[gBattlerAttacker] = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE);
}
if (gBattleMons[gBattlerAttacker].hp != 0)
{
if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER)
@ -324,6 +316,14 @@ void HandleAction_UseMove(void)
SetTypeBeforeUsingMove(gChosenMove, gBattlerAttacker);
GET_MOVE_TYPE(gChosenMove, moveType);
// check max move used
if (gBattleStruct->dynamax.usingMaxMove[gBattlerAttacker])
{
gCurrentMove = gChosenMove = GetMaxMove(gBattlerAttacker, gCurrentMove);
gBattleStruct->dynamax.activeSplit = gBattleStruct->dynamax.splits[gBattlerAttacker];
gBattleStruct->moveTarget[gBattlerAttacker] = GetMoveTarget(gCurrentMove, NO_TARGET_OVERRIDE);
}
// choose target
side = BATTLE_OPPOSITE(GetBattlerSide(gBattlerAttacker));
if (IsAffectedByFollowMe(gBattlerAttacker, side, gCurrentMove)
@ -7918,7 +7918,7 @@ bool32 IsBattlerProtected(u8 battlerId, u16 move)
return FALSE;
}
// Max Moves bypass any protection except Max Guard
// Max Moves bypass any protection except Max Guard.
if (IsMaxMove(move))
{
if (gProtectStructs[battlerId].maxGuarded)