mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +01:00
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:
parent
6153b8e904
commit
d943f891c5
@ -2005,6 +2005,11 @@
|
||||
.byte \stat
|
||||
.endm
|
||||
|
||||
.macro trywindriderpower battler:req, ptr:req
|
||||
various \battler, VARIOUS_TRY_WIND_RIDER_POWER
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
@ helpful macros
|
||||
.macro setstatchanger stat:req, stages:req, down:req
|
||||
setbyte sSTATCHANGER, \stat | \stages << 3 | \down << 7
|
||||
|
@ -2876,22 +2876,20 @@ BattleScript_EffectTailwind:
|
||||
waitanimation
|
||||
printstring STRINGID_TAILWINDBLEW
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
call TryActivateWindRiderLoop
|
||||
call BattleScript_TryTailwindAbilitiesLoop
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
TryActivateWindRiderLoop:
|
||||
BattleScript_TryTailwindAbilitiesLoop:
|
||||
savetarget
|
||||
setbyte gBattlerTarget, 0
|
||||
BattleScript_WindRiderLoop_Iter:
|
||||
jumpifability BS_TARGET, ABILITY_WIND_RIDER, BattleScript_WindRiderLoop_Activate
|
||||
goto BattleScript_WindRiderLoop_Increment
|
||||
BattleScript_WindRiderLoop_Activate:
|
||||
BattleScript_TryTailwindAbilitiesLoop_Iter:
|
||||
trywindriderpower BS_TARGET, BattleScript_TryTailwindAbilitiesLoop_Increment
|
||||
call BattleScript_AbilityPopUp
|
||||
modifybattlerstatstage BS_TARGET, STAT_ATK, INCREASE, 1, BattleScript_WindRiderLoop_Increment, ANIM_ON
|
||||
BattleScript_WindRiderLoop_Increment:
|
||||
modifybattlerstatstage BS_TARGET, STAT_ATK, INCREASE, 1, BattleScript_TryTailwindAbilitiesLoop_Increment, ANIM_ON
|
||||
BattleScript_TryTailwindAbilitiesLoop_Increment:
|
||||
addbyte gBattlerTarget, 0x1
|
||||
jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_WindRiderLoop_Iter
|
||||
BattleScript_WindRiderLoop_Ret:
|
||||
jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_TryTailwindAbilitiesLoop_Iter
|
||||
BattleScript_TryTailwindAbilitiesLoop_Ret:
|
||||
restoretarget
|
||||
return
|
||||
|
||||
|
@ -247,6 +247,7 @@
|
||||
#define VARIOUS_GET_BATTLER_SIDE 156
|
||||
#define VARIOUS_CHECK_PARENTAL_BOND_COUNTER 157
|
||||
#define VARIOUS_SWAP_STATS 158
|
||||
#define VARIOUS_TRY_WIND_RIDER_POWER 159
|
||||
|
||||
// Cmd_manipulatedamage
|
||||
#define DMG_CHANGE_SIGN 0
|
||||
|
@ -10099,6 +10099,23 @@ static void Cmd_various(void)
|
||||
PREPARE_STAT_BUFFER(gBattleTextBuff1, statId);
|
||||
}
|
||||
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])
|
||||
|
||||
gBattlescriptCurrInstr += 3;
|
||||
|
@ -2378,12 +2378,6 @@ u8 DoFieldEndTurnEffects(void)
|
||||
BattleScriptExecute(BattleScript_TailwindEnds);
|
||||
effect++;
|
||||
}
|
||||
if (IsAbilityOnSide(gActiveBattler, ABILITY_WIND_POWER))
|
||||
{
|
||||
gCurrentMove = MOVE_TAILWIND;
|
||||
BattleScriptExecute(BattleScript_WindPowerActivatesEnd2);
|
||||
effect++;
|
||||
}
|
||||
}
|
||||
gBattleStruct->turnSideTracker++;
|
||||
if (effect != 0)
|
||||
|
Loading…
Reference in New Issue
Block a user