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:
parent
8ff1cbed2a
commit
c2ca22d474
1 changed files with 2 additions and 16 deletions
|
@ -2891,20 +2891,6 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||||
RETURN_SCORE_PLUS(DECENT_EFFECT);
|
RETURN_SCORE_PLUS(DECENT_EFFECT);
|
||||||
}
|
}
|
||||||
break;
|
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
|
} // ability checks
|
||||||
|
|
||||||
|
@ -2922,7 +2908,7 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||||
case EFFECT_SWAGGER:
|
case EFFECT_SWAGGER:
|
||||||
if (gBattleMons[battlerAtkPartner].statStages[STAT_ATK] < MAX_STAT_STAGE
|
if (gBattleMons[battlerAtkPartner].statStages[STAT_ATK] < MAX_STAT_STAGE
|
||||||
&& HasMoveWithCategory(battlerAtkPartner, DAMAGE_CATEGORY_PHYSICAL)
|
&& 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_CONFUSION
|
||||||
|| atkPartnerHoldEffect == HOLD_EFFECT_CURE_STATUS))
|
|| atkPartnerHoldEffect == HOLD_EFFECT_CURE_STATUS))
|
||||||
{
|
{
|
||||||
|
@ -2932,7 +2918,7 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||||
case EFFECT_FLATTER:
|
case EFFECT_FLATTER:
|
||||||
if (gBattleMons[battlerAtkPartner].statStages[STAT_SPATK] < MAX_STAT_STAGE
|
if (gBattleMons[battlerAtkPartner].statStages[STAT_SPATK] < MAX_STAT_STAGE
|
||||||
&& HasMoveWithCategory(battlerAtkPartner, DAMAGE_CATEGORY_SPECIAL)
|
&& 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_CONFUSION
|
||||||
|| atkPartnerHoldEffect == HOLD_EFFECT_CURE_STATUS))
|
|| atkPartnerHoldEffect == HOLD_EFFECT_CURE_STATUS))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue