diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 39fb01cdd..083db5f07 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -7293,7 +7293,7 @@ BattleScript_AttackWeakenedByStrongWinds:: call BattleScript_AbilityPopUp printstring STRINGID_ATTACKWEAKENEDBSTRONGWINDS waitmessage B_WAIT_TIME_LONG - end3 + return BattleScript_SnowWarningActivates:: pause B_WAIT_TIME_SHORT diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 90979264a..1fd7daea5 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1914,6 +1914,9 @@ static void Cmd_typecalc(void) static void Cmd_adjustdamage(void) { u8 holdEffect, param; + u32 moveType; + + GET_MOVE_TYPE(gCurrentMove, moveType); if (DoesSubstituteBlockMove(gBattlerAttacker, gBattlerTarget, gCurrentMove)) goto END; @@ -1991,6 +1994,23 @@ END: gBattlescriptCurrInstr = BattleScript_GemActivates; gLastUsedItem = gBattleMons[gBattlerAttacker].item; } + + // WEATHER_STRONG_WINDS prints a string when it's about to reduce the power + // of a move that is Super Effective against a Flying-type Pokémon. + if (gBattleWeather & WEATHER_STRONG_WINDS) + { + if ((gBattleMons[gBattlerTarget].type1 == TYPE_FLYING + && GetTypeModifier(moveType, gBattleMons[gBattlerTarget].type1) >= UQ_4_12(2.0)) + || (gBattleMons[gBattlerTarget].type2 == TYPE_FLYING + && GetTypeModifier(moveType, gBattleMons[gBattlerTarget].type2) >= UQ_4_12(2.0)) + || (gBattleMons[gBattlerTarget].type3 == TYPE_FLYING + && GetTypeModifier(moveType, gBattleMons[gBattlerTarget].type3) >= UQ_4_12(2.0))) + { + gBattlerAbility = gBattlerTarget; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_AttackWeakenedByStrongWinds; + } + } } static void Cmd_multihitresultmessage(void) diff --git a/src/battle_util.c b/src/battle_util.c index 2e7f3e18d..8873d7ae3 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -486,14 +486,6 @@ void HandleAction_UseMove(void) for (i = 0; i < MAX_BATTLERS_COUNT; i++) gBattleStruct->hpBefore[i] = gBattleMons[i].hp; - GET_MOVE_TYPE(gCurrentMove, moveType); - if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_STRONG_WINDS) - { - if (IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_FLYING) - && CalcTypeEffectivenessMultiplier(gCurrentMove, moveType, gBattlerAttacker, gBattlerTarget, FALSE) >= UQ_4_12(2.0)) - BattleScriptPushCursorAndCallback(BattleScript_AttackWeakenedByStrongWinds); - } - gCurrentActionFuncId = B_ACTION_EXEC_SCRIPT; } @@ -8300,8 +8292,12 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move } else if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_STRONG_WINDS) { - if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_FLYING) - && typeEffectivenessModifier >= UQ_4_12(2.0)) + 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))) dmg = ApplyModifier(UQ_4_12(0.5), dmg); }