Rename battlerId to battler for consistency (#2126)
This commit is contained in:
@@ -63,7 +63,7 @@ extern const u8 *const gBattleScriptsForMoveEffects[];
|
||||
|
||||
static bool8 IsTwoTurnsMove(u16 move);
|
||||
static void TrySetDestinyBondToHappen(void);
|
||||
static u8 AttacksThisTurn(u8 battlerId, u16 move); // Note: returns 1 if it's a charging turn, otherwise 2.
|
||||
static u8 AttacksThisTurn(u8 battler, u16 move); // Note: returns 1 if it's a charging turn, otherwise 2.
|
||||
static void CheckWonderGuardAndLevitate(void);
|
||||
static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8, const u8 *BS_ptr);
|
||||
static bool32 IsMonGettingExpSentOut(void);
|
||||
@@ -2207,12 +2207,12 @@ static void Cmd_printselectionstringfromtable(void)
|
||||
}
|
||||
}
|
||||
|
||||
u8 GetBattlerTurnOrderNum(u8 battlerId)
|
||||
u8 GetBattlerTurnOrderNum(u8 battler)
|
||||
{
|
||||
s32 i;
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
{
|
||||
if (gBattlerByTurnOrder[i] == battlerId)
|
||||
if (gBattlerByTurnOrder[i] == battler)
|
||||
break;
|
||||
}
|
||||
return i;
|
||||
@@ -2239,7 +2239,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
|
||||
if (gBattleCommunication[MOVE_EFFECT_BYTE] & MOVE_EFFECT_AFFECTS_USER)
|
||||
{
|
||||
gEffectBattler = gBattlerAttacker; // battlerId that effects get applied on
|
||||
gEffectBattler = gBattlerAttacker; // battler that effects get applied on
|
||||
gBattleCommunication[MOVE_EFFECT_BYTE] &= ~MOVE_EFFECT_AFFECTS_USER;
|
||||
affectsUser = MOVE_EFFECT_AFFECTS_USER;
|
||||
gBattleScripting.battler = gBattlerTarget; // theoretically the attacker
|
||||
@@ -2984,18 +2984,18 @@ static void Cmd_tryfaintmon(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
u8 battlerId;
|
||||
u8 battler;
|
||||
|
||||
if (gBattlescriptCurrInstr[1] == BS_ATTACKER)
|
||||
{
|
||||
gActiveBattler = gBattlerAttacker;
|
||||
battlerId = gBattlerTarget;
|
||||
battler = gBattlerTarget;
|
||||
BS_ptr = BattleScript_FaintAttacker;
|
||||
}
|
||||
else
|
||||
{
|
||||
gActiveBattler = gBattlerTarget;
|
||||
battlerId = gBattlerAttacker;
|
||||
battler = gBattlerAttacker;
|
||||
BS_ptr = BattleScript_FaintTarget;
|
||||
}
|
||||
if (!(gAbsentBattlerFlags & gBitTable[gActiveBattler])
|
||||
@@ -3021,7 +3021,7 @@ static void Cmd_tryfaintmon(void)
|
||||
{
|
||||
gHitMarker &= ~HITMARKER_DESTINYBOND;
|
||||
BattleScriptPush(gBattlescriptCurrInstr);
|
||||
gBattleMoveDamage = gBattleMons[battlerId].hp;
|
||||
gBattleMoveDamage = gBattleMons[battler].hp;
|
||||
gBattlescriptCurrInstr = BattleScript_DestinyBondTakesLife;
|
||||
}
|
||||
if ((gStatuses3[gBattlerTarget] & STATUS3_GRUDGE)
|
||||
@@ -3080,11 +3080,11 @@ static void Cmd_cleareffectsonfaint(void)
|
||||
|
||||
static void Cmd_jumpifstatus(void)
|
||||
{
|
||||
u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||
u8 battler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||
u32 flags = T2_READ_32(gBattlescriptCurrInstr + 2);
|
||||
const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 6);
|
||||
|
||||
if (gBattleMons[battlerId].status1 & flags && gBattleMons[battlerId].hp != 0)
|
||||
if (gBattleMons[battler].status1 & flags && gBattleMons[battler].hp != 0)
|
||||
gBattlescriptCurrInstr = jumpPtr;
|
||||
else
|
||||
gBattlescriptCurrInstr += 10;
|
||||
@@ -3092,11 +3092,11 @@ static void Cmd_jumpifstatus(void)
|
||||
|
||||
static void Cmd_jumpifstatus2(void)
|
||||
{
|
||||
u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||
u8 battler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||
u32 flags = T2_READ_32(gBattlescriptCurrInstr + 2);
|
||||
const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 6);
|
||||
|
||||
if (gBattleMons[battlerId].status2 & flags && gBattleMons[battlerId].hp != 0)
|
||||
if (gBattleMons[battler].status2 & flags && gBattleMons[battler].hp != 0)
|
||||
gBattlescriptCurrInstr = jumpPtr;
|
||||
else
|
||||
gBattlescriptCurrInstr += 10;
|
||||
@@ -3104,19 +3104,19 @@ static void Cmd_jumpifstatus2(void)
|
||||
|
||||
static void Cmd_jumpifability(void)
|
||||
{
|
||||
u8 battlerId;
|
||||
u8 battler;
|
||||
u8 ability = gBattlescriptCurrInstr[2];
|
||||
const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
|
||||
if (gBattlescriptCurrInstr[1] == BS_ATTACKER_SIDE)
|
||||
{
|
||||
battlerId = AbilityBattleEffects(ABILITYEFFECT_CHECK_BATTLER_SIDE, gBattlerAttacker, ability, 0, 0);
|
||||
if (battlerId)
|
||||
battler = AbilityBattleEffects(ABILITYEFFECT_CHECK_BATTLER_SIDE, gBattlerAttacker, ability, 0, 0);
|
||||
if (battler)
|
||||
{
|
||||
gLastUsedAbility = ability;
|
||||
gBattlescriptCurrInstr = jumpPtr;
|
||||
RecordAbilityBattle(battlerId - 1, gLastUsedAbility);
|
||||
gBattleScripting.battlerWithAbility = battlerId - 1;
|
||||
RecordAbilityBattle(battler - 1, gLastUsedAbility);
|
||||
gBattleScripting.battlerWithAbility = battler - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3125,13 +3125,13 @@ static void Cmd_jumpifability(void)
|
||||
}
|
||||
else if (gBattlescriptCurrInstr[1] == BS_NOT_ATTACKER_SIDE)
|
||||
{
|
||||
battlerId = AbilityBattleEffects(ABILITYEFFECT_CHECK_OTHER_SIDE, gBattlerAttacker, ability, 0, 0);
|
||||
if (battlerId)
|
||||
battler = AbilityBattleEffects(ABILITYEFFECT_CHECK_OTHER_SIDE, gBattlerAttacker, ability, 0, 0);
|
||||
if (battler)
|
||||
{
|
||||
gLastUsedAbility = ability;
|
||||
gBattlescriptCurrInstr = jumpPtr;
|
||||
RecordAbilityBattle(battlerId - 1, gLastUsedAbility);
|
||||
gBattleScripting.battlerWithAbility = battlerId - 1;
|
||||
RecordAbilityBattle(battler - 1, gLastUsedAbility);
|
||||
gBattleScripting.battlerWithAbility = battler - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3140,13 +3140,13 @@ static void Cmd_jumpifability(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||
if (gBattleMons[battlerId].ability == ability)
|
||||
battler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||
if (gBattleMons[battler].ability == ability)
|
||||
{
|
||||
gLastUsedAbility = ability;
|
||||
gBattlescriptCurrInstr = jumpPtr;
|
||||
RecordAbilityBattle(battlerId, gLastUsedAbility);
|
||||
gBattleScripting.battlerWithAbility = battlerId;
|
||||
RecordAbilityBattle(battler, gLastUsedAbility);
|
||||
gBattleScripting.battlerWithAbility = battler;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3178,8 +3178,8 @@ static void Cmd_jumpifsideaffecting(void)
|
||||
static void Cmd_jumpifstat(void)
|
||||
{
|
||||
u8 ret = 0;
|
||||
u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||
u8 value = gBattleMons[battlerId].statStages[gBattlescriptCurrInstr[3]];
|
||||
u8 battler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||
u8 value = gBattleMons[battler].statStages[gBattlescriptCurrInstr[3]];
|
||||
|
||||
switch (gBattlescriptCurrInstr[2])
|
||||
{
|
||||
@@ -3242,11 +3242,11 @@ static void Cmd_jumpifstatus3condition(void)
|
||||
|
||||
static void Cmd_jumpiftype(void)
|
||||
{
|
||||
u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||
u8 battler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||
u8 type = gBattlescriptCurrInstr[2];
|
||||
const u8 *jumpPtr = T2_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
|
||||
if (IS_BATTLER_OF_TYPE(battlerId, type))
|
||||
if (IS_BATTLER_OF_TYPE(battler, type))
|
||||
gBattlescriptCurrInstr = jumpPtr;
|
||||
else
|
||||
gBattlescriptCurrInstr += 7;
|
||||
@@ -3396,7 +3396,7 @@ static void Cmd_getexp(void)
|
||||
i = STRINGID_EMPTYSTRING4;
|
||||
}
|
||||
|
||||
// get exp getter battlerId
|
||||
// get exp getter battler
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
||||
{
|
||||
if (gBattlerPartyIndexes[2] == gBattleStruct->expGetterMonId && !(gAbsentBattlerFlags & gBitTable[2]))
|
||||
@@ -3980,9 +3980,9 @@ static void Cmd_call(void)
|
||||
|
||||
static void Cmd_jumpiftype2(void)
|
||||
{
|
||||
u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||
u8 battler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||
|
||||
if (gBattlescriptCurrInstr[2] == gBattleMons[battlerId].types[0] || gBattlescriptCurrInstr[2] == gBattleMons[battlerId].types[1])
|
||||
if (gBattlescriptCurrInstr[2] == gBattleMons[battler].types[0] || gBattlescriptCurrInstr[2] == gBattleMons[battler].types[1])
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
else
|
||||
gBattlescriptCurrInstr += 7;
|
||||
@@ -4464,10 +4464,10 @@ static void Cmd_moveend(void)
|
||||
&& !gProtectStructs[gBattlerAttacker].chargingTurn && gBattleMoves[gCurrentMove].target == MOVE_TARGET_BOTH
|
||||
&& !(gHitMarker & HITMARKER_NO_ATTACKSTRING))
|
||||
{
|
||||
u8 battlerId = GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gBattlerTarget)));
|
||||
if (gBattleMons[battlerId].hp != 0)
|
||||
u8 battler = GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gBattlerTarget)));
|
||||
if (gBattleMons[battler].hp != 0)
|
||||
{
|
||||
gBattlerTarget = battlerId;
|
||||
gBattlerTarget = battler;
|
||||
gHitMarker |= HITMARKER_NO_ATTACKSTRING;
|
||||
gBattleScripting.moveendState = 0;
|
||||
MoveValuesCleanUp();
|
||||
@@ -4866,10 +4866,10 @@ static void Cmd_openpartyscreen(void)
|
||||
{
|
||||
u32 flags;
|
||||
u8 hitmarkerFaintBits;
|
||||
u8 battlerId;
|
||||
u8 battler;
|
||||
const u8 *jumpPtr;
|
||||
|
||||
battlerId = 0;
|
||||
battler = 0;
|
||||
flags = 0;
|
||||
jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 2);
|
||||
|
||||
@@ -5098,21 +5098,21 @@ static void Cmd_openpartyscreen(void)
|
||||
else
|
||||
hitmarkerFaintBits = PARTY_ACTION_SEND_OUT;
|
||||
|
||||
battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1] & ~PARTY_SCREEN_OPTIONAL);
|
||||
if (gSpecialStatuses[battlerId].faintedHasReplacement)
|
||||
battler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1] & ~PARTY_SCREEN_OPTIONAL);
|
||||
if (gSpecialStatuses[battler].faintedHasReplacement)
|
||||
{
|
||||
gBattlescriptCurrInstr += 6;
|
||||
}
|
||||
else if (HasNoMonsToSwitch(battlerId, PARTY_SIZE, PARTY_SIZE))
|
||||
else if (HasNoMonsToSwitch(battler, PARTY_SIZE, PARTY_SIZE))
|
||||
{
|
||||
gActiveBattler = battlerId;
|
||||
gActiveBattler = battler;
|
||||
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
|
||||
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
|
||||
gBattlescriptCurrInstr = jumpPtr;
|
||||
}
|
||||
else
|
||||
{
|
||||
gActiveBattler = battlerId;
|
||||
gActiveBattler = battler;
|
||||
*(gBattleStruct->battlerPartyIndexes + gActiveBattler) = gBattlerPartyIndexes[gActiveBattler];
|
||||
*(gBattleStruct->monToSwitchIntoId + gActiveBattler) = PARTY_SIZE;
|
||||
gBattleStruct->field_93 &= ~(gBitTable[gActiveBattler]);
|
||||
@@ -5129,7 +5129,7 @@ static void Cmd_openpartyscreen(void)
|
||||
{
|
||||
for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++)
|
||||
{
|
||||
if (gActiveBattler != battlerId)
|
||||
if (gActiveBattler != battler)
|
||||
{
|
||||
BtlController_EmitLinkStandbyMsg(B_COMM_TO_CONTROLLER, LINK_STANDBY_MSG_ONLY, FALSE);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
@@ -5138,7 +5138,7 @@ static void Cmd_openpartyscreen(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
gActiveBattler = GetBattlerAtPosition(BATTLE_OPPOSITE(GetBattlerPosition(battlerId)));
|
||||
gActiveBattler = GetBattlerAtPosition(BATTLE_OPPOSITE(GetBattlerPosition(battler)));
|
||||
if (gAbsentBattlerFlags & gBitTable[gActiveBattler])
|
||||
gActiveBattler ^= BIT_FLANK;
|
||||
|
||||
@@ -6798,13 +6798,13 @@ static void Cmd_nop(void)
|
||||
gBattlescriptCurrInstr++;
|
||||
}
|
||||
|
||||
bool8 UproarWakeUpCheck(u8 battlerId)
|
||||
bool8 UproarWakeUpCheck(u8 battler)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
{
|
||||
if (!(gBattleMons[i].status2 & STATUS2_UPROAR) || gBattleMons[battlerId].ability == ABILITY_SOUNDPROOF)
|
||||
if (!(gBattleMons[i].status2 & STATUS2_UPROAR) || gBattleMons[battler].ability == ABILITY_SOUNDPROOF)
|
||||
continue;
|
||||
|
||||
gBattleScripting.battler = i;
|
||||
@@ -8241,7 +8241,7 @@ static bool8 IsInvalidForSleepTalkOrAssist(u16 move)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static u8 AttacksThisTurn(u8 battlerId, u16 move) // Note: returns 1 if it's a charging turn, otherwise 2
|
||||
static u8 AttacksThisTurn(u8 battler, u16 move) // Note: returns 1 if it's a charging turn, otherwise 2
|
||||
{
|
||||
// first argument is unused
|
||||
if (gBattleMoves[move].effect == EFFECT_SOLAR_BEAM
|
||||
@@ -9440,13 +9440,13 @@ static void Cmd_tryimprison(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
u8 battlerId, sideAttacker;
|
||||
u8 battler, sideAttacker;
|
||||
|
||||
sideAttacker = GetBattlerSide(gBattlerAttacker);
|
||||
PressurePPLoseOnUsingImprison(gBattlerAttacker);
|
||||
for (battlerId = 0; battlerId < gBattlersCount; battlerId++)
|
||||
for (battler = 0; battler < gBattlersCount; battler++)
|
||||
{
|
||||
if (sideAttacker != GetBattlerSide(battlerId))
|
||||
if (sideAttacker != GetBattlerSide(battler))
|
||||
{
|
||||
s32 attackerMoveId;
|
||||
for (attackerMoveId = 0; attackerMoveId < MAX_MON_MOVES; attackerMoveId++)
|
||||
@@ -9454,7 +9454,7 @@ static void Cmd_tryimprison(void)
|
||||
s32 i;
|
||||
for (i = 0; i < MAX_MON_MOVES; i++)
|
||||
{
|
||||
if (gBattleMons[gBattlerAttacker].moves[attackerMoveId] == gBattleMons[battlerId].moves[i]
|
||||
if (gBattleMons[gBattlerAttacker].moves[attackerMoveId] == gBattleMons[battler].moves[i]
|
||||
&& gBattleMons[gBattlerAttacker].moves[attackerMoveId] != MOVE_NONE)
|
||||
break;
|
||||
}
|
||||
@@ -9469,7 +9469,7 @@ static void Cmd_tryimprison(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (battlerId == gBattlersCount) // In Generation 3 games, Imprison fails if the user doesn't share any moves with any of the foes
|
||||
if (battler == gBattlersCount) // In Generation 3 games, Imprison fails if the user doesn't share any moves with any of the foes
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user