Add Telepathy's damage prevention effect

This commit is contained in:
StubbornOne 2021-06-21 14:18:33 +08:00
parent 800e2395c0
commit 2d41f08312

View File

@ -8105,6 +8105,17 @@ static u16 CalcTypeEffectivenessMultiplierInternal(u16 move, u8 moveType, u8 bat
RecordAbilityBattle(battlerDef, ABILITY_WONDER_GUARD);
}
}
if (GetBattlerAbility(battlerDef) == ABILITY_TELEPATHY && battlerDef == BATTLE_PARTNER(battlerAtk)) {
modifier = UQ_4_12(0.0);
if (recordAbilities)
{
gLastUsedAbility = ABILITY_TELEPATHY;
gMoveResultFlags |= MOVE_RESULT_MISSED;
gLastLandedMoves[battlerDef] = 0;
gBattleCommunication[6] = B_MSG_AVOIDED_DMG;
RecordAbilityBattle(battlerDef, ABILITY_TELEPATHY);
}
}
return modifier;
}