Merge pull request #1548 from StubbornOne/battle_engine

Add Telepathy's damage prevention effect
This commit is contained in:
Eduardo Quezada D'Ottone 2021-09-21 23:02:41 -03:00 committed by GitHub
commit 9a72178fa2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8381,16 +8381,18 @@ static u16 CalcTypeEffectivenessMultiplierInternal(u16 move, u8 moveType, u8 bat
modifier = UQ_4_12(1.0);
}
if (GetBattlerAbility(battlerDef) == ABILITY_WONDER_GUARD && modifier <= UQ_4_12(1.0) && gBattleMoves[move].power)
if (((GetBattlerAbility(battlerDef) == ABILITY_WONDER_GUARD && modifier <= UQ_4_12(1.0))
|| (GetBattlerAbility(battlerDef) == ABILITY_TELEPATHY && battlerDef == BATTLE_PARTNER(battlerAtk)))
&& gBattleMoves[move].power)
{
modifier = UQ_4_12(0.0);
if (recordAbilities)
{
gLastUsedAbility = ABILITY_WONDER_GUARD;
gLastUsedAbility = gBattleMons[battlerDef].ability;
gMoveResultFlags |= MOVE_RESULT_MISSED;
gLastLandedMoves[battlerDef] = 0;
gBattleCommunication[MISS_TYPE] = B_MSG_AVOIDED_DMG;
RecordAbilityBattle(battlerDef, ABILITY_WONDER_GUARD);
RecordAbilityBattle(battlerDef, gBattleMons[battlerDef].ability);
}
}