implemented max move functionality for dynamic type moves
This commit is contained in:
parent
d69de9fb17
commit
07fd952d52
2 changed files with 14 additions and 9 deletions
|
@ -88,6 +88,11 @@ u16 GetMaxMove(u16 battlerId, u16 baseMove)
|
||||||
if (gBattleMoves[baseMove].split == SPLIT_STATUS)
|
if (gBattleMoves[baseMove].split == SPLIT_STATUS)
|
||||||
{
|
{
|
||||||
move = MOVE_MAX_GUARD;
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -304,14 +304,6 @@ void HandleAction_UseMove(void)
|
||||||
gCurrentMove = gBattleStruct->zmove.toBeUsed[gBattlerAttacker];
|
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 (gBattleMons[gBattlerAttacker].hp != 0)
|
||||||
{
|
{
|
||||||
if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER)
|
if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER)
|
||||||
|
@ -324,6 +316,14 @@ void HandleAction_UseMove(void)
|
||||||
SetTypeBeforeUsingMove(gChosenMove, gBattlerAttacker);
|
SetTypeBeforeUsingMove(gChosenMove, gBattlerAttacker);
|
||||||
GET_MOVE_TYPE(gChosenMove, moveType);
|
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
|
// choose target
|
||||||
side = BATTLE_OPPOSITE(GetBattlerSide(gBattlerAttacker));
|
side = BATTLE_OPPOSITE(GetBattlerSide(gBattlerAttacker));
|
||||||
if (IsAffectedByFollowMe(gBattlerAttacker, side, gCurrentMove)
|
if (IsAffectedByFollowMe(gBattlerAttacker, side, gCurrentMove)
|
||||||
|
@ -7918,7 +7918,7 @@ bool32 IsBattlerProtected(u8 battlerId, u16 move)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Max Moves bypass any protection except Max Guard
|
// Max Moves bypass any protection except Max Guard.
|
||||||
if (IsMaxMove(move))
|
if (IsMaxMove(move))
|
||||||
{
|
{
|
||||||
if (gProtectStructs[battlerId].maxGuarded)
|
if (gProtectStructs[battlerId].maxGuarded)
|
||||||
|
|
Loading…
Reference in a new issue