Fix type check in Magnet Rise AI (#8609)
This commit is contained in:
parent
828e12bee6
commit
ae01e51f85
@ -5519,7 +5519,7 @@ static s32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move, stru
|
|||||||
ADJUST_SCORE(GOOD_EFFECT);
|
ADJUST_SCORE(GOOD_EFFECT);
|
||||||
break;
|
break;
|
||||||
case EFFECT_MAGNET_RISE:
|
case EFFECT_MAGNET_RISE:
|
||||||
if (AI_IsBattlerGrounded(battlerAtk) && HasDamagingMoveOfType(battlerDef, TYPE_ELECTRIC)
|
if (AI_IsBattlerGrounded(battlerAtk) && HasDamagingMoveOfType(battlerDef, TYPE_GROUND)
|
||||||
&& !(effectiveness == UQ_4_12(0.0))) // Doesn't resist ground move
|
&& !(effectiveness == UQ_4_12(0.0))) // Doesn't resist ground move
|
||||||
{
|
{
|
||||||
if (AI_IsFaster(battlerAtk, battlerDef, move, predictedMoveSpeedCheck, CONSIDER_PRIORITY)) // Attacker goes first
|
if (AI_IsFaster(battlerAtk, battlerDef, move, predictedMoveSpeedCheck, CONSIDER_PRIORITY)) // Attacker goes first
|
||||||
@ -5530,8 +5530,7 @@ static s32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move, stru
|
|||||||
}
|
}
|
||||||
else // Opponent Goes First
|
else // Opponent Goes First
|
||||||
{
|
{
|
||||||
if (HasDamagingMoveOfType(battlerDef, TYPE_GROUND))
|
ADJUST_SCORE(DECENT_EFFECT);
|
||||||
ADJUST_SCORE(DECENT_EFFECT);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user