mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-03-12 00:32:18 +01:00
Minor syntax tweaks to HandleAction_UseMove
This commit is contained in:
parent
d270dee6bc
commit
63edb34fe2
@ -99,7 +99,7 @@ void HandleAction_UseMove(void)
|
|||||||
}
|
}
|
||||||
// encore forces you to use the same move
|
// encore forces you to use the same move
|
||||||
else if (gDisableStructs[gBattlerAttacker].encoredMove != MOVE_NONE
|
else if (gDisableStructs[gBattlerAttacker].encoredMove != MOVE_NONE
|
||||||
&& gDisableStructs[gBattlerAttacker].encoredMove == gBattleMons[gBattlerAttacker].moves[gDisableStructs[gBattlerAttacker].encoredMovePos])
|
&& gDisableStructs[gBattlerAttacker].encoredMove == gBattleMons[gBattlerAttacker].moves[gDisableStructs[gBattlerAttacker].encoredMovePos])
|
||||||
{
|
{
|
||||||
gCurrentMove = gChosenMove = gDisableStructs[gBattlerAttacker].encoredMove;
|
gCurrentMove = gChosenMove = gDisableStructs[gBattlerAttacker].encoredMove;
|
||||||
gCurrMovePos = gChosenMovePos = gDisableStructs[gBattlerAttacker].encoredMovePos;
|
gCurrMovePos = gChosenMovePos = gDisableStructs[gBattlerAttacker].encoredMovePos;
|
||||||
@ -107,7 +107,7 @@ void HandleAction_UseMove(void)
|
|||||||
}
|
}
|
||||||
// check if the encored move wasn't overwritten
|
// check if the encored move wasn't overwritten
|
||||||
else if (gDisableStructs[gBattlerAttacker].encoredMove != MOVE_NONE
|
else if (gDisableStructs[gBattlerAttacker].encoredMove != MOVE_NONE
|
||||||
&& gDisableStructs[gBattlerAttacker].encoredMove != gBattleMons[gBattlerAttacker].moves[gDisableStructs[gBattlerAttacker].encoredMovePos])
|
&& gDisableStructs[gBattlerAttacker].encoredMove != gBattleMons[gBattlerAttacker].moves[gDisableStructs[gBattlerAttacker].encoredMovePos])
|
||||||
{
|
{
|
||||||
gCurrMovePos = gChosenMovePos = gDisableStructs[gBattlerAttacker].encoredMovePos;
|
gCurrMovePos = gChosenMovePos = gDisableStructs[gBattlerAttacker].encoredMovePos;
|
||||||
gCurrentMove = gChosenMove = gBattleMons[gBattlerAttacker].moves[gCurrMovePos];
|
gCurrentMove = gChosenMove = gBattleMons[gBattlerAttacker].moves[gCurrMovePos];
|
||||||
@ -145,17 +145,15 @@ void HandleAction_UseMove(void)
|
|||||||
&& GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gSideTimers[side].followmeTarget)
|
&& GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gSideTimers[side].followmeTarget)
|
||||||
&& gBattleMons[gSideTimers[side].followmeTarget].hp != 0
|
&& gBattleMons[gSideTimers[side].followmeTarget].hp != 0
|
||||||
&& (GetBattlerAbility(gBattlerAttacker) != ABILITY_PROPELLER_TAIL
|
&& (GetBattlerAbility(gBattlerAttacker) != ABILITY_PROPELLER_TAIL
|
||||||
|| GetBattlerAbility(gBattlerAttacker) != ABILITY_STALWART))
|
|| GetBattlerAbility(gBattlerAttacker) != ABILITY_STALWART))
|
||||||
{
|
{
|
||||||
gBattlerTarget = gSideTimers[side].followmeTarget;
|
gBattlerTarget = gSideTimers[side].followmeTarget;
|
||||||
}
|
}
|
||||||
else if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
else if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
||||||
&& gSideTimers[side].followmeTimer == 0
|
&& gSideTimers[side].followmeTimer == 0
|
||||||
&& (gBattleMoves[gCurrentMove].power != 0 || gBattleMoves[gCurrentMove].target != MOVE_TARGET_USER)
|
&& (gBattleMoves[gCurrentMove].power != 0 || gBattleMoves[gCurrentMove].target != MOVE_TARGET_USER)
|
||||||
&& ((gBattleMons[*(gBattleStruct->moveTarget + gBattlerAttacker)].ability != ABILITY_LIGHTNING_ROD && moveType == TYPE_ELECTRIC)
|
&& ((gBattleMons[*(gBattleStruct->moveTarget + gBattlerAttacker)].ability != ABILITY_LIGHTNING_ROD && moveType == TYPE_ELECTRIC)
|
||||||
|| (gBattleMons[*(gBattleStruct->moveTarget + gBattlerAttacker)].ability != ABILITY_STORM_DRAIN && moveType == TYPE_WATER)
|
|| (gBattleMons[*(gBattleStruct->moveTarget + gBattlerAttacker)].ability != ABILITY_STORM_DRAIN && moveType == TYPE_WATER)))
|
||||||
)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
side = GetBattlerSide(gBattlerAttacker);
|
side = GetBattlerSide(gBattlerAttacker);
|
||||||
for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++)
|
for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++)
|
||||||
@ -163,10 +161,10 @@ void HandleAction_UseMove(void)
|
|||||||
if (side != GetBattlerSide(gActiveBattler)
|
if (side != GetBattlerSide(gActiveBattler)
|
||||||
&& *(gBattleStruct->moveTarget + gBattlerAttacker) != gActiveBattler
|
&& *(gBattleStruct->moveTarget + gBattlerAttacker) != gActiveBattler
|
||||||
&& ((GetBattlerAbility(gActiveBattler) == ABILITY_LIGHTNING_ROD && moveType == TYPE_ELECTRIC)
|
&& ((GetBattlerAbility(gActiveBattler) == ABILITY_LIGHTNING_ROD && moveType == TYPE_ELECTRIC)
|
||||||
|| (GetBattlerAbility(gActiveBattler) == ABILITY_STORM_DRAIN && moveType == TYPE_WATER))
|
|| (GetBattlerAbility(gActiveBattler) == ABILITY_STORM_DRAIN && moveType == TYPE_WATER))
|
||||||
&& GetBattlerTurnOrderNum(gActiveBattler) < var
|
&& GetBattlerTurnOrderNum(gActiveBattler) < var
|
||||||
&& (GetBattlerAbility(gBattlerAttacker) != ABILITY_PROPELLER_TAIL
|
&& (GetBattlerAbility(gBattlerAttacker) != ABILITY_PROPELLER_TAIL
|
||||||
|| GetBattlerAbility(gBattlerAttacker) != ABILITY_STALWART))
|
|| GetBattlerAbility(gBattlerAttacker) != ABILITY_STALWART))
|
||||||
{
|
{
|
||||||
var = GetBattlerTurnOrderNum(gActiveBattler);
|
var = GetBattlerTurnOrderNum(gActiveBattler);
|
||||||
}
|
}
|
||||||
@ -231,7 +229,7 @@ void HandleAction_UseMove(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE
|
else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE
|
||||||
&& gBattleMoves[gChosenMove].target & MOVE_TARGET_RANDOM)
|
&& gBattleMoves[gChosenMove].target & MOVE_TARGET_RANDOM)
|
||||||
{
|
{
|
||||||
if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER)
|
if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER)
|
||||||
{
|
{
|
||||||
@ -262,7 +260,7 @@ void HandleAction_UseMove(void)
|
|||||||
gBattlerTarget = gBattlerAttacker;
|
gBattlerTarget = gBattlerAttacker;
|
||||||
}
|
}
|
||||||
else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE
|
else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE
|
||||||
&& gBattleMoves[gChosenMove].target == MOVE_TARGET_FOES_AND_ALLY)
|
&& gBattleMoves[gChosenMove].target == MOVE_TARGET_FOES_AND_ALLY)
|
||||||
{
|
{
|
||||||
for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++)
|
for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++)
|
||||||
{
|
{
|
||||||
@ -292,7 +290,7 @@ void HandleAction_UseMove(void)
|
|||||||
|
|
||||||
// Choose battlescript.
|
// Choose battlescript.
|
||||||
if (gBattleTypeFlags & BATTLE_TYPE_PALACE
|
if (gBattleTypeFlags & BATTLE_TYPE_PALACE
|
||||||
&& gProtectStructs[gBattlerAttacker].palaceUnableToUseMove)
|
&& gProtectStructs[gBattlerAttacker].palaceUnableToUseMove)
|
||||||
{
|
{
|
||||||
if (gBattleMons[gBattlerAttacker].hp == 0)
|
if (gBattleMons[gBattlerAttacker].hp == 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user