mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-18 01:14:19 +01:00
fix ai's def magic guard check
This commit is contained in:
parent
90ddc8d706
commit
012877bdc1
@ -578,6 +578,21 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|
||||
{
|
||||
switch (AI_DATA->defAbility)
|
||||
{
|
||||
case ABILITY_MAGIC_GUARD:
|
||||
switch (moveEffect)
|
||||
{
|
||||
case EFFECT_POISON:
|
||||
case EFFECT_WILL_O_WISP:
|
||||
case EFFECT_TOXIC:
|
||||
case EFFECT_LEECH_SEED:
|
||||
score -= 5;
|
||||
break;
|
||||
case EFFECT_CURSE:
|
||||
if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST))
|
||||
score -= 5;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case ABILITY_VOLT_ABSORB:
|
||||
case ABILITY_MOTOR_DRIVE:
|
||||
case ABILITY_LIGHTNING_ROD:
|
||||
@ -2949,7 +2964,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|
||||
}
|
||||
}
|
||||
|
||||
// ability checks
|
||||
// attacker ability checks
|
||||
switch (AI_DATA->atkAbility)
|
||||
{
|
||||
case ABILITY_MOXIE:
|
||||
@ -2960,21 +2975,6 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|
||||
score += 8; // prioritize killing target for stat boost
|
||||
}
|
||||
break;
|
||||
case ABILITY_MAGIC_GUARD:
|
||||
switch (moveEffect)
|
||||
{
|
||||
case EFFECT_POISON:
|
||||
case EFFECT_WILL_O_WISP:
|
||||
case EFFECT_TOXIC:
|
||||
case EFFECT_LEECH_SEED:
|
||||
score -= 5;
|
||||
break;
|
||||
case EFFECT_CURSE:
|
||||
if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST))
|
||||
score -= 5;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
} // ability checks
|
||||
|
||||
// move effect checks
|
||||
|
Loading…
x
Reference in New Issue
Block a user