ice type immunity to sheer cold

This commit is contained in:
ghoulslash 2021-11-26 11:49:49 -05:00
parent 3ac480076c
commit e2af9ec3b4
3 changed files with 9 additions and 0 deletions

View File

@ -126,6 +126,7 @@
#define B_POWDER_GRASS GEN_7 // In Gen6+, Grass-type Pokémon are immune to powder and spore moves.
#define B_STEEL_RESISTANCES GEN_7 // In Gen6+, Steel-type Pokémon are no longer resistant to Dark-type and Ghost-type moves.
#define B_PRANKSTER_DARK_TYPES GEN_7 // In Gen7+, Prankster-elevated status moves do not affect Dark type Pokémon.
#define B_SHEER_COLD_IMMUNITY GEN_7 // In Gen7+, Ice-types are immune to Sheer Cold
// Turn count settings
#define B_BINDING_TURNS GEN_7 // In Gen5+, binding moves last for 4-5 turns instead of 2-5 turns. (With Grip Claw, 7 and 5 turns respectively.)

View File

@ -1178,6 +1178,10 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
score -= 10;
break;
case EFFECT_OHKO:
if (B_SHEER_COLD_IMMUNITY >= GEN_7
&& move == MOVE_SHEER_COLD
&& IS_BATTLER_OF_TYPE(battlerDef, TYPE_ICE))
return 0;
if (!ShouldTryOHKO(battlerAtk, battlerDef, AI_DATA->atkAbility, AI_DATA->defAbility, accuracy, move))
score -= 10;
break;

View File

@ -8945,6 +8945,10 @@ static u16 CalcTypeEffectivenessMultiplierInternal(u16 move, u8 moveType, u8 bat
RecordAbilityBattle(battlerDef, ABILITY_LEVITATE);
}
}
else if (B_SHEER_COLD_IMMUNITY >= GEN_7 && move == MOVE_SHEER_COLD && IS_BATTLER_OF_TYPE(battlerDef, TYPE_ICE))
{
modifier = UQ_4_12(0.0);
}
// Thousand Arrows ignores type modifiers for flying mons
if (!IsBattlerGrounded(battlerDef) && (gBattleMoves[move].flags & FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING)