Merge pull request #1548 from StubbornOne/battle_engine
Add Telepathy's damage prevention effect
This commit is contained in:
commit
9a72178fa2
1 changed files with 5 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue