From 2d41f08312e2b1e39b5c964ab2a644a3ee1392ec Mon Sep 17 00:00:00 2001 From: StubbornOne Date: Mon, 21 Jun 2021 14:18:33 +0800 Subject: [PATCH] Add Telepathy's damage prevention effect --- src/battle_util.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/battle_util.c b/src/battle_util.c index 87f9003e0..06ccae3b6 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -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; }