Implemented Wind Rider's effect

This commit is contained in:
LOuroboros 2022-12-03 06:21:01 -03:00
parent ca656b63b9
commit 4dc44150c5
5 changed files with 60 additions and 16 deletions

View File

@ -6589,6 +6589,26 @@ BattleScript_TailwindEnds::
waitmessage B_WAIT_TIME_LONG waitmessage B_WAIT_TIME_LONG
end2 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_TrickRoomEnds:: BattleScript_TrickRoomEnds::
printstring STRINGID_TRICKROOMENDS printstring STRINGID_TRICKROOMENDS
waitmessage B_WAIT_TIME_LONG waitmessage B_WAIT_TIME_LONG
@ -9812,6 +9832,17 @@ BattleScript_WellBakedBodyActivates::
BattleScript_WellBakedBodyEnd: BattleScript_WellBakedBodyEnd:
goto BattleScript_MoveEnd goto BattleScript_MoveEnd
BattleScript_WindRiderActivatesMoveEnd::
attackstring
ppreduce
showabilitypopup BS_TARGET
pause B_WAIT_TIME_MED
orhalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
printstring STRINGID_EMPTYSTRING3
modifybattlerstatstage BS_TARGET, STAT_ATK, INCREASE, 1, BattleScript_WindRiderActivatesMoveEnd_End, ANIM_ON
BattleScript_WindRiderActivatesMoveEnd_End:
goto BattleScript_MoveEnd
BattleScript_PastelVeilActivates:: BattleScript_PastelVeilActivates::
setbyte gBattleCommunication, 0 setbyte gBattleCommunication, 0
setbyte gBattleCommunication + 1, 0 setbyte gBattleCommunication + 1, 0

View File

@ -436,6 +436,8 @@ extern const u8 BattleScript_TargetAbilityStatRaiseRet[];
extern const u8 BattleScript_SeedSowerActivates[]; extern const u8 BattleScript_SeedSowerActivates[];
extern const u8 BattleScript_AngerShellActivates[]; extern const u8 BattleScript_AngerShellActivates[];
extern const u8 BattleScript_WellBakedBodyActivates[]; extern const u8 BattleScript_WellBakedBodyActivates[];
extern const u8 BattleScript_WindRiderActivatesEnd2[];
extern const u8 BattleScript_WindRiderActivatesMoveEnd[];
// zmoves // zmoves
extern const u8 BattleScript_ZMoveActivateDamaging[]; extern const u8 BattleScript_ZMoveActivateDamaging[];

View File

@ -235,6 +235,7 @@
#define FLAG_THAW_USER (1 << 25) #define FLAG_THAW_USER (1 << 25)
#define FLAG_HIT_IN_SUBSTITUTE (1 << 26) // Hyperspace Fury #define FLAG_HIT_IN_SUBSTITUTE (1 << 26) // Hyperspace Fury
#define FLAG_TWO_STRIKES (1 << 27) // A move with this flag will strike twice, and may apply its effect on each hit #define FLAG_TWO_STRIKES (1 << 27) // A move with this flag will strike twice, and may apply its effect on each hit
#define FLAG_WIND_MOVE (1 << 28)
// Split defines. // Split defines.
#define SPLIT_PHYSICAL 0x0 #define SPLIT_PHYSICAL 0x0

View File

@ -2373,6 +2373,11 @@ u8 DoFieldEndTurnEffects(void)
BattleScriptExecute(BattleScript_TailwindEnds); BattleScriptExecute(BattleScript_TailwindEnds);
effect++; effect++;
} }
if (IsAbilityOnSide(gActiveBattler, ABILITY_WIND_RIDER))
{
BattleScriptExecute(BattleScript_WindRiderActivatesEnd2);
effect++;
}
} }
gBattleStruct->turnSideTracker++; gBattleStruct->turnSideTracker++;
if (effect != 0) if (effect != 0)
@ -5115,6 +5120,11 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
gBattlescriptCurrInstr = BattleScript_WellBakedBodyActivates; gBattlescriptCurrInstr = BattleScript_WellBakedBodyActivates;
effect = 1; effect = 1;
} }
else if (targetAbility == ABILITY_WIND_RIDER && gBattleMoves[gCurrentMove].flags & FLAG_WIND_MOVE && !(moveTarget & MOVE_TARGET_USER))
{
gBattlescriptCurrInstr = BattleScript_WindRiderActivatesMoveEnd;
effect = 1;
}
break; break;
} }
case ABILITYEFFECT_ABSORBING: // 3 case ABILITYEFFECT_ABSORBING: // 3

View File

@ -272,7 +272,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
.secondaryEffectChance = 0, .secondaryEffectChance = 0,
.target = MOVE_TARGET_SELECTED, .target = MOVE_TARGET_SELECTED,
.priority = 0, .priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_DMG_2X_IN_AIR, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_DMG_2X_IN_AIR | FLAG_WIND_MOVE,
.split = SPLIT_SPECIAL, .split = SPLIT_SPECIAL,
.zMovePower = 100, .zMovePower = 100,
.zMoveEffect = Z_EFFECT_NONE, .zMoveEffect = Z_EFFECT_NONE,
@ -298,7 +298,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
{ {
#if B_UPDATED_MOVE_DATA >= GEN_6 #if B_UPDATED_MOVE_DATA >= GEN_6
.accuracy = 0, .accuracy = 0,
.flags = FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .flags = FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_WIND_MOVE,
#elif B_UPDATED_MOVE_DATA == GEN_5 #elif B_UPDATED_MOVE_DATA == GEN_5
.accuracy = 100, .accuracy = 100,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .flags = FLAG_PROTECT_AFFECTED | FLAG_MAGIC_COAT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED,
@ -1073,7 +1073,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
.secondaryEffectChance = 10, .secondaryEffectChance = 10,
.target = MOVE_TARGET_BOTH, .target = MOVE_TARGET_BOTH,
.priority = 0, .priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_WIND_MOVE,
.split = SPLIT_SPECIAL, .split = SPLIT_SPECIAL,
.zMoveEffect = Z_EFFECT_NONE, .zMoveEffect = Z_EFFECT_NONE,
}, },
@ -3531,7 +3531,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
.secondaryEffectChance = 100, .secondaryEffectChance = 100,
.target = MOVE_TARGET_BOTH, .target = MOVE_TARGET_BOTH,
.priority = 0, .priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_WIND_MOVE,
.split = SPLIT_SPECIAL, .split = SPLIT_SPECIAL,
.zMovePower = 100, .zMovePower = 100,
.zMoveEffect = Z_EFFECT_NONE, .zMoveEffect = Z_EFFECT_NONE,
@ -3633,7 +3633,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
.secondaryEffectChance = 0, .secondaryEffectChance = 0,
.target = MOVE_TARGET_ALL_BATTLERS, .target = MOVE_TARGET_ALL_BATTLERS,
.priority = 0, .priority = 0,
.flags = 0, .flags = FLAG_WIND_MOVE,
.split = SPLIT_STATUS, .split = SPLIT_STATUS,
.zMovePower = 0, .zMovePower = 0,
.zMoveEffect = Z_EFFECT_SPD_UP_1, .zMoveEffect = Z_EFFECT_SPD_UP_1,
@ -4290,7 +4290,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
[MOVE_TWISTER] = [MOVE_TWISTER] =
{ {
#if B_UPDATED_MOVE_DATA >= GEN_5 #if B_UPDATED_MOVE_DATA >= GEN_5
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_DMG_2X_IN_AIR, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_DMG_2X_IN_AIR | FLAG_WIND_MOVE,
#else #else
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_DMG_2X_IN_AIR, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_DMG_2X_IN_AIR,
#endif #endif
@ -4663,7 +4663,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
.secondaryEffectChance = 10, .secondaryEffectChance = 10,
.target = MOVE_TARGET_BOTH, .target = MOVE_TARGET_BOTH,
.priority = 0, .priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_WIND_MOVE,
.split = SPLIT_SPECIAL, .split = SPLIT_SPECIAL,
.zMoveEffect = Z_EFFECT_NONE, .zMoveEffect = Z_EFFECT_NONE,
}, },
@ -5656,7 +5656,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
.secondaryEffectChance = 0, .secondaryEffectChance = 0,
.target = MOVE_TARGET_BOTH, .target = MOVE_TARGET_BOTH,
.priority = 0, .priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_HIGH_CRIT | FLAG_WIND_MOVE,
.split = SPLIT_SPECIAL, .split = SPLIT_SPECIAL,
.zMoveEffect = Z_EFFECT_NONE, .zMoveEffect = Z_EFFECT_NONE,
}, },
@ -6613,7 +6613,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
.secondaryEffectChance = 0, .secondaryEffectChance = 0,
.target = MOVE_TARGET_USER, .target = MOVE_TARGET_USER,
.priority = 0, .priority = 0,
.flags = FLAG_SNATCH_AFFECTED, .flags = FLAG_SNATCH_AFFECTED | FLAG_WIND_MOVE,
.split = SPLIT_STATUS, .split = SPLIT_STATUS,
.zMovePower = 0, .zMovePower = 0,
.zMoveEffect = Z_EFFECT_BOOST_CRITS, .zMoveEffect = Z_EFFECT_BOOST_CRITS,
@ -9691,7 +9691,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
.secondaryEffectChance = 30, .secondaryEffectChance = 30,
.target = MOVE_TARGET_SELECTED, .target = MOVE_TARGET_SELECTED,
.priority = 0, .priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_DMG_IN_AIR, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_DMG_IN_AIR | FLAG_WIND_MOVE,
.split = SPLIT_SPECIAL, .split = SPLIT_SPECIAL,
.zMoveEffect = Z_EFFECT_NONE, .zMoveEffect = Z_EFFECT_NONE,
}, },
@ -10201,7 +10201,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
.secondaryEffectChance = 0, .secondaryEffectChance = 0,
.target = MOVE_TARGET_FOES_AND_ALLY, .target = MOVE_TARGET_FOES_AND_ALLY,
.priority = 0, .priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_WIND_MOVE,
.split = SPLIT_PHYSICAL, .split = SPLIT_PHYSICAL,
.zMovePower = 175, .zMovePower = 175,
.zMoveEffect = Z_EFFECT_NONE, .zMoveEffect = Z_EFFECT_NONE,
@ -10400,7 +10400,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
.secondaryEffectChance = 0, .secondaryEffectChance = 0,
.target = MOVE_TARGET_SELECTED, .target = MOVE_TARGET_SELECTED,
.priority = 0, .priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_WIND_MOVE,
.split = SPLIT_SPECIAL, .split = SPLIT_SPECIAL,
.zMovePower = 100, .zMovePower = 100,
.zMoveEffect = Z_EFFECT_NONE, .zMoveEffect = Z_EFFECT_NONE,
@ -13308,7 +13308,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
.secondaryEffectChance = 30, .secondaryEffectChance = 30,
.target = MOVE_TARGET_SELECTED, .target = MOVE_TARGET_SELECTED,
.priority = 0, .priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_WIND_MOVE,
.split = SPLIT_SPECIAL, .split = SPLIT_SPECIAL,
.zMovePower = 175, .zMovePower = 175,
.zMoveEffect = Z_EFFECT_NONE, .zMoveEffect = Z_EFFECT_NONE,
@ -13548,7 +13548,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
.secondaryEffectChance = 0, .secondaryEffectChance = 0,
.target = MOVE_TARGET_SELECTED, .target = MOVE_TARGET_SELECTED,
.priority = 0, .priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_WIND_MOVE,
.split = SPLIT_SPECIAL, .split = SPLIT_SPECIAL,
.zMovePower = 175, .zMovePower = 175,
.zMoveEffect = Z_EFFECT_NONE, .zMoveEffect = Z_EFFECT_NONE,
@ -13564,7 +13564,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
.secondaryEffectChance = 0, .secondaryEffectChance = 0,
.target = MOVE_TARGET_SELECTED, .target = MOVE_TARGET_SELECTED,
.priority = 0, .priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_WIND_MOVE,
.split = SPLIT_SPECIAL, .split = SPLIT_SPECIAL,
.zMovePower = 175, .zMovePower = 175,
.zMoveEffect = Z_EFFECT_NONE, .zMoveEffect = Z_EFFECT_NONE,
@ -13580,7 +13580,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
.secondaryEffectChance = 0, .secondaryEffectChance = 0,
.target = MOVE_TARGET_SELECTED, .target = MOVE_TARGET_SELECTED,
.priority = 0, .priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_WIND_MOVE,
.split = SPLIT_SPECIAL, .split = SPLIT_SPECIAL,
.zMovePower = 175, .zMovePower = 175,
.zMoveEffect = Z_EFFECT_NONE, .zMoveEffect = Z_EFFECT_NONE,