diff --git a/include/constants/battle_ai.h b/include/constants/battle_ai.h index a80e089ad2..e42403e16a 100644 --- a/include/constants/battle_ai.h +++ b/include/constants/battle_ai.h @@ -42,10 +42,10 @@ #define AI_FLAG_HELP_PARTNER (1 << 12) // AI can try to help partner. If not set, will tend not to target partner #define AI_FLAG_PREFER_STATUS_MOVES (1 << 13) // AI gets a score bonus for status moves. Should be combined with AI_FLAG_CHECK_BAD_MOVE to prevent using only status moves #define AI_FLAG_STALL (1 << 14) // AI stalls battle and prefers secondary damage/trapping/etc. TODO not finished -#define AI_FLAG_SMART_SWITCHING (1 << 15) // AI includes a lot more switching checks. Automatically includes AI_FLAG_SMART_MON_CHOICES for better results. +#define AI_FLAG_SMART_SWITCHING (1 << 15) // AI includes a lot more switching checks. Automatically includes AI_FLAG_SMART_MON_CHOICES. #define AI_FLAG_ACE_POKEMON (1 << 16) // AI has an Ace Pokemon. The last Pokemon in the party will not be used until it's the last one remaining. #define AI_FLAG_OMNISCIENT (1 << 17) // AI has full knowledge of player moves, abilities, hold items -#define AI_FLAG_SMART_MON_CHOICES (1 << 18) // AI will make smarter decisions when choosing which mon to send out mid-battle and after a KO, which are separate decisions. Pairs very well with AI_FLAG_SMART_SWITCHING. +#define AI_FLAG_SMART_MON_CHOICES (1 << 18) // AI will make smarter decisions when choosing which mon to send out mid-battle and after a KO, which are separate decisions. Automatically included by AI_FLAG_SMART_SWITCHING. #define AI_FLAG_COUNT 19 diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index c93589c56a..eb942b3712 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -175,7 +175,7 @@ static u32 GetAiFlags(u16 trainerId) flags |= AI_FLAG_DOUBLE_BATTLE; } - // Automatically add smart choice flag to smart switching to greatly improve its behavior + // Automatically includes AI_FLAG_SMART_MON_CHOICES to improve smart switching if (flags & AI_FLAG_SMART_SWITCHING) flags |= AI_FLAG_SMART_MON_CHOICES; diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 74fc07ac7b..f08251e2a5 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -80,7 +80,7 @@ static bool32 HasBadOdds(u32 battler, bool32 emitResult) if (!(AI_THINKING_STRUCT->aiFlags[battler] & AI_FLAG_SMART_SWITCHING)) return FALSE; - // Won't bother configuring this for double battles + // Double Battles aren't included in AI_FLAG_SMART_MON_CHOICE. Defaults to regular switch in logic if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) return FALSE; @@ -1943,7 +1943,7 @@ u8 GetMostSuitableMonToSwitchInto(u32 battler, bool32 switchAfterMonKOd) // Split ideal mon decision between after previous mon KO'd (prioritize offensive options) and after switching active mon out (prioritize defensive options), and expand the scope of both. // Only use better mon selection if AI_FLAG_SMART_MON_CHOICES is set for the trainer. - if (AI_THINKING_STRUCT->aiFlags[battler] & AI_FLAG_SMART_MON_CHOICES && !(gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) // Won't bother configuring this for double battles + if (AI_THINKING_STRUCT->aiFlags[battler] & AI_FLAG_SMART_MON_CHOICES && !(gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) // Double Battles aren't included in AI_FLAG_SMART_MON_CHOICE. Defaults to regular switch in logic { bestMonId = GetBestMonIntegrated(party, firstId, lastId, battler, opposingBattler, battlerIn1, battlerIn2, switchAfterMonKOd); return bestMonId;