-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add AI_FLAG_OMNISCIENT #2872
Add AI_FLAG_OMNISCIENT #2872
Conversation
if ((gBattleTypeFlags & BATTLE_TYPE_HAS_AI || IsWildMonSmart()) | ||
&& (IsBattlerAIControlled(gActiveBattler) && !(gBattleTypeFlags & BATTLE_TYPE_PALACE))) { | ||
&& (BattlerHasAi(gActiveBattler) && !(gBattleTypeFlags & BATTLE_TYPE_PALACE))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suggestion was to stack the conditions so the 2nd line's checks could be read right below the if
statement and the checks in its same line. You only added even more spacing which is not what I suggested 😂 ...
if ((gBattleTypeFlags & BATTLE_TYPE_HAS_AI || IsWildMonSmart())
&& (BattlerHasAi(gActiveBattler) && !(gBattleTypeFlags & BATTLE_TYPE_PALACE)))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per discord discussion it doesn't seem like there is a universal formatting for things like this so I would prefer to leave it as is
src/battle_ai_util.c
Outdated
@@ -473,6 +473,14 @@ bool32 IsBattlerAIControlled(u32 battlerId) | |||
} | |||
} | |||
|
|||
bool32 IsBattlerAIControlled(u32 battlerId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this cause issues with how AI detects if a Pokémon is not controlled by a player?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not used in that many places. And the relevant places have been replaced with BattlerHasAi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better now, but the name doesn't sit well for me.
If I call this function with a player-controlled battlerId and the omniscient flag is on, the function name should conceptually still return FALSE do to that battler not being player-controlled, but it's not doing that currently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed to IsAiBattlerAware
Creates an AI_FLAG_OMNISCIENT ai flag where trainer knows your full party's moves, abilities, and hold items.