Various small doubles AI fixes (#4786)

* fix AI thinking defiant procs off ally moves

* AI see's partner's ability for swagger and flatter
This commit is contained in:
sneed 2024-06-13 14:52:13 +03:00 committed by GitHub
parent 8ff1cbed2a
commit c2ca22d474
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2891,20 +2891,6 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
RETURN_SCORE_PLUS(DECENT_EFFECT);
}
break;
case ABILITY_DEFIANT:
if (IsStatLoweringEffect(effect)
&& BattlerStatCanRise(battlerAtkPartner, atkPartnerAbility, STAT_ATK))
{
RETURN_SCORE_PLUS(WEAK_EFFECT);
}
break;
case ABILITY_COMPETITIVE:
if (IsStatLoweringEffect(effect)
&& BattlerStatCanRise(battlerAtkPartner, atkPartnerAbility, STAT_SPATK))
{
RETURN_SCORE_PLUS(WEAK_EFFECT);
}
break;
}
} // ability checks
@ -2922,7 +2908,7 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
case EFFECT_SWAGGER:
if (gBattleMons[battlerAtkPartner].statStages[STAT_ATK] < MAX_STAT_STAGE
&& HasMoveWithCategory(battlerAtkPartner, DAMAGE_CATEGORY_PHYSICAL)
&& (!AI_CanBeConfused(battlerAtk, battlerAtkPartner, move, TRUE)
&& (!AI_CanBeConfused(battlerAtk, battlerAtkPartner, move, atkPartnerAbility)
|| atkPartnerHoldEffect == HOLD_EFFECT_CURE_CONFUSION
|| atkPartnerHoldEffect == HOLD_EFFECT_CURE_STATUS))
{
@ -2932,7 +2918,7 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
case EFFECT_FLATTER:
if (gBattleMons[battlerAtkPartner].statStages[STAT_SPATK] < MAX_STAT_STAGE
&& HasMoveWithCategory(battlerAtkPartner, DAMAGE_CATEGORY_SPECIAL)
&& (!AI_CanBeConfused(battlerAtk, battlerAtkPartner, move, TRUE)
&& (!AI_CanBeConfused(battlerAtk, battlerAtkPartner, move, atkPartnerAbility)
|| atkPartnerHoldEffect == HOLD_EFFECT_CURE_CONFUSION
|| atkPartnerHoldEffect == HOLD_EFFECT_CURE_STATUS))
{