WEATHER_STRONG_WINDS modifier fix

MulByTypeEffectiveness was the right answer all along.
I also added a short pause to BattleScript_AttackWeakenedByStrongWinds before STRINGID_ATTACKWEAKENEDBSTRONGWINDS is printed.
This commit is contained in:
LOuroboros 2021-10-06 06:32:06 -03:00
parent b93c746a49
commit 0f2cc99f45
2 changed files with 8 additions and 12 deletions

View File

@ -7307,6 +7307,7 @@ BattleScript_DeltaStreamActivates::
end3
BattleScript_AttackWeakenedByStrongWinds::
pause B_WAIT_TIME_SHORT
printstring STRINGID_ATTACKWEAKENEDBSTRONGWINDS
waitmessage B_WAIT_TIME_LONG
return

View File

@ -8476,6 +8476,13 @@ static void MulByTypeEffectiveness(u16 *modifier, u16 move, u8 moveType, u8 batt
if (gProtectStructs[battlerDef].kingsShielded && gBattleMoves[move].effect != EFFECT_FEINT)
mod = UQ_4_12(1.0);
// WEATHER_STRONG_WINDS weakens Super Effective moves against Flying-type Pokémon
if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_STRONG_WINDS)
{
if (defType == TYPE_FLYING && mod >= UQ_4_12(2.0))
mod = UQ_4_12(1.0);
}
MulModifier(modifier, mod);
}
@ -8531,18 +8538,6 @@ static u16 CalcTypeEffectivenessMultiplierInternal(u16 move, u8 moveType, u8 bat
modifier = UQ_4_12(1.0);
}
// WEATHER_STRONG_WINDS weakens Super Effective moves against Flying-type Pokémon
if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_STRONG_WINDS)
{
if ((gBattleMons[battlerDef].type1 == TYPE_FLYING
&& GetTypeModifier(moveType, gBattleMons[battlerDef].type1) >= UQ_4_12(2.0))
|| (gBattleMons[battlerDef].type2 == TYPE_FLYING
&& GetTypeModifier(moveType, gBattleMons[battlerDef].type2) >= UQ_4_12(2.0))
|| (gBattleMons[battlerDef].type3 == TYPE_FLYING
&& GetTypeModifier(moveType, gBattleMons[battlerDef].type3) >= UQ_4_12(2.0)))
modifier = UQ_4_12(1.0);
}
if (((GetBattlerAbility(battlerDef) == ABILITY_WONDER_GUARD && modifier <= UQ_4_12(1.0))
|| (GetBattlerAbility(battlerDef) == ABILITY_TELEPATHY && battlerDef == BATTLE_PARTNER(battlerAtk)))
&& gBattleMoves[move].power)