Applied Wind Power and Wind Rider correction

-Renamed TryActivateWindRiderLoop to BattleScript_TryTailwindAbilitiesLoop
-Modified how it handles the check for Wind Rider by using a various and incorporated Wind Power into the mix because that ability is affected by Tailwind as well.
This commit is contained in:
LOuroboros 2022-12-21 10:08:16 -03:00
parent 6153b8e904
commit d943f891c5
5 changed files with 31 additions and 16 deletions

View File

@ -2005,6 +2005,11 @@
.byte \stat .byte \stat
.endm .endm
.macro trywindriderpower battler:req, ptr:req
various \battler, VARIOUS_TRY_WIND_RIDER_POWER
.4byte \ptr
.endm
@ helpful macros @ helpful macros
.macro setstatchanger stat:req, stages:req, down:req .macro setstatchanger stat:req, stages:req, down:req
setbyte sSTATCHANGER, \stat | \stages << 3 | \down << 7 setbyte sSTATCHANGER, \stat | \stages << 3 | \down << 7

View File

@ -2876,22 +2876,20 @@ BattleScript_EffectTailwind:
waitanimation waitanimation
printstring STRINGID_TAILWINDBLEW printstring STRINGID_TAILWINDBLEW
waitmessage B_WAIT_TIME_LONG waitmessage B_WAIT_TIME_LONG
call TryActivateWindRiderLoop call BattleScript_TryTailwindAbilitiesLoop
goto BattleScript_MoveEnd goto BattleScript_MoveEnd
TryActivateWindRiderLoop: BattleScript_TryTailwindAbilitiesLoop:
savetarget savetarget
setbyte gBattlerTarget, 0 setbyte gBattlerTarget, 0
BattleScript_WindRiderLoop_Iter: BattleScript_TryTailwindAbilitiesLoop_Iter:
jumpifability BS_TARGET, ABILITY_WIND_RIDER, BattleScript_WindRiderLoop_Activate trywindriderpower BS_TARGET, BattleScript_TryTailwindAbilitiesLoop_Increment
goto BattleScript_WindRiderLoop_Increment
BattleScript_WindRiderLoop_Activate:
call BattleScript_AbilityPopUp call BattleScript_AbilityPopUp
modifybattlerstatstage BS_TARGET, STAT_ATK, INCREASE, 1, BattleScript_WindRiderLoop_Increment, ANIM_ON modifybattlerstatstage BS_TARGET, STAT_ATK, INCREASE, 1, BattleScript_TryTailwindAbilitiesLoop_Increment, ANIM_ON
BattleScript_WindRiderLoop_Increment: BattleScript_TryTailwindAbilitiesLoop_Increment:
addbyte gBattlerTarget, 0x1 addbyte gBattlerTarget, 0x1
jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_WindRiderLoop_Iter jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_TryTailwindAbilitiesLoop_Iter
BattleScript_WindRiderLoop_Ret: BattleScript_TryTailwindAbilitiesLoop_Ret:
restoretarget restoretarget
return return

View File

@ -247,6 +247,7 @@
#define VARIOUS_GET_BATTLER_SIDE 156 #define VARIOUS_GET_BATTLER_SIDE 156
#define VARIOUS_CHECK_PARENTAL_BOND_COUNTER 157 #define VARIOUS_CHECK_PARENTAL_BOND_COUNTER 157
#define VARIOUS_SWAP_STATS 158 #define VARIOUS_SWAP_STATS 158
#define VARIOUS_TRY_WIND_RIDER_POWER 159
// Cmd_manipulatedamage // Cmd_manipulatedamage
#define DMG_CHANGE_SIGN 0 #define DMG_CHANGE_SIGN 0

View File

@ -10099,6 +10099,23 @@ static void Cmd_various(void)
PREPARE_STAT_BUFFER(gBattleTextBuff1, statId); PREPARE_STAT_BUFFER(gBattleTextBuff1, statId);
} }
break; break;
case VARIOUS_TRY_WIND_RIDER_POWER:
{
u16 ability = GetBattlerAbility(gActiveBattler);
if (GetBattlerSide(gActiveBattler) == GetBattlerSide(gBattlerAttacker)
&& (ability == ABILITY_WIND_RIDER || ability == ABILITY_WIND_POWER))
{
gLastUsedAbility = ability;
RecordAbilityBattle(gActiveBattler, gLastUsedAbility);
gBattlerAbility = gBattleScripting.battler = gActiveBattler;
gBattlescriptCurrInstr += 7;
}
else
{
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
}
}
return;
} // End of switch (gBattlescriptCurrInstr[2]) } // End of switch (gBattlescriptCurrInstr[2])
gBattlescriptCurrInstr += 3; gBattlescriptCurrInstr += 3;

View File

@ -2378,12 +2378,6 @@ u8 DoFieldEndTurnEffects(void)
BattleScriptExecute(BattleScript_TailwindEnds); BattleScriptExecute(BattleScript_TailwindEnds);
effect++; effect++;
} }
if (IsAbilityOnSide(gActiveBattler, ABILITY_WIND_POWER))
{
gCurrentMove = MOVE_TAILWIND;
BattleScriptExecute(BattleScript_WindPowerActivatesEnd2);
effect++;
}
} }
gBattleStruct->turnSideTracker++; gBattleStruct->turnSideTracker++;
if (effect != 0) if (effect != 0)