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