Changing all HasBattlerSideAbility to AI_IsAbilityOnSide. (#7927)
This commit is contained in:
parent
ca53ccb55e
commit
94a6e126f3
@ -307,7 +307,6 @@ bool32 IsBattlerItemEnabled(u32 battler);
|
||||
bool32 IsBattlerPredictedToSwitch(u32 battler);
|
||||
u32 GetIncomingMove(u32 battler, u32 opposingBattler, struct AiLogicData *aiData);
|
||||
u32 GetIncomingMoveSpeedCheck(u32 battler, u32 opposingBattler, struct AiLogicData *aiData);
|
||||
bool32 HasBattlerSideAbility(u32 battlerDef, enum Ability ability, struct AiLogicData *aiData);
|
||||
bool32 IsNaturalEnemy(u32 speciesAttacker, u32 speciesTarget);
|
||||
|
||||
// These are for the purpose of not doubling up on moves during double battles.
|
||||
|
||||
@ -411,9 +411,9 @@ static enum FieldEffectOutcome BenefitsFromPsychicTerrain(u32 battler)
|
||||
if (grounded || allyGrounded)
|
||||
{
|
||||
// harass priority
|
||||
if (HasBattlerSideAbility(LEFT_FOE(battler), ABILITY_GALE_WINGS, gAiLogicData)
|
||||
|| HasBattlerSideAbility(LEFT_FOE(battler), ABILITY_TRIAGE, gAiLogicData)
|
||||
|| HasBattlerSideAbility(LEFT_FOE(battler), ABILITY_PRANKSTER, gAiLogicData))
|
||||
if (AI_IsAbilityOnSide(LEFT_FOE(battler), ABILITY_GALE_WINGS)
|
||||
|| AI_IsAbilityOnSide(LEFT_FOE(battler), ABILITY_TRIAGE)
|
||||
|| AI_IsAbilityOnSide(LEFT_FOE(battler), ABILITY_PRANKSTER))
|
||||
return FIELD_EFFECT_POSITIVE;
|
||||
}
|
||||
|
||||
@ -423,9 +423,9 @@ static enum FieldEffectOutcome BenefitsFromPsychicTerrain(u32 battler)
|
||||
if (HasBattlerSideMoveWithEffect(LEFT_FOE(battler), EFFECT_EXPANDING_FORCE))
|
||||
return FIELD_EFFECT_NEGATIVE;
|
||||
|
||||
if (HasBattlerSideAbility(battler, ABILITY_GALE_WINGS, gAiLogicData)
|
||||
|| HasBattlerSideAbility(battler, ABILITY_TRIAGE, gAiLogicData)
|
||||
|| HasBattlerSideAbility(battler, ABILITY_PRANKSTER, gAiLogicData))
|
||||
if (AI_IsAbilityOnSide(battler, ABILITY_GALE_WINGS)
|
||||
|| AI_IsAbilityOnSide(battler, ABILITY_TRIAGE)
|
||||
|| AI_IsAbilityOnSide(battler, ABILITY_PRANKSTER))
|
||||
return FIELD_EFFECT_NEGATIVE;
|
||||
|
||||
return FIELD_EFFECT_NEUTRAL;
|
||||
@ -436,7 +436,7 @@ static enum FieldEffectOutcome BenefitsFromGravity(u32 battler)
|
||||
if (!AI_IsBattlerGrounded(battler))
|
||||
return FIELD_EFFECT_NEGATIVE;
|
||||
|
||||
if (HasBattlerSideAbility(battler, ABILITY_HUSTLE, gAiLogicData))
|
||||
if (AI_IsAbilityOnSide(battler, ABILITY_HUSTLE))
|
||||
return FIELD_EFFECT_POSITIVE;
|
||||
|
||||
if (HasMoveWithFlag(battler, IsMoveGravityBanned))
|
||||
|
||||
@ -1456,7 +1456,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||
break;
|
||||
case EFFECT_QUIVER_DANCE:
|
||||
case EFFECT_GEOMANCY:
|
||||
if (HasBattlerSideAbility(battlerDef, ABILITY_UNAWARE, aiData))
|
||||
if (AI_IsAbilityOnSide(battlerDef, ABILITY_UNAWARE))
|
||||
ADJUST_SCORE(-10);
|
||||
if (gBattleMons[battlerAtk].statStages[STAT_SPATK] >= MAX_STAT_STAGE || !HasMoveWithCategory(battlerAtk, DAMAGE_CATEGORY_SPECIAL))
|
||||
ADJUST_SCORE(-10);
|
||||
@ -1988,7 +1988,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||
break;
|
||||
case EFFECT_BELLY_DRUM:
|
||||
case EFFECT_FILLET_AWAY:
|
||||
if (HasBattlerSideAbility(battlerDef, ABILITY_UNAWARE, aiData))
|
||||
if (AI_IsAbilityOnSide(battlerDef, ABILITY_UNAWARE))
|
||||
ADJUST_SCORE(-10);
|
||||
if (aiData->abilities[battlerAtk] == ABILITY_CONTRARY)
|
||||
ADJUST_SCORE(-10);
|
||||
|
||||
@ -1995,7 +1995,7 @@ bool32 ShouldRaiseAnyStat(u32 battlerAtk, u32 battlerDef)
|
||||
return FALSE;
|
||||
|
||||
// Don't increase stats if opposing battler has Unaware
|
||||
if (HasBattlerSideAbility(battlerDef, ABILITY_UNAWARE, gAiLogicData))
|
||||
if (AI_IsAbilityOnSide(battlerDef, ABILITY_UNAWARE))
|
||||
return FALSE;
|
||||
|
||||
// Don't set up if AI is dead to residual damage from weather
|
||||
@ -2003,7 +2003,7 @@ bool32 ShouldRaiseAnyStat(u32 battlerAtk, u32 battlerDef)
|
||||
return FALSE;
|
||||
|
||||
// Don't increase stats if opposing battler has Opportunist
|
||||
if (HasBattlerSideAbility(battlerDef, ABILITY_OPPORTUNIST, gAiLogicData))
|
||||
if (AI_IsAbilityOnSide(battlerDef, ABILITY_OPPORTUNIST))
|
||||
return FALSE;
|
||||
|
||||
// Don't increase stats if opposing battler has Encore
|
||||
@ -5631,15 +5631,6 @@ bool32 IsBattlerItemEnabled(u32 battler)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool32 HasBattlerSideAbility(u32 battler, enum Ability ability, struct AiLogicData *aiData)
|
||||
{
|
||||
if (aiData->abilities[battler] == ability)
|
||||
return TRUE;
|
||||
if (HasPartnerIgnoreFlags(battler) && gAiLogicData->abilities[BATTLE_PARTNER(battler)] == ability)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
u32 GetFriendlyFireKOThreshold(u32 battler)
|
||||
{
|
||||
if (gAiThinkingStruct->aiFlags[battler] & AI_FLAG_RISKY)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user