Use move flags instead of lists for AI calcs (#3389)
This commit is contained in:
parent
410dc1d6c0
commit
28506b4cf8
3 changed files with 2 additions and 68 deletions
|
@ -112,8 +112,6 @@ bool32 IsStatLoweringMoveEffect(u32 moveEffect);
|
||||||
bool32 IsMoveRedirectionPrevented(u32 move, u32 atkAbility);
|
bool32 IsMoveRedirectionPrevented(u32 move, u32 atkAbility);
|
||||||
bool32 IsMoveEncouragedToHit(u32 battlerAtk, u32 battlerDef, u32 move);
|
bool32 IsMoveEncouragedToHit(u32 battlerAtk, u32 battlerDef, u32 move);
|
||||||
bool32 IsHazardMoveEffect(u32 moveEffect);
|
bool32 IsHazardMoveEffect(u32 moveEffect);
|
||||||
bool32 MoveCallsOtherMove(u32 move);
|
|
||||||
bool32 MoveRequiresRecharging(u32 move);
|
|
||||||
bool32 IsEncoreEncouragedEffect(u32 moveEffect);
|
bool32 IsEncoreEncouragedEffect(u32 moveEffect);
|
||||||
void ProtectChecks(u32 battlerAtk, u32 battlerDef, u32 move, u32 predictedMove, s32 *score);
|
void ProtectChecks(u32 battlerAtk, u32 battlerDef, u32 move, u32 predictedMove, s32 *score);
|
||||||
bool32 ShouldSetSandstorm(u32 battler, u32 ability, u32 holdEffect);
|
bool32 ShouldSetSandstorm(u32 battler, u32 ability, u32 holdEffect);
|
||||||
|
|
|
@ -2534,8 +2534,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||||
|
|
||||||
if (instructedMove == MOVE_NONE
|
if (instructedMove == MOVE_NONE
|
||||||
|| gBattleMoves[instructedMove].instructBanned
|
|| gBattleMoves[instructedMove].instructBanned
|
||||||
|| MoveRequiresRecharging(instructedMove)
|
|| gBattleMoves[instructedMove].effect == EFFECT_RECHARGE
|
||||||
|| MoveCallsOtherMove(instructedMove)
|
|
||||||
|| IsZMove(instructedMove)
|
|| IsZMove(instructedMove)
|
||||||
|| (gLockedMoves[battlerDef] != 0 && gLockedMoves[battlerDef] != 0xFFFF)
|
|| (gLockedMoves[battlerDef] != 0 && gLockedMoves[battlerDef] != 0xFFFF)
|
||||||
|| gBattleMons[battlerDef].status2 & STATUS2_MULTIPLETURNS
|
|| gBattleMons[battlerDef].status2 & STATUS2_MULTIPLETURNS
|
||||||
|
|
|
@ -383,41 +383,6 @@ static const u16 sIgnoredPowerfulMoveEffects[] =
|
||||||
IGNORED_MOVES_END
|
IGNORED_MOVES_END
|
||||||
};
|
};
|
||||||
|
|
||||||
static const u16 sIgnoreMoldBreakerMoves[] =
|
|
||||||
{
|
|
||||||
MOVE_MOONGEIST_BEAM,
|
|
||||||
MOVE_SUNSTEEL_STRIKE,
|
|
||||||
MOVE_PHOTON_GEYSER,
|
|
||||||
MOVE_LIGHT_THAT_BURNS_THE_SKY,
|
|
||||||
MOVE_MENACING_MOONRAZE_MAELSTROM,
|
|
||||||
MOVE_SEARING_SUNRAZE_SMASH,
|
|
||||||
};
|
|
||||||
|
|
||||||
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
|
// Functions
|
||||||
u32 GetAIChosenMove(u32 battlerId)
|
u32 GetAIChosenMove(u32 battlerId)
|
||||||
{
|
{
|
||||||
|
@ -1505,13 +1470,7 @@ bool32 DoesBattlerIgnoreAbilityChecks(u32 atkAbility, u32 move)
|
||||||
if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_NEGATE_UNAWARE)
|
if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_NEGATE_UNAWARE)
|
||||||
return FALSE; // AI handicap flag: doesn't understand ability suppression concept
|
return FALSE; // AI handicap flag: doesn't understand ability suppression concept
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_COUNT(sIgnoreMoldBreakerMoves); i++)
|
if (IsMoldBreakerTypeAbility(atkAbility) || gBattleMoves[move].ignoresTargetAbility)
|
||||||
{
|
|
||||||
if (move == sIgnoreMoldBreakerMoves[i])
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsMoldBreakerTypeAbility(atkAbility))
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -2453,28 +2412,6 @@ bool32 IsEncoreEncouragedEffect(u32 moveEffect)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool32 MoveRequiresRecharging(u32 move)
|
|
||||||
{
|
|
||||||
u32 i;
|
|
||||||
for (i = 0; i < ARRAY_COUNT(sRechargeMoves); i++)
|
|
||||||
{
|
|
||||||
if (move == sRechargeMoves[i])
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool32 MoveCallsOtherMove(u32 move)
|
|
||||||
{
|
|
||||||
u32 i;
|
|
||||||
for (i = 0; i < ARRAY_COUNT(sOtherMoveCallingMoves); i++)
|
|
||||||
{
|
|
||||||
if (move == sOtherMoveCallingMoves[i])
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static u32 GetLeechSeedDamage(u32 battlerId)
|
static u32 GetLeechSeedDamage(u32 battlerId)
|
||||||
{
|
{
|
||||||
u32 damage = 0;
|
u32 damage = 0;
|
||||||
|
|
Loading…
Reference in a new issue