rename IsBattlerAIControlled

This commit is contained in:
ghoulslash 2023-04-10 11:36:17 -04:00
parent 5f4bfd9bb4
commit e3ca217d64
3 changed files with 7 additions and 7 deletions

View file

@ -10,7 +10,7 @@
bool32 AI_RandLessThan(u8 val); bool32 AI_RandLessThan(u8 val);
void RecordLastUsedMoveByTarget(void); void RecordLastUsedMoveByTarget(void);
bool32 BattlerHasAi(u32 battlerId); bool32 BattlerHasAi(u32 battlerId);
bool32 IsBattlerAIControlled(u32 battlerId); bool32 IsAiBattlerAware(u32 battlerId);
void ClearBattlerMoveHistory(u8 battlerId); void ClearBattlerMoveHistory(u8 battlerId);
void RecordLastUsedMoveBy(u32 battlerId, u32 move); void RecordLastUsedMoveBy(u32 battlerId, u32 move);
void RecordKnownMove(u8 battlerId, u32 move); void RecordKnownMove(u8 battlerId, u32 move);

View file

@ -367,7 +367,7 @@ void GetAiLogicData(void)
for (battlerAtk = 0; battlerAtk < gBattlersCount; battlerAtk++) for (battlerAtk = 0; battlerAtk < gBattlersCount; battlerAtk++)
{ {
if (!IsBattlerAlive(battlerAtk) if (!IsBattlerAlive(battlerAtk)
|| !IsBattlerAIControlled(battlerAtk)) { || !IsAiBattlerAware(battlerAtk)) {
continue; continue;
} }

View file

@ -473,7 +473,7 @@ bool32 BattlerHasAi(u32 battlerId)
} }
} }
bool32 IsBattlerAIControlled(u32 battlerId) bool32 IsAiBattlerAware(u32 battlerId)
{ {
if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_OMNISCIENT) if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_OMNISCIENT)
return TRUE; return TRUE;
@ -1231,7 +1231,7 @@ s32 AI_GetAbility(u32 battlerId)
return gBattleStruct->overwrittenAbilities[battlerId]; return gBattleStruct->overwrittenAbilities[battlerId];
// The AI knows its own ability. // The AI knows its own ability.
if (IsBattlerAIControlled(battlerId)) if (IsAiBattlerAware(battlerId))
return knownAbility; return knownAbility;
// Check neutralizing gas, gastro acid // Check neutralizing gas, gastro acid
@ -1264,7 +1264,7 @@ u16 AI_GetHoldEffect(u32 battlerId)
{ {
u32 holdEffect; u32 holdEffect;
if (!IsBattlerAIControlled(battlerId)) if (!IsAiBattlerAware(battlerId))
holdEffect = AI_PARTY->mons[GetBattlerSide(battlerId)][gBattlerPartyIndexes[battlerId]].heldEffect; holdEffect = AI_PARTY->mons[GetBattlerSide(battlerId)][gBattlerPartyIndexes[battlerId]].heldEffect;
else else
holdEffect = GetBattlerHoldEffect(battlerId, FALSE); holdEffect = GetBattlerHoldEffect(battlerId, FALSE);
@ -1889,7 +1889,7 @@ bool32 CanIndexMoveFaintTarget(u8 battlerAtk, u8 battlerDef, u8 index, u8 numHit
u16 *GetMovesArray(u32 battler) u16 *GetMovesArray(u32 battler)
{ {
if (IsBattlerAIControlled(battler) || IsBattlerAIControlled(BATTLE_PARTNER(battler))) if (IsAiBattlerAware(battler) || IsAiBattlerAware(BATTLE_PARTNER(battler)))
return gBattleMons[battler].moves; return gBattleMons[battler].moves;
else else
return gBattleResources->battleHistory->usedMoves[battler]; return gBattleResources->battleHistory->usedMoves[battler];
@ -3144,7 +3144,7 @@ u16 GetAllyChosenMove(u8 battlerId)
{ {
u8 partnerBattler = BATTLE_PARTNER(battlerId); u8 partnerBattler = BATTLE_PARTNER(battlerId);
if (!IsBattlerAlive(partnerBattler) || !IsBattlerAIControlled(partnerBattler)) if (!IsBattlerAlive(partnerBattler) || !IsAiBattlerAware(partnerBattler))
return MOVE_NONE; return MOVE_NONE;
else if (partnerBattler > battlerId) // Battler with the lower id chooses the move first. else if (partnerBattler > battlerId) // Battler with the lower id chooses the move first.
return gLastMoves[partnerBattler]; return gLastMoves[partnerBattler];