Merge pull request #1705 from AsparagusEduardo/fix_UnnerveResist

Fix Unnerve not canceling out type resist berries.
This commit is contained in:
ghoulslash 2021-10-06 09:22:34 -04:00 committed by GitHub
commit 5959eac924
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8233,6 +8233,7 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move
u32 abilityDef = GetBattlerAbility(battlerDef);
u32 defSide = GET_BATTLER_SIDE(battlerDef);
u16 finalModifier = UQ_4_12(1.0);
u16 itemDef = gBattleMons[battlerDef].item;
// check multiple targets in double battle
if (GetMoveTargetCount(move, battlerAtk, battlerDef) >= 2)
@ -8353,7 +8354,8 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move
// berries reducing dmg
case HOLD_EFFECT_RESIST_BERRY:
if (moveType == GetBattlerHoldEffectParam(battlerDef)
&& (moveType == TYPE_NORMAL || typeEffectivenessModifier >= UQ_4_12(2.0)))
&& (moveType == TYPE_NORMAL || typeEffectivenessModifier >= UQ_4_12(2.0))
&& !UnnerveOn(battlerDef, itemDef))
{
if (abilityDef == ABILITY_RIPEN)
MulModifier(&finalModifier, UQ_4_12(0.25));