Added Sheer Cold accuracy change to ShouldTryOHKO

This commit is contained in:
Eduardo Quezada D'Ottone 2022-05-07 10:38:16 -04:00
parent 4e7ce0b663
commit 89816b62ba

View File

@ -1499,6 +1499,10 @@ bool32 ShouldTryOHKO(u8 battlerAtk, u8 battlerDef, u16 atkAbility, u16 defAbilit
else // test the odds
{
u16 odds = accuracy + (gBattleMons[battlerAtk].level - gBattleMons[battlerDef].level);
#if B_SHEER_COLD_ACC >= GEN_7
if (gCurrentMove == MOVE_SHEER_COLD && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_ICE))
odds -= 10;
#endif
if (Random() % 100 + 1 < odds && gBattleMons[battlerAtk].level >= gBattleMons[battlerDef].level)
return TRUE;
}