diff --git a/data/battle_ai_scripts.s b/data/battle_ai_scripts.s index 9e504dd55..c71c6b3c1 100644 --- a/data/battle_ai_scripts.s +++ b/data/battle_ai_scripts.s @@ -22,6 +22,7 @@ gBattleAI_ScriptsTable:: @ 82DBEF8 .4byte AI_DoubleBattle @ AI_SCRIPT_DOUBLE_BATTLE .4byte AI_HPAware @ AI_SCRIPT_HP_AWARE +AI_TryToFaint: AI_CheckBadMove: if_target_is_ally AI_Ret @@ -3402,36 +3403,7 @@ AI_CV_DragonDance2: AI_CV_DragonDance_End: end -AI_TryToFaint: - if_target_is_ally AI_Ret - if_can_faint AI_TryToFaint_Can - get_how_powerful_move_is - if_equal MOVE_POWER_DISCOURAGED, Score_Minus1 -AI_TryToFaint2: - if_type_effectiveness AI_EFFECTIVENESS_x4, AI_TryToFaint_DoubleSuperEffective - goto AI_TryToFaint_CheckIfDanger -AI_TryToFaint_DoubleSuperEffective: - if_random_less_than 80, AI_TryToFaint_CheckIfDanger - score +2 - goto AI_TryToFaint_CheckIfDanger -AI_TryToFaint_Can: - if_effect EFFECT_EXPLOSION, AI_TryToFaint_CheckIfDanger - if_user_faster AI_TryToFaint_ScoreUp4 - if_move_flag FLAG_HIGH_CRIT, AI_TryToFaint_ScoreUp4 - score +2 - goto AI_TryToFaint_CheckIfDanger -AI_TryToFaint_ScoreUp4: - score +4 -AI_TryToFaint_CheckIfDanger: - if_user_faster AI_TryToFaint_End - if_ai_can_go_down AI_TryToFaint_Danger -AI_TryToFaint_End: - end -AI_TryToFaint_Danger: - get_how_powerful_move_is - if_not_equal MOVE_POWER_BEST, Score_Minus1 - score +1 - goto AI_TryToFaint_End + AI_SetupFirstTurn: if_target_is_ally AI_Ret diff --git a/include/battle_ai_util.h b/include/battle_ai_util.h index dd9fe2a8a..5d778ef3f 100644 --- a/include/battle_ai_util.h +++ b/include/battle_ai_util.h @@ -5,6 +5,8 @@ #define AI_CHECK_FASTER 0 // if_user_faster #define AI_CHECK_SLOWER 1 // if_target_faster +#define FOE(battler) ((battler ^ BIT_SIDE) & BIT_SIDE) + void RecordLastUsedMoveByTarget(void); bool32 IsBattlerAIControlled(u32 battlerId); void ClearBattlerMoveHistory(u8 battlerId); @@ -20,11 +22,73 @@ void RestoreBattlerData(u8 battlerId); u32 GetHealthPercentage(u8 battler); bool32 IsBattlerTrapped(u8 battler, bool8 switching); +bool32 IsBattlerFaster(u8 battler); +bool32 CanTargetFaintAi(u8 battlerDef, u8 battlerAtk); +s32 AI_GetAbility(u32 battlerId); +u16 AI_GetHoldEffect(u32 battlerId); +u32 AI_GetMoveAccuracy(u8 battlerAtk, u8 battlerDef, u16 atkAbility, u16 defAbility, u8 atkHoldEffect, u8 defHoldEffect, u16 move); +bool32 DoesBattlerIgnoreAbilityChecks(u16 atkAbility, u16 move); +bool32 AI_WeatherHasEffect(void); +bool32 CanAttackerFaintTarget(u8 battlerAtk, u8 battlerDef, u8 index); +s32 CountUsablePartyMons(u8 battlerId); +bool32 IsPartyFullyHealedExceptBattler(u8 battler); +bool32 AI_IsBattlerGrounded(u8 battlerId); +bool32 BattlerHasDamagingMove(u8 battlerId); +bool32 BattlerHasSecondaryDamage(u8 battlerId); +bool32 BattlerWillFaintFromWeather(u8 battler, u16 ability); +bool32 ShouldTryOHKO(u8 battlerAtk, u8 battlerDef, u16 atkAbility, u16 defAbility, u32 accuracy, u16 move); +bool32 ShouldUseRecoilMove(u8 battlerAtk, u8 battlerDef, u32 recoilDmg, u8 moveIndex); +u16 GetBattlerSideSpeedAverage(u8 battler); + +// stat stage checks +bool32 AnyStatIsRaised(u8 battlerId); +bool32 BattlerStatCanFall(u8 battler, u16 battlerAbility, u8 stat); +bool32 BattlerStatCanRise(u8 battler, u16 battlerAbility, u8 stat); +bool32 AreBattlersStatsMaxed(u8 battler); +bool32 BattlerHasAnyStatRaised(u8 battlerId); +u32 CountPositiveStatStages(u8 battlerId); +u32 CountNegativeStatStages(u8 battlerId); +bool32 BattlerShouldRaiseAttacks(u8 battlerId, u16 ability); + +// move checks u8 GetMovePowerResult(u16 move); u16 AI_GetTypeEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef); -u8 GetMoveEffectiveness(u16 move); -bool32 IsBattlerFaster(u8 battler); -bool32 CanTargetFaintAi(void); -s32 AI_GetAbility(u32 battlerId, bool32 guess); +u8 AI_GetMoveEffectiveness(u16 move); +u16 *GetMovesArray(u32 battler); +bool32 IsConfusionMoveEffect(u16 moveEffect); +bool32 HasMoveWithSplit(u32 battler, u32 split); +bool32 HasMoveWithType(u32 battler, u8 type); +bool32 TestMoveFlagsInMoveset(u8 battler, u32 flags); +bool32 IsAromaVeilProtectedMove(u16 move); +bool32 IsNonVolatileStatusMoveEffect(u16 moveEffect); +bool32 IsStatLoweringMoveEffect(u16 moveEffect); +bool32 IsMoveRedirectionPrevented(u16 move, u16 atkAbility); +bool32 IsMoveEncouragedToHit(u8 battlerAtk, u8 battlerDef, u16 move); +bool32 IsHazardMoveEffect(u16 moveEffect); +bool32 MoveCallsOtherMove(u16 move); +bool32 MoveRequiresRecharging(u16 move); +bool32 IsInstructBannedMove(u16 move); + +// status checks +bool32 AI_ShouldPutToSleep(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u16 partnerMove); +bool32 AI_ShouldPoison(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u16 partnerMove); +bool32 AI_CanParalyze(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u16 partnerMove); +bool32 AnyPartyMemberStatused(u8 battlerId, bool32 checkSoundproof); +bool32 AI_CanConfuse(u8 battlerAtk, u8 battlerDef, u16 defAbility, u8 battlerAtkPartner, u16 move, u16 partnerMove); +bool32 AI_CanBurn(u8 battlerAtk, u8 battlerDef, u16 defAbility, u8 battlerAtkPartner, u16 move, u16 partnerMove); +bool32 AI_CanBeInfatuated(u8 battlerAtk, u8 battlerDef, u16 defAbility, u8 atkGender, u8 defGender); + +// partner logic +u16 GetAllyChosenMove(void); +bool32 IsValidDoubleBattle(u8 battlerAtk); +bool32 IsTargetingPartner(u8 battlerAtk, u8 battlerDef); +bool32 DoesPartnerHaveSameMoveEffect(u8 battlerAtkPartner, u8 battlerDef, u16 move, u16 partnerMove); +bool32 PartnerHasSameMoveEffectWithoutTarget(u8 battlerAtkPartner, u16 move, u16 partnerMove); +bool32 PartnerMoveEffectIsStatusSameTarget(u8 battlerAtkPartner, u8 battlerDef, u16 partnerMove); +bool32 PartnerMoveEffectIsWeather(u8 battlerAtkPartner, u16 partnerMove); +bool32 PartnerMoveEffectIsTerrain(u8 battlerAtkPartner, u16 partnerMove); +bool32 PartnerMoveIs(u8 battlerAtkPartner, u16 partnerMove, u16 moveCheck); +bool32 PartnerMoveIsSameAsAttacker(u8 battlerAtkPartner, u8 battlerDef, u16 move, u16 partnerMove); +bool32 PartnerMoveIsSameNoTarget(u8 battlerAtkPartner, u16 move, u16 partnerMove); #endif //GUARD_BATTLE_AI_UTIL_H \ No newline at end of file diff --git a/include/battle_script_commands.h b/include/battle_script_commands.h index 454b6ab34..693fdb36f 100644 --- a/include/battle_script_commands.h +++ b/include/battle_script_commands.h @@ -6,6 +6,12 @@ #define WINDOW_CLEAR 0x1 #define WINDOW_x80 0x80 +struct StatFractions +{ + u8 dividend; + u8 divisor; +}; + s32 CalcCritChanceStage(u8 battlerAtk, u8 battlerDef, u32 move, bool32 recordAbility); u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move); u8 GetBattlerTurnOrderNum(u8 battlerId); @@ -26,8 +32,11 @@ u32 IsFlowerVeilProtected(u32 battler); u32 IsLeafGuardProtected(u32 battler); bool32 IsShieldsDownProtected(u32 battler); u32 IsAbilityStatusProtected(u32 battler); +bool32 CanCamouflage(u8 battlerId); +u16 GetNaturePowerMove(void); extern void (* const gBattleScriptingCommandsTable[])(void); extern const u8 gBattlePalaceNatureToMoveGroupLikelihood[NUM_NATURES][4]; +extern const struct StatFractions gAccuracyStageRatios[]; #endif // GUARD_BATTLE_SCRIPT_COMMANDS_H diff --git a/include/battle_util.h b/include/battle_util.h index f7699fced..b26ea0939 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -130,5 +130,19 @@ void ClearIllusionMon(u32 battlerId); bool32 SetIllusionMon(struct Pokemon *mon, u32 battlerId); bool8 ShouldGetStatBadgeBoost(u16 flagId, u8 battlerId); u8 GetBattleMoveSplit(u32 moveId); +bool32 TestMoveFlags(u16 move, u32 flag); +struct Pokemon *GetBattlerPartyData(u8 battlerId); +bool32 CanFling(u8 battlerId); +bool32 IsTelekinesisBannedSpecies(u16 species); +bool32 IsHealBlockPreventingMove(u32 battler, u32 move); + +// ability checks +bool32 IsRolePlayBannedAbilityAtk(u16 ability); +bool32 IsRolePlayBannedAbility(u16 ability); +bool32 IsSkillSwapBannedAbility(u16 ability); +bool32 IsWorrySeedBannedAbility(u16 ability); +bool32 IsGastroAcidBannedAbility(u16 ability); +bool32 IsEntrainmentBannedAbilityAttacker(u16 ability); +bool32 IsEntrainmentTargetOrSimpleBeamBannedAbility(u16 ability); #endif // GUARD_BATTLE_UTIL_H diff --git a/include/constants/battle.h b/include/constants/battle.h index 40c604c9e..0bc06b0ad 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -220,6 +220,8 @@ #define SIDE_STATUS_CRAFTY_SHIELD (1 << 20) #define SIDE_STATUS_MAT_BLOCK (1 << 21) +#define SIDE_HAZARDS_ANY (SIDE_STATUS_SPIKES | SIDE_STATUS_STICKY_WEB | SIDE_STATUS_TOXIC_SPIKES | SIDE_STATUS_STEALTH_ROCK) + // Field affecting statuses. #define STATUS_FIELD_MAGIC_ROOM 0x1 #define STATUS_FIELD_TRICK_ROOM 0x2 diff --git a/include/constants/battle_ai.h b/include/constants/battle_ai.h index 974ef2b77..dd29f20f2 100644 --- a/include/constants/battle_ai.h +++ b/include/constants/battle_ai.h @@ -35,20 +35,24 @@ #define MOVE_POWER_GOOD 2 // Similar dmg range with best. #define MOVE_POWER_WEAK 3 // Significantly lower than best and good. -// script's table id to bit -#define AI_SCRIPT_CHECK_BAD_MOVE (1 << 0) -#define AI_SCRIPT_TRY_TO_FAINT (1 << 1) -#define AI_SCRIPT_CHECK_VIABILITY (1 << 2) -#define AI_SCRIPT_SETUP_FIRST_TURN (1 << 3) -#define AI_SCRIPT_RISKY (1 << 4) -#define AI_SCRIPT_PREFER_STRONGEST_MOVE (1 << 5) -#define AI_SCRIPT_PREFER_BATON_PASS (1 << 6) -#define AI_SCRIPT_DOUBLE_BATTLE (1 << 7) -#define AI_SCRIPT_HP_AWARE (1 << 8) -#define AI_SCRIPT_UNKNOWN (1 << 9) -// 10 - 28 are not used -#define AI_SCRIPT_ROAMING (1 << 29) -#define AI_SCRIPT_SAFARI (1 << 30) -#define AI_SCRIPT_FIRST_BATTLE (1 << 31) +// AI Flags. Most run specific functions to update score, new flags are used for internal logic in other scripts +#define AI_FLAG_CHECK_BAD_MOVE (1 << 0) +#define AI_FLAG_TRY_TO_FAINT (1 << 1) +#define AI_FLAG_CHECK_VIABILITY (1 << 2) +#define AI_FLAG_SETUP_FIRST_TURN (1 << 3) +#define AI_FLAG_RISKY (1 << 4) +#define AI_FLAG_PREFER_STRONGEST_MOVE (1 << 5) +#define AI_FLAG_PREFER_BATON_PASS (1 << 6) +#define AI_FLAG_DOUBLE_BATTLE (1 << 7) +#define AI_FLAG_HP_AWARE (1 << 8) +// Flags that don't run specific checks themselves, but are used in other score functions +#define AI_FLAG_NEGATE_AWARE (1 << 9) // AI is aware of negating effects like wonder room, mold breaker, etc (eg. smart trainers). TODO unfinished +#define AI_FLAG_HELP_PARTNER (1 << 10) // AI can try to help partner. If not set, will tend not to target partner +#define AI_FLAG_WILL_SUICIDE (1 << 11) // AI will use explosion / self destruct / final gambit / etc + +// 'other' ai logic flags +#define AI_FLAG_ROAMING (1 << 29) +#define AI_FLAG_SAFARI (1 << 30) +#define AI_FLAG_FIRST_BATTLE (1 << 31) #endif // GUARD_CONSTANTS_BATTLE_AI_H diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 55c62af98..9abe4c82d 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -123,6 +123,7 @@ // Item settings #define B_HP_BERRIES GEN_6 // In Gen4+, berries which restore hp activate immediately after hp drops to half. In gen3, the effect occurs at the end of the turn. #define B_BERRIES_INSTANT GEN_6 // In Gen4+, most berries activate on battle start/switch-in if applicable. In gen3, they only activate either at the move end or turn end. +#define B_MENTAL_HERB GEN_5 // In Gen5+, mental herb cures Taunt, Encore, Heal Block, and Disable // Flag settings. // To use the following features in scripting, replace the 0s with the flag ID you're assigning it to. Eg: Replace with FLAG_UNUSED_0x264 so you can use that flag for toggling the feature. diff --git a/include/constants/hold_effects.h b/include/constants/hold_effects.h index 85017cb40..bf983cf5e 100644 --- a/include/constants/hold_effects.h +++ b/include/constants/hold_effects.h @@ -136,6 +136,14 @@ #define HOLD_EFFECT_MEMORY 153 #define HOLD_EFFECT_PLATE 154 +// Gen8 hold effects +#define HOLD_EFFECT_UTILITY_UMBRELLA 155 +#define HOLD_EFFECT_EJECT_PACK 156 +#define HOLD_EFFECT_ROOM_SERVICE 157 +#define HOLD_EFFECT_BLUNDER_POLICY 158 +#define HOLD_EFFECT_HEAVY_DUTY_BOOTS 159 +#define HOLD_EFFECT_THROAT_SPRAY 160 + #define HOLD_EFFECT_CHOICE(holdEffect)((holdEffect == HOLD_EFFECT_CHOICE_BAND || holdEffect == HOLD_EFFECT_CHOICE_SCARF || holdEffect == HOLD_EFFECT_CHOICE_SPECS)) #endif // GUARD_HOLD_EFFECTS_H diff --git a/src/battle_ai_script_commands.c b/src/battle_ai_script_commands.c index 1e0b414d0..5144e5ce8 100644 --- a/src/battle_ai_script_commands.c +++ b/src/battle_ai_script_commands.c @@ -27,6 +27,18 @@ #define AI_ACTION_UNK7 0x0040 #define AI_ACTION_UNK8 0x0080 +#define RETURN_SCORE_MINUS(a) \ +{ \ + score -= a; \ + return score; \ +} +#define RETURN_SCORE_PLUS(a) \ +{ \ + score += a; \ + return score; \ +} + + // AI states enum { @@ -51,7 +63,6 @@ static u8 ChooseMoveOrAction_Doubles(void); static void BattleAI_DoAIProcessing(void); static void AIStackPushVar(const u8 *); static bool8 AIStackPop(void); -static s32 CountUsablePartyMons(u8 battlerId); static void Cmd_if_random_less_than(void); static void Cmd_if_random_greater_than(void); @@ -198,16 +209,16 @@ static u8 AI_FirstBattle(u8 battlerAtk, u8 battlerDef, u16 originalMove, u8 orig static u8 (*const sBattleAiFuncTable[])(u8, u8, u16, u8) = { - [0] = AI_CheckBadMove, // AI_SCRIPT_CHECK_BAD_MOVE - [1] = AI_TryToFaint, // AI_SCRIPT_TRY_TO_FAINT - [2] = AI_CheckViability, // AI_SCRIPT_CHECK_VIABILITY - [3] = AI_SetupFirstTurn, // AI_SCRIPT_SETUP_FIRST_TURN - [4] = AI_Risky, // AI_SCRIPT_RISKY - [5] = AI_PreferStrongestMove, // AI_SCRIPT_PREFER_STRONGEST_MOVE - [6] = AI_PreferBatonPass, // AI_SCRIPT_PREFER_BATON_PASS - [7] = AI_DoubleBattle, // AI_SCRIPT_DOUBLE_BATTLE - [8] = AI_HPAware, // AI_SCRIPT_HP_AWARE - [9] = NULL, // Unused + [0] = AI_CheckBadMove, // AI_FLAG_CHECK_BAD_MOVE + [1] = AI_TryToFaint, // AI_FLAG_TRY_TO_FAINT + [2] = AI_CheckViability, // AI_FLAG_CHECK_VIABILITY + [3] = AI_SetupFirstTurn, // AI_FLAG_SETUP_FIRST_TURN + [4] = AI_Risky, // AI_FLAG_RISKY + [5] = AI_PreferStrongestMove, // AI_FLAG_PREFER_STRONGEST_MOVE + [6] = AI_PreferBatonPass, // AI_FLAG_PREFER_BATON_PASS + [7] = AI_DoubleBattle, // AI_FLAG_DOUBLE_BATTLE + [8] = AI_HPAware, // AI_FLAG_HP_AWARE + [9] = NULL, // Unused [10] = NULL, // Unused [11] = NULL, // Unused [12] = NULL, // Unused @@ -227,9 +238,9 @@ static u8 (*const sBattleAiFuncTable[])(u8, u8, u16, u8) = [26] = NULL, // Unused [27] = NULL, // Unused [28] = NULL, // Unused - [29] = AI_Roaming, // AI_SCRIPT_ROAMING - [30] = AI_Safari, // AI_SCRIPT_SAFARI - [31] = AI_FirstBattle, // AI_SCRIPT_FIRST_BATTLE + [29] = AI_Roaming, // AI_FLAG_ROAMING + [30] = AI_Safari, // AI_FLAG_SAFARI + [31] = AI_FirstBattle, // AI_FLAG_FIRST_BATTLE }; static const BattleAICmdFunc sBattleAICmdTable[] = @@ -391,22 +402,22 @@ void BattleAI_SetupFlags(void) if (gBattleTypeFlags & BATTLE_TYPE_RECORDED) AI_THINKING_STRUCT->aiFlags = GetAiScriptsInRecordedBattle(); else if (gBattleTypeFlags & BATTLE_TYPE_SAFARI) - AI_THINKING_STRUCT->aiFlags = AI_SCRIPT_SAFARI; + AI_THINKING_STRUCT->aiFlags = AI_FLAG_SAFARI; else if (gBattleTypeFlags & BATTLE_TYPE_ROAMER) - AI_THINKING_STRUCT->aiFlags = AI_SCRIPT_ROAMING; + AI_THINKING_STRUCT->aiFlags = AI_FLAG_ROAMING; else if (gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE) - AI_THINKING_STRUCT->aiFlags = AI_SCRIPT_FIRST_BATTLE; + AI_THINKING_STRUCT->aiFlags = AI_FLAG_FIRST_BATTLE; else if (gBattleTypeFlags & BATTLE_TYPE_FACTORY) AI_THINKING_STRUCT->aiFlags = GetAiScriptsInBattleFactory(); else if (gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_TRAINER_HILL | BATTLE_TYPE_SECRET_BASE)) - AI_THINKING_STRUCT->aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_CHECK_VIABILITY | AI_SCRIPT_TRY_TO_FAINT; + AI_THINKING_STRUCT->aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT; else if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) AI_THINKING_STRUCT->aiFlags = gTrainers[gTrainerBattleOpponent_A].aiFlags | gTrainers[gTrainerBattleOpponent_B].aiFlags; else AI_THINKING_STRUCT->aiFlags = gTrainers[gTrainerBattleOpponent_A].aiFlags; if (gBattleTypeFlags & (BATTLE_TYPE_DOUBLE | BATTLE_TYPE_TWO_OPPONENTS) || gTrainers[gTrainerBattleOpponent_A].doubleBattle) - AI_THINKING_STRUCT->aiFlags |= AI_SCRIPT_DOUBLE_BATTLE; // Act smart in doubles and don't attack your partner. + AI_THINKING_STRUCT->aiFlags |= AI_FLAG_DOUBLE_BATTLE; // Act smart in doubles and don't attack your partner. } void BattleAI_SetupAIData(u8 defaultScoreMoves) @@ -542,13 +553,13 @@ static u8 ChooseMoveOrAction_Singles(void) && !(gBattleMons[gActiveBattler].status2 & (STATUS2_WRAPPED | STATUS2_ESCAPE_PREVENTION)) && !(gStatuses3[gActiveBattler] & STATUS3_ROOTED) && !(gBattleTypeFlags & (BATTLE_TYPE_ARENA | BATTLE_TYPE_PALACE)) - && AI_THINKING_STRUCT->aiFlags & (AI_SCRIPT_CHECK_VIABILITY | AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_PREFER_BATON_PASS)) + && AI_THINKING_STRUCT->aiFlags & (AI_FLAG_CHECK_VIABILITY | AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_PREFER_BATON_PASS)) { // Consider switching if all moves are worthless to use. if (GetTotalBaseStat(gBattleMons[sBattler_AI].species) >= 310 // Mon is not weak. && gBattleMons[sBattler_AI].hp >= gBattleMons[sBattler_AI].maxHP / 2) { - s32 cap = AI_THINKING_STRUCT->aiFlags & (AI_SCRIPT_CHECK_VIABILITY) ? 95 : 93; + s32 cap = AI_THINKING_STRUCT->aiFlags & (AI_FLAG_CHECK_VIABILITY) ? 95 : 93; for (i = 0; i < MAX_MON_MOVES; i++) { if (AI_THINKING_STRUCT->score[i] > cap) @@ -1220,19 +1231,7 @@ static void Cmd_if_user_has_attacking_move(void) static void Cmd_if_user_has_no_attacking_moves(void) { - s32 i; - - for (i = 0; i < MAX_MON_MOVES; i++) - { - if (gBattleMons[sBattler_AI].moves[i] != 0 - && gBattleMoves[gBattleMons[sBattler_AI].moves[i]].power != 0) - break; - } - - if (i != MAX_MON_MOVES) - gAIScriptPtr += 5; - else - gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 1); + //BattlerHasDamagingMove } static void Cmd_get_turn_count(void) @@ -1326,42 +1325,6 @@ static void Cmd_nullsub_2B(void) { } -static s32 CountUsablePartyMons(u8 battlerId) -{ - s32 battlerOnField1, battlerOnField2, i, ret; - struct Pokemon *party; - - if (GetBattlerSide(battlerId) == B_SIDE_PLAYER) - party = gPlayerParty; - else - party = gEnemyParty; - - if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) - { - battlerOnField1 = gBattlerPartyIndexes[battlerId]; - battlerOnField2 = gBattlerPartyIndexes[GetBattlerAtPosition(GetBattlerPosition(battlerId) ^ BIT_FLANK)]; - } - else // In singles there's only one battlerId by side. - { - battlerOnField1 = gBattlerPartyIndexes[battlerId]; - battlerOnField2 = gBattlerPartyIndexes[battlerId]; - } - - ret = 0; - for (i = 0; i < PARTY_SIZE; i++) - { - if (i != battlerOnField1 && i != battlerOnField2 - && GetMonData(&party[i], MON_DATA_HP) != 0 - && GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE - && GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG) - { - ret++; - } - } - - return ret; -} - static void Cmd_count_usable_party_mons(void) { AI_THINKING_STRUCT->funcResult = CountUsablePartyMons(BattleAI_GetWantedBattler(gAIScriptPtr[1])); @@ -1382,13 +1345,13 @@ static void Cmd_get_considered_move_effect(void) static void Cmd_get_ability(void) { - AI_THINKING_STRUCT->funcResult = AI_GetAbility(BattleAI_GetWantedBattler(gAIScriptPtr[1]), TRUE); + //AI_THINKING_STRUCT->funcResult = AI_GetAbility(BattleAI_GetWantedBattler(gAIScriptPtr[1]), TRUE); gAIScriptPtr += 2; } static void Cmd_check_ability(void) { - u32 battlerId = BattleAI_GetWantedBattler(gAIScriptPtr[1]); + /*u32 battlerId = BattleAI_GetWantedBattler(gAIScriptPtr[1]); u32 ability = AI_GetAbility(battlerId, FALSE); if (ability == -1) @@ -1398,7 +1361,7 @@ static void Cmd_check_ability(void) else AI_THINKING_STRUCT->funcResult = 0; // Pokemon doesn't have the ability we wanted to check. - gAIScriptPtr += 3; + gAIScriptPtr += 3;*/ } static void Cmd_get_highest_type_effectiveness(void) @@ -1447,7 +1410,7 @@ static void Cmd_get_highest_type_effectiveness(void) static void Cmd_if_type_effectiveness(void) { - // GetMoveEffectiveness + // AI_GetMoveEffectiveness } static void Cmd_nullsub_32(void) @@ -1863,14 +1826,7 @@ static void Cmd_watch(void) static void Cmd_get_hold_effect(void) { - u32 battlerId = BattleAI_GetWantedBattler(gAIScriptPtr[1]); - - if (!IsBattlerAIControlled(battlerId)) - AI_THINKING_STRUCT->funcResult = BATTLE_HISTORY->itemEffects[battlerId]; - else - AI_THINKING_STRUCT->funcResult = GetBattlerHoldEffect(battlerId, FALSE); - - gAIScriptPtr += 2; + // AI_GetHoldEffect } static void Cmd_if_holds_item(void) @@ -2148,15 +2104,7 @@ static bool8 AIStackPop(void) static void Cmd_get_ally_chosen_move(void) { - u8 partnerBattler = BATTLE_PARTNER(sBattler_AI); - if (!IsBattlerAlive(partnerBattler) || !IsBattlerAIControlled(partnerBattler)) - AI_THINKING_STRUCT->funcResult = 0; - else if (partnerBattler > sBattler_AI) // Battler with the lower id chooses the move first. - AI_THINKING_STRUCT->funcResult = 0; - else - AI_THINKING_STRUCT->funcResult = gBattleMons[partnerBattler].moves[gBattleStruct->chosenMovePositions[partnerBattler]]; - - gAIScriptPtr++; + // GetAllyChosenMove } static void Cmd_if_has_no_attacking_moves(void) @@ -2241,28 +2189,6 @@ static void Cmd_if_cant_use_last_resort(void) gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 2); } -static u16 *GetMovesArray(u32 battler) -{ - if (IsBattlerAIControlled(battler) || IsBattlerAIControlled(BATTLE_PARTNER(battler))) - return gBattleMons[battler].moves; - else - return gBattleResources->battleHistory->usedMoves[battler]; -} - -static bool32 HasMoveWithSplit(u32 battler, u32 split) -{ - s32 i; - u16 *moves = GetMovesArray(battler); - - for (i = 0; i < MAX_MON_MOVES; i++) - { - if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && GetBattleMoveSplit(moves[i]) == split) - return TRUE; - } - - return FALSE; -} - static void Cmd_if_has_move_with_split(void) { if (HasMoveWithSplit(BattleAI_GetWantedBattler(gAIScriptPtr[1]), gAIScriptPtr[2])) @@ -2508,30 +2434,1994 @@ static void Cmd_if_has_move_with_accuracy_lt(void) - - // AI Functions static u8 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, u8 originalScore) -{ +{ + // attacker data + u16 atkAbility = AI_GetAbility(battlerAtk); + u8 atkHoldEffect = AI_GetHoldEffect(battlerAtk); + u8 atkParam = GetBattlerHoldEffectParam(battlerAtk); + u8 atkPriority = GetMovePriority(battlerAtk, move); + // target data + u16 defAbility = AI_GetAbility(battlerDef); + u8 defHoldEffect = AI_GetHoldEffect(battlerDef); + u8 defParam = GetBattlerHoldEffectParam(battlerDef); + // attacker partner data + u8 battlerAtkPartner = BATTLE_PARTNER(battlerAtk); + u16 partnerMove = GetAllyChosenMove(); + u16 atkPartnerAbility = AI_GetAbility(battlerAtkPartner); + bool32 targetSameSide = IsTargetingPartner(battlerAtk, battlerDef); + // target partner data + u8 battlerDefPartner = BATTLE_PARTNER(battlerDef); + u16 defPartnerAbility = AI_GetAbility(battlerDefPartner); + // move data + s16 score = originalScore; + u16 moveEffect = gBattleMoves[move].effect; + u8 moveType = gBattleMoves[move].type; + u8 moveTarget = gBattleMoves[move].target; + u16 accuracy = AI_GetMoveAccuracy(battlerAtk, battlerDef, atkAbility, defAbility, atkHoldEffect, defHoldEffect, move); + u8 effectiveness = AI_GetMoveEffectiveness(move); + + if (!(AI_THINKING_STRUCT->aiFlags & AI_FLAG_HELP_PARTNER) && targetSameSide) + return originalScore; // don't consider ally presence + + if (!(gBattleMoves[move].target & MOVE_TARGET_USER)) + { + // handle negative checks on non-user target + // check powder moves + if (TestMoveFlags(move, FLAG_POWDER)) + { + if ((B_POWDER_GRASS >= GEN_6 && IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_GRASS)) + || defAbility == ABILITY_OVERCOAT + || GetBattlerHoldEffect(gBattlerTarget, TRUE) == HOLD_EFFECT_SAFETY_GOOGLES) + RETURN_SCORE_MINUS(10); + } + + // check ground immunities + if (moveType == TYPE_GROUND + && !IsBattlerGrounded(battlerDef) + && ((defAbility == ABILITY_LEVITATE + && DoesBattlerIgnoreAbilityChecks(atkAbility, move)) + || defHoldEffect == HOLD_EFFECT_AIR_BALLOON + || (gStatuses3[battlerDef] & (STATUS3_MAGNET_RISE | STATUS3_TELEKINESIS))) + && move != MOVE_THOUSAND_ARROWS) + { + RETURN_SCORE_MINUS(10); + } + + // check if negates type + if (effectiveness == AI_EFFECTIVENESS_x0) + RETURN_SCORE_MINUS(20); + + // target ability checks + if (!DoesBattlerIgnoreAbilityChecks(battlerAtk, move)) + { + switch (defAbility) + { + case ABILITY_VOLT_ABSORB: + case ABILITY_MOTOR_DRIVE: + case ABILITY_LIGHTNING_ROD: + if (moveType == TYPE_ELECTRIC && !IsTargetingPartner(battlerAtk, battlerDef)) + RETURN_SCORE_MINUS(20); + break; + case ABILITY_WATER_ABSORB: + case ABILITY_DRY_SKIN: + case ABILITY_STORM_DRAIN: + if (moveType == TYPE_WATER && !IsTargetingPartner(battlerAtk, battlerDef)) + RETURN_SCORE_MINUS(20); + break; + case ABILITY_FLASH_FIRE: + if (moveType == TYPE_FIRE && !IsTargetingPartner(battlerAtk, battlerDef)) + RETURN_SCORE_MINUS(20); + break; + case ABILITY_WONDER_GUARD: + if (effectiveness != AI_EFFECTIVENESS_x2 && effectiveness != AI_EFFECTIVENESS_x4) + return 0; + break; + case ABILITY_SAP_SIPPER: + if (moveType == TYPE_GRASS && !IsTargetingPartner(battlerAtk, battlerDef)) + RETURN_SCORE_MINUS(20); + break; + case ABILITY_JUSTIFIED: + if (moveType == TYPE_DARK && !IS_MOVE_STATUS(move) && !IsTargetingPartner(battlerAtk, battlerDef)) + RETURN_SCORE_MINUS(10); + break; + case ABILITY_RATTLED: + if (!IS_MOVE_STATUS(move) + && (moveType == TYPE_DARK || moveType == TYPE_GHOST || moveType == TYPE_BUG) + && !IsTargetingPartner(battlerAtk, battlerDef)) + RETURN_SCORE_MINUS(10); + break; + case ABILITY_SOUNDPROOF: + if (TestMoveFlags(move, FLAG_SOUND)) + RETURN_SCORE_MINUS(10); + break; + case ABILITY_BULLETPROOF: + if (TestMoveFlags(move, FLAG_BALLISTIC)) + RETURN_SCORE_MINUS(10); + break; + case ABILITY_DAZZLING: + case ABILITY_QUEENLY_MAJESTY: + if (atkPriority > 0) + RETURN_SCORE_MINUS(10); + break; + case ABILITY_AROMA_VEIL: + if (IsAromaVeilProtectedMove(move)) + RETURN_SCORE_MINUS(10); + break; + case ABILITY_SWEET_VEIL: + if (moveEffect == EFFECT_SLEEP || moveEffect == EFFECT_YAWN) + RETURN_SCORE_MINUS(10); + break; + case ABILITY_FLOWER_VEIL: + if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_GRASS) && (IsNonVolatileStatusMoveEffect(moveEffect) || IsStatLoweringMoveEffect(moveEffect))) + RETURN_SCORE_MINUS(10); + break; + case ABILITY_MAGIC_BOUNCE: + if (TestMoveFlags(move, FLAG_MAGICCOAT_AFFECTED)) + RETURN_SCORE_MINUS(20); + break; + case ABILITY_CONTRARY: + if (IsStatLoweringMoveEffect(moveEffect) && !IsTargetingPartner(battlerAtk, battlerDef)) + RETURN_SCORE_MINUS(20); + break; + case ABILITY_CLEAR_BODY: + //case ABILITY_FULL_METAL_BODY: // maybe? + case ABILITY_WHITE_SMOKE: + if (IsStatLoweringMoveEffect(moveEffect)) + RETURN_SCORE_MINUS(10); + break; + case ABILITY_HYPER_CUTTER: + if ((moveEffect == EFFECT_ATTACK_DOWN || moveEffect == EFFECT_ATTACK_DOWN_2) + && move != MOVE_PLAY_NICE && move != MOVE_NOBLE_ROAR && move != MOVE_TEARFUL_LOOK && move != MOVE_VENOM_DRENCH) + RETURN_SCORE_MINUS(10); + break; + case ABILITY_KEEN_EYE: + if (moveEffect == EFFECT_ACCURACY_DOWN || moveEffect == EFFECT_ACCURACY_DOWN_2) + RETURN_SCORE_MINUS(10); + break; + case ABILITY_BIG_PECKS: + if (moveEffect == EFFECT_DEFENSE_DOWN || moveEffect == EFFECT_DEFENSE_DOWN_2) + RETURN_SCORE_MINUS(10); + break; + case ABILITY_DEFIANT: + case ABILITY_COMPETITIVE: + if (IsStatLoweringMoveEffect(moveEffect) && !IsTargetingPartner(battlerAtk, battlerDef)) + RETURN_SCORE_MINUS(8); + break; + case ABILITY_COMATOSE: + if (IsNonVolatileStatusMoveEffect(moveEffect)) + RETURN_SCORE_MINUS(10); + break; + case ABILITY_SHIELDS_DOWN: + if (IsShieldsDownProtected(battlerAtk) && IsNonVolatileStatusMoveEffect(moveEffect)) + RETURN_SCORE_MINUS(10); + break; + case ABILITY_WONDER_SKIN: + if (IS_MOVE_STATUS(move)) + accuracy = 50; + break; + case ABILITY_LEAF_GUARD: + if (AI_WeatherHasEffect() && (gBattleWeather & WEATHER_SUN_ANY) + && defHoldEffect != HOLD_EFFECT_UTILITY_UMBRELLA + && IsNonVolatileStatusMoveEffect(moveEffect)) + RETURN_SCORE_MINUS(10); + break; + } // def ability checks + + // target partner ability checks + if (IsValidDoubleBattle(battlerAtk) && !IsTargetingPartner(battlerAtk, battlerDef)) + { + switch (defPartnerAbility) + { + case ABILITY_LIGHTNING_ROD: + if (moveType == TYPE_ELECTRIC && !IsMoveRedirectionPrevented(move, atkAbility)) + RETURN_SCORE_MINUS(20); + break; + case ABILITY_STORM_DRAIN: + if (moveType == TYPE_WATER && !IsMoveRedirectionPrevented(move, atkAbility)) + RETURN_SCORE_MINUS(20); + break; + case ABILITY_MAGIC_BOUNCE: + if (TestMoveFlags(move, FLAG_MAGICCOAT_AFFECTED) && moveTarget & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY | MOVE_TARGET_OPPONENTS_FIELD)) + RETURN_SCORE_MINUS(20); + break; + case ABILITY_SWEET_VEIL: + if (moveEffect == EFFECT_SLEEP || moveEffect == EFFECT_YAWN) + RETURN_SCORE_MINUS(10); + break; + case ABILITY_FLOWER_VEIL: + if ((IS_BATTLER_OF_TYPE(battlerDef, TYPE_GRASS)) && (IsNonVolatileStatusMoveEffect(moveEffect) || IsStatLoweringMoveEffect(moveEffect))) + RETURN_SCORE_MINUS(10); + break; + case ABILITY_AROMA_VEIL: + if (IsAromaVeilProtectedMove(move)) + RETURN_SCORE_MINUS(10); + break; + case ABILITY_DAZZLING: + case ABILITY_QUEENLY_MAJESTY: + if (atkPriority > 0) + RETURN_SCORE_MINUS(10); + break; + } + } // def partner ability checks + } // ignore def ability check + + #if B_PRANKSTER < GEN_7 + if (atkAbility == ABILITY_PRANKSTER && IS_BATTLER_OF_TYPE(battlerDef, TYPE_DARK) && IS_MOVE_STATUS(move) + && !(moveTarget & (MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_USER))) + RETURN_SCORE_MINUS(10); + #endif + + // terrain effect checks + if (gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN) + { + if (moveEffect == EFFECT_SLEEP || moveEffect == EFFECT_YAWN) + RETURN_SCORE_MINUS(10); + } + if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN) + { + if (IsNonVolatileStatusMoveEffect(moveEffect) || IsConfusionMoveEffect(moveEffect)) + RETURN_SCORE_MINUS(10); + } + if (gFieldStatuses & STATUS_FIELD_PSYCHIC_TERRAIN) + { + if (atkPriority > 0) + RETURN_SCORE_MINUS(10); + } + } // end check MOVE_TARGET_USER +// the following checks apply to any target (including user) + + // throat chop check + if (gDisableStructs[battlerAtk].throatChopTimer && TestMoveFlags(move, FLAG_SOUND)) + return 0; // Can't even select move at all + // heal block check + if (gStatuses3[battlerAtk] & STATUS3_HEAL_BLOCK && IsHealBlockPreventingMove(battlerAtk, move)) + return 0; // Can't even select heal blocked move + // primal weather check + //TODO + + // check move effects + switch (moveEffect) + { + case EFFECT_HIT: + default: + break; + case EFFECT_SLEEP: + if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + score -= 10; + else if (!AI_ShouldPutToSleep(battlerAtk, battlerDef, defAbility, move, partnerMove)) + score -= 10; + break; + case EFFECT_ABSORB: + if (defAbility == ABILITY_LIQUID_OOZE) + score -= 6; + break; + case EFFECT_STRENGTH_SAP: + if (defAbility == ABILITY_CONTRARY) + score -= 10; + else if (!BattlerStatCanFall(battlerDef, defAbility, STAT_ATK)) + score -= 10; + break; + case EFFECT_EXPLOSION: + if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_WILL_SUICIDE) + { + if (IsAbilityOnField(ABILITY_DAMP) && !DoesBattlerIgnoreAbilityChecks(atkAbility, move)) + { + score -= 10; + } + else if (CountUsablePartyMons(battlerDef) == 1 && CanAttackerFaintTarget(battlerAtk, battlerDef, AI_THINKING_STRUCT->movesetIndex)) + { + ; // target has 1 pkmn left but you can faint it -> good to use + } + else if (IsValidDoubleBattle(battlerAtk)) + { + if (CountUsablePartyMons(battlerDef) == 2 + && CanAttackerFaintTarget(battlerAtk, battlerDef, AI_THINKING_STRUCT->movesetIndex) + && CanAttackerFaintTarget(battlerAtkPartner, BATTLE_PARTNER(battlerDef), *(gBattleStruct->chosenMovePositions + battlerAtkPartner))) + { + ; // good + } + else + { + score -= 4; + } + } + else + { + if (CanAttackerFaintTarget(battlerAtk, battlerDef, AI_THINKING_STRUCT->movesetIndex)) + { + if (CountUsablePartyMons(battlerDef) == 1) + { + ; //Good to use move + } + } + else + { + score -= 4; + } + } + } + else + { + score -= 4; + } + break; + case EFFECT_DREAM_EATER: + if (defAbility != ABILITY_COMATOSE && !(gBattleMons[battlerDef].status1 & STATUS1_SLEEP)) + score -= 10; + break; + case EFFECT_COPYCAT: + //TODO - predict def move + break; + case EFFECT_MIRROR_MOVE: + //TODO - predict def move + break; + case EFFECT_TELEPORT: + if (gBattleTypeFlags & BATTLE_TYPE_TRAINER) + { + if (CountUsablePartyMons(battlerAtk) == 1) + score -= 10; + } + else if (GetBattlerSide(battlerAtk) == B_SIDE_OPPONENT) + { + if (IsValidDoubleBattle(battlerAtk) || IsBattlerTrapped(battlerAtk, FALSE)) + score -= 10; + } + break; + case EFFECT_ATTACK_UP: + case EFFECT_ATTACK_UP_2: + if (atkAbility != ABILITY_CONTRARY) + { + if (gBattleMons[battlerAtk].statStages[STAT_ATK] >= MAX_STAT_STAGE || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + score -= 10; + } + else + { + score -= 10; + } + break; + case EFFECT_ATTACK_ACCURACY_UP: //hone claws + if (atkAbility != ABILITY_CONTRARY) + { + if (gBattleMons[battlerAtk].statStages[STAT_ATK] >= MAX_STAT_STAGE + && (gBattleMons[battlerAtk].statStages[STAT_ACC] >= MAX_STAT_STAGE || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL))) + score -= 10; + break; + } + else + { + score -= 10; + } + break; + case EFFECT_DEFENSE_UP: + case EFFECT_DEFENSE_UP_2: + case EFFECT_DEFENSE_CURL: + if (move == MOVE_STUFF_CHEEKS) + { + if (ItemId_GetPocket(gBattleMons[battlerAtk].item) != POCKET_BERRIES) // AI knows its own item + score -= 10; + } + else + { + if (atkAbility == ABILITY_CONTRARY || !BattlerStatCanRise(battlerAtk, atkAbility, STAT_DEF)) + score -= 10; + } + break; + case EFFECT_FLOWER_SHIELD: + if (!IS_BATTLER_OF_TYPE(battlerAtk, TYPE_GRASS) + && !(IsValidDoubleBattle(battlerAtk) && IS_BATTLER_OF_TYPE(battlerAtkPartner, TYPE_GRASS))) + score -= 10; + break; + case EFFECT_MAGNETIC_FLUX: + if (atkAbility == ABILITY_PLUS || atkAbility == ABILITY_MINUS) + { + if (gBattleMons[battlerAtk].statStages[STAT_DEF] >= MAX_STAT_STAGE + && gBattleMons[battlerAtk].statStages[STAT_SPDEF] >= MAX_STAT_STAGE) + score -= 10; + } + else if (!IsValidDoubleBattle(battlerAtk)) + { + score -= 10; // our stats wont rise from this move + } + + if (IsValidDoubleBattle(battlerAtk)) + { + if (atkPartnerAbility == ABILITY_PLUS || atkPartnerAbility == ABILITY_MINUS) + { + if ((gBattleMons[battlerAtkPartner].statStages[STAT_DEF] >= MAX_STAT_STAGE) + && (gBattleMons[battlerAtkPartner].statStages[STAT_SPDEF] >= MAX_STAT_STAGE)) + score -= 10; + } + else if (atkAbility != ABILITY_PLUS && atkAbility != ABILITY_MINUS) + { + score -= 10; // nor our or our partner's ability is plus/minus + } + } + break; + case EFFECT_AROMATIC_MIST: + if (!IsValidDoubleBattle(battlerAtk) || gBattleMons[battlerAtkPartner].hp == 0 || !BattlerStatCanRise(battlerAtkPartner, atkPartnerAbility, STAT_SPDEF)) + score -= 10; + break; + case EFFECT_SPEED_UP: + case EFFECT_SPEED_UP_2: + if (atkAbility == ABILITY_CONTRARY || !BattlerStatCanRise(battlerAtk, atkAbility, STAT_SPEED)) + score -= 10; + break; + case EFFECT_SPECIAL_ATTACK_UP: + case EFFECT_SPECIAL_ATTACK_UP_2: + if (atkAbility == ABILITY_CONTRARY + || !BattlerStatCanRise(battlerAtk, atkAbility, STAT_SPATK) + || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) + score -= 10; + break; + case EFFECT_GROWTH: + case EFFECT_ATTACK_SPATK_UP: // work up + if (!BattlerShouldRaiseAttacks(battlerAtk, atkAbility)) + score -= 10; + break; + case EFFECT_ROTOTILLER: + if (IsValidDoubleBattle(battlerAtk)) + { + if (!(IS_BATTLER_OF_TYPE(battlerAtk, TYPE_GRASS) + && AI_IsBattlerGrounded(battlerAtk) + && atkAbility != ABILITY_CONTRARY + && (BattlerStatCanRise(battlerAtk, atkAbility, STAT_ATK) || BattlerStatCanRise(battlerAtk, atkAbility, STAT_SPATK))) + && !(IS_BATTLER_OF_TYPE(battlerAtkPartner, TYPE_GRASS) + && AI_IsBattlerGrounded(battlerAtkPartner) + && atkPartnerAbility != ABILITY_CONTRARY + && (BattlerStatCanRise(battlerAtkPartner, atkPartnerAbility, STAT_ATK) + || BattlerStatCanRise(battlerAtkPartner, atkPartnerAbility, STAT_SPATK)))) + { + score -= 10; + } + } + else if (!(IS_BATTLER_OF_TYPE(battlerAtk, TYPE_GRASS) + && AI_IsBattlerGrounded(battlerAtk) + && atkAbility != ABILITY_CONTRARY + && (BattlerStatCanRise(battlerAtk, atkAbility, STAT_ATK) || BattlerStatCanRise(battlerAtk, atkAbility, STAT_SPATK)))) + { + score -= 10; + } + break; + case EFFECT_GEAR_UP: + if (atkAbility == ABILITY_PLUS || atkAbility == ABILITY_MINUS) + { + if (!BattlerShouldRaiseAttacks(battlerAtk, atkAbility)) + score -= 10; + } + else if (!IsValidDoubleBattle(battlerAtk)) + { + score -= 10; // no partner and our stats wont rise, so don't use + } + + if (IsValidDoubleBattle(battlerAtk)) + { + if (atkPartnerAbility == ABILITY_PLUS || atkPartnerAbility == ABILITY_MINUS) + { + if ((!BattlerStatCanRise(battlerAtkPartner, atkPartnerAbility, STAT_ATK) || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + && (!BattlerStatCanRise(battlerAtkPartner, atkPartnerAbility, STAT_SPATK) || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL))) + score -= 10; + } + else if (atkAbility != ABILITY_PLUS && atkAbility != ABILITY_MINUS) + { + score -= 10; // nor our or our partner's ability is plus/minus + } + } + break; + case EFFECT_SPECIAL_DEFENSE_UP: + case EFFECT_SPECIAL_DEFENSE_UP_2: + if (atkAbility == ABILITY_CONTRARY || !BattlerStatCanRise(battlerAtk, atkAbility, STAT_SPDEF)) + score -= 10; + break; + case EFFECT_ACCURACY_UP: + case EFFECT_ACCURACY_UP_2: + if (atkAbility == ABILITY_CONTRARY || !BattlerStatCanRise(battlerAtk, atkAbility, STAT_ACC)) + score -= 10; + break; + case EFFECT_EVASION_UP: + case EFFECT_EVASION_UP_2: + case EFFECT_MINIMIZE: + if (atkAbility == ABILITY_CONTRARY || !BattlerStatCanRise(battlerAtk, atkAbility, STAT_EVASION)) + score -= 10; + break; + case EFFECT_ACUPRESSURE: + if (DoesSubstituteBlockMove(battlerAtk, battlerDef, move) + || AreBattlersStatsMaxed(battlerDef) || ((defAbility == ABILITY_CONTRARY) && !targetSameSide)) + score -= 10; + break; + case EFFECT_ATTACK_DOWN: + case EFFECT_ATTACK_DOWN_2: + if (gBattleMons[battlerDef].statStages[STAT_ATK] == MIN_STAT_STAGE + || !HasMoveWithSplit(battlerDef, SPLIT_PHYSICAL) + || ((defAbility == ABILITY_CONTRARY) && !targetSameSide)) // don't want to raise target stats unless its your partner + { + score -= 10; + } + break; + case EFFECT_VENOM_DRENCH: + if (targetSameSide) + score -= 10; + + if (!(gBattleMons[battlerDef].status1 & STATUS1_PSN_ANY)) + { + score -= 10; + } + else if (gBattleMons[battlerDef].statStages[STAT_SPEED] == MIN_STAT_STAGE + && (gBattleMons[battlerDef].statStages[STAT_SPATK] == MIN_STAT_STAGE || !HasMoveWithSplit(battlerDef, SPLIT_SPECIAL)) + && (gBattleMons[battlerDef].statStages[STAT_ATK] == MIN_STAT_STAGE || !HasMoveWithSplit(battlerDef, SPLIT_PHYSICAL))) + { + score -= 10; + } + break; + case EFFECT_NOBLE_ROAR: + if (((gBattleMons[battlerDef].statStages[STAT_SPATK] == MIN_STAT_STAGE || !HasMoveWithSplit(battlerDef, SPLIT_SPECIAL)) + && (gBattleMons[battlerDef].statStages[STAT_ATK] == MIN_STAT_STAGE || !HasMoveWithSplit(battlerDef, SPLIT_PHYSICAL))) + || ((defAbility == ABILITY_CONTRARY) && !targetSameSide)) // don't want to raise target stats unless its your partner + { + score -= 10; + } + break; + case EFFECT_DEFENSE_DOWN: + case EFFECT_DEFENSE_DOWN_2: + if (gBattleMons[battlerDef].statStages[STAT_DEF] == MIN_STAT_STAGE + || ((defAbility == ABILITY_CONTRARY) && !targetSameSide)) // don't want to raise target stats unless its your partner + score -= 10; + break; + case EFFECT_SPEED_DOWN: + case EFFECT_SPEED_DOWN_2: + if (gBattleMons[battlerDef].statStages[STAT_SPEED] == MIN_STAT_STAGE + || ((defAbility == ABILITY_CONTRARY) && !targetSameSide)) // don't want to raise target stats unless its your partner + score -= 10; + break; + case EFFECT_SPECIAL_ATTACK_DOWN: + case EFFECT_SPECIAL_ATTACK_DOWN_2: + if (gBattleMons[battlerDef].statStages[STAT_SPATK] == MIN_STAT_STAGE + || ((defAbility == ABILITY_CONTRARY) && !targetSameSide)) // don't want to raise target stats unless its your partner + score -= 10; + break; + case EFFECT_CAPTIVATE: + { + u8 atkGender = GetGenderFromSpeciesAndPersonality(gBattleMons[battlerAtk].species, gBattleMons[battlerAtk].personality); + u8 defGender = GetGenderFromSpeciesAndPersonality(gBattleMons[battlerDef].species, gBattleMons[battlerDef].personality); + if (atkGender == MON_GENDERLESS || defGender == MON_GENDERLESS || atkGender == defGender) + score -= 10; + } + break; + case EFFECT_SPECIAL_DEFENSE_DOWN: + case EFFECT_SPECIAL_DEFENSE_DOWN_2: + if (gBattleMons[battlerDef].statStages[STAT_SPDEF] == MIN_STAT_STAGE + || ((defAbility == ABILITY_CONTRARY) && !targetSameSide)) // don't want to raise target stats unless its your partner + score -= 10; + break; + case EFFECT_ACCURACY_DOWN: + case EFFECT_ACCURACY_DOWN_2: + if (gBattleMons[battlerDef].statStages[STAT_ACC] == MIN_STAT_STAGE + || ((defAbility == ABILITY_CONTRARY) && !targetSameSide)) // don't want to raise target stats unless its your partner + score -= 10; + break; + case EFFECT_EVASION_DOWN: + case EFFECT_EVASION_DOWN_2: + if (gBattleMons[battlerDef].statStages[STAT_EVASION] == MIN_STAT_STAGE + || ((defAbility == ABILITY_CONTRARY) && !targetSameSide)) // don't want to raise target stats unless its your partner + score -= 10; + break; + case EFFECT_HAZE: + if (PartnerHasSameMoveEffectWithoutTarget(battlerAtkPartner, move, partnerMove)) + { + score -= 10; // partner already using haze + } + else + { + u32 i; + for (i = STAT_ATK; i < NUM_BATTLE_STATS; i++) + { + if (gBattleMons[battlerAtk].statStages[i] > DEFAULT_STAT_STAGE || gBattleMons[battlerAtkPartner].statStages[i] > DEFAULT_STAT_STAGE) + RETURN_SCORE_MINUS(10); // Don't want to reset our boosted stats + } + for (i = STAT_ATK; i < NUM_BATTLE_STATS; i++) + { + if (gBattleMons[battlerDef].statStages[i] < DEFAULT_STAT_STAGE || gBattleMons[battlerDefPartner].statStages[i] < DEFAULT_STAT_STAGE) + RETURN_SCORE_MINUS(10); //Don't want to reset enemy lowered stats + } + } + break; + case EFFECT_BIDE: + if (!BattlerHasDamagingMove(battlerDef) + || GetHealthPercentage(battlerAtk) < 30 //Close to death + || gBattleMons[battlerDef].status1 & (STATUS1_SLEEP | STATUS1_FREEZE)) //No point in biding if can't take damage + score -= 10; + break; + case EFFECT_ROAR: + if (DoesPartnerHaveSameMoveEffect(battlerAtkPartner, battlerDef, move, partnerMove)) + RETURN_SCORE_MINUS(10); // don't scare away pokemon twice + + //Don't blow out a Pokemon that'll faint soon or is taking a a lot of secondary damage + if (GetHealthPercentage(battlerDef) < 10 && BattlerHasSecondaryDamage(battlerDef)) + score -= 10; + else if (gStatuses3[battlerDef] & STATUS3_PERISH_SONG) + score -= 10; + + if (CountUsablePartyMons(battlerDef) == 1 + || defAbility == ABILITY_SUCTION_CUPS + || gStatuses3[battlerDef] & STATUS3_ROOTED) + score -= 10; + break; + case EFFECT_HIT_SWITCH_TARGET: + if (DoesPartnerHaveSameMoveEffect(battlerAtkPartner, battlerDef, move, partnerMove)) + score -= 10; // don't scare away pokemon twice + else if (GetHealthPercentage(battlerDef) < 10 && BattlerHasSecondaryDamage(battlerDef)) + score -= 10; // don't blow away mon that will faint soon + else if (gStatuses3[battlerDef] & STATUS3_PERISH_SONG) + score -= 10; + break; + case EFFECT_CONVERSION: + //Check first move type + if (IS_BATTLER_OF_TYPE(battlerAtk, gBattleMoves[gBattleMons[battlerAtk].moves[0]].type)) + score -= 10; + break; + case EFFECT_RESTORE_HP: + case EFFECT_REST: + case EFFECT_MORNING_SUN: + if (GetHealthPercentage(battlerAtk) == 100) + score -= 10; + else if (GetHealthPercentage(battlerAtk) >= 90) + score -= 9; //No point in healing, but should at least do it if nothing better + break; + case EFFECT_PURIFY: + if (!(gBattleMons[battlerDef].status1 & STATUS1_ANY)) + score -= 10; + else if (battlerDef == battlerAtkPartner) + break; //Always heal your ally + else if (GetHealthPercentage(battlerAtk) == 100) + score -= 10; + else if (GetHealthPercentage(battlerAtk) >= 90) + score -= 8; //No point in healing, but should at least do it if nothing better + break; + case EFFECT_TOXIC_THREAD: + if (gBattleMons[battlerDef].statStages[STAT_SPEED] > MIN_STAT_STAGE && defAbility != ABILITY_CONTRARY) + score -= 10; + //fallthrough + case EFFECT_POISON: + case EFFECT_TOXIC: + if (!AI_ShouldPoison(battlerAtk, battlerDef, defAbility, move, partnerMove)) + score -= 10; + else if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + score -= 10; + break; + case EFFECT_LIGHT_SCREEN: + if (gSideStatuses[GetBattlerSide(battlerAtk)] & SIDE_STATUS_LIGHTSCREEN + || PartnerHasSameMoveEffectWithoutTarget(battlerAtkPartner, move, partnerMove)) + score -= 10; + else if (gSideStatuses[GetBattlerSide(battlerAtk)] & SIDE_STATUS_AURORA_VEIL) + score--; //can use move, but it doesn't stack with light screen + break; + case EFFECT_REFLECT: + if (gSideStatuses[GetBattlerSide(battlerAtk)] & SIDE_STATUS_REFLECT + || PartnerHasSameMoveEffectWithoutTarget(battlerAtkPartner, move, partnerMove)) + score -= 10; + else if (gSideStatuses[GetBattlerSide(battlerAtk)] & SIDE_STATUS_AURORA_VEIL) + score--; // can use, but doesn't stack with reflect + break; + case EFFECT_AURORA_VEIL: + if (gSideStatuses[GetBattlerSide(battlerAtk)] & SIDE_STATUS_AURORA_VEIL + || PartnerHasSameMoveEffectWithoutTarget(battlerAtkPartner, move, partnerMove) + || !(gBattleWeather & WEATHER_HAIL_ANY)) + score -= 10; + else if (gSideStatuses[GetBattlerSide(battlerAtk)] & (SIDE_STATUS_REFLECT | SIDE_STATUS_LIGHTSCREEN)) + score--; // can use, but won't stack + break; + case EFFECT_OHKO: + if (gMoveResultFlags & (MOVE_RESULT_NO_EFFECT | MOVE_RESULT_MISSED)) + score -= 10; + if (!ShouldTryOHKO(battlerAtk, battlerDef, atkAbility, defAbility, accuracy, move)) + score -= 10; + break; + case EFFECT_RECOIL_IF_MISS: + if (atkAbility != ABILITY_MAGIC_GUARD && accuracy < 75) + score -= 6; + break; + case EFFECT_MIST: + if (gSideStatuses[GetBattlerSide(battlerAtk)] & SIDE_STATUS_MIST + || PartnerHasSameMoveEffectWithoutTarget(battlerAtkPartner, move, partnerMove)) + score -= 10; + break; + case EFFECT_FOCUS_ENERGY: + if (gBattleMons[battlerAtk].status2 & STATUS2_FOCUS_ENERGY) + score -= 10; + break; + case EFFECT_RECOIL_25: + if (atkAbility != ABILITY_MAGIC_GUARD && atkAbility != ABILITY_ROCK_HEAD) + { + u32 recoilDmg = max(1, AI_THINKING_STRUCT->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex] / 4); + if (!ShouldUseRecoilMove(battlerAtk, battlerDef, recoilDmg, AI_THINKING_STRUCT->movesetIndex)) + score -= 10; + break; + } + break; + case EFFECT_RECOIL_33: + case EFFECT_RECOIL_33_STATUS: + if (atkAbility != ABILITY_MAGIC_GUARD && atkAbility != ABILITY_ROCK_HEAD) + { + u32 recoilDmg = max(1, AI_THINKING_STRUCT->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex] / 3); + if (!ShouldUseRecoilMove(battlerAtk, battlerDef, recoilDmg, AI_THINKING_STRUCT->movesetIndex)) + score -= 10; + break; + } + break; + case EFFECT_RECOIL_50: + if (atkAbility != ABILITY_MAGIC_GUARD && atkAbility != ABILITY_ROCK_HEAD) + { + u32 recoilDmg = max(1, AI_THINKING_STRUCT->simulatedDmg[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex] / 2); + if (!ShouldUseRecoilMove(battlerAtk, battlerDef, recoilDmg, AI_THINKING_STRUCT->movesetIndex)) + score -= 10; + break; + } + break; + case EFFECT_CONFUSE: + if (!AI_CanConfuse(battlerAtk, battlerDef, defAbility, battlerAtkPartner, move, partnerMove)) + score -= 10; + break; + case EFFECT_TEETER_DANCE: + if (((gBattleMons[battlerDef].status2 & STATUS2_CONFUSION) + || (!DoesBattlerIgnoreAbilityChecks(battlerAtk, move) && defAbility == ABILITY_OWN_TEMPO) + || (IsBattlerGrounded(battlerDef) && (gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN)) + || (DoesSubstituteBlockMove(battlerAtk, battlerDef, move))) + && ((gBattleMons[battlerDefPartner].status2 & STATUS2_CONFUSION) + || (!DoesBattlerIgnoreAbilityChecks(battlerAtk, move) && defPartnerAbility == ABILITY_OWN_TEMPO) + || (IsBattlerGrounded(battlerDefPartner) && (gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN)) + || (DoesSubstituteBlockMove(battlerAtk, battlerDefPartner, move)))) + { + score -= 10; + } + break; + case EFFECT_TRANSFORM: + if (gBattleMons[battlerAtk].status2 & STATUS2_TRANSFORMED + || (gBattleMons[battlerDef].status2 & (STATUS2_TRANSFORMED | STATUS2_SUBSTITUTE))) //Leave out Illusion b/c AI is supposed to be fooled + score -= 10; + break; + case EFFECT_PARALYZE: + if (move != MOVE_GLARE && gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + score -= 10; + else if (AI_CanParalyze(battlerAtk, battlerDef, defAbility, move, partnerMove)) + score -= 10; + break; + case EFFECT_TWO_TURNS_ATTACK: + if (atkHoldEffect != HOLD_EFFECT_POWER_HERB && CanTargetFaintAi(battlerDef, battlerAtk)) + score -= 6; + break; + case EFFECT_SUBSTITUTE: + if (gBattleMons[battlerAtk].status2 & STATUS2_SUBSTITUTE + || GetHealthPercentage(battlerAtk) <= 25 + || defAbility == ABILITY_INFILTRATOR) + score -= 10; + else if (B_SOUND_SUBSTITUTE >= GEN_6 && TestMoveFlagsInMoveset(battlerDef, FLAG_SOUND)) + score -= 10; + break; + case EFFECT_RECHARGE: + if (atkAbility != ABILITY_TRUANT + && !CanAttackerFaintTarget(battlerAtk, battlerDef, AI_THINKING_STRUCT->movesetIndex)) + score -= 2; + break; + case EFFECT_SPITE: + case EFFECT_MIMIC: + if (GetWhoStrikesFirst(battlerAtk, battlerDef, TRUE) == 0) // attacker should go first + { + if (gLastMoves[battlerDef] == MOVE_NONE + || gLastMoves[battlerDef] == 0xFFFF) + score -= 10; + } + // TODO - if no predicted move, decrease viability + break; + case EFFECT_METRONOME: + break; + case EFFECT_LEECH_SEED: + if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_GRASS) + || gStatuses3[battlerDef] & STATUS3_LEECHSEED + || defAbility == ABILITY_LIQUID_OOZE + || DoesPartnerHaveSameMoveEffect(battlerAtkPartner, battlerDef, move, partnerMove)) + score -= 10; + break; + case EFFECT_DISABLE: + if (gDisableStructs[battlerDef].disableTimer == 0 + && (B_MENTAL_HERB >= GEN_5 && defHoldEffect != HOLD_EFFECT_CURE_ATTRACT) + && !PartnerHasSameMoveEffectWithoutTarget(battlerAtkPartner, move, partnerMove)) + { + if (GetWhoStrikesFirst(battlerAtk, battlerDef, TRUE) == 0) // attacker should go first + { + if (gLastMoves[battlerDef] == MOVE_NONE || gLastMoves[battlerDef] == 0xFFFF) + score -= 10; + } + //TODO - if predictive move = MOVE_NONE, score -= 10 + } + else + { + score -= 10; + } + break; + case EFFECT_COUNTER: + case EFFECT_MIRROR_COAT: + //TODO - predicted move + /*if (GetBattleMoveSplit(predictedMove) == SPLIT_STATUS + || predictedMove == MOVE_NONE + || DoesSubstituteBlockMove(battlerAtk, battlerDefPartner, predictedMove) + score -= 10;*/ + break; + case EFFECT_ENCORE: + if (gDisableStructs[battlerDef].encoreTimer == 0 + && (B_MENTAL_HERB >= GEN_5 && defHoldEffect != HOLD_EFFECT_CURE_ATTRACT) + && !DoesPartnerHaveSameMoveEffect(battlerAtkPartner, battlerDef, move, partnerMove)) + { + if (GetWhoStrikesFirst(battlerAtk, battlerDef, TRUE) == 0) // attacker should go first + { + if (gLastMoves[battlerDef] == MOVE_NONE + || gLastMoves[battlerDef] == 0xFFFF) + score -= 10; + } + //TODO predicted moves + //else if (predictedMove == MOVE_NONE) + //score -= 10; + } + else + { + score -= 10; + } + break; + case EFFECT_ENDEAVOR: + case EFFECT_PAIN_SPLIT: + if (gBattleMons[battlerAtk].hp > (gBattleMons[battlerAtk].hp + gBattleMons[battlerDef].hp) / 2) + score -= 10; + break; + case EFFECT_SNORE: + case EFFECT_SLEEP_TALK: + // AI shouldn't really know if its about to wake up since its random + /*if (((gBattleMons[battlerAtk].status1 & STATUS1_SLEEP) == 1 || !(gBattleMons[battlerAtk].status1 & STATUS1_SLEEP)) + && atkAbility != ABILITY_COMATOSE) + score -= 10;*/ + if (!(gBattleMons[battlerAtk].status1 & STATUS1_SLEEP) && atkAbility != ABILITY_COMATOSE) + score -= 10; + break; + case EFFECT_CONVERSION_2: + //TODO + break; + case EFFECT_LOCK_ON: + if (gStatuses3[battlerDef] & STATUS3_ALWAYS_HITS + || atkAbility == ABILITY_NO_GUARD + || defAbility == ABILITY_NO_GUARD + || DoesPartnerHaveSameMoveEffect(battlerAtkPartner, battlerDef, move, partnerMove)) + score -= 10; + break; + case EFFECT_LASER_FOCUS: + if (gStatuses3[battlerAtk] & STATUS3_LASER_FOCUS) + score -= 10; + else if (defAbility == ABILITY_SHELL_ARMOR || defAbility == ABILITY_BATTLE_ARMOR) + score -= 8; + break; + case EFFECT_SKETCH: + if (gLastMoves[battlerDef] == MOVE_NONE) + score -= 10; + break; + case EFFECT_DESTINY_BOND: + if (gBattleMons[battlerDef].status2 & STATUS2_DESTINY_BOND) + score -= 10; + break; + case EFFECT_FALSE_SWIPE: + // TODO + break; + case EFFECT_HEAL_BELL: + if (!AnyPartyMemberStatused(battlerAtk, TestMoveFlags(move, FLAG_SOUND)) || PartnerHasSameMoveEffectWithoutTarget(battlerAtkPartner, move, partnerMove)) + score -= 10; + break; + case EFFECT_MEAN_LOOK: + if (IsBattlerTrapped(battlerDef, TRUE) + || DoesPartnerHaveSameMoveEffect(battlerAtkPartner, battlerDef, move, partnerMove)) + score -= 10; + break; + case EFFECT_HIT_PREVENT_ESCAPE: + break; + case EFFECT_NIGHTMARE: + if (gBattleMons[battlerDef].status2 & STATUS2_NIGHTMARE + || !(gBattleMons[battlerDef].status1 & STATUS1_SLEEP || defAbility == ABILITY_COMATOSE) + || DoesPartnerHaveSameMoveEffect(battlerAtkPartner, battlerDef, move, partnerMove)) + score -= 10; + break; + case EFFECT_CURSE: + if (IS_BATTLER_OF_TYPE(battlerAtk, TYPE_GHOST)) + { + if (gBattleMons[battlerDef].status2 & STATUS2_CURSED + || DoesPartnerHaveSameMoveEffect(battlerAtkPartner, battlerDef, move, partnerMove)) + score -= 10; + else if (GetHealthPercentage(battlerAtk) <= 50) + score -= 6; + } + else //Regular Curse + { + if (!BattlerStatCanRise(battlerAtk, atkAbility, STAT_ATK) + && !BattlerStatCanRise(battlerAtk, atkAbility, STAT_DEF) + && !BattlerStatCanFall(battlerAtk, atkAbility, STAT_SPEED)) + score -= 10; + } + break; + case EFFECT_ENDURE: + if (gBattleMons[battlerAtk].hp == 1 || BattlerHasSecondaryDamage(battlerAtk)) //Don't use Endure if you'll die after using it + score -= 10; + break; + case EFFECT_PROTECT: + { + bool32 decreased = FALSE; + switch (move) + { + case MOVE_QUICK_GUARD: + case MOVE_WIDE_GUARD: + case MOVE_CRAFTY_SHIELD: + if (!IsValidDoubleBattle(battlerAtk)) + { + score -= 10; + decreased = TRUE; + } + break; + case MOVE_MAT_BLOCK: + if (!gDisableStructs[battlerAtk].isFirstTurn) + { + score -= 10; + decreased = TRUE; + } + break; + } // move check + + if (decreased) + break; + if (gBattleMons[battlerDef].status2 & STATUS2_RECHARGE) + { + score -= 10; + break; + } + + if (gBattleMoves[gLastResultingMoves[battlerAtk]].effect == EFFECT_PROTECT + && move != MOVE_QUICK_GUARD + && move != MOVE_WIDE_GUARD + && move != MOVE_CRAFTY_SHIELD) //These moves have infinite usage + { + if (BattlerHasSecondaryDamage(battlerAtk) + && defAbility != ABILITY_MOXIE + && defAbility != ABILITY_BEAST_BOOST) + { + score -= 10; //Don't protect if you're going to faint after protecting + } + else if (gDisableStructs[battlerAtk].protectUses == 1 && Random() % 100 < 50) + { + if (!IsValidDoubleBattle(battlerAtk)) + score -= 6; + else + score -= 10; //Don't try double protecting in doubles + } + else if (gDisableStructs[battlerAtk].protectUses >= 2) + { + score -= 10; + } + } + + /*if (AI_THINKING_STRUCT->aiFlags == AI_SCRIPT_CHECK_BAD_MOVE //Only basic AI + && IS_DOUBLE_BATTLE) //Make the regular AI know how to use Protect minimally in Doubles + { + u8 shouldProtect = ShouldProtect(battlerAtk, battlerDef, move); + if (shouldProtect == USE_PROTECT || shouldProtect == PROTECT_FROM_FOES) + IncreaseFoeProtectionViability(&viability, 0xFF, battlerAtk, battlerDef); + else if (shouldProtect == PROTECT_FROM_ALLIES) + IncreaseAllyProtectionViability(&viability, 0xFF); + }*/ + } + break; + case EFFECT_SPIKES: + if (gSideTimers[GetBattlerSide(battlerDef)].spikesAmount >= 3) + score -= 10; + else if (PartnerMoveIsSameNoTarget(battlerAtkPartner, move, partnerMove) + && gSideTimers[GetBattlerSide(battlerDef)].spikesAmount == 2) + score -= 10; //Only one mon needs to set up the last layer of Spikes + break; + case EFFECT_STEALTH_ROCK: + if (gSideTimers[GetBattlerSide(battlerDef)].stealthRockAmount > 0 + || PartnerMoveIsSameNoTarget(battlerAtkPartner, move, partnerMove)) //Only one mon needs to set up Stealth Rocks + score -= 10; + break; + case EFFECT_TOXIC_SPIKES: + if (gSideTimers[GetBattlerSide(battlerDef)].toxicSpikesAmount >= 2) + score -= 10; + else if (PartnerMoveIsSameNoTarget(battlerAtkPartner, move, partnerMove) && gSideTimers[GetBattlerSide(battlerDef)].toxicSpikesAmount == 1) + score -= 10; //Only one mon needs to set up the last layer of Toxic Spikes + break; + case EFFECT_STICKY_WEB: + if (gSideTimers[GetBattlerSide(battlerDef)].stickyWebAmount) + score -= 10; + else if (PartnerMoveIsSameNoTarget(battlerAtkPartner, move, partnerMove) && gSideTimers[GetBattlerSide(battlerDef)].stickyWebAmount) + score -= 10; //Only one mon needs to set up Sticky Web + break; + case EFFECT_FORESIGHT: + if (gBattleMons[battlerDef].status2 & STATUS2_FORESIGHT) + { + score -= 10; + } + else if (gBattleMons[battlerDef].statStages[STAT_EVASION] <= 4 + || !(IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST)) + || DoesPartnerHaveSameMoveEffect(battlerAtkPartner, battlerDef, move, partnerMove)) + { + score -= 9; + } + break; + case EFFECT_MIRACLE_EYE: + if (gStatuses3[battlerDef] & STATUS3_MIRACLE_EYED) + score -= 10; + + if (gBattleMons[battlerDef].statStages[STAT_EVASION] <= 4 + || !(IS_BATTLER_OF_TYPE(battlerDef, TYPE_DARK)) + || DoesPartnerHaveSameMoveEffect(battlerAtkPartner, battlerDef, move, partnerMove)) + score -= 9; + break; + case EFFECT_PERISH_SONG: + if (IsValidDoubleBattle(battlerAtk)) + { + if (CountUsablePartyMons(battlerAtk) <= 2 + && atkAbility != ABILITY_SOUNDPROOF + && atkPartnerAbility != ABILITY_SOUNDPROOF + && CountUsablePartyMons(FOE(battlerAtk)) >= 3) + { + score -= 10; //Don't wipe your team if you're going to lose + } + else if ((!IsBattlerAlive(FOE(battlerAtk)) || AI_GetAbility(FOE(battlerAtk)) == ABILITY_SOUNDPROOF + || gStatuses3[FOE(battlerAtk)] & STATUS3_PERISH_SONG) + && (!IsBattlerAlive(BATTLE_PARTNER(FOE(battlerAtk))) || AI_GetAbility(BATTLE_PARTNER(FOE(battlerAtk))) == ABILITY_SOUNDPROOF + || gStatuses3[BATTLE_PARTNER(FOE(battlerAtk))] & STATUS3_PERISH_SONG)) + { + score -= 10; //Both enemies are perish songed + } + else if (DoesPartnerHaveSameMoveEffect(battlerAtkPartner, battlerDef, move, partnerMove)) + score -= 10; + } + else + { + if (CountUsablePartyMons(battlerAtk) == 1 && atkAbility != ABILITY_SOUNDPROOF + && CountUsablePartyMons(battlerDef) >= 2) + score -= 10; + + if (gStatuses3[FOE(battlerAtk)] & STATUS3_PERISH_SONG || AI_GetAbility(FOE(battlerAtk)) == ABILITY_SOUNDPROOF) + score -= 10; + } + break; + case EFFECT_SANDSTORM: + if (gBattleWeather & WEATHER_SANDSTORM_ANY //TODO | WEATHER_PRIMAL_ANY) + || PartnerMoveEffectIsWeather(battlerAtkPartner, partnerMove)) + score -= 10; + break; + case EFFECT_SUNNY_DAY: + if (gBattleWeather & WEATHER_SUN_ANY //TODO | WEATHER_PRIMAL_ANY) + || PartnerMoveEffectIsWeather(battlerAtkPartner, partnerMove)) + score -= 10; + break; + case EFFECT_RAIN_DANCE: + if (gBattleWeather & WEATHER_RAIN_ANY //TODO | WEATHER_PRIMAL_ANY) + || PartnerMoveEffectIsWeather(battlerAtkPartner, partnerMove)) + score -= 10; + break; + case EFFECT_HAIL: + if (gBattleWeather & WEATHER_HAIL_ANY //TODO | WEATHER_PRIMAL_ANY | WEATHER_CIRCUS) + || PartnerMoveEffectIsWeather(battlerAtkPartner, partnerMove)) + score -= 10; + break; + case EFFECT_SWAGGER: + if (targetSameSide && defAbility == ABILITY_CONTRARY) + score -= 10; + else if (!AI_CanConfuse(battlerAtk, battlerDef, defAbility, battlerAtkPartner, move, partnerMove)) + score -= 10; + break; + case EFFECT_ATTRACT: + { + u8 atkGender = GetGenderFromSpeciesAndPersonality(gBattleMons[battlerAtk].species, gBattleMons[battlerAtk].personality); + u8 defGender = GetGenderFromSpeciesAndPersonality(gBattleMons[battlerDef].species, gBattleMons[battlerDef].personality); + if (!AI_CanBeInfatuated(battlerAtk, battlerDef, defAbility, atkGender, defGender) + || DoesPartnerHaveSameMoveEffect(battlerAtkPartner, battlerDef, move, partnerMove)) + score -= 10; + } + break; + case EFFECT_SAFEGUARD: + if (gSideStatuses[GetBattlerSide(battlerAtk)] & SIDE_STATUS_SAFEGUARD + || PartnerHasSameMoveEffectWithoutTarget(battlerAtkPartner, move, partnerMove)) + score -= 10; + break; + case EFFECT_BURN_UP: + if (!IS_BATTLER_OF_TYPE(battlerAtk, TYPE_FIRE)) + score -= 10; + break; + case EFFECT_PARTING_SHOT: + if (CountUsablePartyMons(battlerAtk) == 1) + score -= 10; + break; + case EFFECT_BATON_PASS: + if (gBattleMons[battlerAtk].status2 & STATUS2_SUBSTITUTE + || (gStatuses3[battlerAtk] & (STATUS3_ROOTED | STATUS3_AQUA_RING | STATUS3_MAGNET_RISE | STATUS3_POWER_TRICK)) + || AnyStatIsRaised(battlerAtk)) + break; + + score -= 6; + break; + case EFFECT_HIT_ESCAPE: + break; + case EFFECT_RAPID_SPIN: + if ((gBattleMons[battlerAtk].status2 & STATUS2_WRAPPED) || (gStatuses3[battlerAtk] & STATUS3_LEECHSEED)) + break; // check damage/accuracy + + //Spin checks + if (!(gSideStatuses[GetBattlerSide(battlerAtk)] & SIDE_HAZARDS_ANY)) + score -= 6; + break; + case EFFECT_DEFOG: + if (gSideStatuses[GetBattlerSide(battlerDef)] + & (SIDE_STATUS_REFLECT | SIDE_STATUS_LIGHTSCREEN | SIDE_STATUS_AURORA_VEIL | SIDE_STATUS_SAFEGUARD | SIDE_STATUS_MIST) + || gSideTimers[GetBattlerSide(battlerDef)].auroraVeilTimer != 0 + || gSideStatuses[GetBattlerSide(battlerAtk)] & SIDE_HAZARDS_ANY) + { + if (PartnerHasSameMoveEffectWithoutTarget(battlerAtkPartner, move, partnerMove)) + { + score -= 10; //Only need one hazards removal + break; + } + } + + if (gSideStatuses[GetBattlerSide(battlerDef)] & SIDE_HAZARDS_ANY) + { + score -= 10; //Don't blow away opposing hazards + break; + } + + if (IsValidDoubleBattle(battlerAtk)) + { + if (IsHazardMoveEffect(gBattleMoves[partnerMove].effect) // partner is going to set up hazards + && GetWhoStrikesFirst(battlerAtkPartner, battlerAtk, FALSE)) // partner is going to set up before the potential Defog + { + score -= 10; + break; // Don't use Defog if partner is going to set up hazards + } + } + + // evasion check + if (gBattleMons[battlerDef].statStages[STAT_EVASION] == MIN_STAT_STAGE + || ((defAbility == ABILITY_CONTRARY) && !targetSameSide)) // don't want to raise target stats unless its your partner + score -= 10; + break; + case EFFECT_BELLY_DRUM: + if (atkAbility == ABILITY_CONTRARY) + score -= 10; + else if (GetHealthPercentage(battlerAtk) <= 60) + score -= 10; + break; + case EFFECT_PSYCH_UP: // haze stats check + { + u32 i; + for (i = STAT_ATK; i < NUM_BATTLE_STATS; i++) + { + if (gBattleMons[battlerAtk].statStages[i] > DEFAULT_STAT_STAGE || gBattleMons[battlerAtkPartner].statStages[i] > DEFAULT_STAT_STAGE) + RETURN_SCORE_MINUS(10); // Don't want to reset our boosted stats + } + for (i = STAT_ATK; i < NUM_BATTLE_STATS; i++) + { + if (gBattleMons[battlerDef].statStages[i] < DEFAULT_STAT_STAGE || gBattleMons[battlerDefPartner].statStages[i] < DEFAULT_STAT_STAGE) + RETURN_SCORE_MINUS(10); //Don't want to copy enemy lowered stats + } + } + break; + case EFFECT_SPECTRAL_THIEF: + break; + case EFFECT_FUTURE_SIGHT: + if (gWishFutureKnock.futureSightCounter[battlerDef] != 0) + score -= 10; + break; + case EFFECT_SOLARBEAM: + if (atkHoldEffect == HOLD_EFFECT_POWER_HERB + || (AI_WeatherHasEffect() && gBattleWeather & WEATHER_SUN_ANY && atkHoldEffect != HOLD_EFFECT_UTILITY_UMBRELLA)) + break; + if (CanTargetFaintAi(battlerDef, battlerAtk)) //Attacker can be knocked out + score -= 4; + break; + case EFFECT_SEMI_INVULNERABLE: + //TODO - predicted moves + /*if (predictedMove != MOVE_NONE + && MoveWouldHitFirst(move, battlerAtk, battlerDef) + && gBattleMoves[predictedMove].effect == EFFECT_SEMI_INVULNERABLE) + score -= 10;*/ // Don't Fly if opponent is going to fly after you + + if (BattlerWillFaintFromWeather(battlerAtk, atkAbility) + && (move == MOVE_FLY || move == MOVE_BOUNCE)) + score -= 10; // Attacker will faint while in the air + break; + case EFFECT_FAKE_OUT: + // first impression check + if (!gDisableStructs[battlerAtk].isFirstTurn) + { + score -= 10; + } + else if (move == MOVE_FAKE_OUT) + { + if ((atkHoldEffect == HOLD_EFFECT_CHOICE_BAND || atkAbility == ABILITY_GORILLA_TACTICS) + && (CountUsablePartyMons(battlerDef) >= 2 || !CanAttackerFaintTarget(battlerAtk, battlerDef, AI_THINKING_STRUCT->movesetIndex))) + { + if (CountUsablePartyMons(battlerAtk) == 1) + score -= 10; // Don't lock the attacker into Fake Out if they can't switch out afterwards. + } + } + break; //damage checks + case EFFECT_STOCKPILE: + if (gDisableStructs[battlerAtk].stockpileCounter >= 3) + score -= 10; + break; + case EFFECT_SPIT_UP: + if (gDisableStructs[battlerAtk].stockpileCounter == 1) + score -= 10; + else if (gDisableStructs[battlerAtk].stockpileCounter <= 1) + score -= 2; + break; + case EFFECT_SWALLOW: + if (gDisableStructs[battlerAtk].stockpileCounter == 0) + { + score -= 10; + } + else + { + if (GetHealthPercentage(battlerAtk) == 100) + score -= 10; + else if (GetHealthPercentage(battlerAtk) >= 80) + score -= 5; // do it if nothing better + } + break; + case EFFECT_TORMENT: + if (gBattleMons[battlerDef].status2 & STATUS2_TORMENT + || DoesPartnerHaveSameMoveEffect(battlerAtkPartner, battlerDef, move, partnerMove)) + { + score -= 10; + break; + } + + if (B_MENTAL_HERB >= GEN_5 && defHoldEffect == HOLD_EFFECT_CURE_ATTRACT) + score -= 6; + break; + case EFFECT_FLATTER: + if (targetSameSide && defAbility == ABILITY_CONTRARY) + score -= 10; + else if (!AI_CanConfuse(battlerAtk, battlerDef, defAbility, battlerAtkPartner, move, partnerMove)) + score -= 10; + break; + case EFFECT_WILL_O_WISP: + if (!AI_CanBurn(battlerAtk, battlerDef, defAbility, battlerAtkPartner, move, partnerMove)) + score -= 10; + break; + case EFFECT_MEMENTO: + if (CountUsablePartyMons(battlerAtk) == 1 || DoesPartnerHaveSameMoveEffect(battlerAtkPartner, battlerDef, move, partnerMove)) + score -= 10; + else if (gBattleMons[battlerDef].statStages[STAT_ATK] == MIN_STAT_STAGE && gBattleMons[battlerDef].statStages[STAT_SPATK] == MIN_STAT_STAGE) + score -= 10; + break; + case EFFECT_HEALING_WISH: //healing wish, lunar dance + if (CountUsablePartyMons(battlerAtk) == 1 || DoesPartnerHaveSameMoveEffect(battlerAtkPartner, battlerDef, move, partnerMove)) + score -= 10; + else if (IsPartyFullyHealedExceptBattler(battlerAtk)) + score -= 10; + break; + case EFFECT_FINAL_GAMBIT: + if (CountUsablePartyMons(battlerAtk) == 1 || DoesPartnerHaveSameMoveEffect(battlerAtkPartner, battlerDef, move, partnerMove)) + score -= 10; + break; + case EFFECT_FOCUS_PUNCH: + //TODO predicted moves + /*if (predictedMove != MOVE_NONE + && !DoesSubstituteBlockMove(battlerAtk, battlerDef, predictedMove) + && SPLIT(predictedMove) != SPLIT_STATUS + && gBattleMoves[predictedMove].power != 0) + score -= 10;*/ //Probably better not to use it + break; + //TODO + // case EFFECT_SHELL_TRAP: + // case EFFECT_BEAK_BLAST: + case EFFECT_NATURE_POWER: + return AI_CheckBadMove(battlerAtk, battlerDef, GetNaturePowerMove(), originalScore); + case EFFECT_CHARGE: + if (gStatuses3[battlerAtk] & STATUS3_CHARGED_UP) + { + score -= 10; + break; + } + else if (!HasMoveWithType(battlerAtk, TYPE_ELECTRIC)) + { + if (atkAbility == ABILITY_CONTRARY || !BattlerStatCanRise(battlerAtk, atkAbility, STAT_SPDEF)) + score -= 10; + } + break; + case EFFECT_TAUNT: + if (gDisableStructs[battlerDef].tauntTimer > 0 + || DoesPartnerHaveSameMoveEffect(battlerAtkPartner, battlerDef, move, partnerMove)) + score--; + break; + case EFFECT_FOLLOW_ME: + case EFFECT_HELPING_HAND: + if (!IsValidDoubleBattle(battlerAtk) + || !IsBattlerAlive(battlerAtkPartner) + || PartnerHasSameMoveEffectWithoutTarget(battlerAtkPartner, move, partnerMove) + || (partnerMove != MOVE_NONE && IS_MOVE_STATUS(partnerMove)) + || *(gBattleStruct->monToSwitchIntoId + battlerAtkPartner) != PARTY_SIZE) //Partner is switching out. + score -= 10; + break; + case EFFECT_TRICK: + if ((atkHoldEffect == HOLD_EFFECT_NONE && defHoldEffect == HOLD_EFFECT_NONE) + || defAbility == ABILITY_STICKY_HOLD + || !CanBattlerGetOrLoseItem(battlerAtk, gBattleMons[battlerAtk].item) + || !CanBattlerGetOrLoseItem(battlerAtk, gBattleMons[battlerDef].item) + || !CanBattlerGetOrLoseItem(battlerDef, gBattleMons[battlerAtk].item) + || !CanBattlerGetOrLoseItem(battlerDef, gBattleMons[battlerDef].item)) + score -= 10; // kinda cheating with battlerDef item check, but only item effects recorded + break; + case EFFECT_BESTOW: + if (atkHoldEffect == HOLD_EFFECT_NONE + || !CanBattlerGetOrLoseItem(battlerAtk, gBattleMons[battlerAtk].item)) // AI knows its own item + score -= 10; + break; + case EFFECT_ROLE_PLAY: + if (atkAbility == defAbility + || defAbility == ABILITY_NONE + || IsRolePlayBannedAbilityAtk(atkAbility) + || IsRolePlayBannedAbility(defAbility)) + score -= 10; + break; + case EFFECT_WISH: + if (gWishFutureKnock.wishCounter[battlerAtk] != 0) + score -= 10; + break; + case EFFECT_ASSIST: + if (CountUsablePartyMons(battlerAtk) == 1) + score -= 10; // no teammates to assist from + break; + case EFFECT_INGRAIN: + if (gStatuses3[battlerAtk] & STATUS3_ROOTED) + score -= 10; + break; + case EFFECT_AQUA_RING: + if (gStatuses3[battlerAtk] & STATUS3_AQUA_RING) + score -= 10; + break; + case EFFECT_SUPERPOWER: + #ifdef POKEMON_EXPANSION + if (move == MOVE_HYPERSPACE_FURY && gBattleMons[battlerAtk].species != SPECIES_HOOPA_UNBOUND) + score -= 10; + #endif + break; + case EFFECT_MAGIC_COAT: + if (!TestMoveFlagsInMoveset(battlerDef, FLAG_MAGICCOAT_AFFECTED)) + score -= 10; + break; + case EFFECT_RECYCLE: + if (gBattleStruct->usedHeldItems[battlerAtk] == 0 || gBattleMons[battlerAtk].item != 0) + score -= 10; + break; + case EFFECT_BELCH: + if (ItemId_GetPocket(gBattleStruct->usedHeldItems[battlerAtk]) != POCKET_BERRIES) + score -= 10; // attacker has not consumed a berry + break; + case EFFECT_YAWN: + if (gStatuses3[battlerDef] & STATUS3_YAWN) + score -= 10; + else if (!AI_ShouldPutToSleep(battlerAtk, battlerDef, defAbility, move, partnerMove)) + score -= 10; + break; + case EFFECT_KNOCK_OFF: + /*if (defHoldEffect == HOLD_EFFECT_ASSAULT_VEST + || (defHoldEffect == HOLD_EFFECT_CHOICE_BAND && atkAbility != ABILITY_GORILLA_TACTICS && gBattleStruct->choicedMove[battlerDef])) + { + if (GetStrongestMove(battlerDef, battlerAtk) == MOVE_NONE + || AI_SpecialTypeCalc(GetStrongestMove(battlerDef, battlerAtk), battlerDef, battlerAtk) & (MOVE_RESULT_NO_EFFECT | MOVE_RESULT_MISSED)) + DECREASE_VIABILITY(9); //Don't use Knock Off is the enemy's only moves don't affect the AI + }*/ + if (defHoldEffect == HOLD_EFFECT_NONE) + score -= 4; + break; + case EFFECT_SKILL_SWAP: + if (atkAbility == ABILITY_NONE || defAbility == ABILITY_NONE + || IsSkillSwapBannedAbility(atkAbility) || IsSkillSwapBannedAbility(defAbility)) + score -= 10; + break; + case EFFECT_WORRY_SEED: + if (defAbility == ABILITY_INSOMNIA + || IsWorrySeedBannedAbility(defAbility)) + score -= 10; + break; + case EFFECT_GASTRO_ACID: + if (gStatuses3[battlerDef] & STATUS3_GASTRO_ACID + || IsGastroAcidBannedAbility(defAbility)) + score -= 10; + break; + case EFFECT_ENTRAINMENT: + if (atkAbility == ABILITY_NONE + || IsEntrainmentBannedAbilityAttacker(atkAbility) + || IsEntrainmentTargetOrSimpleBeamBannedAbility(defAbility)) + score -= 10; + break; + case EFFECT_CORE_ENFORCER: + break; + case EFFECT_SIMPLE_BEAM: + if (defAbility == ABILITY_SIMPLE + || IsEntrainmentTargetOrSimpleBeamBannedAbility(defAbility)) + score -= 10; + break; + case EFFECT_IMPRISON: + if (gStatuses3[battlerAtk] & STATUS3_IMPRISONED_OTHERS) + score -= 10; + break; + case EFFECT_REFRESH: + if (!(gBattleMons[battlerDef].status1 & (STATUS1_PSN_ANY | STATUS1_BURN | STATUS1_PARALYSIS))) + score -= 10; + break; + case EFFECT_PSYCHO_SHIFT: + if (gBattleMons[battlerAtk].status1 & STATUS1_PSN_ANY && !AI_ShouldPoison(battlerAtk, battlerDef, defAbility, move, partnerMove)) + score -= 10; + else if (gBattleMons[battlerAtk].status1 & STATUS1_BURN && !AI_CanBurn(battlerAtk, battlerDef, defAbility, battlerAtkPartner, move, partnerMove)) + score -= 10; + else if (gBattleMons[battlerAtk].status1 & STATUS1_PARALYSIS && !AI_CanParalyze(battlerAtk, battlerDef, defAbility, move, partnerMove)) + score -= 10; + else if (gBattleMons[battlerAtk].status1 & STATUS1_SLEEP && !AI_ShouldPutToSleep(battlerAtk, battlerDef, defAbility, move, partnerMove)) + score -= 10; + else + score -= 10; + break; + case EFFECT_SNATCH: + if (!TestMoveFlagsInMoveset(battlerDef, FLAG_SNATCH_AFFECTED) + || PartnerHasSameMoveEffectWithoutTarget(battlerAtkPartner, move, partnerMove)) + score -= 10; + break; + case EFFECT_MUD_SPORT: + if (gFieldStatuses & STATUS_FIELD_MUDSPORT + || PartnerHasSameMoveEffectWithoutTarget(battlerAtkPartner, move, partnerMove)) + score -= 10; + break; + case EFFECT_WATER_SPORT: + if (gFieldStatuses & STATUS_FIELD_WATERSPORT + || PartnerHasSameMoveEffectWithoutTarget(battlerAtkPartner, move, partnerMove)) + score -= 10; + break; + case EFFECT_TICKLE: + if ((defAbility == ABILITY_CONTRARY) && !targetSameSide) + score -= 10; + else if ((gBattleMons[battlerDef].statStages[STAT_ATK] == MIN_STAT_STAGE || !HasMoveWithSplit(battlerDef, SPLIT_PHYSICAL)) + && gBattleMons[battlerDef].statStages[STAT_DEF] == MIN_STAT_STAGE) + score -= 10; + break; + case EFFECT_COSMIC_POWER: + if (atkAbility == ABILITY_CONTRARY) + score -= 10; + else if (gBattleMons[battlerAtk].statStages[STAT_DEF] >= MAX_STAT_STAGE + && gBattleMons[battlerAtk].statStages[STAT_SPDEF] >= MAX_STAT_STAGE) + score -= 10; + break; + // TODO + /*case EFFECT_NO_RETREAT: + if (TrappedByNoRetreat(battlerAtk)) + score -= 10; + break; + case EFFECT_EXTREME_EVOBOOST: + if (MainStatsMaxed(battlerAtk)) + score -= 10; + break; + case EFFECT_CLANGOROUS_SOUL: + if (gBattleMons[battlerAtk].hp <= gBattleMons[battlerAtk].maxHP / 3) + score -= 10; + break;*/ + case EFFECT_BULK_UP: + if (atkAbility == ABILITY_CONTRARY) + score -= 10; + else if ((gBattleMons[battlerAtk].statStages[STAT_ATK] >= MAX_STAT_STAGE && !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + && gBattleMons[battlerAtk].statStages[STAT_DEF] >= MAX_STAT_STAGE) + score -= 10; + break; + case EFFECT_COIL: + if (atkAbility == ABILITY_CONTRARY) + score -= 10; + else if (gBattleMons[battlerAtk].statStages[STAT_ACC] >= MAX_STAT_STAGE + && (gBattleMons[battlerAtk].statStages[STAT_ATK] >= MAX_STAT_STAGE && !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + && gBattleMons[battlerAtk].statStages[STAT_DEF] >= MAX_STAT_STAGE) + score -= 10; + break; + case EFFECT_CALM_MIND: + if (atkAbility == ABILITY_CONTRARY) + score -= 10; + else if ((gBattleMons[battlerAtk].statStages[STAT_SPATK] >= MAX_STAT_STAGE || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) + && gBattleMons[battlerAtk].statStages[STAT_SPDEF] >= MAX_STAT_STAGE) + score -= 10; + break; + case EFFECT_QUIVER_DANCE: + case EFFECT_GEOMANCY: + if (atkAbility == ABILITY_CONTRARY) + score -= 10; + else if (gBattleMons[battlerAtk].statStages[STAT_SPEED] >= MAX_STAT_STAGE + && (gBattleMons[battlerAtk].statStages[STAT_SPATK] >= MAX_STAT_STAGE || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) + && gBattleMons[battlerAtk].statStages[STAT_SPDEF] >= MAX_STAT_STAGE) + score -= 10; + break; + case EFFECT_DRAGON_DANCE: + case EFFECT_SHIFT_GEAR: + if (atkAbility == ABILITY_CONTRARY) + score -= 10; + else if ((gBattleMons[battlerAtk].statStages[STAT_ATK] >= MAX_STAT_STAGE || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + && (gBattleMons[battlerAtk].statStages[STAT_SPEED] >= MAX_STAT_STAGE)) + score -= 10; + break; + case EFFECT_SHELL_SMASH: + if (atkAbility == ABILITY_CONTRARY) + { + if (gBattleMons[battlerAtk].statStages[STAT_DEF] >= MAX_STAT_STAGE + && gBattleMons[battlerAtk].statStages[STAT_SPDEF] >= MAX_STAT_STAGE) + score -= 10; + } + else + { + if ((gBattleMons[battlerAtk].statStages[STAT_SPATK] >= MAX_STAT_STAGE || !HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL)) + && (gBattleMons[battlerAtk].statStages[STAT_ATK] >= MAX_STAT_STAGE || !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + && (gBattleMons[battlerAtk].statStages[STAT_SPEED] >= MAX_STAT_STAGE)) + score -= 10; + } + break; + + case EFFECT_POWER_TRICK: + if (targetSameSide) + score -= 10; + else if (gBattleMons[battlerAtk].defense >= gBattleMons[battlerAtk].attack && !HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL)) + score -= 10; + break; + case EFFECT_POWER_SWAP: // Don't use if attacker's stat stages are higher than opponents + if (targetSameSide) + score -= 10; + else if (gBattleMons[battlerAtk].statStages[STAT_ATK] >= gBattleMons[battlerDef].statStages[STAT_ATK] + && gBattleMons[battlerAtk].statStages[STAT_SPATK] >= gBattleMons[battlerDef].statStages[STAT_SPATK]) + score -= 10; + break; + case EFFECT_GUARD_SWAP: // Don't use if attacker's stat stages are higher than opponents + if (targetSameSide) + score -= 10; + else if (gBattleMons[battlerAtk].statStages[STAT_DEF] >= gBattleMons[battlerDef].statStages[STAT_DEF] + && gBattleMons[battlerAtk].statStages[STAT_SPDEF] >= gBattleMons[battlerDef].statStages[STAT_SPDEF]) + score -= 10; + break; + case EFFECT_SPEED_SWAP: + if (targetSameSide) + { + score -= 10; + } + else + { + if (gFieldStatuses & STATUS_FIELD_TRICK_ROOM && (gBattleMons[battlerAtk].speed <= gBattleMons[battlerDef].speed)) + score -= 10; + else if (gBattleMons[battlerAtk].speed >= gBattleMons[battlerDef].speed) + score -= 10; + } + break; + case EFFECT_HEART_SWAP: + if (targetSameSide) + { + score -= 10; + } + else + { + u32 atkPositiveStages = CountPositiveStatStages(battlerAtk); + u32 atkNegativeStages = CountNegativeStatStages(battlerAtk); + u32 defPositiveStages = CountPositiveStatStages(battlerDef); + u32 defNegativeStages = CountNegativeStatStages(battlerDef); + + if (atkPositiveStages >= defPositiveStages && atkNegativeStages <= defNegativeStages) + score -= 10; + break; + } + break; + case EFFECT_POWER_SPLIT: + if (targetSameSide) + { + score -= 10; + } + else + { + u8 atkAttack = gBattleMons[battlerAtk].attack; + u8 defAttack = gBattleMons[battlerDef].attack; + u8 atkSpAttack = gBattleMons[battlerAtk].spAttack; + u8 defSpAttack = gBattleMons[battlerDef].spAttack; + + if (atkAttack + atkSpAttack >= defAttack + defSpAttack) // Combined attacker stats are > than combined target stats + score -= 10; + break; + } + break; + case EFFECT_GUARD_SPLIT: + if (targetSameSide) + { + score -= 10; + } + else + { + u8 atkDefense = gBattleMons[battlerAtk].defense; + u8 defDefense = gBattleMons[battlerDef].defense; + u8 atkSpDefense = gBattleMons[battlerAtk].spDefense; + u8 defSpDefense = gBattleMons[battlerDef].spDefense; + + if (atkDefense + atkSpDefense >= defDefense + defSpDefense) //Combined attacker stats are > than combined target stats + score -= 10; + break; + } + break; + case EFFECT_ME_FIRST: + //TODO - predicted move + /*if (predictedMove != MOVE_NONE) + { + if (!MoveWouldHitFirst(move, battlerAtk, battlerDef)) + score -= 10; + else + return AIScript_Negatives(battlerAtk, battlerDef, predictedMove, originalViability, data); + } + else //Target is predicted to switch most likely + score -= 10;*/ + break; + case EFFECT_NATURAL_GIFT: + if (atkAbility == ABILITY_KLUTZ + || gFieldStatuses & STATUS_FIELD_MAGIC_ROOM + || GetPocketByItemId(gBattleMons[battlerAtk].item) != POCKET_BERRIES) + score -= 10; + break; + case EFFECT_GRASSY_TERRAIN: + if (PartnerMoveEffectIsTerrain(battlerAtkPartner, partnerMove) || gFieldStatuses & STATUS_FIELD_GRASSY_TERRAIN) + score -= 10; + break; + case EFFECT_ELECTRIC_TERRAIN: + if (PartnerMoveEffectIsTerrain(battlerAtkPartner, partnerMove) || gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN) + score -= 10; + break; + case EFFECT_PSYCHIC_TERRAIN: + if (PartnerMoveEffectIsTerrain(battlerAtkPartner, partnerMove) || gFieldStatuses & STATUS_FIELD_PSYCHIC_TERRAIN) + score -= 10; + break; + case EFFECT_MISTY_TERRAIN: + if (PartnerMoveEffectIsTerrain(battlerAtkPartner, partnerMove) || gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN) + score -= 10; + break; + case EFFECT_PLEDGE: + if (IsValidDoubleBattle(battlerAtk) && gBattleMons[battlerAtkPartner].hp > 0) + { + if (partnerMove != MOVE_NONE + && gBattleMoves[partnerMove].effect == EFFECT_PLEDGE + && move != partnerMove) // Different pledge moves + { + if (gBattleMons[battlerAtkPartner].status1 & (STATUS1_SLEEP | STATUS1_FREEZE)) + // && gBattleMons[battlerAtkPartner].status1 != 1) // Will wake up this turn - how would AI know + score -= 10; // Don't use combo move if your partner will cause failure + } + } + break; + case EFFECT_TRICK_ROOM: + if (PartnerMoveIs(battlerAtkPartner, partnerMove, MOVE_TRICK_ROOM)) + { + score -= 10; + } + else if (gFieldStatuses & STATUS_FIELD_TRICK_ROOM) // Trick Room Up + { + if (GetBattlerSideSpeedAverage(battlerAtk) < GetBattlerSideSpeedAverage(battlerDef)) // Attacker side slower than target side + score -= 10; // Keep the Trick Room up + } + else + { + if (GetBattlerSideSpeedAverage(battlerAtk) > GetBattlerSideSpeedAverage(battlerDef)) // Attacker side faster than target side + score -= 10; // Keep the Trick Room down + } + break; + case EFFECT_MAGIC_ROOM: + if (gFieldStatuses & STATUS_FIELD_MAGIC_ROOM || PartnerMoveIsSameNoTarget(battlerAtkPartner, move, partnerMove)) + score -= 10; + break; + case EFFECT_WONDER_ROOM: + if (gFieldStatuses & STATUS_FIELD_WONDER_ROOM || PartnerMoveIsSameNoTarget(battlerAtkPartner, move, partnerMove)) + score -= 10; + break; + case EFFECT_GRAVITY: + if ((gFieldStatuses & STATUS_FIELD_GRAVITY + && !IS_BATTLER_OF_TYPE(battlerAtk, TYPE_FLYING) + && atkHoldEffect != HOLD_EFFECT_AIR_BALLOON) // Should revert Gravity in this case + || PartnerMoveIsSameNoTarget(battlerAtkPartner, move, partnerMove)) + score -= 10; + break; + case EFFECT_ION_DELUGE: + if (gFieldStatuses & STATUS_FIELD_ION_DELUGE + || PartnerMoveIsSameNoTarget(battlerAtkPartner, move, partnerMove)) + score -= 10; + break; + //TODO + //case EFFECT_PLASMA_FISTS: + //break; + case EFFECT_FLING: + if (!CanFling(battlerAtk)) + score -= 10; + else + { + /* TODO + u8 effect = gFlingTable[gBattleMons[battlerAtk].item].effect; + switch (effect) + { + case MOVE_EFFECT_BURN: + if (!AI_CanBurn(battlerAtk, battlerDef, battlerAtkPartner, move, partnerMove)) + score -= 10; + break; + case MOVE_EFFECT_PARALYSIS: + if (!AI_CanParalyze(battlerAtk, battlerDef, defAbility, move, partnerMove)) + score -= 10; + break; + case MOVE_EFFECT_POISON: + if (!AI_ShouldPoison(battlerAtk, battlerDef, defAbility, move, partnerMove)) + score -= 10; + break; + case MOVE_EFFECT_TOXIC: + if (!AI_ShouldPoison(battlerAtk, battlerDef, defAbility, move, partnerMove)) + score -= 10; + break; + case MOVE_EFFECT_FREEZE: + if (!CanBeFrozen(battlerDef, TRUE) + || MoveBlockedBySubstitute(move, battlerAtk, battlerDef)) + score -= 10; + break; + }*/ + } + break; + case EFFECT_EMBARGO: + if (defAbility == ABILITY_KLUTZ + || gFieldStatuses & STATUS_FIELD_MAGIC_ROOM + || gDisableStructs[battlerDef].embargoTimer != 0 + || PartnerMoveIsSameAsAttacker(battlerAtkPartner, battlerDef, move, partnerMove)) + score -= 10; + break; + case EFFECT_POWDER: + if (!HasMoveWithType(battlerDef, TYPE_FIRE) + || PartnerMoveIsSameAsAttacker(battlerAtkPartner, battlerDef, move, partnerMove)) + score -= 10; + break; + case EFFECT_TELEKINESIS: + if (gStatuses3[battlerDef] & (STATUS3_TELEKINESIS | STATUS3_ROOTED | STATUS3_SMACKED_DOWN) + || gFieldStatuses & STATUS_FIELD_GRAVITY + || defHoldEffect == HOLD_EFFECT_IRON_BALL + || IsTelekinesisBannedSpecies(gBattleMons[battlerDef].species) + || PartnerMoveIsSameAsAttacker(battlerAtkPartner, battlerDef, move, partnerMove)) + score -= 10; + break; + case EFFECT_THROAT_CHOP: + break; + case EFFECT_HEAL_BLOCK: + if (gDisableStructs[battlerDef].healBlockTimer != 0 + || PartnerMoveIsSameAsAttacker(battlerAtkPartner, battlerDef, move, partnerMove)) + score -= 10; + break; + case EFFECT_SOAK: + if (PartnerMoveIsSameAsAttacker(battlerAtkPartner, battlerDef, move, partnerMove) + || (gBattleMons[battlerDef].type1 == TYPE_WATER + && gBattleMons[battlerDef].type2 == TYPE_WATER + && gBattleMons[battlerDef].type3 == TYPE_MYSTERY)) + score -= 10; // target is already water-only + break; + case EFFECT_THIRD_TYPE: + switch (move) + { + case MOVE_TRICK_OR_TREAT: + if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST) || PartnerMoveIsSameAsAttacker(battlerAtkPartner, battlerDef, move, partnerMove)) + score -= 10; + break; + case MOVE_FORESTS_CURSE: + if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_GRASS) || PartnerMoveIsSameAsAttacker(battlerAtkPartner, battlerDef, move, partnerMove)) + score -= 10; + break; + } + break; + case EFFECT_HIT_ENEMY_HEAL_ALLY: // pollen puff + if (targetSameSide) + { + if (GetHealthPercentage(battlerDef) == 100) + score -= 10; + else if (gBattleMons[battlerDef].hp > gBattleMons[battlerDef].maxHP / 2) + score -= 5; + break; + } + // fallthrough + case EFFECT_HEAL_PULSE: // and floral healing + if (!targetSameSide) // Don't heal enemies + { + score -= 10; + } + else + { + if (GetHealthPercentage(battlerDef) == 100) + score -= 10; + else if (gBattleMons[battlerDef].hp > gBattleMons[battlerDef].maxHP / 2) + score -= 5; + } + break; + case EFFECT_ELECTRIFY: + if (GetWhoStrikesFirst(battlerAtk, battlerDef, TRUE) == 0 + //|| GetMoveTypeSpecial(battlerDef, predictedMove) == TYPE_ELECTRIC // Move will already be electric type + || PartnerMoveIsSameAsAttacker(battlerAtkPartner, battlerDef, move, partnerMove)) + score -= 10; + break; + case EFFECT_TOPSY_TURVY: + if (!targetSameSide) + { + u8 targetPositiveStages = CountPositiveStatStages(battlerDef); + u8 targetNegativeStages = CountNegativeStatStages(battlerDef); + + if (targetPositiveStages == 0 //No good stat changes to make bad + || PartnerMoveIsSameAsAttacker(battlerAtkPartner, battlerDef, move, partnerMove)) + score -= 10; + + else if (targetNegativeStages < targetPositiveStages) + score -= 5; //More stages would be made positive than negative + } + break; + case EFFECT_FAIRY_LOCK: + if ((gFieldStatuses & STATUS_FIELD_FAIRY_LOCK) || PartnerMoveIsSameNoTarget(battlerAtkPartner, move, partnerMove)) + score -= 10; + break; + case EFFECT_DO_NOTHING: + score -= 10; + break; + case EFFECT_INSTRUCT: + { + u16 instructedMove; + if (GetWhoStrikesFirst(battlerAtk, battlerDef, TRUE) == 1) + instructedMove = MOVE_NONE; //TODO instructedMove = predictedMove; + else + instructedMove = gLastMoves[battlerDef]; + + if (instructedMove == MOVE_NONE + || IsInstructBannedMove(instructedMove) + || MoveRequiresRecharging(instructedMove) + || MoveCallsOtherMove(instructedMove) + #ifdef ITEM_Z_RING + || (IsZMove(instructedMove)) + #endif + || (gLockedMoves[battlerDef] != 0 && gLockedMoves[battlerDef] != 0xFFFF) + || gBattleMons[battlerDef].status2 & STATUS2_MULTIPLETURNS + || PartnerMoveIsSameAsAttacker(battlerAtkPartner, battlerDef, move, partnerMove)) + { + score -= 10; + } + else if (IsValidDoubleBattle(battlerAtk)) + { + if (!targetSameSide) + score -= 10; + } + else + { + if (gBattleMoves[instructedMove].target & (MOVE_TARGET_SELECTED + | MOVE_TARGET_DEPENDS + | MOVE_TARGET_RANDOM + | MOVE_TARGET_BOTH + | MOVE_TARGET_FOES_AND_ALLY + | MOVE_TARGET_OPPONENTS_FIELD) + && instructedMove != MOVE_MIND_BLOWN && instructedMove != MOVE_STEEL_BEAM) + score -= 10; //Don't force the enemy to attack you again unless it can kill itself with Mind Blown + else if (instructedMove != MOVE_MIND_BLOWN) + score -= 5; //Do something better + } + } + break; + case EFFECT_QUASH: + if (!IsValidDoubleBattle(battlerAtk) + || GetWhoStrikesFirst(battlerAtk, battlerDef, TRUE) == 1 + || PartnerMoveIsSameAsAttacker(battlerAtkPartner, battlerDef, move, partnerMove)) + score -= 10; + break; + case EFFECT_AFTER_YOU: + if (!targetSameSide + || !IsValidDoubleBattle(battlerAtk) + || GetWhoStrikesFirst(battlerAtk, battlerDef, TRUE) == 1 + || PartnerMoveIsSameAsAttacker(battlerAtkPartner, battlerDef, move, partnerMove)) + score -= 10; + break; + case EFFECT_SUCKER_PUNCH: + /*TODO predicted move + if (predictedMove != MOVE_NONE) + { + if (IS_MOVE_STATUS(predictedMove) + || GetWhoStrikesFirst(battlerAtk, battlerDef, TRUE) == 1 + { + score -= 10; + break; + } + }*/ + break; + case EFFECT_TAILWIND: + if (gSideTimers[GetBattlerSide(battlerAtk)].tailwindTimer != 0 + || PartnerMoveIs(battlerAtkPartner, partnerMove, MOVE_TAILWIND) + || (gFieldStatuses & STATUS_FIELD_TRICK_ROOM && gFieldTimers.trickRoomTimer > 1)) // Trick Room active and not ending this turn + score -= 10; + break; + case EFFECT_LUCKY_CHANT: + if (gSideTimers[GET_BATTLER_SIDE(battlerAtk)].luckyChantTimer != 0 + || PartnerMoveIsSameNoTarget(battlerAtkPartner, move, partnerMove)) + score -= 10; + break; + case EFFECT_MAGNET_RISE: + if (gFieldStatuses & STATUS_FIELD_GRAVITY + || gDisableStructs[battlerAtk].magnetRiseTimer != 0 + || atkHoldEffect == HOLD_EFFECT_IRON_BALL + || gStatuses3[battlerAtk] & (STATUS3_ROOTED | STATUS3_MAGNET_RISE | STATUS3_SMACKED_DOWN) + || !IsBattlerGrounded(battlerAtk)) + score -= 10; + break; + case EFFECT_CAMOUFLAGE: + if (!CanCamouflage(battlerAtk)) + score -= 10; + break; + case EFFECT_LAST_RESORT: + if (!CanUseLastResort(battlerAtk)) + score -= 10; + break; + //TODO + /*case EFFECT_SKY_DROP: + if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_FLYING)) + score -= 10; + if (WillFaintFromWeather(battlerAtk) + || MoveBlockedBySubstitute(move, battlerAtk, battlerDef) + || GetSpeciesWeight(gBattleMons[battlerDef].species, defAbility, defHoldEffect, battlerDef, TRUE) >= 2000) //200.0 kg + score -= 10; + break; + */ + case EFFECT_SYNCHRONOISE: + //Check holding ring target or is of same type + if (defHoldEffect == HOLD_EFFECT_RING_TARGET + || IS_BATTLER_OF_TYPE(battlerDef, gBattleMons[battlerAtk].type1) + || IS_BATTLER_OF_TYPE(battlerDef, gBattleMons[battlerAtk].type2) + || IS_BATTLER_OF_TYPE(battlerDef, gBattleMons[battlerAtk].type3)) + break; + else + score -= 10; + break; + + } // move effect checks + + // substitute check + if (IS_MOVE_STATUS(move) && DoesSubstituteBlockMove(battlerAtk, battlerDef, move)) + score -= 10; + + // damage check + if (!IS_MOVE_STATUS(move)) + { + if (gMoveResultFlags & (MOVE_RESULT_NO_EFFECT | MOVE_RESULT_MISSED)) + score -= 15; + + if (effectiveness < AI_EFFECTIVENESS_x1) + score -= 4; + } + + // helping hand check + if (IsValidDoubleBattle(battlerAtk) && partnerMove != MOVE_NONE + && gBattleMoves[partnerMove].effect == EFFECT_HELPING_HAND + && IS_MOVE_STATUS(move)) + score -= 10; //Don't use a status move if partner wants to help + + if (score < 0) + return 0; //essentially 'dont use this move' + + return score; } static u8 AI_TryToFaint(u8 battlerAtk, u8 battlerDef, u16 move, u8 originalScore) { s32 dmg; u8 result; - u8 score = originalScore; + s16 score = originalScore; - if (GetBattlerSide(battlerAtk) == GetBattlerSide(battlerDef)) - return originalScore; // don't try to faint your ally + if (IsTargetingPartner(battlerAtk, battlerDef)) + return originalScore; // don't try to faint your ally ever if (gBattleMoves[AI_THINKING_STRUCT->moveConsidered].power == 0) return originalScore; // can't make anything faint with no power - - dmg = AI_THINKING_STRUCT->simulatedDmg[sBattler_AI][gBattlerTarget][AI_THINKING_STRUCT->movesetIndex]; - if (gBattleMons[gBattlerTarget].hp <= dmg && gBattleMoves[move].effect != EFFECT_EXPLOSION) + + if (CanAttackerFaintTarget(battlerAtk, battlerDef, AI_THINKING_STRUCT->movesetIndex) && gBattleMoves[move].effect != EFFECT_EXPLOSION) { // AI_TryToFaint_Can - if (IsBattlerFaster(AI_CHECK_FASTER) || gBattleMoves[move].flags & FLAG_HIGH_CRIT) + if (IsBattlerFaster(AI_CHECK_FASTER) || TestMoveFlags(move, FLAG_HIGH_CRIT)) score += 4; else score += 2; @@ -2541,7 +4431,7 @@ static u8 AI_TryToFaint(u8 battlerAtk, u8 battlerDef, u16 move, u8 originalScore if (GetMovePowerResult(move) == MOVE_POWER_DISCOURAGED) return (score - 1); - if (GetMoveEffectiveness(move) == AI_EFFECTIVENESS_x4) + if (AI_GetMoveEffectiveness(move) == AI_EFFECTIVENESS_x4) { // AI_TryToFaint_DoubleSuperEffective if ((Random() % 256) >= 80) @@ -2550,7 +4440,7 @@ static u8 AI_TryToFaint(u8 battlerAtk, u8 battlerDef, u16 move, u8 originalScore } //AI_TryToFaint_CheckIfDanger - if (!IsBattlerFaster(AI_CHECK_FASTER) && CanTargetFaintAi()) + if (!IsBattlerFaster(AI_CHECK_FASTER) && CanTargetFaintAi(battlerDef, battlerAtk)) { // AI_TryToFaint_Danger if (GetMovePowerResult(move) != MOVE_POWER_BEST) score--; @@ -2563,6 +4453,7 @@ static u8 AI_TryToFaint(u8 battlerAtk, u8 battlerDef, u16 move, u8 originalScore static u8 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, u8 originalScore) { + } static u8 AI_SetupFirstTurn(u8 battlerAtk, u8 battlerDef, u16 move, u8 originalScore) @@ -2612,20 +4503,20 @@ static u8 AI_Safari(u8 battlerAtk, u8 battlerDef, u16 move, u8 originalScore) { u8 safariFleeRate = gBattleStruct->safariEscapeFactor * 5; // Safari flee rate, from 0-20. - if ((Random() % 100) < safariFleeRate) - AI_Flee(); - else - AI_Watch(); + if ((Random() % 100) < safariFleeRate) + AI_Flee(); + else + AI_Watch(); - return originalScore; + return originalScore; } static u8 AI_FirstBattle(u8 battlerAtk, u8 battlerDef, u16 move, u8 originalScore) { if (GetHealthPercentage(battlerDef) <= 20) - AI_Flee(); + AI_Flee(); - return originalScore; + return originalScore; } diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 3a62c02b5..0fa9509a1 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -35,6 +35,76 @@ static const u16 sDiscouragedPowerfulMoveEffects[] = 0xFFFF }; +static const u16 sIgnoreMoldBreakerMoves[] = +{ + MOVE_MOONGEIST_BEAM, + MOVE_SUNSTEEL_STRIKE, + MOVE_PHOTON_GEYSER, + #ifdef MOVE_LIGHT_THAT_BURNS_THE_SKY + MOVE_LIGHT_THAT_BURNS_THE_SKY, + #endif + #ifdef MOVE_MENACING_MOONRAZE_MAELSTROM + MOVE_MENACING_MOONRAZE_MAELSTROM, + #endif + #ifdef MOVE_SEARING_SUNRAZE_SMASH + MOVE_SEARING_SUNRAZE_SMASH, + #endif +}; + +static const u16 sInstructBannedMoves[] = +{ + MOVE_INSTRUCT, + MOVE_BIDE, + MOVE_FOCUS_PUNCH, + MOVE_BEAK_BLAST, + MOVE_SHELL_TRAP, + MOVE_SKETCH, + MOVE_TRANSFORM, + MOVE_MIMIC, + MOVE_KINGS_SHIELD, + MOVE_STRUGGLE, + MOVE_BOUNCE, + MOVE_DIG, + MOVE_DIVE, + MOVE_FLY, + MOVE_FREEZE_SHOCK, + MOVE_GEOMANCY, + MOVE_ICE_BURN, + MOVE_PHANTOM_FORCE, + MOVE_RAZOR_WIND, + MOVE_SHADOW_FORCE, + MOVE_SKULL_BASH, + MOVE_SKY_ATTACK, + MOVE_SKY_DROP, + MOVE_SOLAR_BEAM, + MOVE_SOLAR_BLADE, +}; + +static const u16 sRechargeMoves[] = +{ + MOVE_HYPER_BEAM, + MOVE_BLAST_BURN, + MOVE_HYDRO_CANNON, + MOVE_FRENZY_PLANT, + MOVE_GIGA_IMPACT, + MOVE_ROCK_WRECKER, + MOVE_ROAR_OF_TIME, + MOVE_PRISMATIC_LASER, + MOVE_METEOR_ASSAULT, + MOVE_ETERNABEAM, +}; + +static const u16 sOtherMoveCallingMoves[] = +{ + MOVE_ASSIST, + MOVE_COPYCAT, + MOVE_ME_FIRST, + MOVE_METRONOME, + MOVE_MIRROR_MOVE, + MOVE_NATURE_POWER, + MOVE_SLEEP_TALK, +}; + // Functions void RecordLastUsedMoveByTarget(void) { @@ -171,38 +241,38 @@ void RestoreBattlerData(u8 battlerId) u32 GetHealthPercentage(u8 battlerId) { - return (u32)(100 * gBattleMons[battlerId].hp / gBattleMons[battlerId].maxHP); + return (u32)((100 * gBattleMons[battlerId].hp) / gBattleMons[battlerId].maxHP); } -bool32 IsBattlerTrapped(u8 battler, bool8 switching) +bool32 IsBattlerTrapped(u8 battler, bool8 checkSwitch) { - u8 holdEffect = GetBattlerHoldEffect(battler, TRUE); - if (IS_BATTLER_OF_TYPE(battler, TYPE_GHOST) - || (switching && holdEffect == HOLD_EFFECT_SHED_SHELL) - || (!switching && GetBattlerAbility(battler) == ABILITY_RUN_AWAY) - || (!switching && holdEffect == HOLD_EFFECT_CAN_ALWAYS_RUN)) + u8 holdEffect = AI_GetHoldEffect(battler); + if (IS_BATTLER_OF_TYPE(battler, TYPE_GHOST) + || (checkSwitch && holdEffect == HOLD_EFFECT_SHED_SHELL) + || (!checkSwitch && GetBattlerAbility(battler) == ABILITY_RUN_AWAY) + || (!checkSwitch && holdEffect == HOLD_EFFECT_CAN_ALWAYS_RUN)) { - return FALSE; + return FALSE; } - else - { - if (gBattleMons[battler].status2 & (STATUS2_ESCAPE_PREVENTION | STATUS2_WRAPPED) + else + { + if (gBattleMons[battler].status2 & (STATUS2_ESCAPE_PREVENTION | STATUS2_WRAPPED) || IsAbilityPreventingEscape(battler) - || gStatuses3[battler] & (STATUS3_ROOTED) // TODO: sky drop target in air - || (gFieldStatuses & STATUS_FIELD_FAIRY_LOCK)) - return TRUE; - } + || gStatuses3[battler] & (STATUS3_ROOTED) // TODO: sky drop target in air + || (gFieldStatuses & STATUS_FIELD_FAIRY_LOCK)) + return TRUE; + } - return FALSE; + return FALSE; } // Checks if one of the moves has side effects or perks static u32 WhichMoveBetter(u32 move1, u32 move2) { - s32 defAbility = AI_GetAbility(gBattlerTarget, FALSE); + s32 defAbility = AI_GetAbility(gBattlerTarget); // Check if physical moves hurt. - if (GetBattlerHoldEffect(sBattler_AI, TRUE) != HOLD_EFFECT_PROTECTIVE_PADS + if (AI_GetHoldEffect(sBattler_AI) != HOLD_EFFECT_PROTECTIVE_PADS && (BATTLE_HISTORY->itemEffects[gBattlerTarget] == HOLD_EFFECT_ROCKY_HELMET || defAbility == ABILITY_IRON_BARBS || defAbility == ABILITY_ROUGH_SKIN)) { @@ -354,7 +424,7 @@ u16 AI_GetTypeEffectiveness(u16 move, u8 battlerAtk, u8 battlerDef) return typeEffectiveness; } -u8 GetMoveEffectiveness(u16 move) +u8 AI_GetMoveEffectiveness(u16 move) { u8 damageVar; u32 effectivenessMultiplier; @@ -437,16 +507,16 @@ bool32 IsBattlerFaster(u8 battler) } // Check if target has means to faint ai mon. -bool32 CanTargetFaintAi(void) +bool32 CanTargetFaintAi(u8 battlerDef, u8 battlerAtk) { s32 i, dmg; - u32 unusable = CheckMoveLimitations(gBattlerTarget, 0, 0xFF & ~MOVE_LIMITATION_PP); - u16 *moves = gBattleResources->battleHistory->usedMoves[gBattlerTarget]; + u32 unusable = CheckMoveLimitations(battlerDef, 0, 0xFF & ~MOVE_LIMITATION_PP); + u16 *moves = gBattleResources->battleHistory->usedMoves[battlerDef]; for (i = 0; i < MAX_MON_MOVES; i++) { if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && !(unusable & gBitTable[i]) - && AI_CalcDamage(moves[i], gBattlerTarget, sBattler_AI) >= gBattleMons[sBattler_AI].hp) + && AI_CalcDamage(moves[i], battlerDef, battlerAtk) >= gBattleMons[battlerAtk].hp) { return TRUE; } @@ -455,13 +525,14 @@ bool32 CanTargetFaintAi(void) return FALSE; } -s32 AI_GetAbility(u32 battlerId, bool32 guess) +// does NOT include ability suppression checks +s32 AI_GetAbility(u32 battlerId) { // The AI knows its own ability. if (IsBattlerAIControlled(battlerId)) return gBattleMons[battlerId].ability; - if (BATTLE_HISTORY->abilities[battlerId] != 0) + if (BATTLE_HISTORY->abilities[battlerId] != ABILITY_NONE) return BATTLE_HISTORY->abilities[battlerId]; // Abilities that prevent fleeing. @@ -475,14 +546,1013 @@ s32 AI_GetAbility(u32 battlerId, bool32 guess) if (gBaseStats[gBattleMons[battlerId].species].abilities[1] != ABILITY_NONE) { // AI has no knowledge of opponent, so it guesses which ability. - if (guess) - return gBaseStats[gBattleMons[battlerId].species].abilities[Random() & 1]; + return gBaseStats[gBattleMons[battlerId].species].abilities[Random() & 1]; } else { return gBaseStats[gBattleMons[battlerId].species].abilities[0]; // It's definitely ability 1. } } - return -1; // Unknown. + return ABILITY_NONE; // Unknown. +} + +u16 AI_GetHoldEffect(u32 battlerId) +{ + u32 holdEffect; + + if (!IsBattlerAIControlled(battlerId)) + holdEffect = BATTLE_HISTORY->itemEffects[battlerId]; + else + holdEffect = GetBattlerHoldEffect(battlerId, FALSE); + + if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_NEGATE_AWARE) + { + if (gStatuses3[battlerId] & STATUS3_EMBARGO) + return HOLD_EFFECT_NONE; + if (gFieldStatuses & STATUS_FIELD_MAGIC_ROOM) + return HOLD_EFFECT_NONE; + if (AI_GetAbility(battlerId) == ABILITY_KLUTZ && !(gStatuses3[battlerId] & STATUS3_GASTRO_ACID)) + return HOLD_EFFECT_NONE; + } +} + +// different from IsBattlerGrounded in that we don't always know battler's hold effect or ability +bool32 AI_IsBattlerGrounded(u8 battlerId) +{ + u32 holdEffect = AI_GetHoldEffect(battlerId); + + if (holdEffect == HOLD_EFFECT_IRON_BALL) + return TRUE; + else if (gFieldStatuses & STATUS_FIELD_GRAVITY) + return TRUE; + else if (gStatuses3[battlerId] & STATUS3_ROOTED) + return TRUE; + else if (gStatuses3[battlerId] & STATUS3_SMACKED_DOWN) + return TRUE; + else if (gStatuses3[battlerId] & STATUS3_TELEKINESIS) + return FALSE; + else if (gStatuses3[battlerId] & STATUS3_MAGNET_RISE) + return FALSE; + else if (holdEffect == HOLD_EFFECT_AIR_BALLOON) + return FALSE; + else if (AI_GetAbility(battlerId) == ABILITY_LEVITATE) + return FALSE; + else if (IS_BATTLER_OF_TYPE(battlerId, TYPE_FLYING)) + return FALSE; + else + return TRUE; +} + +bool32 DoesBattlerIgnoreAbilityChecks(u16 atkAbility, u16 move) +{ + u32 i; + + if (!(AI_THINKING_STRUCT->aiFlags & AI_FLAG_NEGATE_AWARE)) + return FALSE; // AI doesn't understand ability suppression concept + + for (i = 0; i < ARRAY_COUNT(sIgnoreMoldBreakerMoves); i++) + { + if (move == sIgnoreMoldBreakerMoves[i]) + return TRUE; + } + + if (atkAbility == ABILITY_MOLD_BREAKER + || atkAbility == ABILITY_TERAVOLT + || atkAbility == ABILITY_TURBOBLAZE) + return TRUE; + + return FALSE; +} + +bool32 AI_WeatherHasEffect(void) +{ + if (!(AI_THINKING_STRUCT->aiFlags & AI_FLAG_NEGATE_AWARE)) + return FALSE; // AI doesn't understand ability suppression concept + + return WEATHER_HAS_EFFECT; +} + +bool32 IsAromaVeilProtectedMove(u16 move) +{ + u32 i; + + switch (move) + { + case MOVE_DISABLE: + case MOVE_ATTRACT: + case MOVE_ENCORE: + case MOVE_TORMENT: + case MOVE_TAUNT: + case MOVE_HEAL_BLOCK: + return TRUE; + default: + return FALSE; + } +} + +bool32 IsNonVolatileStatusMoveEffect(u16 moveEffect) +{ + switch (moveEffect) + { + case EFFECT_SLEEP: + case EFFECT_TOXIC: + case EFFECT_POISON: + case EFFECT_PARALYZE: + case EFFECT_WILL_O_WISP: + case EFFECT_YAWN: + return TRUE; + default: + return FALSE; + } +} + +bool32 IsConfusionMoveEffect(u16 moveEffect) +{ + switch (moveEffect) + { + case EFFECT_CONFUSE_HIT: + case EFFECT_SWAGGER: + case EFFECT_FLATTER: + case EFFECT_TEETER_DANCE: + return TRUE; + default: + return FALSE; + } +} + +bool32 IsStatLoweringMoveEffect(u16 moveEffect) +{ + switch (moveEffect) + { + case EFFECT_ATTACK_DOWN: + case EFFECT_DEFENSE_DOWN: + case EFFECT_SPEED_DOWN: + case EFFECT_SPECIAL_ATTACK_DOWN: + case EFFECT_SPECIAL_DEFENSE_DOWN: + case EFFECT_ACCURACY_DOWN: + case EFFECT_EVASION_DOWN: + case EFFECT_ATTACK_DOWN_2: + case EFFECT_DEFENSE_DOWN_2: + case EFFECT_SPEED_DOWN_2: + case EFFECT_SPECIAL_ATTACK_DOWN_2: + case EFFECT_SPECIAL_DEFENSE_DOWN_2: + case EFFECT_ACCURACY_DOWN_2: + case EFFECT_EVASION_DOWN_2: + return TRUE; + default: + return FALSE; + } +} + +bool32 IsHazardMoveEffect(u16 moveEffect) +{ + switch (moveEffect) + { + case EFFECT_SPIKES: + case EFFECT_TOXIC_SPIKES: + case EFFECT_STICKY_WEB: + case EFFECT_STEALTH_ROCK: + return TRUE; + default: + return FALSE; + } +} + +bool32 IsMoveRedirectionPrevented(u16 move, u16 atkAbility) +{ + if (!(AI_THINKING_STRUCT->aiFlags & AI_FLAG_NEGATE_AWARE)) + return FALSE; + + if (move == MOVE_SKY_DROP + || move == MOVE_SNIPE_SHOT + || atkAbility == ABILITY_PROPELLER_TAIL + || atkAbility == ABILITY_STALWART) + return TRUE; + return FALSE; +} + +// differs from GetTotalAccuracy in that we need to check AI history for item, ability, etc +u32 AI_GetMoveAccuracy(u8 battlerAtk, u8 battlerDef, u16 atkAbility, u16 defAbility, u8 atkHoldEffect, u8 defHoldEffect, u16 move) +{ + u32 calc, moveAcc, atkParam, defParam; + s8 buff, accStage, evasionStage; + + gPotentialItemEffectBattler = battlerDef; + accStage = gBattleMons[battlerAtk].statStages[STAT_ACC]; + evasionStage = gBattleMons[battlerDef].statStages[STAT_EVASION]; + if (atkAbility == ABILITY_UNAWARE) + evasionStage = DEFAULT_STAT_STAGE; + if (gBattleMoves[move].flags & FLAG_STAT_STAGES_IGNORED) + evasionStage = DEFAULT_STAT_STAGE; + if (defAbility == ABILITY_UNAWARE) + accStage = DEFAULT_STAT_STAGE; + + if (gBattleMons[battlerDef].status2 & STATUS2_FORESIGHT || gStatuses3[battlerDef] & STATUS3_MIRACLE_EYED) + buff = accStage; + else + buff = accStage + DEFAULT_STAT_STAGE - evasionStage; + + if (buff < MIN_STAT_STAGE) + buff = MIN_STAT_STAGE; + if (buff > MAX_STAT_STAGE) + buff = MAX_STAT_STAGE; + + moveAcc = gBattleMoves[move].accuracy; + // Check Thunder and Hurricane on sunny weather. + if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY + && (gBattleMoves[move].effect == EFFECT_THUNDER || gBattleMoves[move].effect == EFFECT_HURRICANE)) + moveAcc = 50; + // Check Wonder Skin. + if (defAbility == ABILITY_WONDER_SKIN && gBattleMoves[move].power == 0) + moveAcc = 50; + + calc = gAccuracyStageRatios[buff].dividend * moveAcc; + calc /= gAccuracyStageRatios[buff].divisor; + + if (atkAbility == ABILITY_COMPOUND_EYES) + calc = (calc * 130) / 100; // 1.3 compound eyes boost + else if (atkAbility == ABILITY_VICTORY_STAR) + calc = (calc * 110) / 100; // 1.1 victory star boost + if (IsBattlerAlive(BATTLE_PARTNER(battlerAtk)) && GetBattlerAbility(BATTLE_PARTNER(battlerAtk)) == ABILITY_VICTORY_STAR) + calc = (calc * 110) / 100; // 1.1 ally's victory star boost + + if (defAbility == ABILITY_SAND_VEIL && WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SANDSTORM_ANY) + calc = (calc * 80) / 100; // 1.2 sand veil loss + else if (defAbility == ABILITY_SNOW_CLOAK && WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_HAIL_ANY) + calc = (calc * 80) / 100; // 1.2 snow cloak loss + else if (defAbility == ABILITY_TANGLED_FEET && gBattleMons[battlerDef].status2 & STATUS2_CONFUSION) + calc = (calc * 50) / 100; // 1.5 tangled feet loss + + if (atkAbility == ABILITY_HUSTLE && IS_MOVE_PHYSICAL(move)) + calc = (calc * 80) / 100; // 1.2 hustle loss + + if (defHoldEffect == HOLD_EFFECT_EVASION_UP) + calc = (calc * (100 - defParam)) / 100; + + if (atkHoldEffect == HOLD_EFFECT_WIDE_LENS) + calc = (calc * (100 + atkParam)) / 100; + else if (atkHoldEffect == HOLD_EFFECT_ZOOM_LENS && GetBattlerTurnOrderNum(battlerAtk) > GetBattlerTurnOrderNum(battlerDef)); + calc = (calc * (100 + atkParam)) / 100; + + return calc; +} + +bool32 IsMoveEncouragedToHit(u8 battlerAtk, u8 battlerDef, u16 move) +{ + // never hits + if (gStatuses3[battlerDef] & (STATUS3_SEMI_INVULNERABLE)) + return FALSE; + + if ((gStatuses3[battlerDef] & STATUS3_PHANTOM_FORCE) + || (!TestMoveFlags(move, FLAG_HIT_IN_AIR) && gStatuses3[battlerDef] & STATUS3_ON_AIR) + || (!TestMoveFlags(move, FLAG_DMG_UNDERGROUND) && gStatuses3[battlerDef] & STATUS3_UNDERGROUND) + || (!TestMoveFlags(move, FLAG_DMG_UNDERWATER) && gStatuses3[battlerDef] & STATUS3_UNDERWATER)) + return FALSE; + + //TODO - anticipate protect move? + + // always hits + if (gStatuses3[battlerDef] & STATUS3_ALWAYS_HITS || gDisableStructs[battlerDef].battlerWithSureHit == battlerAtk) + return TRUE; + + if (AI_GetAbility(battlerDef) == ABILITY_NO_GUARD || AI_GetAbility(battlerAtk) == ABILITY_NO_GUARD) + return TRUE; + + if (B_TOXIC_NEVER_MISS >= GEN_6 && gBattleMoves[move].effect == EFFECT_TOXIC && IS_BATTLER_OF_TYPE(battlerAtk, TYPE_POISON)) + return TRUE; + + // discouraged from hitting + if (AI_WeatherHasEffect() && (gBattleWeather & WEATHER_SUN_ANY) + && (gBattleMoves[move].effect == EFFECT_THUNDER || gBattleMoves[move].effect == EFFECT_HURRICANE)) + return FALSE; + + // increased accuracy but don't always hit + if ((AI_WeatherHasEffect() && + (((gBattleWeather & WEATHER_RAIN_ANY) && (gBattleMoves[move].effect == EFFECT_THUNDER || gBattleMoves[move].effect == EFFECT_HURRICANE)) + || (((gBattleWeather & WEATHER_HAIL_ANY) && move == MOVE_BLIZZARD)))) + || (gBattleMoves[move].effect == EFFECT_VITAL_THROW) + || (gBattleMoves[move].accuracy == 0) + || ((B_MINIMIZE_DMG_ACC >= GEN_6) && (gStatuses3[battlerDef] & STATUS3_MINIMIZED) && (gBattleMoves[move].flags & FLAG_DMG_MINIMIZE))) + { + return TRUE; + } + + return FALSE; +} + +bool32 ShouldTryOHKO(u8 battlerAtk, u8 battlerDef, u16 atkAbility, u16 defAbility, u32 accuracy, u16 move) +{ + u32 holdEffect = AI_GetHoldEffect(battlerDef); + + gPotentialItemEffectBattler = battlerDef; + if (holdEffect == HOLD_EFFECT_FOCUS_BAND && (Random() % 100) < GetBattlerHoldEffectParam(battlerDef)) + return FALSE; //probabilistically speaking, focus band should activate so dont OHKO + else if (holdEffect == HOLD_EFFECT_FOCUS_SASH && GetHealthPercentage(battlerDef) == 100) + return FALSE; + + if (!DoesBattlerIgnoreAbilityChecks(atkAbility, move) && defAbility == ABILITY_STURDY) + return FALSE; + + if ((((gStatuses3[battlerDef] & STATUS3_ALWAYS_HITS) + && gDisableStructs[battlerDef].battlerWithSureHit == battlerAtk) + || atkAbility == ABILITY_NO_GUARD || defAbility == ABILITY_NO_GUARD) + && gBattleMons[battlerAtk].level >= gBattleMons[battlerDef].level) + { + return TRUE; + } + else // test the odds + { + u16 odds = accuracy + (gBattleMons[battlerAtk].level - gBattleMons[battlerDef].level); + if (Random() % 100 + 1 < odds && gBattleMons[battlerAtk].level >= gBattleMons[battlerDef].level) + return TRUE; + } + return FALSE; +} + +// stat stages +bool32 BattlerStatCanFall(u8 battler, u16 battlerAbility, u8 stat) +{ + if ((gBattleMons[battler].statStages[stat] > MIN_STAT_STAGE && battlerAbility != ABILITY_CONTRARY) + || (battlerAbility == ABILITY_CONTRARY && gBattleMons[battler].statStages[stat] < MAX_STAT_STAGE)) + return TRUE; + return FALSE; +} + +bool32 BattlerStatCanRise(u8 battler, u16 battlerAbility, u8 stat) +{ + if ((gBattleMons[battler].statStages[stat] < MAX_STAT_STAGE && battlerAbility != ABILITY_CONTRARY) + || (battlerAbility == ABILITY_CONTRARY && gBattleMons[battler].statStages[stat] > MIN_STAT_STAGE)) + return TRUE; + return FALSE; +} + +bool32 AreBattlersStatsMaxed(u8 battlerId) +{ + u32 i; + for (i = STAT_ATK; i < NUM_BATTLE_STATS; i++) + { + if (gBattleMons[battlerId].statStages[i] < MAX_STAT_STAGE) + return FALSE; + } + return TRUE; +} + +bool32 AnyStatIsRaised(u8 battlerId) +{ + u32 i; + + for (i = STAT_ATK; i < NUM_BATTLE_STATS; i++) + { + if (gBattleMons[battlerId].statStages[i] > DEFAULT_STAT_STAGE) + return TRUE; + } + return FALSE; +} + +u32 CountPositiveStatStages(u8 battlerId) +{ + u32 count = 0; + u32 i; + for (i = STAT_ATK; i < NUM_BATTLE_STATS; i++) + { + if (gBattleMons[battlerId].statStages[i] > DEFAULT_STAT_STAGE) + count++; + } + return count; +} + +u32 CountNegativeStatStages(u8 battlerId) +{ + u32 count = 0; + u32 i; + for (i = STAT_ATK; i < NUM_BATTLE_STATS; i++) + { + if (gBattleMons[battlerId].statStages[i] < DEFAULT_STAT_STAGE) + count++; + } + return count; +} + +// checks for growth, gear up, work up +bool32 BattlerShouldRaiseAttacks(u8 battlerId, u16 ability) +{ + if (((!BattlerStatCanRise(battlerId, ability, STAT_ATK)|| !HasMoveWithSplit(battlerId, SPLIT_PHYSICAL)) + && (!BattlerStatCanRise(battlerId, ability, STAT_SPATK) || !HasMoveWithSplit(battlerId, SPLIT_SPECIAL))) + || ability == ABILITY_CONTRARY) + { + return FALSE; + } + return TRUE; +} + +bool32 CanAttackerFaintTarget(u8 battlerAtk, u8 battlerDef, u8 index) +{ + s32 dmg = AI_THINKING_STRUCT->simulatedDmg[battlerAtk][battlerDef][index]; + + if (gBattleMons[battlerDef].hp <= dmg) + return TRUE; + return FALSE; +} + +s32 CountUsablePartyMons(u8 battlerId) +{ + s32 battlerOnField1, battlerOnField2, i, ret; + struct Pokemon *party; + + if (GetBattlerSide(battlerId) == B_SIDE_PLAYER) + party = gPlayerParty; + else + party = gEnemyParty; + + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + { + battlerOnField1 = gBattlerPartyIndexes[battlerId]; + battlerOnField2 = gBattlerPartyIndexes[GetBattlerAtPosition(GetBattlerPosition(battlerId) ^ BIT_FLANK)]; + } + else // In singles there's only one battlerId by side. + { + battlerOnField1 = gBattlerPartyIndexes[battlerId]; + battlerOnField2 = gBattlerPartyIndexes[battlerId]; + } + + ret = 0; + for (i = 0; i < PARTY_SIZE; i++) + { + if (i != battlerOnField1 && i != battlerOnField2 + && GetMonData(&party[i], MON_DATA_HP) != 0 + && GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE + && GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG) + { + ret++; + } + } + + return ret; +} + +u16 *GetMovesArray(u32 battler) +{ + if (IsBattlerAIControlled(battler) || IsBattlerAIControlled(BATTLE_PARTNER(battler))) + return gBattleMons[battler].moves; + else + return gBattleResources->battleHistory->usedMoves[battler]; +} + +bool32 HasMoveWithSplit(u32 battler, u32 split) +{ + u32 i; + u16 *moves = GetMovesArray(battler); + + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && GetBattleMoveSplit(moves[i]) == split) + return TRUE; + } + + return FALSE; +} + +bool32 HasMoveWithType(u32 battler, u8 type) +{ + s32 i; + u16 *moves = GetMovesArray(battler); + + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && gBattleMoves[moves[i]].type == type) + return TRUE; + } + + return FALSE; +} + +bool32 IsInstructBannedMove(u16 move) +{ + u32 i; + for (i = 0; i < ARRAY_COUNT(sInstructBannedMoves); i++) + { + if (move == sInstructBannedMoves[i]) + return TRUE; + } + return FALSE; +} + +bool32 MoveRequiresRecharging(u16 move) +{ + u32 i; + for (i = 0; i < ARRAY_COUNT(sRechargeMoves); i++) + { + if (move == sRechargeMoves[i]) + return TRUE; + } + return FALSE; +} + +bool32 MoveCallsOtherMove(u16 move) +{ + u32 i; + for (i = 0; i < ARRAY_COUNT(sOtherMoveCallingMoves); i++) + { + if (move == sOtherMoveCallingMoves[i]) + return TRUE; + } + return FALSE; +} + +bool32 TestMoveFlagsInMoveset(u8 battler, u32 flags) +{ + s32 i; + u16 *moves = GetMovesArray(battler); + + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && TestMoveFlags(moves[i], flags)) + return TRUE; + } + return FALSE; +} + +bool32 BattlerHasDamagingMove(u8 battlerId) +{ + u32 i; + u16 *moves = GetMovesArray(battlerId); + + for (i = 0; i < MAX_MON_MOVES; i++) + { + if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && gBattleMoves[moves[i]].power != 0) + return TRUE; + } + + return FALSE; +} + +static u32 GetLeechSeedDamage(u8 battlerId) +{ + u32 damage = 0; + if ((gStatuses3[battlerId] & STATUS3_LEECHSEED) + && gBattleMons[gStatuses3[battlerId] & STATUS3_LEECHSEED_BATTLER].hp != 0) + { + damage = gBattleMons[battlerId].maxHP / 8; + if (damage == 0) + damage = 1; + } + return damage; +} + +static u32 GetNightmareDamage(u8 battlerId) +{ + u32 damage = 0; + if ((gBattleMons[battlerId].status2 & STATUS2_NIGHTMARE) && gBattleMons[battlerId].status1 & STATUS1_SLEEP) + { + damage = gBattleMons[battlerId].maxHP / 4; + if (damage == 0) + damage = 1; + } + return damage; +} + +static u32 GetCurseDamage(u8 battlerId) +{ + u32 damage = 0; + if (gBattleMons[battlerId].status2 & STATUS2_CURSED) + { + damage = gBattleMons[battlerId].maxHP / 4; + if (damage == 0) + damage = 1; + } + return damage; +} + +static u32 GetTrapDamage(u8 battlerId) +{ + // ai has no knowledge about turns remaining + u32 damage = 0; + u32 holdEffect = AI_GetHoldEffect(gBattleStruct->wrappedBy[battlerId]); + if (gBattleMons[battlerId].status2 & STATUS2_WRAPPED) + { + if (holdEffect == HOLD_EFFECT_BINDING_BAND) + damage = gBattleMons[battlerId].maxHP / (B_BINDING_DAMAGE >= GEN_6) ? 6 : 8; + else + damage = gBattleMons[battlerId].maxHP / (B_BINDING_DAMAGE >= GEN_6) ? 8 : 16; + + if (damage == 0) + damage = 1; + } + return damage; +} + +static u32 GetPoisonDamage(u8 battlerId) +{ + u32 damage = 0; + + if (AI_GetAbility(battlerId) == ABILITY_POISON_HEAL) + return damage; + + if (gBattleMons[battlerId].status1 & STATUS1_POISON) + { + damage = gBattleMons[battlerId].maxHP / 8; + if (damage == 0) + damage = 1; + } + else if (gBattleMons[battlerId].status1 & STATUS1_TOXIC_POISON) + { + damage = gBattleMons[battlerId].maxHP / 16; + if (damage == 0) + damage = 1; + if ((gBattleMons[battlerId].status1 & STATUS1_TOXIC_COUNTER) != STATUS1_TOXIC_TURN(15)) // not 16 turns + gBattleMons[battlerId].status1 += STATUS1_TOXIC_TURN(1); + damage *= (gBattleMons[battlerId].status1 & STATUS1_TOXIC_COUNTER) >> 8; + } + return damage; +} + +static bool32 BattlerAffectedBySandstorm(u8 battlerId, u16 ability) +{ + if (!IS_BATTLER_OF_TYPE(battlerId, TYPE_ROCK) + && !IS_BATTLER_OF_TYPE(battlerId, TYPE_GROUND) + && !IS_BATTLER_OF_TYPE(battlerId, TYPE_STEEL) + && ability != ABILITY_SAND_VEIL + && ability != ABILITY_SAND_FORCE + && ability != ABILITY_SAND_RUSH + && ability != ABILITY_OVERCOAT) + return TRUE; + return FALSE; +} + +static bool32 BattlerAffectedByHail(u8 battlerId, u16 ability) +{ + if (!IS_BATTLER_OF_TYPE(battlerId, TYPE_ICE) + && ability != ABILITY_SNOW_CLOAK + && ability != ABILITY_OVERCOAT + && ability != ABILITY_ICE_BODY) + return TRUE; + return FALSE; +} + +static u32 GetWeatherDamage(u8 battlerId) +{ + u32 ability = AI_GetAbility(battlerId); + u32 holdEffect = AI_GetHoldEffect(battlerId); + u32 damage = 0; + if (!AI_WeatherHasEffect()) + return 0; + + if (gBattleWeather & WEATHER_SANDSTORM_ANY) + { + if (BattlerAffectedBySandstorm(battlerId, ability) + && !(gStatuses3[battlerId] & (STATUS3_UNDERGROUND | STATUS3_UNDERWATER)) + && holdEffect != HOLD_EFFECT_SAFETY_GOOGLES) + { + damage = gBattleMons[battlerId].maxHP / 16; + if (damage == 0) + damage = 1; + } + } + if ((gBattleWeather & WEATHER_HAIL_ANY) && ability != ABILITY_ICE_BODY) + { + if (BattlerAffectedByHail(battlerId, ability) + && !(gStatuses3[battlerId] & (STATUS3_UNDERGROUND | STATUS3_UNDERWATER)) + && holdEffect != HOLD_EFFECT_SAFETY_GOOGLES) + { + damage = gBattleMons[battlerId].maxHP / 16; + if (damage == 0) + damage = 1; + } + } + return damage; +} + +bool32 BattlerHasSecondaryDamage(u8 battlerId) +{ + u32 secondaryDamage; + + if (AI_GetAbility(battlerId) == ABILITY_MAGIC_GUARD) + return FALSE; + + secondaryDamage = GetLeechSeedDamage(battlerId) + + GetNightmareDamage(battlerId) + + GetCurseDamage(battlerId) + + GetTrapDamage(battlerId) + + GetPoisonDamage(battlerId) + + GetWeatherDamage(battlerId); + + if (secondaryDamage != 0) + return TRUE; + return FALSE; +} + +bool32 BattlerWillFaintFromWeather(u8 battler, u16 ability) +{ + if ((BattlerAffectedBySandstorm(battler, ability) || BattlerAffectedByHail(battler, ability)) + && gBattleMons[battler].hp <= gBattleMons[battler].maxHP / 16) + return TRUE; + + return FALSE; +} + +// status checks +bool32 AI_ShouldPutToSleep(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u16 partnerMove) +{ + if (defAbility == ABILITY_INSOMNIA + || defAbility == ABILITY_VITAL_SPIRIT + || gBattleMons[battlerDef].status1 & STATUS1_ANY + || gSideStatuses[GetBattlerSide(battlerDef)] & SIDE_STATUS_SAFEGUARD + || IsAbilityStatusProtected(battlerDef) + || DoesSubstituteBlockMove(battlerAtk, battlerDef, move) + || PartnerMoveEffectIsStatusSameTarget(BATTLE_PARTNER(battlerAtk), battlerDef, partnerMove)) // shouldn't try to sleep mon that partner is trying to make sleep + return FALSE; + return TRUE; +} + +bool32 AI_ShouldPoison(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u16 partnerMove) +{ + if (defAbility == ABILITY_IMMUNITY + || defAbility == ABILITY_PASTEL_VEIL + || gBattleMons[battlerDef].status1 & STATUS1_ANY + || IsAbilityStatusProtected(battlerDef) + || DoesSubstituteBlockMove(battlerAtk, battlerDef, move) + || PartnerMoveEffectIsStatusSameTarget(BATTLE_PARTNER(battlerAtk), battlerDef, partnerMove)) + return FALSE; + else if (defAbility != ABILITY_CORROSION && (IS_BATTLER_OF_TYPE(battlerDef, TYPE_POISON) || IS_BATTLER_OF_TYPE(battlerDef, TYPE_STEEL))) + return FALSE; + else if (IsValidDoubleBattle(battlerAtk) && AI_GetAbility(BATTLE_PARTNER(battlerDef)) == ABILITY_PASTEL_VEIL) + return FALSE; + + return TRUE; +} + +bool32 AI_CanParalyze(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u16 partnerMove) +{ + if (defAbility == ABILITY_LIMBER + || IS_BATTLER_OF_TYPE(battlerDef, TYPE_ELECTRIC) + || gBattleMons[battlerDef].status1 & STATUS1_ANY + || IsAbilityStatusProtected(battlerDef) + || DoesSubstituteBlockMove(battlerAtk, battlerDef, move) + || PartnerMoveEffectIsStatusSameTarget(BATTLE_PARTNER(battlerAtk), battlerDef, partnerMove)) + return FALSE; + return TRUE; +} + +bool32 AI_CanConfuse(u8 battlerAtk, u8 battlerDef, u16 defAbility, u8 battlerAtkPartner, u16 move, u16 partnerMove) +{ + if ((gBattleMons[battlerDef].status2 & STATUS2_CONFUSION) + || (!DoesBattlerIgnoreAbilityChecks(battlerAtk, move) && defAbility == ABILITY_OWN_TEMPO) + || (IsBattlerGrounded(battlerDef) && (gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN)) + || DoesSubstituteBlockMove(battlerAtk, battlerDef, move) + || DoesPartnerHaveSameMoveEffect(battlerAtkPartner, battlerDef, move, partnerMove)) + { + return FALSE; + } + + return TRUE; +} + +bool32 AI_CanBurn(u8 battlerAtk, u8 battlerDef, u16 defAbility, u8 battlerAtkPartner, u16 move, u16 partnerMove) +{ + if (defAbility == ABILITY_WATER_VEIL + || defAbility == ABILITY_WATER_BUBBLE + || IS_BATTLER_OF_TYPE(battlerDef, TYPE_FIRE) + || gBattleMons[battlerDef].status1 & STATUS1_ANY + || IsAbilityStatusProtected(battlerDef) + || DoesSubstituteBlockMove(battlerAtk, battlerDef, move) + || PartnerMoveEffectIsStatusSameTarget(battlerAtkPartner, battlerDef, partnerMove)) + { + return FALSE; + } + return TRUE; +} + +bool32 AI_CanBeInfatuated(u8 battlerAtk, u8 battlerDef, u16 defAbility, u8 atkGender, u8 defGender) +{ + if (IsBattlerAlive(battlerDef) + && !(gBattleMons[battlerDef].status2 & STATUS2_INFATUATION) + && defAbility != ABILITY_OBLIVIOUS + && atkGender != defGender + && atkGender != MON_GENDERLESS + && defGender != MON_GENDERLESS + && !IsAbilityOnSide(battlerDef, ABILITY_AROMA_VEIL)) + return FALSE; + return TRUE; +} + + +bool32 AnyPartyMemberStatused(u8 battlerId, bool32 checkSoundproof) +{ + struct Pokemon *party; + u32 i; + + if (GetBattlerSide(battlerId) == B_SIDE_PLAYER) + party = gPlayerParty; + else + party = gEnemyParty; + + for (i = 0; i < PARTY_SIZE; i++) + { + if (checkSoundproof && GetMonAbility(&party[i]) == ABILITY_SOUNDPROOF) + continue; + + if (GetMonData(&party[i], MON_DATA_STATUS) != STATUS1_NONE) + return TRUE; + } + + return FALSE; +} + +bool32 IsPartyFullyHealedExceptBattler(u8 battlerId) +{ + struct Pokemon *party; + u32 i; + + if (GetBattlerSide(battlerId) == B_SIDE_PLAYER) + party = gPlayerParty; + else + party = gEnemyParty; + + for (i = 0; i < PARTY_SIZE; i++) + { + if (i != gBattlerPartyIndexes[battlerId] + && GetMonData(&party[i], MON_DATA_HP) != 0 + && GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE + && GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG + && GetMonData(&party[i], MON_DATA_HP) < GetMonData(&party[i], MON_DATA_MAX_HP)) + return FALSE; + } + return TRUE; +} + +u16 GetBattlerSideSpeedAverage(u8 battler) +{ + u16 speed1 = 0; + u16 speed2 = 0; + u8 numBattlersAlive = 0; + + if (IsBattlerAlive(battler)) + { + speed1 = GetBattlerTotalSpeedStat(battler); + numBattlersAlive++; + } + + if (IsDoubleBattle() && IsBattlerAlive(BATTLE_PARTNER(battler))) + { + speed2 = GetBattlerTotalSpeedStat(BATTLE_PARTNER(battler)); + numBattlersAlive++; + } + + return (speed1 + speed2) / numBattlersAlive; +} + +bool32 ShouldUseRecoilMove(u8 battlerAtk, u8 battlerDef, u32 recoilDmg, u8 moveIndex) +{ + if (recoilDmg >= gBattleMons[battlerAtk].hp //Recoil kills attacker + && CountUsablePartyMons(battlerDef) > 1) //Foe has more than 1 target left + { + if (recoilDmg >= gBattleMons[battlerDef].hp && !CanAttackerFaintTarget(battlerAtk, battlerDef, moveIndex)) + return TRUE; //If it's the only KO move then just use it + else + return FALSE; //Not as good to use move if you'll faint and not win + } + + return TRUE; +} + +// Partner Logic +bool32 IsValidDoubleBattle(u8 battlerAtk) +{ + if (IsDoubleBattle() + && ((IsBattlerAlive(BATTLE_OPPOSITE(battlerAtk)) && IsBattlerAlive(BATTLE_PARTNER(BATTLE_OPPOSITE(battlerAtk)))) || IsBattlerAlive(BATTLE_PARTNER(battlerAtk)))) + return TRUE; + return FALSE; +} + +u16 GetAllyChosenMove(void) +{ + u8 partnerBattler = BATTLE_PARTNER(sBattler_AI); + + if (!IsBattlerAlive(partnerBattler) || !IsBattlerAIControlled(partnerBattler)) + return MOVE_NONE; // TODO: prediction? + else if (partnerBattler > sBattler_AI) // Battler with the lower id chooses the move first. + return MOVE_NONE; + else + return gBattleMons[partnerBattler].moves[gBattleStruct->chosenMovePositions[partnerBattler]]; +} + +bool32 IsTargetingPartner(u8 battlerAtk, u8 battlerDef) +{ + if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE)) + return FALSE; + + if (battlerDef == BATTLE_PARTNER(battlerAtk)) + return TRUE; + + return FALSE; +} + +//PARTNER_MOVE_EFFECT_IS_SAME +bool32 DoesPartnerHaveSameMoveEffect(u8 battlerAtkPartner, u8 battlerDef, u16 move, u16 partnerMove) +{ + if (!IsDoubleBattle()) + return FALSE; + + if (gBattleMoves[move].effect == gBattleMoves[partnerMove].effect + && gChosenMoveByBattler[battlerAtkPartner] != MOVE_NONE + && gBattleStruct->moveTarget[battlerAtkPartner] == battlerDef) + { + return TRUE; + } + return FALSE; +} + +//PARTNER_MOVE_EFFECT_IS_SAME_NO_TARGET +bool32 PartnerHasSameMoveEffectWithoutTarget(u8 battlerAtkPartner, u16 move, u16 partnerMove) +{ + if (!IsDoubleBattle()) + return FALSE; + + if (gBattleMoves[move].effect == gBattleMoves[partnerMove].effect + && gChosenMoveByBattler[battlerAtkPartner] != MOVE_NONE) + return TRUE; + return FALSE; +} + +//PARTNER_MOVE_EFFECT_IS_STATUS_SAME_TARGET +bool32 PartnerMoveEffectIsStatusSameTarget(u8 battlerAtkPartner, u8 battlerDef, u16 partnerMove) +{ + if (!IsDoubleBattle()) + return FALSE; + + if (gChosenMoveByBattler[battlerAtkPartner] != MOVE_NONE + && gBattleStruct->moveTarget[battlerAtkPartner] == battlerDef + && (gBattleMoves[partnerMove].effect == EFFECT_SLEEP + || gBattleMoves[partnerMove].effect == EFFECT_POISON + || gBattleMoves[partnerMove].effect == EFFECT_TOXIC + || gBattleMoves[partnerMove].effect == EFFECT_PARALYZE + || gBattleMoves[partnerMove].effect == EFFECT_WILL_O_WISP + || gBattleMoves[partnerMove].effect == EFFECT_YAWN)) + return TRUE; + return FALSE; +} + +//PARTNER_MOVE_EFFECT_IS_WEATHER +bool32 PartnerMoveEffectIsWeather(u8 battlerAtkPartner, u16 partnerMove) +{ + if (!IsDoubleBattle()) + return FALSE; + + if (gChosenMoveByBattler[battlerAtkPartner] != MOVE_NONE + && (gBattleMoves[partnerMove].effect == EFFECT_SUNNY_DAY + || gBattleMoves[partnerMove].effect == EFFECT_RAIN_DANCE + || gBattleMoves[partnerMove].effect == EFFECT_SANDSTORM + || gBattleMoves[partnerMove].effect == EFFECT_HAIL)) + return TRUE; + + return FALSE; +} + +//PARTNER_MOVE_EFFECT_IS_TERRAIN +bool32 PartnerMoveEffectIsTerrain(u8 battlerAtkPartner, u16 partnerMove) +{ + if (!IsDoubleBattle()) + return FALSE; + + if (gChosenMoveByBattler[battlerAtkPartner] != MOVE_NONE + && (gBattleMoves[partnerMove].effect == EFFECT_GRASSY_TERRAIN + || gBattleMoves[partnerMove].effect == EFFECT_MISTY_TERRAIN + || gBattleMoves[partnerMove].effect == EFFECT_ELECTRIC_TERRAIN + || gBattleMoves[partnerMove].effect == EFFECT_PSYCHIC_TERRAIN)) + return TRUE; + + return FALSE; +} + +//PARTNER_MOVE_IS_TAILWIND_TRICKROOM +bool32 PartnerMoveIs(u8 battlerAtkPartner, u16 partnerMove, u16 moveCheck) +{ + if (!IsDoubleBattle()) + return FALSE; + + if (gChosenMoveByBattler[battlerAtkPartner] != MOVE_NONE && partnerMove == moveCheck) + return TRUE; + return FALSE; +} + +//PARTNER_MOVE_IS_SAME +bool32 PartnerMoveIsSameAsAttacker(u8 battlerAtkPartner, u8 battlerDef, u16 move, u16 partnerMove) +{ + if (!IsDoubleBattle()) + return FALSE; + + if (gChosenMoveByBattler[battlerAtkPartner] != MOVE_NONE && move == partnerMove && gBattleStruct->moveTarget[battlerAtkPartner] == battlerDef) + return TRUE; + return FALSE; +} + +//PARTNER_MOVE_IS_SAME_NO_TARGET +bool32 PartnerMoveIsSameNoTarget(u8 battlerAtkPartner, u16 move, u16 partnerMove) +{ + if (!IsDoubleBattle()) + return FALSE; + if (gChosenMoveByBattler[battlerAtkPartner] != MOVE_NONE && move == partnerMove) + return TRUE; + return FALSE; } diff --git a/src/battle_factory.c b/src/battle_factory.c index a2b1d337a..98af96664 100644 --- a/src/battle_factory.c +++ b/src/battle_factory.c @@ -850,13 +850,13 @@ u32 GetAiScriptsInBattleFactory(void) int challengeNum = gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode] / 7; if (gTrainerBattleOpponent_A == TRAINER_FRONTIER_BRAIN) - return AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY; + return AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY; else if (challengeNum < 2) return 0; else if (challengeNum < 4) - return AI_SCRIPT_CHECK_BAD_MOVE; + return AI_FLAG_CHECK_BAD_MOVE; else - return AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY; + return AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY; } } diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 16e2989f8..9872d04fe 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -813,13 +813,7 @@ void (* const gBattleScriptingCommandsTable[])(void) = Cmd_metalburstdamagecalculator, // 0xFF }; -struct StatFractions -{ - u8 dividend; - u8 divisor; -}; - -static const struct StatFractions sAccuracyStageRatios[] = +const struct StatFractions gAccuracyStageRatios[] = { { 33, 100}, // -6 { 36, 100}, // -5 @@ -1536,8 +1530,8 @@ u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move) if (defAbility == ABILITY_WONDER_SKIN && gBattleMoves[move].power == 0) moveAcc = 50; - calc = sAccuracyStageRatios[buff].dividend * moveAcc; - calc /= sAccuracyStageRatios[buff].divisor; + calc = gAccuracyStageRatios[buff].dividend * moveAcc; + calc /= gAccuracyStageRatios[buff].divisor; if (atkAbility == ABILITY_COMPOUND_EYES) calc = (calc * 130) / 100; // 1.3 compound eyes boost @@ -7646,51 +7640,25 @@ static void Cmd_various(void) gBattlescriptCurrInstr += 7; return; case VARIOUS_SET_SIMPLE_BEAM: - switch (gBattleMons[gActiveBattler].ability) + if (IsEntrainmentTargetOrSimpleBeamBannedAbility(gBattleMons[gActiveBattler].ability)) { - case ABILITY_SIMPLE: - case ABILITY_TRUANT: - case ABILITY_STANCE_CHANGE: - case ABILITY_DISGUISE: - case ABILITY_MULTITYPE: gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); - break; - default: + } + else + { gBattleMons[gActiveBattler].ability = ABILITY_SIMPLE; gBattlescriptCurrInstr += 7; break; } return; case VARIOUS_TRY_ENTRAINMENT: - switch (gBattleMons[gBattlerTarget].ability) + if (IsEntrainmentBannedAbilityAttacker(gBattleMons[gBattlerAttacker].ability) + || IsEntrainmentTargetOrSimpleBeamBannedAbility(gBattleMons[gBattlerTarget].ability)) { - case ABILITY_TRUANT: - case ABILITY_MULTITYPE: - case ABILITY_STANCE_CHANGE: - case ABILITY_SCHOOLING: - case ABILITY_COMATOSE: - case ABILITY_SHIELDS_DOWN: - case ABILITY_DISGUISE: - case ABILITY_RKS_SYSTEM: - case ABILITY_BATTLE_BOND: - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); - return; - } - switch (gBattleMons[gBattlerAttacker].ability) - { - case ABILITY_TRACE: - case ABILITY_FORECAST: - case ABILITY_FLOWER_GIFT: - case ABILITY_ZEN_MODE: - case ABILITY_ILLUSION: - case ABILITY_IMPOSTER: - case ABILITY_POWER_OF_ALCHEMY: - case ABILITY_RECEIVER: - case ABILITY_DISGUISE: - case ABILITY_POWER_CONSTRUCT: gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); return; } + if (gBattleMons[gBattlerTarget].ability == gBattleMons[gBattlerAttacker].ability) { gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); @@ -10945,6 +10913,12 @@ static void Cmd_callterrainattack(void) // nature power gBattlescriptCurrInstr++; } +u16 GetNaturePowerMove(void) +{ + //TODO terrain + return sNaturePowerMoves[gBattleTerrain]; +} + static void Cmd_cureifburnedparalysedorpoisoned(void) // refresh { if (gBattleMons[gBattlerAttacker].status1 & (STATUS1_POISON | STATUS1_BURN | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON)) @@ -11111,18 +11085,20 @@ static void Cmd_tryswapitems(void) // trick static void Cmd_trycopyability(void) // role play { - switch (gBattleMons[gBattlerTarget].ability) + u16 defAbility = gBattleMons[gBattlerTarget].ability; + + if (gBattleMons[gBattlerAttacker].ability == defAbility + || defAbility == ABILITY_NONE + || IsRolePlayBannedAbilityAtk(gBattleMons[gBattlerAttacker].ability) + || IsRolePlayBannedAbility(defAbility)) { - case ABILITY_NONE: - case ABILITY_WONDER_GUARD: - case ABILITY_DISGUISE: - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); - break; - default: - gBattleMons[gBattlerAttacker].ability = gBattleMons[gBattlerTarget].ability; - gLastUsedAbility = gBattleMons[gBattlerTarget].ability; - gBattlescriptCurrInstr += 5; - break; + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + } + else + { + gBattleMons[gBattlerAttacker].ability = defAbility; + gLastUsedAbility = defAbility; + gBattlescriptCurrInstr += 5; } } @@ -11176,23 +11152,14 @@ static void Cmd_settoxicspikes(void) static void Cmd_setgastroacid(void) { - switch (gBattleMons[gBattlerTarget].ability) + if (IsGastroAcidBannedAbility(gBattleMons[gBattlerTarget].ability)) { - case ABILITY_MULTITYPE: - case ABILITY_STANCE_CHANGE: - case ABILITY_SCHOOLING: - case ABILITY_COMATOSE: - case ABILITY_SHIELDS_DOWN: - case ABILITY_DISGUISE: - case ABILITY_RKS_SYSTEM: - case ABILITY_BATTLE_BOND: - case ABILITY_POWER_CONSTRUCT: gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); - break; - default: + } + else + { gStatuses3[gBattlerTarget] |= STATUS3_GASTRO_ACID; gBattlescriptCurrInstr += 5; - break; } } @@ -11261,24 +11228,13 @@ static void Cmd_setroom(void) static void Cmd_tryswapabilities(void) // skill swap { - switch (gBattleMons[gBattlerAttacker].ability) + if (IsSkillSwapBannedAbility(gBattleMons[gBattlerAttacker].ability) + || IsSkillSwapBannedAbility(gBattleMons[gBattlerTarget].ability)) { - case ABILITY_NONE: - case ABILITY_WONDER_GUARD: - case ABILITY_DISGUISE: gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); return; } - - switch (gBattleMons[gBattlerTarget].ability) - { - case ABILITY_NONE: - case ABILITY_WONDER_GUARD: - case ABILITY_DISGUISE: - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); - return; - } - + if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT) { gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); @@ -11751,6 +11707,13 @@ static void Cmd_tryrecycleitem(void) } } +bool32 CanCamouflage(u8 battlerId) +{ + if (IS_BATTLER_OF_TYPE(battlerId, sTerrainToType[gBattleTerrain])) + return FALSE; + return TRUE; +} + static void Cmd_settypetoterrain(void) { if (!IS_BATTLER_OF_TYPE(gBattlerAttacker, sTerrainToType[gBattleTerrain])) @@ -12271,11 +12234,36 @@ static void Cmd_trainerslideout(void) gBattlescriptCurrInstr += 2; } +static const u16 sTelekinesisBanList[] = +{ + SPECIES_DIGLETT, + SPECIES_DUGTRIO, + #ifdef POKEMON_EXPANSION + SPECIES_DIGLETT_ALOLAN, + SPECIES_DUGTRIO_ALOLAN, + SPECIES_SANDYGAST, + SPECIES_PALOSSAND, + SPECIES_GENGAR_MEGA, + #endif +}; + +bool32 IsTelekinesisBannedSpecies(u16 species) +{ + u32 i; + + for (i = 0; i < ARRAY_COUNT(sTelekinesisBanList); i++) + { + if (species == sTelekinesisBanList[i]) + return TRUE; + } + return FALSE; +} + static void Cmd_settelekinesis(void) { if (gStatuses3[gBattlerTarget] & (STATUS3_TELEKINESIS | STATUS3_ROOTED | STATUS3_SMACKED_DOWN) || gFieldStatuses & STATUS_FIELD_GRAVITY - || (gBattleMons[gBattlerTarget].species == SPECIES_DIGLETT || gBattleMons[gBattlerTarget].species == SPECIES_DUGTRIO)) + || IsTelekinesisBannedSpecies(gBattleMons[gBattlerTarget].species)) { gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } @@ -12343,19 +12331,14 @@ static void Cmd_trygetbaddreamstarget(void) static void Cmd_tryworryseed(void) { - switch (gBattleMons[gBattlerTarget].ability) + if (IsWorrySeedBannedAbility(gBattleMons[gBattlerTarget].ability)) { - case ABILITY_INSOMNIA: - case ABILITY_MULTITYPE: - case ABILITY_TRUANT: - case ABILITY_STANCE_CHANGE: - case ABILITY_DISGUISE: gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); - break; - default: + } + else + { gBattleMons[gBattlerTarget].ability = ABILITY_INSOMNIA; gBattlescriptCurrInstr += 5; - break; } } diff --git a/src/battle_util.c b/src/battle_util.c index b929b7499..846e269b1 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -63,6 +63,131 @@ static const u8 sPkblToEscapeFactor[][3] = {{0, 0, 0}, {3, 5, 0}, {2, 3, 0}, {1, static const u8 sGoNearCounterToCatchFactor[] = {4, 3, 2, 1}; static const u8 sGoNearCounterToEscapeFactor[] = {4, 4, 4, 4}; +static const u16 sSkillSwapBannedAbilities[] = +{ + ABILITY_WONDER_GUARD, + ABILITY_MULTITYPE, + ABILITY_ILLUSION, + ABILITY_STANCE_CHANGE, + ABILITY_SCHOOLING, + ABILITY_COMATOSE, + ABILITY_SHIELDS_DOWN, + ABILITY_DISGUISE, + ABILITY_RKS_SYSTEM, + ABILITY_BATTLE_BOND, + ABILITY_POWER_CONSTRUCT, + ABILITY_NEUTRALIZING_GAS, + ABILITY_ICE_FACE, + ABILITY_HUNGER_SWITCH, + ABILITY_GULP_MISSILE, +}; + +static const u16 sRolePlayBannedAbilities[] = +{ + ABILITY_TRACE, + ABILITY_WONDER_GUARD, + ABILITY_FORECAST, + ABILITY_FLOWER_GIFT, + ABILITY_MULTITYPE, + ABILITY_ILLUSION, + ABILITY_ZEN_MODE, + ABILITY_IMPOSTER, + ABILITY_STANCE_CHANGE, + ABILITY_POWER_OF_ALCHEMY, + ABILITY_RECEIVER, + ABILITY_SCHOOLING, + ABILITY_COMATOSE, + ABILITY_SHIELDS_DOWN, + ABILITY_DISGUISE, + ABILITY_RKS_SYSTEM, + ABILITY_BATTLE_BOND, + ABILITY_POWER_CONSTRUCT, + ABILITY_ICE_FACE, + ABILITY_HUNGER_SWITCH, + ABILITY_GULP_MISSILE, +}; + +static const u16 sRolePlayBannedAttackerAbilities[] = +{ + ABILITY_MULTITYPE, + ABILITY_ZEN_MODE, + ABILITY_STANCE_CHANGE, + ABILITY_SCHOOLING, + ABILITY_COMATOSE, + ABILITY_SHIELDS_DOWN, + ABILITY_DISGUISE, + ABILITY_RKS_SYSTEM, + ABILITY_BATTLE_BOND, + ABILITY_POWER_CONSTRUCT, + ABILITY_ICE_FACE, + ABILITY_GULP_MISSILE, +}; + +static const u16 sWorrySeedBannedAbilities[] = +{ + ABILITY_MULTITYPE, + ABILITY_STANCE_CHANGE, + ABILITY_SCHOOLING, + ABILITY_COMATOSE, + ABILITY_SHIELDS_DOWN, + ABILITY_DISGUISE, + ABILITY_RKS_SYSTEM, + ABILITY_BATTLE_BOND, + ABILITY_POWER_CONSTRUCT, + ABILITY_TRUANT, + ABILITY_ICE_FACE, + ABILITY_GULP_MISSILE, +}; + +static const u16 sGastroAcidBannedAbilities[] = +{ + ABILITY_MULTITYPE, + ABILITY_STANCE_CHANGE, + ABILITY_SCHOOLING, + ABILITY_COMATOSE, + ABILITY_SHIELDS_DOWN, + ABILITY_DISGUISE, + ABILITY_RKS_SYSTEM, + ABILITY_BATTLE_BOND, + ABILITY_POWER_CONSTRUCT, + ABILITY_ICE_FACE, + ABILITY_GULP_MISSILE, +}; + +static const u16 sEntrainmentBannedAttackerAbilities[] = +{ + ABILITY_TRACE, + ABILITY_FORECAST, + ABILITY_FLOWER_GIFT, + ABILITY_ZEN_MODE, + ABILITY_ILLUSION, + ABILITY_IMPOSTER, + ABILITY_POWER_OF_ALCHEMY, + ABILITY_RECEIVER, + ABILITY_DISGUISE, + ABILITY_POWER_CONSTRUCT, + ABILITY_NEUTRALIZING_GAS, + ABILITY_ICE_FACE, + ABILITY_HUNGER_SWITCH, + ABILITY_GULP_MISSILE, +}; + +static const u16 sEntrainmentTargetSimpleBeamBannedAbilities[] = +{ + ABILITY_TRUANT, + ABILITY_MULTITYPE, + ABILITY_STANCE_CHANGE, + ABILITY_SCHOOLING, + ABILITY_COMATOSE, + ABILITY_SHIELDS_DOWN, + ABILITY_DISGUISE, + ABILITY_RKS_SYSTEM, + ABILITY_BATTLE_BOND, + ABILITY_ICE_FACE, + ABILITY_GULP_MISSILE, +}; + +// Functions void HandleAction_UseMove(void) { u32 i, side, moveType, var = 4; @@ -1325,11 +1450,11 @@ static bool32 IsGravityPreventingMove(u32 move) } } -static bool32 IsHealBlockPreventingMove(u32 battler, u32 move) +bool32 IsHealBlockPreventingMove(u32 battler, u32 move) { if (!(gStatuses3[battler] & STATUS3_HEAL_BLOCK)) return FALSE; - + switch (gBattleMoves[move].effect) { case EFFECT_ABSORB: @@ -5339,10 +5464,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) u8 ppBonuses; u16 move; - if (GetBattlerSide(battlerId) == B_SIDE_PLAYER) - mon = &gPlayerParty[gBattlerPartyIndexes[battlerId]]; - else - mon = &gEnemyParty[gBattlerPartyIndexes[battlerId]]; + mon = GetBattlerPartyData(battlerId); for (i = 0; i < MAX_MON_MOVES; i++) { move = GetMonData(mon, MON_DATA_MOVE1 + i); @@ -7830,3 +7952,123 @@ u8 GetBattleMoveSplit(u32 moveId) else return SPLIT_SPECIAL; } + +bool32 TestMoveFlags(u16 move, u32 flag) +{ + if (gBattleMoves[move].flags & flag) + return TRUE; + return FALSE; +} + +struct Pokemon *GetBattlerPartyData(u8 battlerId) +{ + struct Pokemon *mon; + if (GetBattlerSide(battlerId) == B_SIDE_PLAYER) + mon = &gPlayerParty[gBattlerPartyIndexes[battlerId]]; + else + mon = &gEnemyParty[gBattlerPartyIndexes[battlerId]]; + + return mon; +} + +//Make sure the input bank is any bank on the specific mon's side +bool32 CanFling(u8 battlerId) +{ + u16 item = gBattleMons[battlerId].item; + u16 itemEffect = ItemId_GetHoldEffect(item); + + if (item == ITEM_NONE + || GetBattlerAbility(battlerId) == ABILITY_KLUTZ + || gFieldStatuses & STATUS_FIELD_MAGIC_ROOM + || gDisableStructs[battlerId].embargoTimer != 0 + || !CanBattlerGetOrLoseItem(battlerId, item) + //|| itemEffect == HOLD_EFFECT_PRIMAL_ORB + || itemEffect == HOLD_EFFECT_GEMS + #ifdef ITEM_ABILITY_CAPSULE + || item == ITEM_ABILITY_CAPSULE + #endif + || (ItemId_GetPocket(item) == POCKET_BERRIES && IsAbilityOnSide(battlerId, ABILITY_UNNERVE)) + || GetPocketByItemId(item) == POCKET_POKE_BALLS) + return FALSE; + + return TRUE; +} + +// ability checks +bool32 IsRolePlayBannedAbilityAtk(u16 ability) +{ + u32 i; + for (i = 0; i < ARRAY_COUNT(sRolePlayBannedAttackerAbilities); i++) + { + if (ability == sRolePlayBannedAttackerAbilities[i]) + return TRUE; + } + return FALSE; +} + +bool32 IsRolePlayBannedAbility(u16 ability) +{ + u32 i; + for (i = 0; i < ARRAY_COUNT(sRolePlayBannedAbilities); i++) + { + if (ability == sRolePlayBannedAbilities[i]) + return TRUE; + } + return FALSE; +} + +bool32 IsSkillSwapBannedAbility(u16 ability) +{ + u32 i; + for (i = 0; i < ARRAY_COUNT(sSkillSwapBannedAbilities); i++) + { + if (ability == sSkillSwapBannedAbilities[i]) + return TRUE; + } + return FALSE; +} + +bool32 IsWorrySeedBannedAbility(u16 ability) +{ + u32 i; + for (i = 0; i < ARRAY_COUNT(sWorrySeedBannedAbilities); i++) + { + if (ability == sWorrySeedBannedAbilities[i]) + return TRUE; + } + return FALSE; +} + +bool32 IsGastroAcidBannedAbility(u16 ability) +{ + u32 i; + for (i = 0; i < ARRAY_COUNT(sGastroAcidBannedAbilities); i++) + { + if (ability == sGastroAcidBannedAbilities[i]) + return TRUE; + } + return FALSE; +} + +bool32 IsEntrainmentBannedAbilityAttacker(u16 ability) +{ + u32 i; + for (i = 0; i < ARRAY_COUNT(sEntrainmentBannedAttackerAbilities); i++) + { + if (ability == sEntrainmentBannedAttackerAbilities[i]) + return TRUE; + } + return FALSE; +} + +bool32 IsEntrainmentTargetOrSimpleBeamBannedAbility(u16 ability) +{ + u32 i; + for (i = 0; i < ARRAY_COUNT(sEntrainmentTargetSimpleBeamBannedAbilities); i++) + { + if (ability == sEntrainmentTargetSimpleBeamBannedAbilities[i]) + return TRUE; + } + return FALSE; +} + diff --git a/src/data/trainers.h b/src/data/trainers.h index 163a8296d..619763ea1 100644 --- a/src/data/trainers.h +++ b/src/data/trainers.h @@ -22,7 +22,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SAWYER"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Sawyer1), .party = {.NoItemDefaultMoves = sParty_Sawyer1}, }, @@ -36,7 +36,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntAquaHideout1), .party = {.NoItemDefaultMoves = sParty_GruntAquaHideout1}, }, @@ -50,7 +50,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntAquaHideout2), .party = {.NoItemDefaultMoves = sParty_GruntAquaHideout2}, }, @@ -64,7 +64,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntAquaHideout3), .party = {.NoItemDefaultMoves = sParty_GruntAquaHideout3}, }, @@ -78,7 +78,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntAquaHideout4), .party = {.NoItemDefaultMoves = sParty_GruntAquaHideout4}, }, @@ -92,7 +92,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntSeafloorCavern1), .party = {.NoItemDefaultMoves = sParty_GruntSeafloorCavern1}, }, @@ -106,7 +106,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntSeafloorCavern2), .party = {.NoItemDefaultMoves = sParty_GruntSeafloorCavern2}, }, @@ -120,7 +120,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntSeafloorCavern3), .party = {.NoItemDefaultMoves = sParty_GruntSeafloorCavern3}, }, @@ -134,7 +134,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GABRIELLE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Gabrielle1), .party = {.NoItemDefaultMoves = sParty_Gabrielle1}, }, @@ -148,7 +148,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntPetalburgWoods), .party = {.NoItemDefaultMoves = sParty_GruntPetalburgWoods}, }, @@ -162,7 +162,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MARCEL"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Marcel), .party = {.NoItemDefaultMoves = sParty_Marcel}, }, @@ -176,7 +176,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ALBERTO"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Alberto), .party = {.NoItemDefaultMoves = sParty_Alberto}, }, @@ -190,7 +190,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ED"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Ed), .party = {.NoItemDefaultMoves = sParty_Ed}, }, @@ -204,7 +204,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntSeafloorCavern4), .party = {.NoItemDefaultMoves = sParty_GruntSeafloorCavern4}, }, @@ -218,7 +218,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DECLAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Declan), .party = {.NoItemDefaultMoves = sParty_Declan}, }, @@ -232,7 +232,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntRusturfTunnel), .party = {.NoItemDefaultMoves = sParty_GruntRusturfTunnel}, }, @@ -246,7 +246,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntWeatherInst1), .party = {.NoItemDefaultMoves = sParty_GruntWeatherInst1}, }, @@ -260,7 +260,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntWeatherInst2), .party = {.NoItemDefaultMoves = sParty_GruntWeatherInst2}, }, @@ -274,7 +274,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntWeatherInst3), .party = {.NoItemDefaultMoves = sParty_GruntWeatherInst3}, }, @@ -288,7 +288,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntMuseum1), .party = {.NoItemDefaultMoves = sParty_GruntMuseum1}, }, @@ -302,7 +302,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntMuseum2), .party = {.NoItemDefaultMoves = sParty_GruntMuseum2}, }, @@ -316,7 +316,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntSpaceCenter1), .party = {.NoItemDefaultMoves = sParty_GruntSpaceCenter1}, }, @@ -330,7 +330,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntMtPyre1), .party = {.NoItemDefaultMoves = sParty_GruntMtPyre1}, }, @@ -344,7 +344,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntMtPyre2), .party = {.NoItemDefaultMoves = sParty_GruntMtPyre2}, }, @@ -358,7 +358,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntMtPyre3), .party = {.NoItemDefaultMoves = sParty_GruntMtPyre3}, }, @@ -372,7 +372,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntWeatherInst4), .party = {.NoItemDefaultMoves = sParty_GruntWeatherInst4}, }, @@ -386,7 +386,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntAquaHideout5), .party = {.NoItemDefaultMoves = sParty_GruntAquaHideout5}, }, @@ -400,7 +400,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntAquaHideout6), .party = {.NoItemDefaultMoves = sParty_GruntAquaHideout6}, }, @@ -414,7 +414,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("FREDRICK"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Fredrick), .party = {.NoItemDefaultMoves = sParty_Fredrick}, }, @@ -428,7 +428,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MATT"), .items = {ITEM_SUPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Matt), .party = {.NoItemDefaultMoves = sParty_Matt}, }, @@ -442,7 +442,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ZANDER"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Zander), .party = {.NoItemDefaultMoves = sParty_Zander}, }, @@ -456,7 +456,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SHELLY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_ShellyWeatherInstitute), .party = {.NoItemDefaultMoves = sParty_ShellyWeatherInstitute}, }, @@ -470,7 +470,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SHELLY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_ShellySeafloorCavern), .party = {.NoItemDefaultMoves = sParty_ShellySeafloorCavern}, }, @@ -484,7 +484,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ARCHIE"), .items = {ITEM_SUPER_POTION, ITEM_SUPER_POTION, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Archie), .party = {.NoItemDefaultMoves = sParty_Archie}, }, @@ -498,7 +498,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LEAH"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Leah), .party = {.NoItemDefaultMoves = sParty_Leah}, }, @@ -512,7 +512,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DAISY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Daisy), .party = {.NoItemDefaultMoves = sParty_Daisy}, }, @@ -526,7 +526,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ROSE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Rose1), .party = {.NoItemDefaultMoves = sParty_Rose1}, }, @@ -540,7 +540,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("FELIX"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Felix), .party = {.NoItemCustomMoves = sParty_Felix}, }, @@ -554,7 +554,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("VIOLET"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Violet), .party = {.NoItemDefaultMoves = sParty_Violet}, }, @@ -568,7 +568,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ROSE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Rose2), .party = {.NoItemDefaultMoves = sParty_Rose2}, }, @@ -582,7 +582,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ROSE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Rose3), .party = {.NoItemDefaultMoves = sParty_Rose3}, }, @@ -596,7 +596,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ROSE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Rose4), .party = {.NoItemDefaultMoves = sParty_Rose4}, }, @@ -610,7 +610,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ROSE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Rose5), .party = {.NoItemDefaultMoves = sParty_Rose5}, }, @@ -624,7 +624,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DUSTY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Dusty1), .party = {.NoItemCustomMoves = sParty_Dusty1}, }, @@ -638,7 +638,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CHIP"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Chip), .party = {.NoItemCustomMoves = sParty_Chip}, }, @@ -652,7 +652,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("FOSTER"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Foster), .party = {.NoItemCustomMoves = sParty_Foster}, }, @@ -666,7 +666,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DUSTY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Dusty2), .party = {.NoItemCustomMoves = sParty_Dusty2}, }, @@ -680,7 +680,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DUSTY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Dusty3), .party = {.NoItemCustomMoves = sParty_Dusty3}, }, @@ -694,7 +694,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DUSTY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Dusty4), .party = {.NoItemCustomMoves = sParty_Dusty4}, }, @@ -708,7 +708,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DUSTY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Dusty5), .party = {.NoItemCustomMoves = sParty_Dusty5}, }, @@ -722,7 +722,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GABBY & TY"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GabbyAndTy1), .party = {.NoItemDefaultMoves = sParty_GabbyAndTy1}, }, @@ -736,7 +736,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GABBY & TY"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GabbyAndTy2), .party = {.NoItemDefaultMoves = sParty_GabbyAndTy2}, }, @@ -750,7 +750,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GABBY & TY"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GabbyAndTy3), .party = {.NoItemDefaultMoves = sParty_GabbyAndTy3}, }, @@ -764,7 +764,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GABBY & TY"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GabbyAndTy4), .party = {.NoItemDefaultMoves = sParty_GabbyAndTy4}, }, @@ -778,7 +778,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GABBY & TY"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GabbyAndTy5), .party = {.NoItemDefaultMoves = sParty_GabbyAndTy5}, }, @@ -792,7 +792,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GABBY & TY"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GabbyAndTy6), .party = {.NoItemCustomMoves = sParty_GabbyAndTy6}, }, @@ -806,7 +806,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LOLA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Lola1), .party = {.NoItemDefaultMoves = sParty_Lola1}, }, @@ -820,7 +820,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("AUSTINA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Austina), .party = {.NoItemDefaultMoves = sParty_Austina}, }, @@ -834,7 +834,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GWEN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Gwen), .party = {.NoItemDefaultMoves = sParty_Gwen}, }, @@ -848,7 +848,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LOLA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Lola2), .party = {.NoItemDefaultMoves = sParty_Lola2}, }, @@ -862,7 +862,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LOLA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Lola3), .party = {.NoItemDefaultMoves = sParty_Lola3}, }, @@ -876,7 +876,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LOLA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Lola4), .party = {.NoItemDefaultMoves = sParty_Lola4}, }, @@ -890,7 +890,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LOLA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Lola5), .party = {.NoItemDefaultMoves = sParty_Lola5}, }, @@ -904,7 +904,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("RICKY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Ricky1), .party = {.NoItemCustomMoves = sParty_Ricky1}, }, @@ -918,7 +918,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SIMON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Simon), .party = {.NoItemDefaultMoves = sParty_Simon}, }, @@ -932,7 +932,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CHARLIE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Charlie), .party = {.NoItemDefaultMoves = sParty_Charlie}, }, @@ -946,7 +946,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("RICKY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Ricky2), .party = {.NoItemCustomMoves = sParty_Ricky2}, }, @@ -960,7 +960,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("RICKY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Ricky3), .party = {.NoItemCustomMoves = sParty_Ricky3}, }, @@ -974,7 +974,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("RICKY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Ricky4), .party = {.NoItemCustomMoves = sParty_Ricky4}, }, @@ -988,7 +988,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("RICKY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Ricky5), .party = {.NoItemCustomMoves = sParty_Ricky5}, }, @@ -1002,7 +1002,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("RANDALL"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Randall), .party = {.ItemCustomMoves = sParty_Randall}, }, @@ -1016,7 +1016,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("PARKER"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Parker), .party = {.ItemCustomMoves = sParty_Parker}, }, @@ -1030,7 +1030,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GEORGE"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_George), .party = {.ItemCustomMoves = sParty_George}, }, @@ -1044,7 +1044,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BERKE"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Berke), .party = {.ItemCustomMoves = sParty_Berke}, }, @@ -1058,7 +1058,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRAXTON"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Braxton), .party = {.NoItemCustomMoves = sParty_Braxton}, }, @@ -1072,7 +1072,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("VINCENT"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Vincent), .party = {.NoItemDefaultMoves = sParty_Vincent}, }, @@ -1086,7 +1086,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LEROY"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Leroy), .party = {.NoItemDefaultMoves = sParty_Leroy}, }, @@ -1100,7 +1100,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WILTON"), .items = {ITEM_SUPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Wilton1), .party = {.NoItemDefaultMoves = sParty_Wilton1}, }, @@ -1114,7 +1114,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("EDGAR"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Edgar), .party = {.NoItemDefaultMoves = sParty_Edgar}, }, @@ -1128,7 +1128,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ALBERT"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Albert), .party = {.NoItemDefaultMoves = sParty_Albert}, }, @@ -1142,7 +1142,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SAMUEL"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Samuel), .party = {.NoItemDefaultMoves = sParty_Samuel}, }, @@ -1156,7 +1156,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("VITO"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Vito), .party = {.NoItemDefaultMoves = sParty_Vito}, }, @@ -1170,7 +1170,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("OWEN"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Owen), .party = {.NoItemDefaultMoves = sParty_Owen}, }, @@ -1184,7 +1184,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WILTON"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Wilton2), .party = {.NoItemDefaultMoves = sParty_Wilton2}, }, @@ -1198,7 +1198,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WILTON"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Wilton3), .party = {.NoItemDefaultMoves = sParty_Wilton3}, }, @@ -1212,7 +1212,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WILTON"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Wilton4), .party = {.NoItemDefaultMoves = sParty_Wilton4}, }, @@ -1226,7 +1226,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WILTON"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Wilton5), .party = {.NoItemDefaultMoves = sParty_Wilton5}, }, @@ -1240,7 +1240,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WARREN"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Warren), .party = {.NoItemDefaultMoves = sParty_Warren}, }, @@ -1254,7 +1254,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MARY"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Mary), .party = {.ItemCustomMoves = sParty_Mary}, }, @@ -1268,7 +1268,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ALEXIA"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Alexia), .party = {.ItemCustomMoves = sParty_Alexia}, }, @@ -1282,7 +1282,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JODY"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_SETUP_FIRST_TURN, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SETUP_FIRST_TURN, .partySize = ARRAY_COUNT(sParty_Jody), .party = {.ItemCustomMoves = sParty_Jody}, }, @@ -1296,7 +1296,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WENDY"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_SETUP_FIRST_TURN, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SETUP_FIRST_TURN, .partySize = ARRAY_COUNT(sParty_Wendy), .party = {.NoItemCustomMoves = sParty_Wendy}, }, @@ -1310,7 +1310,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KEIRA"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_SETUP_FIRST_TURN, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SETUP_FIRST_TURN, .partySize = ARRAY_COUNT(sParty_Keira), .party = {.NoItemDefaultMoves = sParty_Keira}, }, @@ -1324,7 +1324,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BROOKE"), .items = {ITEM_SUPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Brooke1), .party = {.NoItemDefaultMoves = sParty_Brooke1}, }, @@ -1338,7 +1338,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JENNIFER"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Jennifer), .party = {.NoItemDefaultMoves = sParty_Jennifer}, }, @@ -1352,7 +1352,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("HOPE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Hope), .party = {.NoItemDefaultMoves = sParty_Hope}, }, @@ -1366,7 +1366,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SHANNON"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Shannon), .party = {.NoItemDefaultMoves = sParty_Shannon}, }, @@ -1380,7 +1380,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MICHELLE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Michelle), .party = {.NoItemDefaultMoves = sParty_Michelle}, }, @@ -1394,7 +1394,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CAROLINE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Caroline), .party = {.NoItemDefaultMoves = sParty_Caroline}, }, @@ -1408,7 +1408,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JULIE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Julie), .party = {.NoItemDefaultMoves = sParty_Julie}, }, @@ -1422,7 +1422,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BROOKE"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Brooke2), .party = {.NoItemDefaultMoves = sParty_Brooke2}, }, @@ -1436,7 +1436,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BROOKE"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Brooke3), .party = {.NoItemDefaultMoves = sParty_Brooke3}, }, @@ -1450,7 +1450,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BROOKE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Brooke4), .party = {.NoItemDefaultMoves = sParty_Brooke4}, }, @@ -1464,7 +1464,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BROOKE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Brooke5), .party = {.NoItemDefaultMoves = sParty_Brooke5}, }, @@ -1478,7 +1478,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("PATRICIA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Patricia), .party = {.NoItemDefaultMoves = sParty_Patricia}, }, @@ -1492,7 +1492,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KINDRA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Kindra), .party = {.NoItemDefaultMoves = sParty_Kindra}, }, @@ -1506,7 +1506,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TAMMY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Tammy), .party = {.NoItemDefaultMoves = sParty_Tammy}, }, @@ -1520,7 +1520,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("VALERIE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Valerie1), .party = {.NoItemDefaultMoves = sParty_Valerie1}, }, @@ -1534,7 +1534,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TASHA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Tasha), .party = {.NoItemDefaultMoves = sParty_Tasha}, }, @@ -1548,7 +1548,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("VALERIE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Valerie2), .party = {.NoItemDefaultMoves = sParty_Valerie2}, }, @@ -1562,7 +1562,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("VALERIE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Valerie3), .party = {.NoItemDefaultMoves = sParty_Valerie3}, }, @@ -1576,7 +1576,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("VALERIE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Valerie4), .party = {.NoItemDefaultMoves = sParty_Valerie4}, }, @@ -1590,7 +1590,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("VALERIE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Valerie5), .party = {.NoItemDefaultMoves = sParty_Valerie5}, }, @@ -1604,7 +1604,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CINDY"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Cindy1), .party = {.ItemDefaultMoves = sParty_Cindy1}, }, @@ -1618,7 +1618,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DAPHNE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Daphne), .party = {.ItemCustomMoves = sParty_Daphne}, }, @@ -1632,7 +1632,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntSpaceCenter2), .party = {.NoItemDefaultMoves = sParty_GruntSpaceCenter2}, }, @@ -1646,7 +1646,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CINDY"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Cindy2), .party = {.ItemCustomMoves = sParty_Cindy2}, }, @@ -1660,7 +1660,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRIANNA"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Brianna), .party = {.ItemDefaultMoves = sParty_Brianna}, }, @@ -1674,7 +1674,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NAOMI"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Naomi), .party = {.ItemDefaultMoves = sParty_Naomi}, }, @@ -1688,7 +1688,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CINDY"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Cindy3), .party = {.ItemDefaultMoves = sParty_Cindy3}, }, @@ -1702,7 +1702,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CINDY"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Cindy4), .party = {.ItemDefaultMoves = sParty_Cindy4}, }, @@ -1716,7 +1716,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CINDY"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Cindy5), .party = {.ItemDefaultMoves = sParty_Cindy5}, }, @@ -1730,7 +1730,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CINDY"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Cindy6), .party = {.ItemCustomMoves = sParty_Cindy6}, }, @@ -1744,7 +1744,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MELISSA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Melissa), .party = {.NoItemDefaultMoves = sParty_Melissa}, }, @@ -1758,7 +1758,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SHEILA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Sheila), .party = {.NoItemDefaultMoves = sParty_Sheila}, }, @@ -1772,7 +1772,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SHIRLEY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Shirley), .party = {.NoItemDefaultMoves = sParty_Shirley}, }, @@ -1786,7 +1786,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JESSICA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jessica1), .party = {.NoItemCustomMoves = sParty_Jessica1}, }, @@ -1800,7 +1800,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CONNIE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Connie), .party = {.NoItemDefaultMoves = sParty_Connie}, }, @@ -1814,7 +1814,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRIDGET"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Bridget), .party = {.NoItemDefaultMoves = sParty_Bridget}, }, @@ -1828,7 +1828,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("OLIVIA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Olivia), .party = {.NoItemCustomMoves = sParty_Olivia}, }, @@ -1842,7 +1842,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TIFFANY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Tiffany), .party = {.NoItemDefaultMoves = sParty_Tiffany}, }, @@ -1856,7 +1856,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JESSICA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jessica2), .party = {.NoItemCustomMoves = sParty_Jessica2}, }, @@ -1870,7 +1870,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JESSICA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jessica3), .party = {.NoItemCustomMoves = sParty_Jessica3}, }, @@ -1884,7 +1884,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JESSICA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jessica4), .party = {.NoItemCustomMoves = sParty_Jessica4}, }, @@ -1898,7 +1898,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JESSICA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jessica5), .party = {.NoItemCustomMoves = sParty_Jessica5}, }, @@ -1912,7 +1912,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WINSTON"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Winston1), .party = {.ItemDefaultMoves = sParty_Winston1}, }, @@ -1926,7 +1926,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MOLLIE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Mollie), .party = {.NoItemDefaultMoves = sParty_Mollie}, }, @@ -1940,7 +1940,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GARRET"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Garret), .party = {.ItemDefaultMoves = sParty_Garret}, }, @@ -1954,7 +1954,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WINSTON"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Winston2), .party = {.ItemDefaultMoves = sParty_Winston2}, }, @@ -1968,7 +1968,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WINSTON"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Winston3), .party = {.ItemDefaultMoves = sParty_Winston3}, }, @@ -1982,7 +1982,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WINSTON"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Winston4), .party = {.ItemDefaultMoves = sParty_Winston4}, }, @@ -1996,7 +1996,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WINSTON"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Winston5), .party = {.ItemCustomMoves = sParty_Winston5}, }, @@ -2010,7 +2010,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("STEVE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Steve1), .party = {.NoItemDefaultMoves = sParty_Steve1}, }, @@ -2024,7 +2024,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("THALIA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Thalia1), .party = {.NoItemDefaultMoves = sParty_Thalia1}, }, @@ -2038,7 +2038,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MARK"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Mark), .party = {.NoItemDefaultMoves = sParty_Mark}, }, @@ -2052,7 +2052,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntMtChimney1), .party = {.NoItemDefaultMoves = sParty_GruntMtChimney1}, }, @@ -2066,7 +2066,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("STEVE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Steve2), .party = {.NoItemDefaultMoves = sParty_Steve2}, }, @@ -2080,7 +2080,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("STEVE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Steve3), .party = {.NoItemDefaultMoves = sParty_Steve3}, }, @@ -2094,7 +2094,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("STEVE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Steve4), .party = {.NoItemDefaultMoves = sParty_Steve4}, }, @@ -2108,7 +2108,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("STEVE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Steve5), .party = {.NoItemDefaultMoves = sParty_Steve5}, }, @@ -2122,7 +2122,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LUIS"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Luis), .party = {.NoItemDefaultMoves = sParty_Luis}, }, @@ -2136,7 +2136,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DOMINIK"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Dominik), .party = {.NoItemDefaultMoves = sParty_Dominik}, }, @@ -2150,7 +2150,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DOUGLAS"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Douglas), .party = {.NoItemDefaultMoves = sParty_Douglas}, }, @@ -2164,7 +2164,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DARRIN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Darrin), .party = {.NoItemDefaultMoves = sParty_Darrin}, }, @@ -2178,7 +2178,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TONY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Tony1), .party = {.NoItemDefaultMoves = sParty_Tony1}, }, @@ -2192,7 +2192,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JEROME"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jerome), .party = {.NoItemDefaultMoves = sParty_Jerome}, }, @@ -2206,7 +2206,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MATTHEW"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Matthew), .party = {.NoItemDefaultMoves = sParty_Matthew}, }, @@ -2220,7 +2220,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DAVID"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_David), .party = {.NoItemDefaultMoves = sParty_David}, }, @@ -2234,7 +2234,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SPENCER"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Spencer), .party = {.NoItemDefaultMoves = sParty_Spencer}, }, @@ -2248,7 +2248,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ROLAND"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Roland), .party = {.NoItemDefaultMoves = sParty_Roland}, }, @@ -2262,7 +2262,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NOLEN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Nolen), .party = {.NoItemDefaultMoves = sParty_Nolen}, }, @@ -2276,7 +2276,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("STAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Stan), .party = {.NoItemDefaultMoves = sParty_Stan}, }, @@ -2290,7 +2290,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BARRY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Barry), .party = {.NoItemDefaultMoves = sParty_Barry}, }, @@ -2304,7 +2304,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DEAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Dean), .party = {.NoItemDefaultMoves = sParty_Dean}, }, @@ -2318,7 +2318,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("RODNEY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Rodney), .party = {.NoItemDefaultMoves = sParty_Rodney}, }, @@ -2332,7 +2332,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("RICHARD"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Richard), .party = {.NoItemDefaultMoves = sParty_Richard}, }, @@ -2346,7 +2346,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("HERMAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Herman), .party = {.NoItemDefaultMoves = sParty_Herman}, }, @@ -2360,7 +2360,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SANTIAGO"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Santiago), .party = {.NoItemDefaultMoves = sParty_Santiago}, }, @@ -2374,7 +2374,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GILBERT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Gilbert), .party = {.NoItemDefaultMoves = sParty_Gilbert}, }, @@ -2388,7 +2388,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("FRANKLIN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Franklin), .party = {.NoItemDefaultMoves = sParty_Franklin}, }, @@ -2402,7 +2402,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KEVIN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Kevin), .party = {.NoItemDefaultMoves = sParty_Kevin}, }, @@ -2416,7 +2416,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JACK"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jack), .party = {.NoItemDefaultMoves = sParty_Jack}, }, @@ -2430,7 +2430,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DUDLEY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Dudley), .party = {.NoItemDefaultMoves = sParty_Dudley}, }, @@ -2444,7 +2444,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CHAD"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Chad), .party = {.NoItemDefaultMoves = sParty_Chad}, }, @@ -2458,7 +2458,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TONY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Tony2), .party = {.NoItemDefaultMoves = sParty_Tony2}, }, @@ -2472,7 +2472,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TONY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Tony3), .party = {.NoItemDefaultMoves = sParty_Tony3}, }, @@ -2486,7 +2486,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TONY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Tony4), .party = {.NoItemDefaultMoves = sParty_Tony4}, }, @@ -2500,7 +2500,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TONY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Tony5), .party = {.NoItemDefaultMoves = sParty_Tony5}, }, @@ -2514,7 +2514,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TAKAO"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Takao), .party = {.NoItemDefaultMoves = sParty_Takao}, }, @@ -2528,7 +2528,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("HITOSHI"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Hitoshi), .party = {.NoItemDefaultMoves = sParty_Hitoshi}, }, @@ -2542,7 +2542,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KIYO"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Kiyo), .party = {.NoItemDefaultMoves = sParty_Kiyo}, }, @@ -2556,7 +2556,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KOICHI"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Koichi), .party = {.NoItemDefaultMoves = sParty_Koichi}, }, @@ -2570,7 +2570,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NOB"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Nob1), .party = {.NoItemDefaultMoves = sParty_Nob1}, }, @@ -2584,7 +2584,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NOB"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Nob2), .party = {.NoItemDefaultMoves = sParty_Nob2}, }, @@ -2598,7 +2598,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NOB"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Nob3), .party = {.NoItemDefaultMoves = sParty_Nob3}, }, @@ -2612,7 +2612,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NOB"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Nob4), .party = {.NoItemDefaultMoves = sParty_Nob4}, }, @@ -2626,7 +2626,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NOB"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Nob5), .party = {.ItemDefaultMoves = sParty_Nob5}, }, @@ -2640,7 +2640,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("YUJI"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Yuji), .party = {.NoItemDefaultMoves = sParty_Yuji}, }, @@ -2654,7 +2654,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DAISUKE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Daisuke), .party = {.NoItemDefaultMoves = sParty_Daisuke}, }, @@ -2668,7 +2668,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ATSUSHI"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Atsushi), .party = {.NoItemDefaultMoves = sParty_Atsushi}, }, @@ -2682,7 +2682,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KIRK"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Kirk), .party = {.NoItemCustomMoves = sParty_Kirk}, }, @@ -2696,7 +2696,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntAquaHideout7), .party = {.NoItemDefaultMoves = sParty_GruntAquaHideout7}, }, @@ -2710,7 +2710,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntAquaHideout8), .party = {.NoItemDefaultMoves = sParty_GruntAquaHideout8}, }, @@ -2724,7 +2724,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SHAWN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Shawn), .party = {.NoItemDefaultMoves = sParty_Shawn}, }, @@ -2738,7 +2738,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("FERNANDO"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Fernando1), .party = {.NoItemDefaultMoves = sParty_Fernando1}, }, @@ -2752,7 +2752,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DALTON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Dalton1), .party = {.NoItemDefaultMoves = sParty_Dalton1}, }, @@ -2766,7 +2766,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DALTON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Dalton2), .party = {.NoItemDefaultMoves = sParty_Dalton2}, }, @@ -2780,7 +2780,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DALTON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Dalton3), .party = {.NoItemDefaultMoves = sParty_Dalton3}, }, @@ -2794,7 +2794,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DALTON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Dalton4), .party = {.NoItemDefaultMoves = sParty_Dalton4}, }, @@ -2808,7 +2808,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DALTON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Dalton5), .party = {.NoItemDefaultMoves = sParty_Dalton5}, }, @@ -2822,7 +2822,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("COLE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Cole), .party = {.NoItemDefaultMoves = sParty_Cole}, }, @@ -2836,7 +2836,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JEFF"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jeff), .party = {.NoItemDefaultMoves = sParty_Jeff}, }, @@ -2850,7 +2850,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("AXLE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Axle), .party = {.NoItemDefaultMoves = sParty_Axle}, }, @@ -2864,7 +2864,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JACE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jace), .party = {.NoItemDefaultMoves = sParty_Jace}, }, @@ -2878,7 +2878,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KEEGAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Keegan), .party = {.NoItemDefaultMoves = sParty_Keegan}, }, @@ -2892,7 +2892,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BERNIE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Bernie1), .party = {.NoItemDefaultMoves = sParty_Bernie1}, }, @@ -2906,7 +2906,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BERNIE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Bernie2), .party = {.NoItemDefaultMoves = sParty_Bernie2}, }, @@ -2920,7 +2920,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BERNIE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Bernie3), .party = {.NoItemDefaultMoves = sParty_Bernie3}, }, @@ -2934,7 +2934,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BERNIE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Bernie4), .party = {.NoItemDefaultMoves = sParty_Bernie4}, }, @@ -2948,7 +2948,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BERNIE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Bernie5), .party = {.NoItemDefaultMoves = sParty_Bernie5}, }, @@ -2962,7 +2962,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DREW"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Drew), .party = {.NoItemCustomMoves = sParty_Drew}, }, @@ -2976,7 +2976,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BEAU"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Beau), .party = {.NoItemCustomMoves = sParty_Beau}, }, @@ -2990,7 +2990,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LARRY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Larry), .party = {.NoItemDefaultMoves = sParty_Larry}, }, @@ -3004,7 +3004,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SHANE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Shane), .party = {.NoItemDefaultMoves = sParty_Shane}, }, @@ -3018,7 +3018,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JUSTIN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Justin), .party = {.NoItemDefaultMoves = sParty_Justin}, }, @@ -3032,7 +3032,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ETHAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Ethan1), .party = {.NoItemDefaultMoves = sParty_Ethan1}, }, @@ -3046,7 +3046,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("AUTUMN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Autumn), .party = {.NoItemDefaultMoves = sParty_Autumn}, }, @@ -3060,7 +3060,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TRAVIS"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Travis), .party = {.NoItemDefaultMoves = sParty_Travis}, }, @@ -3074,7 +3074,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ETHAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Ethan2), .party = {.NoItemDefaultMoves = sParty_Ethan2}, }, @@ -3088,7 +3088,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ETHAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Ethan3), .party = {.NoItemDefaultMoves = sParty_Ethan3}, }, @@ -3102,7 +3102,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ETHAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Ethan4), .party = {.NoItemDefaultMoves = sParty_Ethan4}, }, @@ -3116,7 +3116,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ETHAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Ethan5), .party = {.NoItemDefaultMoves = sParty_Ethan5}, }, @@ -3130,7 +3130,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRENT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Brent), .party = {.NoItemDefaultMoves = sParty_Brent}, }, @@ -3144,7 +3144,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DONALD"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Donald), .party = {.NoItemDefaultMoves = sParty_Donald}, }, @@ -3158,7 +3158,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TAYLOR"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Taylor), .party = {.NoItemDefaultMoves = sParty_Taylor}, }, @@ -3172,7 +3172,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JEFFREY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jeffrey1), .party = {.NoItemDefaultMoves = sParty_Jeffrey1}, }, @@ -3186,7 +3186,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DEREK"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Derek), .party = {.NoItemDefaultMoves = sParty_Derek}, }, @@ -3200,7 +3200,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JEFFREY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jeffrey2), .party = {.NoItemDefaultMoves = sParty_Jeffrey2}, }, @@ -3214,7 +3214,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JEFFREY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jeffrey3), .party = {.NoItemDefaultMoves = sParty_Jeffrey3}, }, @@ -3228,7 +3228,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JEFFREY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jeffrey4), .party = {.NoItemDefaultMoves = sParty_Jeffrey4}, }, @@ -3242,7 +3242,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JEFFREY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jeffrey5), .party = {.ItemDefaultMoves = sParty_Jeffrey5}, }, @@ -3256,7 +3256,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("EDWARD"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Edward), .party = {.NoItemCustomMoves = sParty_Edward}, }, @@ -3270,7 +3270,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("PRESTON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Preston), .party = {.NoItemDefaultMoves = sParty_Preston}, }, @@ -3284,7 +3284,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("VIRGIL"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Virgil), .party = {.NoItemDefaultMoves = sParty_Virgil}, }, @@ -3298,7 +3298,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BLAKE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Blake), .party = {.NoItemDefaultMoves = sParty_Blake}, }, @@ -3312,7 +3312,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WILLIAM"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_William), .party = {.NoItemDefaultMoves = sParty_William}, }, @@ -3326,7 +3326,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JOSHUA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Joshua), .party = {.NoItemDefaultMoves = sParty_Joshua}, }, @@ -3340,7 +3340,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CAMERON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Cameron1), .party = {.NoItemDefaultMoves = sParty_Cameron1}, }, @@ -3354,7 +3354,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CAMERON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Cameron2), .party = {.NoItemDefaultMoves = sParty_Cameron2}, }, @@ -3368,7 +3368,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CAMERON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Cameron3), .party = {.NoItemDefaultMoves = sParty_Cameron3}, }, @@ -3382,7 +3382,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CAMERON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Cameron4), .party = {.NoItemDefaultMoves = sParty_Cameron4}, }, @@ -3396,7 +3396,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CAMERON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Cameron5), .party = {.NoItemDefaultMoves = sParty_Cameron5}, }, @@ -3410,7 +3410,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JACLYN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jaclyn), .party = {.NoItemCustomMoves = sParty_Jaclyn}, }, @@ -3424,7 +3424,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("HANNAH"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Hannah), .party = {.NoItemDefaultMoves = sParty_Hannah}, }, @@ -3438,7 +3438,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SAMANTHA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Samantha), .party = {.NoItemDefaultMoves = sParty_Samantha}, }, @@ -3452,7 +3452,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MAURA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Maura), .party = {.NoItemDefaultMoves = sParty_Maura}, }, @@ -3466,7 +3466,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KAYLA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Kayla), .party = {.NoItemDefaultMoves = sParty_Kayla}, }, @@ -3480,7 +3480,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ALEXIS"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Alexis), .party = {.NoItemDefaultMoves = sParty_Alexis}, }, @@ -3494,7 +3494,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JACKI"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jacki1), .party = {.NoItemDefaultMoves = sParty_Jacki1}, }, @@ -3508,7 +3508,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JACKI"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jacki2), .party = {.NoItemDefaultMoves = sParty_Jacki2}, }, @@ -3522,7 +3522,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JACKI"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jacki3), .party = {.NoItemDefaultMoves = sParty_Jacki3}, }, @@ -3536,7 +3536,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JACKI"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jacki4), .party = {.NoItemDefaultMoves = sParty_Jacki4}, }, @@ -3550,7 +3550,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JACKI"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jacki5), .party = {.NoItemDefaultMoves = sParty_Jacki5}, }, @@ -3564,7 +3564,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WALTER"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Walter1), .party = {.NoItemDefaultMoves = sParty_Walter1}, }, @@ -3578,7 +3578,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MICAH"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Micah), .party = {.NoItemDefaultMoves = sParty_Micah}, }, @@ -3592,7 +3592,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("THOMAS"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Thomas), .party = {.NoItemDefaultMoves = sParty_Thomas}, }, @@ -3606,7 +3606,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WALTER"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Walter2), .party = {.NoItemDefaultMoves = sParty_Walter2}, }, @@ -3620,7 +3620,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WALTER"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Walter3), .party = {.NoItemCustomMoves = sParty_Walter3}, }, @@ -3634,7 +3634,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WALTER"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Walter4), .party = {.NoItemCustomMoves = sParty_Walter4}, }, @@ -3648,7 +3648,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WALTER"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Walter5), .party = {.NoItemCustomMoves = sParty_Walter5}, }, @@ -3662,7 +3662,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SIDNEY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY | AI_SCRIPT_SETUP_FIRST_TURN, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY | AI_FLAG_SETUP_FIRST_TURN, .partySize = ARRAY_COUNT(sParty_Sidney), .party = {.ItemCustomMoves = sParty_Sidney}, }, @@ -3676,7 +3676,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("PHOEBE"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Phoebe), .party = {.ItemCustomMoves = sParty_Phoebe}, }, @@ -3690,7 +3690,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GLACIA"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Glacia), .party = {.ItemCustomMoves = sParty_Glacia}, }, @@ -3704,7 +3704,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DRAKE"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Drake), .party = {.ItemCustomMoves = sParty_Drake}, }, @@ -3718,7 +3718,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ROXANNE"), .items = {ITEM_POTION, ITEM_POTION, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Roxanne1), .party = {.ItemCustomMoves = sParty_Roxanne1}, }, @@ -3732,7 +3732,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRAWLY"), .items = {ITEM_SUPER_POTION, ITEM_SUPER_POTION, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Brawly1), .party = {.ItemCustomMoves = sParty_Brawly1}, }, @@ -3746,7 +3746,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WATTSON"), .items = {ITEM_SUPER_POTION, ITEM_SUPER_POTION, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Wattson1), .party = {.ItemCustomMoves = sParty_Wattson1}, }, @@ -3760,7 +3760,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("FLANNERY"), .items = {ITEM_HYPER_POTION, ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Flannery1), .party = {.ItemCustomMoves = sParty_Flannery1}, }, @@ -3774,7 +3774,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NORMAN"), .items = {ITEM_HYPER_POTION, ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Norman1), .party = {.ItemCustomMoves = sParty_Norman1}, }, @@ -3788,7 +3788,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WINONA"), .items = {ITEM_HYPER_POTION, ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY | AI_SCRIPT_RISKY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY | AI_FLAG_RISKY, .partySize = ARRAY_COUNT(sParty_Winona1), .party = {.ItemCustomMoves = sParty_Winona1}, }, @@ -3802,7 +3802,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TATE&LIZA"), .items = {ITEM_HYPER_POTION, ITEM_HYPER_POTION, ITEM_HYPER_POTION, ITEM_HYPER_POTION}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_TateAndLiza1), .party = {.ItemCustomMoves = sParty_TateAndLiza1}, }, @@ -3816,7 +3816,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JUAN"), .items = {ITEM_HYPER_POTION, ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Juan1), .party = {.ItemCustomMoves = sParty_Juan1}, }, @@ -3830,7 +3830,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JERRY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jerry1), .party = {.NoItemDefaultMoves = sParty_Jerry1}, }, @@ -3844,7 +3844,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TED"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Ted), .party = {.NoItemDefaultMoves = sParty_Ted}, }, @@ -3858,7 +3858,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("PAUL"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Paul), .party = {.NoItemDefaultMoves = sParty_Paul}, }, @@ -3872,7 +3872,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JERRY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jerry2), .party = {.NoItemDefaultMoves = sParty_Jerry2}, }, @@ -3886,7 +3886,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JERRY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jerry3), .party = {.NoItemDefaultMoves = sParty_Jerry3}, }, @@ -3900,7 +3900,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JERRY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jerry4), .party = {.NoItemDefaultMoves = sParty_Jerry4}, }, @@ -3914,7 +3914,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JERRY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jerry5), .party = {.NoItemDefaultMoves = sParty_Jerry5}, }, @@ -3928,7 +3928,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KAREN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Karen1), .party = {.NoItemDefaultMoves = sParty_Karen1}, }, @@ -3942,7 +3942,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GEORGIA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Georgia), .party = {.NoItemDefaultMoves = sParty_Georgia}, }, @@ -3956,7 +3956,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KAREN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Karen2), .party = {.NoItemDefaultMoves = sParty_Karen2}, }, @@ -3970,7 +3970,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KAREN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Karen3), .party = {.NoItemDefaultMoves = sParty_Karen3}, }, @@ -3984,7 +3984,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KAREN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Karen4), .party = {.NoItemDefaultMoves = sParty_Karen4}, }, @@ -3998,7 +3998,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KAREN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Karen5), .party = {.NoItemDefaultMoves = sParty_Karen5}, }, @@ -4012,7 +4012,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KATE & JOY"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_KateAndJoy), .party = {.NoItemCustomMoves = sParty_KateAndJoy}, }, @@ -4026,7 +4026,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ANNA & MEG"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_AnnaAndMeg1), .party = {.NoItemCustomMoves = sParty_AnnaAndMeg1}, }, @@ -4040,7 +4040,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ANNA & MEG"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_AnnaAndMeg2), .party = {.NoItemCustomMoves = sParty_AnnaAndMeg2}, }, @@ -4054,7 +4054,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ANNA & MEG"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_AnnaAndMeg3), .party = {.NoItemCustomMoves = sParty_AnnaAndMeg3}, }, @@ -4068,7 +4068,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ANNA & MEG"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_AnnaAndMeg4), .party = {.NoItemCustomMoves = sParty_AnnaAndMeg4}, }, @@ -4082,7 +4082,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ANNA & MEG"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_AnnaAndMeg5), .party = {.NoItemCustomMoves = sParty_AnnaAndMeg5}, }, @@ -4096,7 +4096,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("VICTOR"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Victor), .party = {.ItemDefaultMoves = sParty_Victor}, }, @@ -4110,7 +4110,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MIGUEL"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Miguel1), .party = {.ItemDefaultMoves = sParty_Miguel1}, }, @@ -4124,7 +4124,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("COLTON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Colton), .party = {.ItemCustomMoves = sParty_Colton}, }, @@ -4138,7 +4138,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MIGUEL"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Miguel2), .party = {.ItemDefaultMoves = sParty_Miguel2}, }, @@ -4152,7 +4152,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MIGUEL"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Miguel3), .party = {.ItemDefaultMoves = sParty_Miguel3}, }, @@ -4166,7 +4166,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MIGUEL"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Miguel4), .party = {.ItemDefaultMoves = sParty_Miguel4}, }, @@ -4180,7 +4180,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MIGUEL"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Miguel5), .party = {.ItemDefaultMoves = sParty_Miguel5}, }, @@ -4194,7 +4194,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("VICTORIA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT, .partySize = ARRAY_COUNT(sParty_Victoria), .party = {.ItemDefaultMoves = sParty_Victoria}, }, @@ -4208,7 +4208,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("VANESSA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Vanessa), .party = {.ItemDefaultMoves = sParty_Vanessa}, }, @@ -4222,7 +4222,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BETHANY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Bethany), .party = {.ItemDefaultMoves = sParty_Bethany}, }, @@ -4236,7 +4236,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ISABEL"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Isabel1), .party = {.ItemDefaultMoves = sParty_Isabel1}, }, @@ -4250,7 +4250,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ISABEL"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Isabel2), .party = {.ItemDefaultMoves = sParty_Isabel2}, }, @@ -4264,7 +4264,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ISABEL"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Isabel3), .party = {.ItemDefaultMoves = sParty_Isabel3}, }, @@ -4278,7 +4278,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ISABEL"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Isabel4), .party = {.ItemDefaultMoves = sParty_Isabel4}, }, @@ -4292,7 +4292,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ISABEL"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Isabel5), .party = {.ItemDefaultMoves = sParty_Isabel5}, }, @@ -4306,7 +4306,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TIMOTHY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Timothy1), .party = {.NoItemDefaultMoves = sParty_Timothy1}, }, @@ -4320,7 +4320,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TIMOTHY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Timothy2), .party = {.NoItemCustomMoves = sParty_Timothy2}, }, @@ -4334,7 +4334,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TIMOTHY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Timothy3), .party = {.NoItemCustomMoves = sParty_Timothy3}, }, @@ -4348,7 +4348,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TIMOTHY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Timothy4), .party = {.NoItemCustomMoves = sParty_Timothy4}, }, @@ -4362,7 +4362,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TIMOTHY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Timothy5), .party = {.NoItemCustomMoves = sParty_Timothy5}, }, @@ -4376,7 +4376,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("VICKY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Vicky), .party = {.NoItemCustomMoves = sParty_Vicky}, }, @@ -4390,7 +4390,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SHELBY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Shelby1), .party = {.NoItemDefaultMoves = sParty_Shelby1}, }, @@ -4404,7 +4404,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SHELBY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Shelby2), .party = {.NoItemDefaultMoves = sParty_Shelby2}, }, @@ -4418,7 +4418,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SHELBY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Shelby3), .party = {.NoItemDefaultMoves = sParty_Shelby3}, }, @@ -4432,7 +4432,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SHELBY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Shelby4), .party = {.NoItemDefaultMoves = sParty_Shelby4}, }, @@ -4446,7 +4446,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SHELBY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Shelby5), .party = {.NoItemDefaultMoves = sParty_Shelby5}, }, @@ -4460,7 +4460,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CALVIN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Calvin1), .party = {.NoItemDefaultMoves = sParty_Calvin1}, }, @@ -4474,7 +4474,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BILLY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Billy), .party = {.NoItemDefaultMoves = sParty_Billy}, }, @@ -4488,7 +4488,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JOSH"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Josh), .party = {.NoItemCustomMoves = sParty_Josh}, }, @@ -4502,7 +4502,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TOMMY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Tommy), .party = {.NoItemDefaultMoves = sParty_Tommy}, }, @@ -4516,7 +4516,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JOEY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Joey), .party = {.NoItemDefaultMoves = sParty_Joey}, }, @@ -4530,7 +4530,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BEN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Ben), .party = {.NoItemCustomMoves = sParty_Ben}, }, @@ -4544,7 +4544,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("QUINCY"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Quincy), .party = {.NoItemCustomMoves = sParty_Quincy}, }, @@ -4558,7 +4558,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KATELYNN"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Katelynn), .party = {.NoItemCustomMoves = sParty_Katelynn}, }, @@ -4572,7 +4572,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JAYLEN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jaylen), .party = {.NoItemDefaultMoves = sParty_Jaylen}, }, @@ -4586,7 +4586,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DILLON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Dillon), .party = {.NoItemDefaultMoves = sParty_Dillon}, }, @@ -4600,7 +4600,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CALVIN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Calvin2), .party = {.NoItemDefaultMoves = sParty_Calvin2}, }, @@ -4614,7 +4614,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CALVIN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Calvin3), .party = {.NoItemDefaultMoves = sParty_Calvin3}, }, @@ -4628,7 +4628,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CALVIN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Calvin4), .party = {.NoItemDefaultMoves = sParty_Calvin4}, }, @@ -4642,7 +4642,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CALVIN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Calvin5), .party = {.NoItemDefaultMoves = sParty_Calvin5}, }, @@ -4656,7 +4656,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("EDDIE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Eddie), .party = {.NoItemDefaultMoves = sParty_Eddie}, }, @@ -4670,7 +4670,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ALLEN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Allen), .party = {.NoItemDefaultMoves = sParty_Allen}, }, @@ -4684,7 +4684,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TIMMY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Timmy), .party = {.NoItemDefaultMoves = sParty_Timmy}, }, @@ -4698,7 +4698,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WALLACE"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Wallace), .party = {.ItemCustomMoves = sParty_Wallace}, }, @@ -4712,7 +4712,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ANDREW"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Andrew), .party = {.NoItemDefaultMoves = sParty_Andrew}, }, @@ -4726,7 +4726,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("IVAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Ivan), .party = {.NoItemDefaultMoves = sParty_Ivan}, }, @@ -4740,7 +4740,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CLAUDE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Claude), .party = {.NoItemDefaultMoves = sParty_Claude}, }, @@ -4754,7 +4754,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ELLIOT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Elliot1), .party = {.NoItemDefaultMoves = sParty_Elliot1}, }, @@ -4768,7 +4768,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NED"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Ned), .party = {.NoItemDefaultMoves = sParty_Ned}, }, @@ -4782,7 +4782,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DALE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Dale), .party = {.NoItemDefaultMoves = sParty_Dale}, }, @@ -4796,7 +4796,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NOLAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Nolan), .party = {.NoItemDefaultMoves = sParty_Nolan}, }, @@ -4810,7 +4810,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BARNY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Barny), .party = {.NoItemDefaultMoves = sParty_Barny}, }, @@ -4824,7 +4824,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WADE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Wade), .party = {.NoItemDefaultMoves = sParty_Wade}, }, @@ -4838,7 +4838,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CARTER"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Carter), .party = {.NoItemDefaultMoves = sParty_Carter}, }, @@ -4852,7 +4852,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ELLIOT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Elliot2), .party = {.NoItemDefaultMoves = sParty_Elliot2}, }, @@ -4866,7 +4866,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ELLIOT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Elliot3), .party = {.NoItemDefaultMoves = sParty_Elliot3}, }, @@ -4880,7 +4880,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ELLIOT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Elliot4), .party = {.NoItemDefaultMoves = sParty_Elliot4}, }, @@ -4894,7 +4894,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ELLIOT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT, .partySize = ARRAY_COUNT(sParty_Elliot5), .party = {.NoItemDefaultMoves = sParty_Elliot5}, }, @@ -4908,7 +4908,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("RONALD"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Ronald), .party = {.NoItemDefaultMoves = sParty_Ronald}, }, @@ -4922,7 +4922,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JACOB"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jacob), .party = {.NoItemDefaultMoves = sParty_Jacob}, }, @@ -4936,7 +4936,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ANTHONY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Anthony), .party = {.NoItemDefaultMoves = sParty_Anthony}, }, @@ -4950,7 +4950,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BENJAMIN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Benjamin1), .party = {.NoItemDefaultMoves = sParty_Benjamin1}, }, @@ -4964,7 +4964,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BENJAMIN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Benjamin2), .party = {.NoItemDefaultMoves = sParty_Benjamin2}, }, @@ -4978,7 +4978,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BENJAMIN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Benjamin3), .party = {.NoItemDefaultMoves = sParty_Benjamin3}, }, @@ -4992,7 +4992,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BENJAMIN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Benjamin4), .party = {.NoItemDefaultMoves = sParty_Benjamin4}, }, @@ -5006,7 +5006,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BENJAMIN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Benjamin5), .party = {.NoItemDefaultMoves = sParty_Benjamin5}, }, @@ -5020,7 +5020,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ABIGAIL"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Abigail1), .party = {.NoItemDefaultMoves = sParty_Abigail1}, }, @@ -5034,7 +5034,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JASMINE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jasmine), .party = {.NoItemDefaultMoves = sParty_Jasmine}, }, @@ -5048,7 +5048,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ABIGAIL"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Abigail2), .party = {.NoItemDefaultMoves = sParty_Abigail2}, }, @@ -5062,7 +5062,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ABIGAIL"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Abigail3), .party = {.NoItemDefaultMoves = sParty_Abigail3}, }, @@ -5076,7 +5076,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ABIGAIL"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Abigail4), .party = {.NoItemDefaultMoves = sParty_Abigail4}, }, @@ -5090,7 +5090,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ABIGAIL"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Abigail5), .party = {.NoItemDefaultMoves = sParty_Abigail5}, }, @@ -5104,7 +5104,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DYLAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Dylan1), .party = {.NoItemDefaultMoves = sParty_Dylan1}, }, @@ -5118,7 +5118,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DYLAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Dylan2), .party = {.NoItemDefaultMoves = sParty_Dylan2}, }, @@ -5132,7 +5132,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DYLAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Dylan3), .party = {.NoItemDefaultMoves = sParty_Dylan3}, }, @@ -5146,7 +5146,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DYLAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Dylan4), .party = {.NoItemDefaultMoves = sParty_Dylan4}, }, @@ -5160,7 +5160,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DYLAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Dylan5), .party = {.NoItemDefaultMoves = sParty_Dylan5}, }, @@ -5174,7 +5174,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MARIA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Maria1), .party = {.NoItemDefaultMoves = sParty_Maria1}, }, @@ -5188,7 +5188,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MARIA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Maria2), .party = {.NoItemDefaultMoves = sParty_Maria2}, }, @@ -5202,7 +5202,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MARIA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Maria3), .party = {.NoItemDefaultMoves = sParty_Maria3}, }, @@ -5216,7 +5216,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MARIA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Maria4), .party = {.NoItemDefaultMoves = sParty_Maria4}, }, @@ -5230,7 +5230,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MARIA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Maria5), .party = {.NoItemDefaultMoves = sParty_Maria5}, }, @@ -5244,7 +5244,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CAMDEN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Camden), .party = {.NoItemDefaultMoves = sParty_Camden}, }, @@ -5258,7 +5258,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DEMETRIUS"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Demetrius), .party = {.NoItemDefaultMoves = sParty_Demetrius}, }, @@ -5272,7 +5272,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ISAIAH"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Isaiah1), .party = {.NoItemDefaultMoves = sParty_Isaiah1}, }, @@ -5286,7 +5286,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("PABLO"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Pablo1), .party = {.NoItemDefaultMoves = sParty_Pablo1}, }, @@ -5300,7 +5300,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CHASE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Chase), .party = {.NoItemDefaultMoves = sParty_Chase}, }, @@ -5314,7 +5314,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ISAIAH"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Isaiah2), .party = {.NoItemDefaultMoves = sParty_Isaiah2}, }, @@ -5328,7 +5328,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ISAIAH"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Isaiah3), .party = {.NoItemDefaultMoves = sParty_Isaiah3}, }, @@ -5342,7 +5342,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ISAIAH"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Isaiah4), .party = {.NoItemDefaultMoves = sParty_Isaiah4}, }, @@ -5356,7 +5356,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ISAIAH"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Isaiah5), .party = {.NoItemDefaultMoves = sParty_Isaiah5}, }, @@ -5370,7 +5370,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ISOBEL"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Isobel), .party = {.NoItemDefaultMoves = sParty_Isobel}, }, @@ -5384,7 +5384,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DONNY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Donny), .party = {.NoItemDefaultMoves = sParty_Donny}, }, @@ -5398,7 +5398,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TALIA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Talia), .party = {.NoItemDefaultMoves = sParty_Talia}, }, @@ -5412,7 +5412,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KATELYN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Katelyn1), .party = {.NoItemDefaultMoves = sParty_Katelyn1}, }, @@ -5426,7 +5426,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ALLISON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Allison), .party = {.NoItemDefaultMoves = sParty_Allison}, }, @@ -5440,7 +5440,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KATELYN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Katelyn2), .party = {.NoItemDefaultMoves = sParty_Katelyn2}, }, @@ -5454,7 +5454,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KATELYN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Katelyn3), .party = {.NoItemDefaultMoves = sParty_Katelyn3}, }, @@ -5468,7 +5468,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KATELYN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Katelyn4), .party = {.NoItemDefaultMoves = sParty_Katelyn4}, }, @@ -5482,7 +5482,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KATELYN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Katelyn5), .party = {.NoItemDefaultMoves = sParty_Katelyn5}, }, @@ -5496,7 +5496,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NICOLAS"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Nicolas1), .party = {.NoItemDefaultMoves = sParty_Nicolas1}, }, @@ -5510,7 +5510,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NICOLAS"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Nicolas2), .party = {.NoItemDefaultMoves = sParty_Nicolas2}, }, @@ -5524,7 +5524,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NICOLAS"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Nicolas3), .party = {.NoItemDefaultMoves = sParty_Nicolas3}, }, @@ -5538,7 +5538,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NICOLAS"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Nicolas4), .party = {.NoItemDefaultMoves = sParty_Nicolas4}, }, @@ -5552,7 +5552,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NICOLAS"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Nicolas5), .party = {.ItemDefaultMoves = sParty_Nicolas5}, }, @@ -5566,7 +5566,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("AARON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Aaron), .party = {.NoItemCustomMoves = sParty_Aaron}, }, @@ -5580,7 +5580,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("PERRY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Perry), .party = {.NoItemDefaultMoves = sParty_Perry}, }, @@ -5594,7 +5594,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("HUGH"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Hugh), .party = {.NoItemDefaultMoves = sParty_Hugh}, }, @@ -5608,7 +5608,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("PHIL"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Phil), .party = {.NoItemDefaultMoves = sParty_Phil}, }, @@ -5622,7 +5622,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JARED"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jared), .party = {.NoItemDefaultMoves = sParty_Jared}, }, @@ -5636,7 +5636,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("HUMBERTO"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Humberto), .party = {.NoItemDefaultMoves = sParty_Humberto}, }, @@ -5650,7 +5650,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("PRESLEY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Presley), .party = {.NoItemDefaultMoves = sParty_Presley}, }, @@ -5664,7 +5664,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("EDWARDO"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Edwardo), .party = {.NoItemDefaultMoves = sParty_Edwardo}, }, @@ -5678,7 +5678,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("COLIN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Colin), .party = {.NoItemDefaultMoves = sParty_Colin}, }, @@ -5692,7 +5692,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ROBERT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Robert1), .party = {.NoItemDefaultMoves = sParty_Robert1}, }, @@ -5706,7 +5706,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BENNY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Benny), .party = {.NoItemDefaultMoves = sParty_Benny}, }, @@ -5720,7 +5720,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CHESTER"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Chester), .party = {.NoItemDefaultMoves = sParty_Chester}, }, @@ -5734,7 +5734,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ROBERT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Robert2), .party = {.NoItemDefaultMoves = sParty_Robert2}, }, @@ -5748,7 +5748,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ROBERT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Robert3), .party = {.NoItemDefaultMoves = sParty_Robert3}, }, @@ -5762,7 +5762,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ROBERT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Robert4), .party = {.NoItemDefaultMoves = sParty_Robert4}, }, @@ -5776,7 +5776,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ROBERT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Robert5), .party = {.NoItemDefaultMoves = sParty_Robert5}, }, @@ -5790,7 +5790,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ALEX"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Alex), .party = {.NoItemDefaultMoves = sParty_Alex}, }, @@ -5804,7 +5804,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BECK"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Beck), .party = {.NoItemDefaultMoves = sParty_Beck}, }, @@ -5818,7 +5818,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("YASU"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT, .partySize = ARRAY_COUNT(sParty_Yasu), .party = {.NoItemDefaultMoves = sParty_Yasu}, }, @@ -5832,7 +5832,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TAKASHI"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT, .partySize = ARRAY_COUNT(sParty_Takashi), .party = {.NoItemDefaultMoves = sParty_Takashi}, }, @@ -5958,7 +5958,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JOCELYN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jocelyn), .party = {.NoItemDefaultMoves = sParty_Jocelyn}, }, @@ -5972,7 +5972,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LAURA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Laura), .party = {.NoItemDefaultMoves = sParty_Laura}, }, @@ -5986,7 +5986,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CYNDY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Cyndy1), .party = {.NoItemDefaultMoves = sParty_Cyndy1}, }, @@ -6000,7 +6000,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CORA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Cora), .party = {.NoItemDefaultMoves = sParty_Cora}, }, @@ -6014,7 +6014,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("PAULA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Paula), .party = {.NoItemDefaultMoves = sParty_Paula}, }, @@ -6028,7 +6028,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CYNDY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Cyndy2), .party = {.NoItemDefaultMoves = sParty_Cyndy2}, }, @@ -6042,7 +6042,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CYNDY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Cyndy3), .party = {.NoItemDefaultMoves = sParty_Cyndy3}, }, @@ -6056,7 +6056,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CYNDY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Cyndy4), .party = {.NoItemDefaultMoves = sParty_Cyndy4}, }, @@ -6070,7 +6070,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CYNDY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Cyndy5), .party = {.NoItemDefaultMoves = sParty_Cyndy5}, }, @@ -6084,7 +6084,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MADELINE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Madeline1), .party = {.NoItemCustomMoves = sParty_Madeline1}, }, @@ -6098,7 +6098,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CLARISSA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Clarissa), .party = {.NoItemDefaultMoves = sParty_Clarissa}, }, @@ -6112,7 +6112,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ANGELICA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Angelica), .party = {.NoItemCustomMoves = sParty_Angelica}, }, @@ -6126,7 +6126,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MADELINE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Madeline2), .party = {.NoItemCustomMoves = sParty_Madeline2}, }, @@ -6140,7 +6140,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MADELINE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Madeline3), .party = {.NoItemCustomMoves = sParty_Madeline3}, }, @@ -6154,7 +6154,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MADELINE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Madeline4), .party = {.NoItemCustomMoves = sParty_Madeline4}, }, @@ -6168,7 +6168,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MADELINE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Madeline5), .party = {.NoItemCustomMoves = sParty_Madeline5}, }, @@ -6182,7 +6182,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BEVERLY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Beverly), .party = {.NoItemDefaultMoves = sParty_Beverly}, }, @@ -6196,7 +6196,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("IMANI"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Imani), .party = {.NoItemDefaultMoves = sParty_Imani}, }, @@ -6210,7 +6210,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KYLA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Kyla), .party = {.NoItemDefaultMoves = sParty_Kyla}, }, @@ -6224,7 +6224,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DENISE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Denise), .party = {.NoItemDefaultMoves = sParty_Denise}, }, @@ -6238,7 +6238,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BETH"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Beth), .party = {.NoItemDefaultMoves = sParty_Beth}, }, @@ -6252,7 +6252,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TARA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Tara), .party = {.NoItemDefaultMoves = sParty_Tara}, }, @@ -6266,7 +6266,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MISSY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Missy), .party = {.NoItemDefaultMoves = sParty_Missy}, }, @@ -6280,7 +6280,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ALICE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Alice), .party = {.NoItemDefaultMoves = sParty_Alice}, }, @@ -6294,7 +6294,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JENNY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jenny1), .party = {.NoItemDefaultMoves = sParty_Jenny1}, }, @@ -6308,7 +6308,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRACE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Grace), .party = {.NoItemDefaultMoves = sParty_Grace}, }, @@ -6322,7 +6322,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TANYA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Tanya), .party = {.NoItemDefaultMoves = sParty_Tanya}, }, @@ -6336,7 +6336,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SHARON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Sharon), .party = {.NoItemDefaultMoves = sParty_Sharon}, }, @@ -6350,7 +6350,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NIKKI"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Nikki), .party = {.NoItemDefaultMoves = sParty_Nikki}, }, @@ -6364,7 +6364,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRENDA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Brenda), .party = {.NoItemDefaultMoves = sParty_Brenda}, }, @@ -6378,7 +6378,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KATIE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Katie), .party = {.NoItemDefaultMoves = sParty_Katie}, }, @@ -6392,7 +6392,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SUSIE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Susie), .party = {.NoItemDefaultMoves = sParty_Susie}, }, @@ -6406,7 +6406,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KARA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Kara), .party = {.NoItemDefaultMoves = sParty_Kara}, }, @@ -6420,7 +6420,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DANA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Dana), .party = {.NoItemDefaultMoves = sParty_Dana}, }, @@ -6434,7 +6434,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SIENNA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Sienna), .party = {.NoItemDefaultMoves = sParty_Sienna}, }, @@ -6448,7 +6448,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DEBRA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Debra), .party = {.NoItemDefaultMoves = sParty_Debra}, }, @@ -6462,7 +6462,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LINDA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Linda), .party = {.NoItemDefaultMoves = sParty_Linda}, }, @@ -6476,7 +6476,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KAYLEE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Kaylee), .party = {.NoItemDefaultMoves = sParty_Kaylee}, }, @@ -6490,7 +6490,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LAUREL"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Laurel), .party = {.NoItemDefaultMoves = sParty_Laurel}, }, @@ -6504,7 +6504,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CARLEE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Carlee), .party = {.NoItemDefaultMoves = sParty_Carlee}, }, @@ -6518,7 +6518,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JENNY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jenny2), .party = {.NoItemDefaultMoves = sParty_Jenny2}, }, @@ -6532,7 +6532,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JENNY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jenny3), .party = {.NoItemDefaultMoves = sParty_Jenny3}, }, @@ -6546,7 +6546,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JENNY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jenny4), .party = {.NoItemDefaultMoves = sParty_Jenny4}, }, @@ -6560,7 +6560,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JENNY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jenny5), .party = {.NoItemDefaultMoves = sParty_Jenny5}, }, @@ -6574,7 +6574,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("HEIDI"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Heidi), .party = {.NoItemCustomMoves = sParty_Heidi}, }, @@ -6588,7 +6588,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BECKY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Becky), .party = {.NoItemCustomMoves = sParty_Becky}, }, @@ -6602,7 +6602,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CAROL"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Carol), .party = {.NoItemDefaultMoves = sParty_Carol}, }, @@ -6616,7 +6616,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NANCY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Nancy), .party = {.NoItemDefaultMoves = sParty_Nancy}, }, @@ -6630,7 +6630,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MARTHA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Martha), .party = {.NoItemDefaultMoves = sParty_Martha}, }, @@ -6644,7 +6644,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DIANA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Diana1), .party = {.NoItemDefaultMoves = sParty_Diana1}, }, @@ -6658,7 +6658,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CEDRIC"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Cedric), .party = {.NoItemCustomMoves = sParty_Cedric}, }, @@ -6672,7 +6672,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("IRENE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Irene), .party = {.NoItemDefaultMoves = sParty_Irene}, }, @@ -6686,7 +6686,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DIANA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Diana2), .party = {.NoItemDefaultMoves = sParty_Diana2}, }, @@ -6700,7 +6700,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DIANA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Diana3), .party = {.NoItemDefaultMoves = sParty_Diana3}, }, @@ -6714,7 +6714,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DIANA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Diana4), .party = {.NoItemDefaultMoves = sParty_Diana4}, }, @@ -6728,7 +6728,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DIANA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Diana5), .party = {.NoItemDefaultMoves = sParty_Diana5}, }, @@ -6742,7 +6742,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("AMY & LIV"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_AmyAndLiv1), .party = {.NoItemDefaultMoves = sParty_AmyAndLiv1}, }, @@ -6756,7 +6756,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("AMY & LIV"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_AmyAndLiv2), .party = {.NoItemDefaultMoves = sParty_AmyAndLiv2}, }, @@ -6770,7 +6770,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GINA & MIA"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GinaAndMia1), .party = {.NoItemDefaultMoves = sParty_GinaAndMia1}, }, @@ -6784,7 +6784,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MIU & YUKI"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_MiuAndYuki), .party = {.NoItemDefaultMoves = sParty_MiuAndYuki}, }, @@ -6798,7 +6798,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("AMY & LIV"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_AmyAndLiv3), .party = {.NoItemDefaultMoves = sParty_AmyAndLiv3}, }, @@ -6812,7 +6812,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GINA & MIA"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GinaAndMia2), .party = {.NoItemCustomMoves = sParty_GinaAndMia2}, }, @@ -6826,7 +6826,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("AMY & LIV"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_AmyAndLiv4), .party = {.NoItemDefaultMoves = sParty_AmyAndLiv4}, }, @@ -6840,7 +6840,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("AMY & LIV"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_AmyAndLiv5), .party = {.NoItemCustomMoves = sParty_AmyAndLiv5}, }, @@ -6854,7 +6854,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("AMY & LIV"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_AmyAndLiv6), .party = {.NoItemCustomMoves = sParty_AmyAndLiv6}, }, @@ -6868,7 +6868,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("HUEY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Huey), .party = {.NoItemDefaultMoves = sParty_Huey}, }, @@ -6882,7 +6882,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("EDMOND"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Edmond), .party = {.NoItemDefaultMoves = sParty_Edmond}, }, @@ -6896,7 +6896,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ERNEST"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Ernest1), .party = {.NoItemDefaultMoves = sParty_Ernest1}, }, @@ -6910,7 +6910,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DWAYNE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Dwayne), .party = {.NoItemDefaultMoves = sParty_Dwayne}, }, @@ -6924,7 +6924,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("PHILLIP"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Phillip), .party = {.NoItemDefaultMoves = sParty_Phillip}, }, @@ -6938,7 +6938,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LEONARD"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Leonard), .party = {.NoItemDefaultMoves = sParty_Leonard}, }, @@ -6952,7 +6952,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DUNCAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Duncan), .party = {.NoItemDefaultMoves = sParty_Duncan}, }, @@ -6966,7 +6966,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ERNEST"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Ernest2), .party = {.NoItemDefaultMoves = sParty_Ernest2}, }, @@ -6980,7 +6980,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ERNEST"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Ernest3), .party = {.NoItemDefaultMoves = sParty_Ernest3}, }, @@ -6994,7 +6994,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ERNEST"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Ernest4), .party = {.NoItemDefaultMoves = sParty_Ernest4}, }, @@ -7008,7 +7008,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ERNEST"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Ernest5), .party = {.NoItemDefaultMoves = sParty_Ernest5}, }, @@ -7022,7 +7022,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ELI"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Eli), .party = {.NoItemDefaultMoves = sParty_Eli}, }, @@ -7036,7 +7036,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ANNIKA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Annika), .party = {.ItemCustomMoves = sParty_Annika}, }, @@ -7050,7 +7050,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JAZMYN"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Jazmyn), .party = {.NoItemDefaultMoves = sParty_Jazmyn}, }, @@ -7064,7 +7064,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JONAS"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Jonas), .party = {.NoItemCustomMoves = sParty_Jonas}, }, @@ -7078,7 +7078,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KAYLEY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Kayley), .party = {.NoItemCustomMoves = sParty_Kayley}, }, @@ -7092,7 +7092,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("AURON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Auron), .party = {.NoItemDefaultMoves = sParty_Auron}, }, @@ -7106,7 +7106,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KELVIN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Kelvin), .party = {.NoItemDefaultMoves = sParty_Kelvin}, }, @@ -7120,7 +7120,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MARLEY"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Marley), .party = {.ItemCustomMoves = sParty_Marley}, }, @@ -7134,7 +7134,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("REYNA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Reyna), .party = {.NoItemDefaultMoves = sParty_Reyna}, }, @@ -7148,7 +7148,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("HUDSON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Hudson), .party = {.NoItemDefaultMoves = sParty_Hudson}, }, @@ -7162,7 +7162,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CONOR"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Conor), .party = {.NoItemDefaultMoves = sParty_Conor}, }, @@ -7176,7 +7176,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("EDWIN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Edwin1), .party = {.NoItemDefaultMoves = sParty_Edwin1}, }, @@ -7190,7 +7190,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("HECTOR"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Hector), .party = {.NoItemDefaultMoves = sParty_Hector}, }, @@ -7204,7 +7204,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TABITHA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_TabithaMossdeep), .party = {.NoItemDefaultMoves = sParty_TabithaMossdeep}, }, @@ -7218,7 +7218,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("EDWIN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Edwin2), .party = {.NoItemDefaultMoves = sParty_Edwin2}, }, @@ -7232,7 +7232,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("EDWIN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Edwin3), .party = {.NoItemDefaultMoves = sParty_Edwin3}, }, @@ -7246,7 +7246,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("EDWIN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Edwin4), .party = {.NoItemDefaultMoves = sParty_Edwin4}, }, @@ -7260,7 +7260,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("EDWIN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Edwin5), .party = {.NoItemDefaultMoves = sParty_Edwin5}, }, @@ -7274,7 +7274,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WALLY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_WallyVR1), .party = {.NoItemCustomMoves = sParty_WallyVR1}, }, @@ -7288,7 +7288,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRENDAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_BrendanRoute103Mudkip), .party = {.NoItemDefaultMoves = sParty_BrendanRoute103Mudkip}, }, @@ -7302,7 +7302,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRENDAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_BrendanRoute110Mudkip), .party = {.NoItemDefaultMoves = sParty_BrendanRoute110Mudkip}, }, @@ -7316,7 +7316,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRENDAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_BrendanRoute119Mudkip), .party = {.NoItemDefaultMoves = sParty_BrendanRoute119Mudkip}, }, @@ -7330,7 +7330,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRENDAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_SETUP_FIRST_TURN, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SETUP_FIRST_TURN, .partySize = ARRAY_COUNT(sParty_BrendanRoute103Treecko), .party = {.NoItemDefaultMoves = sParty_BrendanRoute103Treecko}, }, @@ -7344,7 +7344,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRENDAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_BrendanRoute110Treecko), .party = {.NoItemDefaultMoves = sParty_BrendanRoute110Treecko}, }, @@ -7358,7 +7358,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRENDAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_BrendanRoute119Treecko), .party = {.NoItemDefaultMoves = sParty_BrendanRoute119Treecko}, }, @@ -7372,7 +7372,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRENDAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_BrendanRoute103Torchic), .party = {.NoItemDefaultMoves = sParty_BrendanRoute103Torchic}, }, @@ -7386,7 +7386,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRENDAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_BrendanRoute110Torchic), .party = {.NoItemDefaultMoves = sParty_BrendanRoute110Torchic}, }, @@ -7400,7 +7400,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRENDAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_BrendanRoute119Torchic), .party = {.NoItemDefaultMoves = sParty_BrendanRoute119Torchic}, }, @@ -7414,7 +7414,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MAY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_MayRoute103Mudkip), .party = {.NoItemDefaultMoves = sParty_MayRoute103Mudkip}, }, @@ -7428,7 +7428,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MAY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_MayRoute110Mudkip), .party = {.NoItemDefaultMoves = sParty_MayRoute110Mudkip}, }, @@ -7442,7 +7442,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MAY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_MayRoute119Mudkip), .party = {.NoItemDefaultMoves = sParty_MayRoute119Mudkip}, }, @@ -7456,7 +7456,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MAY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_MayRoute103Treecko), .party = {.NoItemDefaultMoves = sParty_MayRoute103Treecko}, }, @@ -7470,7 +7470,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MAY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_MayRoute110Treecko), .party = {.NoItemDefaultMoves = sParty_MayRoute110Treecko}, }, @@ -7484,7 +7484,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MAY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_MayRoute119Treecko), .party = {.NoItemDefaultMoves = sParty_MayRoute119Treecko}, }, @@ -7498,7 +7498,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MAY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_MayRoute103Torchic), .party = {.NoItemDefaultMoves = sParty_MayRoute103Torchic}, }, @@ -7512,7 +7512,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MAY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_MayRoute110Torchic), .party = {.NoItemDefaultMoves = sParty_MayRoute110Torchic}, }, @@ -7526,7 +7526,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MAY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_MayRoute119Torchic), .party = {.NoItemDefaultMoves = sParty_MayRoute119Torchic}, }, @@ -7540,7 +7540,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ISAAC"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Isaac1), .party = {.NoItemDefaultMoves = sParty_Isaac1}, }, @@ -7554,7 +7554,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DAVIS"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Davis), .party = {.NoItemDefaultMoves = sParty_Davis}, }, @@ -7568,7 +7568,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MITCHELL"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Mitchell), .party = {.NoItemCustomMoves = sParty_Mitchell}, }, @@ -7582,7 +7582,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ISAAC"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Isaac2), .party = {.NoItemDefaultMoves = sParty_Isaac2}, }, @@ -7596,7 +7596,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ISAAC"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Isaac3), .party = {.NoItemDefaultMoves = sParty_Isaac3}, }, @@ -7610,7 +7610,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ISAAC"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Isaac4), .party = {.NoItemDefaultMoves = sParty_Isaac4}, }, @@ -7624,7 +7624,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ISAAC"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Isaac5), .party = {.NoItemDefaultMoves = sParty_Isaac5}, }, @@ -7638,7 +7638,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LYDIA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Lydia1), .party = {.NoItemDefaultMoves = sParty_Lydia1}, }, @@ -7652,7 +7652,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("HALLE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Halle), .party = {.NoItemDefaultMoves = sParty_Halle}, }, @@ -7666,7 +7666,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GARRISON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Garrison), .party = {.NoItemDefaultMoves = sParty_Garrison}, }, @@ -7680,7 +7680,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LYDIA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Lydia2), .party = {.NoItemDefaultMoves = sParty_Lydia2}, }, @@ -7694,7 +7694,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LYDIA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Lydia3), .party = {.NoItemDefaultMoves = sParty_Lydia3}, }, @@ -7708,7 +7708,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LYDIA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Lydia4), .party = {.NoItemDefaultMoves = sParty_Lydia4}, }, @@ -7722,7 +7722,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LYDIA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Lydia5), .party = {.NoItemDefaultMoves = sParty_Lydia5}, }, @@ -7736,7 +7736,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JACKSON"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Jackson1), .party = {.NoItemDefaultMoves = sParty_Jackson1}, }, @@ -7750,7 +7750,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LORENZO"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Lorenzo), .party = {.NoItemDefaultMoves = sParty_Lorenzo}, }, @@ -7764,7 +7764,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SEBASTIAN"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Sebastian), .party = {.NoItemDefaultMoves = sParty_Sebastian}, }, @@ -7778,7 +7778,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JACKSON"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_SETUP_FIRST_TURN, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SETUP_FIRST_TURN, .partySize = ARRAY_COUNT(sParty_Jackson2), .party = {.NoItemDefaultMoves = sParty_Jackson2}, }, @@ -7792,7 +7792,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JACKSON"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Jackson3), .party = {.NoItemDefaultMoves = sParty_Jackson3}, }, @@ -7806,7 +7806,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JACKSON"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_SETUP_FIRST_TURN, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SETUP_FIRST_TURN, .partySize = ARRAY_COUNT(sParty_Jackson4), .party = {.NoItemDefaultMoves = sParty_Jackson4}, }, @@ -7820,7 +7820,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JACKSON"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Jackson5), .party = {.NoItemDefaultMoves = sParty_Jackson5}, }, @@ -7834,7 +7834,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CATHERINE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_SETUP_FIRST_TURN, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SETUP_FIRST_TURN, .partySize = ARRAY_COUNT(sParty_Catherine1), .party = {.NoItemDefaultMoves = sParty_Catherine1}, }, @@ -7848,7 +7848,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JENNA"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_SETUP_FIRST_TURN, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SETUP_FIRST_TURN, .partySize = ARRAY_COUNT(sParty_Jenna), .party = {.NoItemDefaultMoves = sParty_Jenna}, }, @@ -7862,7 +7862,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SOPHIA"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Sophia), .party = {.NoItemDefaultMoves = sParty_Sophia}, }, @@ -7876,7 +7876,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CATHERINE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_SETUP_FIRST_TURN, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SETUP_FIRST_TURN, .partySize = ARRAY_COUNT(sParty_Catherine2), .party = {.NoItemDefaultMoves = sParty_Catherine2}, }, @@ -7890,7 +7890,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CATHERINE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Catherine3), .party = {.NoItemDefaultMoves = sParty_Catherine3}, }, @@ -7904,7 +7904,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CATHERINE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_SETUP_FIRST_TURN, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SETUP_FIRST_TURN, .partySize = ARRAY_COUNT(sParty_Catherine4), .party = {.NoItemDefaultMoves = sParty_Catherine4}, }, @@ -7918,7 +7918,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CATHERINE"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Catherine5), .party = {.NoItemDefaultMoves = sParty_Catherine5}, }, @@ -7932,7 +7932,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JULIO"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Julio), .party = {.NoItemDefaultMoves = sParty_Julio}, }, @@ -7946,7 +7946,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntSeafloorCavern5), .party = {.NoItemDefaultMoves = sParty_GruntSeafloorCavern5}, }, @@ -7960,7 +7960,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntUnused), .party = {.NoItemDefaultMoves = sParty_GruntUnused}, }, @@ -7974,7 +7974,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntMtPyre4), .party = {.NoItemDefaultMoves = sParty_GruntMtPyre4}, }, @@ -7988,7 +7988,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntJaggedPass), .party = {.NoItemDefaultMoves = sParty_GruntJaggedPass}, }, @@ -8002,7 +8002,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MARC"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Marc), .party = {.NoItemDefaultMoves = sParty_Marc}, }, @@ -8016,7 +8016,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRENDEN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Brenden), .party = {.NoItemDefaultMoves = sParty_Brenden}, }, @@ -8030,7 +8030,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LILITH"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Lilith), .party = {.NoItemDefaultMoves = sParty_Lilith}, }, @@ -8044,7 +8044,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CRISTIAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Cristian), .party = {.NoItemDefaultMoves = sParty_Cristian}, }, @@ -8058,7 +8058,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SYLVIA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Sylvia), .party = {.NoItemDefaultMoves = sParty_Sylvia}, }, @@ -8072,7 +8072,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LEONARDO"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Leonardo), .party = {.NoItemDefaultMoves = sParty_Leonardo}, }, @@ -8086,7 +8086,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ATHENA"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Athena), .party = {.ItemCustomMoves = sParty_Athena}, }, @@ -8100,7 +8100,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("HARRISON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Harrison), .party = {.NoItemDefaultMoves = sParty_Harrison}, }, @@ -8114,7 +8114,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntMtChimney2), .party = {.NoItemDefaultMoves = sParty_GruntMtChimney2}, }, @@ -8128,7 +8128,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CLARENCE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Clarence), .party = {.NoItemDefaultMoves = sParty_Clarence}, }, @@ -8142,7 +8142,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TERRY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Terry), .party = {.NoItemDefaultMoves = sParty_Terry}, }, @@ -8156,7 +8156,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NATE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Nate), .party = {.NoItemDefaultMoves = sParty_Nate}, }, @@ -8170,7 +8170,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KATHLEEN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Kathleen), .party = {.NoItemDefaultMoves = sParty_Kathleen}, }, @@ -8184,7 +8184,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CLIFFORD"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Clifford), .party = {.NoItemDefaultMoves = sParty_Clifford}, }, @@ -8198,7 +8198,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NICHOLAS"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Nicholas), .party = {.NoItemDefaultMoves = sParty_Nicholas}, }, @@ -8212,7 +8212,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntSpaceCenter3), .party = {.NoItemDefaultMoves = sParty_GruntSpaceCenter3}, }, @@ -8226,7 +8226,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntSpaceCenter4), .party = {.NoItemDefaultMoves = sParty_GruntSpaceCenter4}, }, @@ -8240,7 +8240,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntSpaceCenter5), .party = {.NoItemDefaultMoves = sParty_GruntSpaceCenter5}, }, @@ -8254,7 +8254,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntSpaceCenter6), .party = {.NoItemDefaultMoves = sParty_GruntSpaceCenter6}, }, @@ -8268,7 +8268,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntSpaceCenter7), .party = {.NoItemDefaultMoves = sParty_GruntSpaceCenter7}, }, @@ -8282,7 +8282,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MACEY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Macey), .party = {.NoItemDefaultMoves = sParty_Macey}, }, @@ -8296,7 +8296,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRENDAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_BrendanRustboroTreecko), .party = {.NoItemDefaultMoves = sParty_BrendanRustboroTreecko}, }, @@ -8310,7 +8310,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRENDAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_BrendanRustboroMudkip), .party = {.NoItemDefaultMoves = sParty_BrendanRustboroMudkip}, }, @@ -8324,7 +8324,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("PAXTON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Paxton), .party = {.NoItemDefaultMoves = sParty_Paxton}, }, @@ -8338,7 +8338,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ISABELLA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Isabella), .party = {.NoItemDefaultMoves = sParty_Isabella}, }, @@ -8352,7 +8352,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntWeatherInst5), .party = {.NoItemDefaultMoves = sParty_GruntWeatherInst5}, }, @@ -8366,7 +8366,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TABITHA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_TabithaMtChimney), .party = {.NoItemDefaultMoves = sParty_TabithaMtChimney}, }, @@ -8380,7 +8380,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JONATHAN"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_SETUP_FIRST_TURN, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SETUP_FIRST_TURN, .partySize = ARRAY_COUNT(sParty_Jonathan), .party = {.NoItemDefaultMoves = sParty_Jonathan}, }, @@ -8394,7 +8394,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRENDAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_BrendanRustboroTorchic), .party = {.NoItemDefaultMoves = sParty_BrendanRustboroTorchic}, }, @@ -8408,7 +8408,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MAY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_SETUP_FIRST_TURN, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SETUP_FIRST_TURN, .partySize = ARRAY_COUNT(sParty_MayRustboroMudkip), .party = {.NoItemDefaultMoves = sParty_MayRustboroMudkip}, }, @@ -8422,7 +8422,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MAXIE"), .items = {ITEM_SUPER_POTION, ITEM_SUPER_POTION, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_MaxieMagmaHideout), .party = {.NoItemDefaultMoves = sParty_MaxieMagmaHideout}, }, @@ -8436,7 +8436,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MAXIE"), .items = {ITEM_SUPER_POTION, ITEM_SUPER_POTION, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_MaxieMtChimney), .party = {.NoItemDefaultMoves = sParty_MaxieMtChimney}, }, @@ -8450,7 +8450,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TIANA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Tiana), .party = {.NoItemDefaultMoves = sParty_Tiana}, }, @@ -8464,7 +8464,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("HALEY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Haley1), .party = {.NoItemDefaultMoves = sParty_Haley1}, }, @@ -8478,7 +8478,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JANICE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Janice), .party = {.NoItemDefaultMoves = sParty_Janice}, }, @@ -8492,7 +8492,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("VIVI"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Vivi), .party = {.NoItemDefaultMoves = sParty_Vivi}, }, @@ -8506,7 +8506,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("HALEY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Haley2), .party = {.NoItemDefaultMoves = sParty_Haley2}, }, @@ -8520,7 +8520,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("HALEY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Haley3), .party = {.NoItemDefaultMoves = sParty_Haley3}, }, @@ -8534,7 +8534,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("HALEY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Haley4), .party = {.NoItemDefaultMoves = sParty_Haley4}, }, @@ -8548,7 +8548,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("HALEY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Haley5), .party = {.NoItemDefaultMoves = sParty_Haley5}, }, @@ -8562,7 +8562,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SALLY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Sally), .party = {.NoItemDefaultMoves = sParty_Sally}, }, @@ -8576,7 +8576,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ROBIN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Robin), .party = {.NoItemDefaultMoves = sParty_Robin}, }, @@ -8590,7 +8590,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ANDREA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Andrea), .party = {.NoItemDefaultMoves = sParty_Andrea}, }, @@ -8604,7 +8604,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CRISSY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Crissy), .party = {.NoItemDefaultMoves = sParty_Crissy}, }, @@ -8618,7 +8618,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("RICK"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Rick), .party = {.NoItemDefaultMoves = sParty_Rick}, }, @@ -8632,7 +8632,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LYLE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Lyle), .party = {.NoItemDefaultMoves = sParty_Lyle}, }, @@ -8646,7 +8646,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JOSE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jose), .party = {.NoItemDefaultMoves = sParty_Jose}, }, @@ -8660,7 +8660,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DOUG"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Doug), .party = {.NoItemDefaultMoves = sParty_Doug}, }, @@ -8674,7 +8674,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GREG"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Greg), .party = {.NoItemDefaultMoves = sParty_Greg}, }, @@ -8688,7 +8688,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KENT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Kent), .party = {.NoItemDefaultMoves = sParty_Kent}, }, @@ -8702,7 +8702,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JAMES"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_James1), .party = {.NoItemDefaultMoves = sParty_James1}, }, @@ -8716,7 +8716,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JAMES"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_James2), .party = {.NoItemDefaultMoves = sParty_James2}, }, @@ -8730,7 +8730,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JAMES"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_James3), .party = {.NoItemDefaultMoves = sParty_James3}, }, @@ -8744,7 +8744,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JAMES"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_James4), .party = {.NoItemDefaultMoves = sParty_James4}, }, @@ -8758,7 +8758,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JAMES"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_James5), .party = {.NoItemDefaultMoves = sParty_James5}, }, @@ -8772,7 +8772,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRICE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Brice), .party = {.NoItemDefaultMoves = sParty_Brice}, }, @@ -8786,7 +8786,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TRENT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Trent1), .party = {.NoItemDefaultMoves = sParty_Trent1}, }, @@ -8800,7 +8800,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LENNY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Lenny), .party = {.NoItemDefaultMoves = sParty_Lenny}, }, @@ -8814,7 +8814,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LUCAS"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Lucas1), .party = {.NoItemDefaultMoves = sParty_Lucas1}, }, @@ -8828,7 +8828,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ALAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Alan), .party = {.NoItemDefaultMoves = sParty_Alan}, }, @@ -8842,7 +8842,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CLARK"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Clark), .party = {.NoItemDefaultMoves = sParty_Clark}, }, @@ -8856,7 +8856,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ERIC"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Eric), .party = {.NoItemDefaultMoves = sParty_Eric}, }, @@ -8870,7 +8870,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LUCAS"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Lucas2), .party = {.NoItemCustomMoves = sParty_Lucas2}, }, @@ -8884,7 +8884,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MIKE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Mike1), .party = {.NoItemCustomMoves = sParty_Mike1}, }, @@ -8898,7 +8898,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MIKE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Mike2), .party = {.NoItemDefaultMoves = sParty_Mike2}, }, @@ -8912,7 +8912,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TRENT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Trent2), .party = {.NoItemDefaultMoves = sParty_Trent2}, }, @@ -8926,7 +8926,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TRENT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Trent3), .party = {.NoItemDefaultMoves = sParty_Trent3}, }, @@ -8940,7 +8940,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TRENT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Trent4), .party = {.NoItemDefaultMoves = sParty_Trent4}, }, @@ -8954,7 +8954,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TRENT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Trent5), .party = {.NoItemDefaultMoves = sParty_Trent5}, }, @@ -8968,7 +8968,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DEZ & LUKE"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_DezAndLuke), .party = {.NoItemDefaultMoves = sParty_DezAndLuke}, }, @@ -8982,7 +8982,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LEA & JED"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_LeaAndJed), .party = {.NoItemDefaultMoves = sParty_LeaAndJed}, }, @@ -8996,7 +8996,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KIRA & DAN"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_KiraAndDan1), .party = {.NoItemDefaultMoves = sParty_KiraAndDan1}, }, @@ -9010,7 +9010,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KIRA & DAN"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_KiraAndDan2), .party = {.NoItemDefaultMoves = sParty_KiraAndDan2}, }, @@ -9024,7 +9024,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KIRA & DAN"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_KiraAndDan3), .party = {.NoItemDefaultMoves = sParty_KiraAndDan3}, }, @@ -9038,7 +9038,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KIRA & DAN"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_KiraAndDan4), .party = {.NoItemDefaultMoves = sParty_KiraAndDan4}, }, @@ -9052,7 +9052,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KIRA & DAN"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_KiraAndDan5), .party = {.NoItemDefaultMoves = sParty_KiraAndDan5}, }, @@ -9066,7 +9066,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JOHANNA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Johanna), .party = {.NoItemDefaultMoves = sParty_Johanna}, }, @@ -9080,7 +9080,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GERALD"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Gerald), .party = {.NoItemCustomMoves = sParty_Gerald}, }, @@ -9094,7 +9094,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("VIVIAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Vivian), .party = {.NoItemCustomMoves = sParty_Vivian}, }, @@ -9108,7 +9108,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DANIELLE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Danielle), .party = {.NoItemCustomMoves = sParty_Danielle}, }, @@ -9122,7 +9122,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("HIDEO"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT, .partySize = ARRAY_COUNT(sParty_Hideo), .party = {.NoItemCustomMoves = sParty_Hideo}, }, @@ -9136,7 +9136,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KEIGO"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT, .partySize = ARRAY_COUNT(sParty_Keigo), .party = {.NoItemCustomMoves = sParty_Keigo}, }, @@ -9150,7 +9150,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("RILEY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT, .partySize = ARRAY_COUNT(sParty_Riley), .party = {.NoItemCustomMoves = sParty_Riley}, }, @@ -9164,7 +9164,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("FLINT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Flint), .party = {.NoItemDefaultMoves = sParty_Flint}, }, @@ -9178,7 +9178,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ASHLEY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Ashley), .party = {.NoItemDefaultMoves = sParty_Ashley}, }, @@ -9192,7 +9192,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WALLY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_WallyMauville), .party = {.NoItemDefaultMoves = sParty_WallyMauville}, }, @@ -9206,7 +9206,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WALLY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_WallyVR2), .party = {.NoItemCustomMoves = sParty_WallyVR2}, }, @@ -9220,7 +9220,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WALLY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_WallyVR3), .party = {.NoItemCustomMoves = sParty_WallyVR3}, }, @@ -9234,7 +9234,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WALLY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_WallyVR4), .party = {.NoItemCustomMoves = sParty_WallyVR4}, }, @@ -9248,7 +9248,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WALLY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_WallyVR5), .party = {.NoItemCustomMoves = sParty_WallyVR5}, }, @@ -9262,7 +9262,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRENDAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_BrendanLilycoveMudkip), .party = {.NoItemDefaultMoves = sParty_BrendanLilycoveMudkip}, }, @@ -9276,7 +9276,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRENDAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_BrendanLilycoveTreecko), .party = {.NoItemDefaultMoves = sParty_BrendanLilycoveTreecko}, }, @@ -9290,7 +9290,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRENDAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_BrendanLilycoveTorchic), .party = {.NoItemDefaultMoves = sParty_BrendanLilycoveTorchic}, }, @@ -9304,7 +9304,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MAY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_MayLilycoveMudkip), .party = {.NoItemDefaultMoves = sParty_MayLilycoveMudkip}, }, @@ -9318,7 +9318,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MAY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_MayLilycoveTreecko), .party = {.NoItemDefaultMoves = sParty_MayLilycoveTreecko}, }, @@ -9332,7 +9332,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MAY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_MayLilycoveTorchic), .party = {.NoItemDefaultMoves = sParty_MayLilycoveTorchic}, }, @@ -9346,7 +9346,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JONAH"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jonah), .party = {.NoItemDefaultMoves = sParty_Jonah}, }, @@ -9360,7 +9360,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("HENRY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Henry), .party = {.NoItemDefaultMoves = sParty_Henry}, }, @@ -9374,7 +9374,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ROGER"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Roger), .party = {.NoItemDefaultMoves = sParty_Roger}, }, @@ -9388,7 +9388,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ALEXA"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Alexa), .party = {.NoItemDefaultMoves = sParty_Alexa}, }, @@ -9402,7 +9402,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("RUBEN"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Ruben), .party = {.NoItemDefaultMoves = sParty_Ruben}, }, @@ -9416,7 +9416,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KOJI"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Koji1), .party = {.NoItemDefaultMoves = sParty_Koji1}, }, @@ -9430,7 +9430,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WAYNE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Wayne), .party = {.NoItemDefaultMoves = sParty_Wayne}, }, @@ -9444,7 +9444,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("AIDAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Aidan), .party = {.NoItemDefaultMoves = sParty_Aidan}, }, @@ -9458,7 +9458,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("REED"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Reed), .party = {.NoItemDefaultMoves = sParty_Reed}, }, @@ -9472,7 +9472,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TISHA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Tisha), .party = {.NoItemDefaultMoves = sParty_Tisha}, }, @@ -9486,7 +9486,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TORI & TIA"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_ToriAndTia), .party = {.NoItemDefaultMoves = sParty_ToriAndTia}, }, @@ -9500,7 +9500,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KIM & IRIS"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_KimAndIris), .party = {.NoItemCustomMoves = sParty_KimAndIris}, }, @@ -9514,7 +9514,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TYRA & IVY"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_TyraAndIvy), .party = {.NoItemCustomMoves = sParty_TyraAndIvy}, }, @@ -9528,7 +9528,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MEL & PAUL"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_MelAndPaul), .party = {.NoItemCustomMoves = sParty_MelAndPaul}, }, @@ -9542,7 +9542,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JOHN & JAY"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_JohnAndJay1), .party = {.NoItemCustomMoves = sParty_JohnAndJay1}, }, @@ -9556,7 +9556,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JOHN & JAY"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_JohnAndJay2), .party = {.NoItemCustomMoves = sParty_JohnAndJay2}, }, @@ -9570,7 +9570,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JOHN & JAY"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_JohnAndJay3), .party = {.NoItemCustomMoves = sParty_JohnAndJay3}, }, @@ -9584,7 +9584,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JOHN & JAY"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_SETUP_FIRST_TURN, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_SETUP_FIRST_TURN, .partySize = ARRAY_COUNT(sParty_JohnAndJay4), .party = {.NoItemCustomMoves = sParty_JohnAndJay4}, }, @@ -9598,7 +9598,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JOHN & JAY"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_JohnAndJay5), .party = {.NoItemCustomMoves = sParty_JohnAndJay5}, }, @@ -9612,7 +9612,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("RELI & IAN"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_ReliAndIan), .party = {.NoItemDefaultMoves = sParty_ReliAndIan}, }, @@ -9626,7 +9626,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LILA & ROY"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_LilaAndRoy1), .party = {.NoItemDefaultMoves = sParty_LilaAndRoy1}, }, @@ -9640,7 +9640,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LILA & ROY"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_LilaAndRoy2), .party = {.NoItemDefaultMoves = sParty_LilaAndRoy2}, }, @@ -9654,7 +9654,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LILA & ROY"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_LilaAndRoy3), .party = {.NoItemDefaultMoves = sParty_LilaAndRoy3}, }, @@ -9668,7 +9668,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LILA & ROY"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_LilaAndRoy4), .party = {.NoItemDefaultMoves = sParty_LilaAndRoy4}, }, @@ -9682,7 +9682,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LILA & ROY"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_LilaAndRoy5), .party = {.NoItemDefaultMoves = sParty_LilaAndRoy5}, }, @@ -9696,7 +9696,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LISA & RAY"), .items = {}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_LisaAndRay), .party = {.NoItemDefaultMoves = sParty_LisaAndRay}, }, @@ -9710,7 +9710,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CHRIS"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Chris), .party = {.NoItemDefaultMoves = sParty_Chris}, }, @@ -9724,7 +9724,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DAWSON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Dawson), .party = {.ItemDefaultMoves = sParty_Dawson}, }, @@ -9738,7 +9738,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SARAH"), .items = {ITEM_FULL_RESTORE, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Sarah), .party = {.ItemDefaultMoves = sParty_Sarah}, }, @@ -9752,7 +9752,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DARIAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Darian), .party = {.NoItemDefaultMoves = sParty_Darian}, }, @@ -9766,7 +9766,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("HAILEY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Hailey), .party = {.NoItemDefaultMoves = sParty_Hailey}, }, @@ -9780,7 +9780,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CHANDLER"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Chandler), .party = {.NoItemDefaultMoves = sParty_Chandler}, }, @@ -9794,7 +9794,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KALEB"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Kaleb), .party = {.ItemDefaultMoves = sParty_Kaleb}, }, @@ -9808,7 +9808,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JOSEPH"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Joseph), .party = {.NoItemDefaultMoves = sParty_Joseph}, }, @@ -9822,7 +9822,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ALYSSA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Alyssa), .party = {.NoItemDefaultMoves = sParty_Alyssa}, }, @@ -9836,7 +9836,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MARCOS"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Marcos), .party = {.NoItemDefaultMoves = sParty_Marcos}, }, @@ -9850,7 +9850,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("RHETT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Rhett), .party = {.NoItemDefaultMoves = sParty_Rhett}, }, @@ -9864,7 +9864,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TYRON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Tyron), .party = {.NoItemDefaultMoves = sParty_Tyron}, }, @@ -9878,7 +9878,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CELINA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Celina), .party = {.NoItemDefaultMoves = sParty_Celina}, }, @@ -9892,7 +9892,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BIANCA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Bianca), .party = {.NoItemDefaultMoves = sParty_Bianca}, }, @@ -9906,7 +9906,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("HAYDEN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Hayden), .party = {.NoItemDefaultMoves = sParty_Hayden}, }, @@ -9920,7 +9920,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SOPHIE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Sophie), .party = {.NoItemDefaultMoves = sParty_Sophie}, }, @@ -9934,7 +9934,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("COBY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Coby), .party = {.NoItemDefaultMoves = sParty_Coby}, }, @@ -9948,7 +9948,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LAWRENCE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Lawrence), .party = {.NoItemDefaultMoves = sParty_Lawrence}, }, @@ -9962,7 +9962,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WYATT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Wyatt), .party = {.NoItemDefaultMoves = sParty_Wyatt}, }, @@ -9976,7 +9976,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ANGELINA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Angelina), .party = {.NoItemDefaultMoves = sParty_Angelina}, }, @@ -9990,7 +9990,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KAI"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Kai), .party = {.NoItemDefaultMoves = sParty_Kai}, }, @@ -10004,7 +10004,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CHARLOTTE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Charlotte), .party = {.NoItemDefaultMoves = sParty_Charlotte}, }, @@ -10018,7 +10018,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DEANDRE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Deandre), .party = {.NoItemDefaultMoves = sParty_Deandre}, }, @@ -10032,7 +10032,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntMagmaHideout1), .party = {.NoItemDefaultMoves = sParty_GruntMagmaHideout1}, }, @@ -10046,7 +10046,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntMagmaHideout2), .party = {.NoItemDefaultMoves = sParty_GruntMagmaHideout2}, }, @@ -10060,7 +10060,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntMagmaHideout3), .party = {.NoItemDefaultMoves = sParty_GruntMagmaHideout3}, }, @@ -10074,7 +10074,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntMagmaHideout4), .party = {.NoItemDefaultMoves = sParty_GruntMagmaHideout4}, }, @@ -10088,7 +10088,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntMagmaHideout5), .party = {.NoItemDefaultMoves = sParty_GruntMagmaHideout5}, }, @@ -10102,7 +10102,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntMagmaHideout6), .party = {.NoItemDefaultMoves = sParty_GruntMagmaHideout6}, }, @@ -10116,7 +10116,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntMagmaHideout7), .party = {.NoItemDefaultMoves = sParty_GruntMagmaHideout7}, }, @@ -10130,7 +10130,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntMagmaHideout8), .party = {.NoItemDefaultMoves = sParty_GruntMagmaHideout8}, }, @@ -10144,7 +10144,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntMagmaHideout9), .party = {.NoItemDefaultMoves = sParty_GruntMagmaHideout9}, }, @@ -10158,7 +10158,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntMagmaHideout10), .party = {.NoItemDefaultMoves = sParty_GruntMagmaHideout10}, }, @@ -10172,7 +10172,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntMagmaHideout11), .party = {.NoItemDefaultMoves = sParty_GruntMagmaHideout11}, }, @@ -10186,7 +10186,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntMagmaHideout12), .party = {.NoItemDefaultMoves = sParty_GruntMagmaHideout12}, }, @@ -10200,7 +10200,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntMagmaHideout13), .party = {.NoItemDefaultMoves = sParty_GruntMagmaHideout13}, }, @@ -10214,7 +10214,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntMagmaHideout14), .party = {.NoItemDefaultMoves = sParty_GruntMagmaHideout14}, }, @@ -10228,7 +10228,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntMagmaHideout15), .party = {.NoItemDefaultMoves = sParty_GruntMagmaHideout15}, }, @@ -10242,7 +10242,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRUNT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_GruntMagmaHideout16), .party = {.NoItemDefaultMoves = sParty_GruntMagmaHideout16}, }, @@ -10256,7 +10256,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TABITHA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_TabithaMagmaHideout), .party = {.NoItemDefaultMoves = sParty_TabithaMagmaHideout}, }, @@ -10270,7 +10270,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DARCY"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Darcy), .party = {.NoItemDefaultMoves = sParty_Darcy}, }, @@ -10284,7 +10284,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MAXIE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_MaxieMossdeep), .party = {.NoItemDefaultMoves = sParty_MaxieMossdeep}, }, @@ -10298,7 +10298,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("PETE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Pete), .party = {.NoItemDefaultMoves = sParty_Pete}, }, @@ -10312,7 +10312,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ISABELLE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Isabelle), .party = {.NoItemDefaultMoves = sParty_Isabelle}, }, @@ -10326,7 +10326,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ANDRES"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Andres1), .party = {.NoItemDefaultMoves = sParty_Andres1}, }, @@ -10340,7 +10340,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JOSUE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Josue), .party = {.NoItemDefaultMoves = sParty_Josue}, }, @@ -10354,7 +10354,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CAMRON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Camron), .party = {.NoItemDefaultMoves = sParty_Camron}, }, @@ -10368,7 +10368,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CORY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Cory1), .party = {.NoItemDefaultMoves = sParty_Cory1}, }, @@ -10382,7 +10382,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CAROLINA"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Carolina), .party = {.NoItemDefaultMoves = sParty_Carolina}, }, @@ -10396,7 +10396,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ELIJAH"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Elijah), .party = {.NoItemDefaultMoves = sParty_Elijah}, }, @@ -10410,7 +10410,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CELIA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Celia), .party = {.NoItemDefaultMoves = sParty_Celia}, }, @@ -10424,7 +10424,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRYAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Bryan), .party = {.NoItemDefaultMoves = sParty_Bryan}, }, @@ -10438,7 +10438,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRANDEN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Branden), .party = {.NoItemDefaultMoves = sParty_Branden}, }, @@ -10452,7 +10452,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRYANT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Bryant), .party = {.NoItemDefaultMoves = sParty_Bryant}, }, @@ -10466,7 +10466,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SHAYLA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Shayla), .party = {.NoItemDefaultMoves = sParty_Shayla}, }, @@ -10480,7 +10480,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KYRA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Kyra), .party = {.NoItemDefaultMoves = sParty_Kyra}, }, @@ -10494,7 +10494,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JAIDEN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Jaiden), .party = {.NoItemDefaultMoves = sParty_Jaiden}, }, @@ -10508,7 +10508,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ALIX"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Alix), .party = {.NoItemDefaultMoves = sParty_Alix}, }, @@ -10522,7 +10522,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("HELENE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Helene), .party = {.NoItemDefaultMoves = sParty_Helene}, }, @@ -10536,7 +10536,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MARLENE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Marlene), .party = {.NoItemDefaultMoves = sParty_Marlene}, }, @@ -10550,7 +10550,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DEVAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Devan), .party = {.NoItemDefaultMoves = sParty_Devan}, }, @@ -10564,7 +10564,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JOHNSON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Johnson), .party = {.NoItemDefaultMoves = sParty_Johnson}, }, @@ -10578,7 +10578,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MELINA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Melina), .party = {.NoItemDefaultMoves = sParty_Melina}, }, @@ -10592,7 +10592,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRANDI"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Brandi), .party = {.NoItemDefaultMoves = sParty_Brandi}, }, @@ -10606,7 +10606,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("AISHA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Aisha), .party = {.NoItemDefaultMoves = sParty_Aisha}, }, @@ -10620,7 +10620,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MAKAYLA"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Makayla), .party = {.NoItemDefaultMoves = sParty_Makayla}, }, @@ -10634,7 +10634,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("FABIAN"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Fabian), .party = {.NoItemDefaultMoves = sParty_Fabian}, }, @@ -10648,7 +10648,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DAYTON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Dayton), .party = {.NoItemDefaultMoves = sParty_Dayton}, }, @@ -10662,7 +10662,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("RACHEL"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Rachel), .party = {.NoItemDefaultMoves = sParty_Rachel}, }, @@ -10676,7 +10676,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LEONEL"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Leonel), .party = {.NoItemCustomMoves = sParty_Leonel}, }, @@ -10690,7 +10690,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CALLIE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Callie), .party = {.NoItemDefaultMoves = sParty_Callie}, }, @@ -10704,7 +10704,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CALE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Cale), .party = {.NoItemDefaultMoves = sParty_Cale}, }, @@ -10718,7 +10718,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MYLES"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Myles), .party = {.NoItemDefaultMoves = sParty_Myles}, }, @@ -10732,7 +10732,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("PAT"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Pat), .party = {.NoItemDefaultMoves = sParty_Pat}, }, @@ -10746,7 +10746,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CRISTIN"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Cristin1), .party = {.NoItemDefaultMoves = sParty_Cristin1}, }, @@ -10760,7 +10760,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MAY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_MayRustboroTreecko), .party = {.NoItemDefaultMoves = sParty_MayRustboroTreecko}, }, @@ -10774,7 +10774,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("MAY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_MayRustboroTorchic), .party = {.NoItemDefaultMoves = sParty_MayRustboroTorchic}, }, @@ -10788,7 +10788,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ROXANNE"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Roxanne2), .party = {.ItemCustomMoves = sParty_Roxanne2}, }, @@ -10802,7 +10802,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ROXANNE"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Roxanne3), .party = {.ItemCustomMoves = sParty_Roxanne3}, }, @@ -10816,7 +10816,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ROXANNE"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Roxanne4), .party = {.ItemCustomMoves = sParty_Roxanne4}, }, @@ -10830,7 +10830,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ROXANNE"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Roxanne5), .party = {.ItemCustomMoves = sParty_Roxanne5}, }, @@ -10844,7 +10844,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRAWLY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Brawly2), .party = {.ItemCustomMoves = sParty_Brawly2}, }, @@ -10858,7 +10858,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRAWLY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Brawly3), .party = {.ItemCustomMoves = sParty_Brawly3}, }, @@ -10872,7 +10872,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRAWLY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Brawly4), .party = {.ItemCustomMoves = sParty_Brawly4}, }, @@ -10886,7 +10886,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRAWLY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Brawly5), .party = {.ItemCustomMoves = sParty_Brawly5}, }, @@ -10900,7 +10900,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WATTSON"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Wattson2), .party = {.ItemCustomMoves = sParty_Wattson2}, }, @@ -10914,7 +10914,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WATTSON"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Wattson3), .party = {.ItemCustomMoves = sParty_Wattson3}, }, @@ -10928,7 +10928,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WATTSON"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Wattson4), .party = {.ItemCustomMoves = sParty_Wattson4}, }, @@ -10942,7 +10942,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WATTSON"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Wattson5), .party = {.ItemCustomMoves = sParty_Wattson5}, }, @@ -10956,7 +10956,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("FLANNERY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Flannery2), .party = {.ItemCustomMoves = sParty_Flannery2}, }, @@ -10970,7 +10970,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("FLANNERY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Flannery3), .party = {.ItemCustomMoves = sParty_Flannery3}, }, @@ -10984,7 +10984,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("FLANNERY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Flannery4), .party = {.ItemCustomMoves = sParty_Flannery4}, }, @@ -10998,7 +10998,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("FLANNERY"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Flannery5), .party = {.ItemCustomMoves = sParty_Flannery5}, }, @@ -11012,7 +11012,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NORMAN"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Norman2), .party = {.ItemCustomMoves = sParty_Norman2}, }, @@ -11026,7 +11026,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NORMAN"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Norman3), .party = {.ItemCustomMoves = sParty_Norman3}, }, @@ -11040,7 +11040,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NORMAN"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Norman4), .party = {.ItemCustomMoves = sParty_Norman4}, }, @@ -11054,7 +11054,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NORMAN"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Norman5), .party = {.ItemCustomMoves = sParty_Norman5}, }, @@ -11068,7 +11068,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WINONA"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY | AI_SCRIPT_RISKY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY | AI_FLAG_RISKY, .partySize = ARRAY_COUNT(sParty_Winona2), .party = {.ItemCustomMoves = sParty_Winona2}, }, @@ -11082,7 +11082,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WINONA"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY | AI_SCRIPT_RISKY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY | AI_FLAG_RISKY, .partySize = ARRAY_COUNT(sParty_Winona3), .party = {.ItemCustomMoves = sParty_Winona3}, }, @@ -11096,7 +11096,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WINONA"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY | AI_SCRIPT_RISKY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY | AI_FLAG_RISKY, .partySize = ARRAY_COUNT(sParty_Winona4), .party = {.ItemCustomMoves = sParty_Winona4}, }, @@ -11110,7 +11110,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("WINONA"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY | AI_SCRIPT_RISKY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY | AI_FLAG_RISKY, .partySize = ARRAY_COUNT(sParty_Winona5), .party = {.ItemCustomMoves = sParty_Winona5}, }, @@ -11124,7 +11124,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TATE&LIZA"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_TateAndLiza2), .party = {.ItemCustomMoves = sParty_TateAndLiza2}, }, @@ -11138,7 +11138,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TATE&LIZA"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_TateAndLiza3), .party = {.ItemCustomMoves = sParty_TateAndLiza3}, }, @@ -11152,7 +11152,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TATE&LIZA"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_TateAndLiza4), .party = {.ItemCustomMoves = sParty_TateAndLiza4}, }, @@ -11166,7 +11166,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TATE&LIZA"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_TateAndLiza5), .party = {.ItemCustomMoves = sParty_TateAndLiza5}, }, @@ -11180,7 +11180,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JUAN"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Juan2), .party = {.ItemCustomMoves = sParty_Juan2}, }, @@ -11194,7 +11194,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JUAN"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Juan3), .party = {.ItemCustomMoves = sParty_Juan3}, }, @@ -11208,7 +11208,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JUAN"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Juan4), .party = {.ItemCustomMoves = sParty_Juan4}, }, @@ -11222,7 +11222,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("JUAN"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_NONE}, .doubleBattle = TRUE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Juan5), .party = {.ItemCustomMoves = sParty_Juan5}, }, @@ -11236,7 +11236,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ANGELO"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Angelo), .party = {.ItemCustomMoves = sParty_Angelo}, }, @@ -11250,7 +11250,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("DARIUS"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Darius), .party = {.NoItemDefaultMoves = sParty_Darius}, }, @@ -11264,7 +11264,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("STEVEN"), .items = {ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE, ITEM_FULL_RESTORE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Steven), .party = {.ItemCustomMoves = sParty_Steven}, }, @@ -11278,7 +11278,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ANABEL"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Anabel), .party = {.NoItemDefaultMoves = sParty_Anabel}, }, @@ -11292,7 +11292,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("TUCKER"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Tucker), .party = {.NoItemDefaultMoves = sParty_Tucker}, }, @@ -11306,7 +11306,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SPENSER"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Spenser), .party = {.NoItemDefaultMoves = sParty_Spenser}, }, @@ -11320,7 +11320,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GRETA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Greta), .party = {.NoItemDefaultMoves = sParty_Greta}, }, @@ -11334,7 +11334,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("NOLAND"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Noland), .party = {.NoItemDefaultMoves = sParty_Noland}, }, @@ -11348,7 +11348,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("LUCY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Lucy), .party = {.NoItemDefaultMoves = sParty_Lucy}, }, @@ -11362,7 +11362,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("BRANDON"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Brandon), .party = {.NoItemDefaultMoves = sParty_Brandon}, }, @@ -11376,7 +11376,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ANDRES"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Andres2), .party = {.NoItemDefaultMoves = sParty_Andres2}, }, @@ -11390,7 +11390,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ANDRES"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Andres3), .party = {.NoItemDefaultMoves = sParty_Andres3}, }, @@ -11404,7 +11404,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ANDRES"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Andres4), .party = {.NoItemDefaultMoves = sParty_Andres4}, }, @@ -11418,7 +11418,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("ANDRES"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Andres5), .party = {.NoItemDefaultMoves = sParty_Andres5}, }, @@ -11432,7 +11432,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CORY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Cory2), .party = {.NoItemDefaultMoves = sParty_Cory2}, }, @@ -11446,7 +11446,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CORY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Cory3), .party = {.NoItemDefaultMoves = sParty_Cory3}, }, @@ -11460,7 +11460,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CORY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Cory4), .party = {.NoItemDefaultMoves = sParty_Cory4}, }, @@ -11474,7 +11474,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CORY"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Cory5), .party = {.NoItemDefaultMoves = sParty_Cory5}, }, @@ -11488,7 +11488,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("PABLO"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Pablo2), .party = {.NoItemDefaultMoves = sParty_Pablo2}, }, @@ -11502,7 +11502,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("PABLO"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Pablo3), .party = {.NoItemDefaultMoves = sParty_Pablo3}, }, @@ -11516,7 +11516,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("PABLO"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Pablo4), .party = {.NoItemDefaultMoves = sParty_Pablo4}, }, @@ -11530,7 +11530,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("PABLO"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Pablo5), .party = {.NoItemDefaultMoves = sParty_Pablo5}, }, @@ -11544,7 +11544,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KOJI"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Koji2), .party = {.NoItemDefaultMoves = sParty_Koji2}, }, @@ -11558,7 +11558,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KOJI"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Koji3), .party = {.NoItemDefaultMoves = sParty_Koji3}, }, @@ -11572,7 +11572,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KOJI"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Koji4), .party = {.NoItemDefaultMoves = sParty_Koji4}, }, @@ -11586,7 +11586,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("KOJI"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Koji5), .party = {.NoItemDefaultMoves = sParty_Koji5}, }, @@ -11600,7 +11600,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CRISTIN"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Cristin2), .party = {.NoItemDefaultMoves = sParty_Cristin2}, }, @@ -11614,7 +11614,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CRISTIN"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Cristin3), .party = {.NoItemDefaultMoves = sParty_Cristin3}, }, @@ -11628,7 +11628,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CRISTIN"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Cristin4), .party = {.NoItemDefaultMoves = sParty_Cristin4}, }, @@ -11642,7 +11642,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("CRISTIN"), .items = {ITEM_HYPER_POTION, ITEM_NONE, ITEM_NONE, ITEM_NONE}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Cristin5), .party = {.NoItemDefaultMoves = sParty_Cristin5}, }, @@ -11656,7 +11656,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("FERNANDO"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Fernando2), .party = {.NoItemDefaultMoves = sParty_Fernando2}, }, @@ -11670,7 +11670,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("FERNANDO"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Fernando3), .party = {.NoItemDefaultMoves = sParty_Fernando3}, }, @@ -11684,7 +11684,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("FERNANDO"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Fernando4), .party = {.NoItemDefaultMoves = sParty_Fernando4}, }, @@ -11698,7 +11698,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("FERNANDO"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Fernando5), .party = {.NoItemDefaultMoves = sParty_Fernando5}, }, @@ -11712,7 +11712,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SAWYER"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Sawyer2), .party = {.NoItemDefaultMoves = sParty_Sawyer2}, }, @@ -11726,7 +11726,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SAWYER"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Sawyer3), .party = {.NoItemDefaultMoves = sParty_Sawyer3}, }, @@ -11740,7 +11740,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SAWYER"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Sawyer4), .party = {.NoItemDefaultMoves = sParty_Sawyer4}, }, @@ -11754,7 +11754,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("SAWYER"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY, .partySize = ARRAY_COUNT(sParty_Sawyer5), .party = {.NoItemDefaultMoves = sParty_Sawyer5}, }, @@ -11768,7 +11768,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GABRIELLE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Gabrielle2), .party = {.NoItemDefaultMoves = sParty_Gabrielle2}, }, @@ -11782,7 +11782,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GABRIELLE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Gabrielle3), .party = {.NoItemDefaultMoves = sParty_Gabrielle3}, }, @@ -11796,7 +11796,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GABRIELLE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Gabrielle4), .party = {.NoItemDefaultMoves = sParty_Gabrielle4}, }, @@ -11810,7 +11810,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("GABRIELLE"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Gabrielle5), .party = {.NoItemDefaultMoves = sParty_Gabrielle5}, }, @@ -11824,7 +11824,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("THALIA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Thalia2), .party = {.NoItemDefaultMoves = sParty_Thalia2}, }, @@ -11838,7 +11838,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("THALIA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Thalia3), .party = {.NoItemDefaultMoves = sParty_Thalia3}, }, @@ -11852,7 +11852,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("THALIA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Thalia4), .party = {.NoItemDefaultMoves = sParty_Thalia4}, }, @@ -11866,7 +11866,7 @@ const struct Trainer gTrainers[] = { .trainerName = _("THALIA"), .items = {}, .doubleBattle = FALSE, - .aiFlags = AI_SCRIPT_CHECK_BAD_MOVE, + .aiFlags = AI_FLAG_CHECK_BAD_MOVE, .partySize = ARRAY_COUNT(sParty_Thalia5), .party = {.NoItemDefaultMoves = sParty_Thalia5}, }, diff --git a/src/trainer_hill.c b/src/trainer_hill.c index 18d56723c..043522aee 100644 --- a/src/trainer_hill.c +++ b/src/trainer_hill.c @@ -897,7 +897,7 @@ void FillHillTrainersParties(void) // hill trainers. u32 GetTrainerHillAIFlags(void) { - return (AI_SCRIPT_CHECK_BAD_MOVE | AI_SCRIPT_TRY_TO_FAINT | AI_SCRIPT_CHECK_VIABILITY); + return (AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY); } u8 GetTrainerEncounterMusicIdInTrainerHill(u16 trainerId)