From 0ef148dfbbd9391aec26f32d5d1dee7e994fb5e4 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Wed, 28 Dec 2022 08:50:15 -0300 Subject: [PATCH] Applied more corrections -Removed BattleScript_WindRiderActivatesEnd2 -Tweaked the condition of Wind Power in AbilityBattleEffects -Renamed ApplySupremeOverlordModifier to GetSupremeOverlordModifier --- data/battle_scripts_1.s | 20 -------------------- include/battle_scripts.h | 1 - src/battle_util.c | 19 +++++-------------- 3 files changed, 5 insertions(+), 35 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 4cb11f183..01ef1fdd3 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -6683,26 +6683,6 @@ BattleScript_TailwindEnds:: waitmessage B_WAIT_TIME_LONG end2 -BattleScript_WindRiderActivatesEnd2:: - setbyte gBattlerTarget, 0 -BattleScript_WindRiderLoop: - printstring STRINGID_EMPTYSTRING3 - jumpifability BS_TARGET, ABILITY_WIND_RIDER, BattleScript_WindRiderLoop_Cont - goto BattleScript_WindRiderIncrement -BattleScript_WindRiderLoop_Cont: - jumpifsideaffecting BS_TARGET, SIDE_STATUS_TAILWIND, BattleScript_WindRider_Activate - goto BattleScript_WindRiderIncrement -BattleScript_WindRider_Activate: - call BattleScript_AbilityPopUp - pause B_WAIT_TIME_MED - modifybattlerstatstage BS_TARGET, STAT_ATK, INCREASE, 1, BattleScript_WindRiderIncrement, ANIM_ON -BattleScript_WindRiderIncrement: - addbyte gBattlerTarget, 1 - jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_WindRiderLoop -BattleScript_WindRiderEnd: - destroyabilitypopup - end2 - BattleScript_WindPowerActivatesEnd2:: setbyte gBattlerAttacker, 0 BattleScript_WindPowerLoop: diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 5fc55cc65..d79566a44 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -436,7 +436,6 @@ extern const u8 BattleScript_DoubleShockRemoveType[]; extern const u8 BattleScript_SeedSowerActivates[]; extern const u8 BattleScript_AngerShellActivates[]; extern const u8 BattleScript_WellBakedBodyActivates[]; -extern const u8 BattleScript_WindRiderActivatesEnd2[]; extern const u8 BattleScript_WindRiderActivatesMoveEnd[]; extern const u8 BattleScript_WindPowerActivates[]; extern const u8 BattleScript_WindPowerActivatesEnd2[]; diff --git a/src/battle_util.c b/src/battle_util.c index ac34d5360..c1d112d19 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -5891,18 +5891,9 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move } break; case ABILITY_WIND_POWER: - if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) - && !gProtectStructs[gBattlerAttacker].confusionSelfDmg - && TARGET_TURN_DAMAGED - && gBattleMoves[gCurrentMove].flags & FLAG_WIND_MOVE - && IsBattlerAlive(gBattlerTarget)) - { - gBattlerAttacker = gBattlerTarget; - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_WindPowerActivates; - effect++; - } - break; + if (!(gBattleMoves[gCurrentMove].flags & FLAG_WIND_MOVE)) + break; + // fall through case ABILITY_ELECTROMORPHOSIS: if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && !gProtectStructs[gBattlerAttacker].confusionSelfDmg @@ -8756,7 +8747,7 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) // Supreme Overlord adds a damage boost for each fainted ally. // The first ally adds a x1.2 boost, and subsequent allies add an extra x0.1 boost each. -static u16 ApplySupremeOverlordModifier(u8 battlerId) +static u16 GetSupremeOverlordModifier(u8 battlerId) { u32 i; u8 side = GetBattlerSide(battlerId); @@ -8925,7 +8916,7 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe MulModifier(&modifier, UQ_4_12(1.5)); break; case ABILITY_SUPREME_OVERLORD: - MulModifier(&modifier, ApplySupremeOverlordModifier(battlerAtk)); + MulModifier(&modifier, GetSupremeOverlordModifier(battlerAtk)); break; }