Review changes
This commit is contained in:
+1
-2
@@ -792,8 +792,7 @@ static void SetPlayerBerryDataInBattleStruct(void)
|
||||
|
||||
static void SetAllPlayersBerryData(void)
|
||||
{
|
||||
s32 i;
|
||||
s32 j;
|
||||
s32 i, j;
|
||||
|
||||
if (!(gBattleTypeFlags & BATTLE_TYPE_LINK))
|
||||
{
|
||||
|
||||
+20
-22
@@ -405,8 +405,7 @@ u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check)
|
||||
#define ALL_MOVES_MASK ((1 << MAX_MON_MOVES) - 1)
|
||||
bool8 AreAllMovesUnusable(void)
|
||||
{
|
||||
u8 unusable;
|
||||
unusable = CheckMoveLimitations(gActiveBattler, 0, MOVE_LIMITATIONS_ALL);
|
||||
u8 unusable = CheckMoveLimitations(gActiveBattler, 0, MOVE_LIMITATIONS_ALL);
|
||||
|
||||
if (unusable == ALL_MOVES_MASK) // All moves are unusable.
|
||||
{
|
||||
@@ -523,7 +522,7 @@ u8 DoFieldEndTurnEffects(void)
|
||||
if (effect != 0)
|
||||
break;
|
||||
}
|
||||
if (!effect)
|
||||
if (effect == 0)
|
||||
{
|
||||
gBattleStruct->turnCountersTracker++;
|
||||
gBattleStruct->turnSideTracker = 0;
|
||||
@@ -549,7 +548,7 @@ u8 DoFieldEndTurnEffects(void)
|
||||
if (effect != 0)
|
||||
break;
|
||||
}
|
||||
if (!effect)
|
||||
if (effect == 0)
|
||||
{
|
||||
gBattleStruct->turnCountersTracker++;
|
||||
gBattleStruct->turnSideTracker = 0;
|
||||
@@ -560,8 +559,7 @@ u8 DoFieldEndTurnEffects(void)
|
||||
{
|
||||
side = gBattleStruct->turnSideTracker;
|
||||
gActiveBattler = gBattlerAttacker = gSideTimers[side].mistBattlerId;
|
||||
if (gSideTimers[side].mistTimer != 0
|
||||
&& --gSideTimers[side].mistTimer == 0)
|
||||
if (gSideTimers[side].mistTimer != 0 && --gSideTimers[side].mistTimer == 0)
|
||||
{
|
||||
gSideStatuses[side] &= ~SIDE_STATUS_MIST;
|
||||
BattleScriptExecute(BattleScript_SideStatusWoreOff);
|
||||
@@ -573,7 +571,7 @@ u8 DoFieldEndTurnEffects(void)
|
||||
if (effect != 0)
|
||||
break;
|
||||
}
|
||||
if (!effect)
|
||||
if (effect == 0)
|
||||
{
|
||||
gBattleStruct->turnCountersTracker++;
|
||||
gBattleStruct->turnSideTracker = 0;
|
||||
@@ -597,7 +595,7 @@ u8 DoFieldEndTurnEffects(void)
|
||||
if (effect != 0)
|
||||
break;
|
||||
}
|
||||
if (!effect)
|
||||
if (effect == 0)
|
||||
{
|
||||
gBattleStruct->turnCountersTracker++;
|
||||
gBattleStruct->turnSideTracker = 0;
|
||||
@@ -619,7 +617,7 @@ u8 DoFieldEndTurnEffects(void)
|
||||
if (effect != 0)
|
||||
break;
|
||||
}
|
||||
if (!effect)
|
||||
if (effect == 0)
|
||||
{
|
||||
gBattleStruct->turnCountersTracker++;
|
||||
}
|
||||
@@ -1544,8 +1542,8 @@ u8 AtkCanceller_UnableToUseMove(void)
|
||||
|
||||
bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2)
|
||||
{
|
||||
u8 playerId, flankId;
|
||||
struct Pokemon *party;
|
||||
u8 id1, id2;
|
||||
s32 i;
|
||||
|
||||
if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE))
|
||||
@@ -1553,41 +1551,41 @@ bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2)
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
|
||||
{
|
||||
id2 = GetBattlerMultiplayerId(battler);
|
||||
flankId = GetBattlerMultiplayerId(battler);
|
||||
if (GetBattlerSide(battler) == B_SIDE_PLAYER)
|
||||
party = gPlayerParty;
|
||||
else
|
||||
party = gEnemyParty;
|
||||
|
||||
id1 = GetLinkTrainerFlankId(id2);
|
||||
for (i = id1 * MULTI_PARTY_SIZE; i < id1 * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE; i++)
|
||||
playerId = GetLinkTrainerFlankId(flankId);
|
||||
for (i = playerId * MULTI_PARTY_SIZE; i < playerId * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE; i++)
|
||||
{
|
||||
if (GetMonData(&party[i], MON_DATA_HP) != 0
|
||||
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE
|
||||
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG)
|
||||
break;
|
||||
}
|
||||
return (i == id1 * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE);
|
||||
return (i == playerId * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GetBattlerSide(battler) == B_SIDE_OPPONENT)
|
||||
{
|
||||
id2 = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT);
|
||||
id1 = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT);
|
||||
flankId = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT);
|
||||
playerId = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT);
|
||||
party = gEnemyParty;
|
||||
}
|
||||
else
|
||||
{
|
||||
id2 = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT);
|
||||
id1 = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT);
|
||||
flankId = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT);
|
||||
playerId = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT);
|
||||
party = gPlayerParty;
|
||||
}
|
||||
|
||||
if (partyIdBattlerOn1 == PARTY_SIZE)
|
||||
partyIdBattlerOn1 = gBattlerPartyIndexes[id2];
|
||||
partyIdBattlerOn1 = gBattlerPartyIndexes[flankId];
|
||||
if (partyIdBattlerOn2 == PARTY_SIZE)
|
||||
partyIdBattlerOn2 = gBattlerPartyIndexes[id1];
|
||||
partyIdBattlerOn2 = gBattlerPartyIndexes[playerId];
|
||||
|
||||
for (i = 0; i < PARTY_SIZE; i++)
|
||||
{
|
||||
@@ -1595,7 +1593,7 @@ bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2)
|
||||
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE
|
||||
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG
|
||||
&& i != partyIdBattlerOn1 && i != partyIdBattlerOn2
|
||||
&& i != *(gBattleStruct->monToSwitchIntoId + id2) && i != id1[gBattleStruct->monToSwitchIntoId])
|
||||
&& i != *(gBattleStruct->monToSwitchIntoId + flankId) && i != playerId[gBattleStruct->monToSwitchIntoId])
|
||||
break;
|
||||
}
|
||||
return (i == PARTY_SIZE);
|
||||
@@ -2375,7 +2373,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!effect)
|
||||
if (effect == 0)
|
||||
{
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user