Label various battle scripts

This commit is contained in:
DizzyEggg 2018-09-01 20:00:13 +02:00
parent ead21250a6
commit 44ba432dad
8 changed files with 140 additions and 187 deletions

View File

@ -3044,17 +3044,17 @@ AI_TrySkillSwapOnAlly:
end end
AI_TrySkillSwapOnAlly2: AI_TrySkillSwapOnAlly2:
if_not_equal 14, Score_Minus30_ if_not_equal ABILITY_COMPOUND_EYES, Score_Minus30_
if_has_move AI_USER_PARTNER, MOVE_FIRE_BLAST, AI_TrySkillSwapOnAllyEnd if_has_move AI_USER_PARTNER, MOVE_FIRE_BLAST, AI_TrySkillSwapOnAllyPlus3
if_has_move AI_USER_PARTNER, MOVE_THUNDER, AI_TrySkillSwapOnAllyEnd if_has_move AI_USER_PARTNER, MOVE_THUNDER, AI_TrySkillSwapOnAllyPlus3
if_has_move AI_USER_PARTNER, MOVE_CROSS_CHOP, AI_TrySkillSwapOnAllyEnd if_has_move AI_USER_PARTNER, MOVE_CROSS_CHOP, AI_TrySkillSwapOnAllyPlus3
if_has_move AI_USER_PARTNER, MOVE_HYDRO_PUMP, AI_TrySkillSwapOnAllyEnd if_has_move AI_USER_PARTNER, MOVE_HYDRO_PUMP, AI_TrySkillSwapOnAllyPlus3
if_has_move AI_USER_PARTNER, MOVE_DYNAMIC_PUNCH, AI_TrySkillSwapOnAllyEnd if_has_move AI_USER_PARTNER, MOVE_DYNAMIC_PUNCH, AI_TrySkillSwapOnAllyPlus3
if_has_move AI_USER_PARTNER, MOVE_BLIZZARD, AI_TrySkillSwapOnAllyEnd if_has_move AI_USER_PARTNER, MOVE_BLIZZARD, AI_TrySkillSwapOnAllyPlus3
if_has_move AI_USER_PARTNER, MOVE_MEGAHORN, AI_TrySkillSwapOnAllyEnd if_has_move AI_USER_PARTNER, MOVE_MEGAHORN, AI_TrySkillSwapOnAllyPlus3
goto Score_Minus30_ goto Score_Minus30_
AI_TrySkillSwapOnAllyEnd: AI_TrySkillSwapOnAllyPlus3:
goto Score_Plus3 goto Score_Plus3
AI_TryStatusOnAlly: AI_TryStatusOnAlly:

View File

@ -399,19 +399,19 @@ BattleScript_EffectExplosion::
faintifabilitynotdamp faintifabilitynotdamp
setatkhptozero setatkhptozero
waitstate waitstate
jumpifbyte CMP_NO_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_MISSED, BattleScript_82D8B94 jumpifbyte CMP_NO_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_MISSED, BattleScript_ExplosionDoAnimStartLoop
call BattleScript_82D8BEA call BattleScript_PreserveMissedBitDoMoveAnim
goto BattleScript_82D8B96 goto BattleScript_ExplosionLoop
BattleScript_82D8B94:: BattleScript_ExplosionDoAnimStartLoop:
attackanimation attackanimation
waitanimation waitanimation
BattleScript_82D8B96:: BattleScript_ExplosionLoop:
movevaluescleanup movevaluescleanup
critcalc critcalc
damagecalc damagecalc
typecalc typecalc
adjustnormaldamage adjustnormaldamage
accuracycheck BattleScript_82D8BCF, ACC_CURR_MOVE accuracycheck BattleScript_ExplosionMissed, ACC_CURR_MOVE
effectivenesssound effectivenesssound
hitanimation BS_TARGET hitanimation BS_TARGET
waitstate waitstate
@ -424,20 +424,20 @@ BattleScript_82D8B96::
tryfaintmon BS_TARGET, FALSE, NULL tryfaintmon BS_TARGET, FALSE, NULL
setbyte sMOVEEND_STATE, 0x0 setbyte sMOVEEND_STATE, 0x0
moveend 0x2, 0x10 moveend 0x2, 0x10
jumpifnexttargetvalid BattleScript_82D8B96 jumpifnexttargetvalid BattleScript_ExplosionLoop
tryfaintmon BS_ATTACKER, FALSE, NULL tryfaintmon BS_ATTACKER, FALSE, NULL
end end
BattleScript_82D8BCF:: BattleScript_ExplosionMissed:
effectivenesssound effectivenesssound
resultmessage resultmessage
waitmessage 0x40 waitmessage 0x40
setbyte sMOVEEND_STATE, 0x0 setbyte sMOVEEND_STATE, 0x0
moveend 0x2, 0x10 moveend 0x2, 0x10
jumpifnexttargetvalid BattleScript_82D8B96 jumpifnexttargetvalid BattleScript_ExplosionLoop
tryfaintmon BS_ATTACKER, FALSE, NULL tryfaintmon BS_ATTACKER, FALSE, NULL
end end
BattleScript_82D8BEA:: BattleScript_PreserveMissedBitDoMoveAnim:
bicbyte gMoveResultFlags, MOVE_RESULT_MISSED bicbyte gMoveResultFlags, MOVE_RESULT_MISSED
attackanimation attackanimation
waitanimation waitanimation
@ -446,14 +446,14 @@ BattleScript_82D8BEA::
BattleScript_EffectDreamEater:: BattleScript_EffectDreamEater::
attackcanceler attackcanceler
jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_82D8C0E jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_DreamEaterNoEffect
jumpifstatus BS_TARGET, STATUS1_SLEEP, BattleScript_82D8C18 jumpifstatus BS_TARGET, STATUS1_SLEEP, BattleScript_DreamEaterWorked
BattleScript_82D8C0E:: BattleScript_DreamEaterNoEffect:
attackstring attackstring
ppreduce ppreduce
waitmessage 0x40 waitmessage 0x40
goto BattleScript_WasntAffected goto BattleScript_WasntAffected
BattleScript_82D8C18:: BattleScript_DreamEaterWorked:
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring attackstring
ppreduce ppreduce
@ -479,7 +479,7 @@ BattleScript_82D8C18::
jumpifmovehadnoeffect BattleScript_DreamEaterTryFaintEnd jumpifmovehadnoeffect BattleScript_DreamEaterTryFaintEnd
printstring STRINGID_PKMNDREAMEATEN printstring STRINGID_PKMNDREAMEATEN
waitmessage 0x40 waitmessage 0x40
BattleScript_DreamEaterTryFaintEnd:: BattleScript_DreamEaterTryFaintEnd:
tryfaintmon BS_TARGET, FALSE, NULL tryfaintmon BS_TARGET, FALSE, NULL
goto BattleScript_MoveEnd goto BattleScript_MoveEnd
@ -606,9 +606,9 @@ BattleScript_EffectRampage::
attackcanceler attackcanceler
accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE
attackstring attackstring
jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_82D8DAE jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_EffectRampage2
ppreduce ppreduce
BattleScript_82D8DAE:: BattleScript_EffectRampage2:
confuseifrepeatingattackends confuseifrepeatingattackends
goto BattleScript_HitFromCritCalc goto BattleScript_HitFromCritCalc
@ -2297,8 +2297,7 @@ BattleScript_EffectSmellingsalt::
setmoveeffect MOVE_EFFECT_REMOVE_PARALYSIS | MOVE_EFFECT_CERTAIN setmoveeffect MOVE_EFFECT_REMOVE_PARALYSIS | MOVE_EFFECT_CERTAIN
jumpifstatus BS_TARGET, STATUS1_PARALYSIS, BattleScript_SmellingsaltDoubleDmg jumpifstatus BS_TARGET, STATUS1_PARALYSIS, BattleScript_SmellingsaltDoubleDmg
goto BattleScript_EffectHit goto BattleScript_EffectHit
BattleScript_SmellingsaltDoubleDmg:
BattleScript_SmellingsaltDoubleDmg::
setbyte sDMG_MULTIPLIER, 0x2 setbyte sDMG_MULTIPLIER, 0x2
goto BattleScript_EffectHit goto BattleScript_EffectHit
@ -2593,7 +2592,7 @@ BattleScript_EffectSecretPower::
goto BattleScript_EffectHit goto BattleScript_EffectHit
BattleScript_EffectDoubleEdge:: BattleScript_EffectDoubleEdge::
setmoveeffect MOVE_EFFECT_RECOIL_33_PARALYSIS | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN setmoveeffect MOVE_EFFECT_RECOIL_33 | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN
goto BattleScript_EffectHit goto BattleScript_EffectHit
BattleScript_EffectTeeterDance:: BattleScript_EffectTeeterDance::
@ -3050,12 +3049,12 @@ BattleScript_82DAA83::
BattleScript_FrontierTrainerBattleWon:: BattleScript_FrontierTrainerBattleWon::
jumpifnotbattletype BATTLE_TYPE_TRAINER, BattleScript_PayDayMoneyAndPickUpItems jumpifnotbattletype BATTLE_TYPE_TRAINER, BattleScript_PayDayMoneyAndPickUpItems
jumpifbattletype BATTLE_TYPE_TWO_OPPONENTS, BattleScript_82DAAAB jumpifbattletype BATTLE_TYPE_TWO_OPPONENTS, BattleScript_FrontierTrainerBattleWon_TwoDefeated
printstring STRINGID_PLAYERDEFEATEDTRAINER1 printstring STRINGID_PLAYERDEFEATEDTRAINER1
goto BattleScript_82DAAAE goto BattleScript_FrontierTrainerBattleWon_LoseTexts
BattleScript_82DAAAB:: BattleScript_FrontierTrainerBattleWon_TwoDefeated:
printstring STRINGID_TWOENEMIESDEFEATED printstring STRINGID_TWOENEMIESDEFEATED
BattleScript_82DAAAE:: BattleScript_FrontierTrainerBattleWon_LoseTexts:
trainerslidein BS_ATTACKER trainerslidein BS_ATTACKER
waitstate waitstate
printstring STRINGID_TRAINER1LOSETEXT printstring STRINGID_TRAINER1LOSETEXT
@ -3065,10 +3064,10 @@ BattleScript_82DAAAE::
trainerslidein BS_FAINTED trainerslidein BS_FAINTED
waitstate waitstate
printstring STRINGID_TRAINER2LOSETEXT printstring STRINGID_TRAINER2LOSETEXT
BattleScript_82DAACB:: BattleScript_82DAACB:
jumpifnotbattletype BATTLE_TYPE_PYRAMID, BattleScript_82DAADA jumpifnotbattletype BATTLE_TYPE_PYRAMID, BattleScript_FrontierTrainerBattleWon_End
pickup pickup
BattleScript_82DAADA:: BattleScript_FrontierTrainerBattleWon_End:
end2 end2
BattleScript_SmokeBallEscape:: BattleScript_SmokeBallEscape::
@ -3172,7 +3171,7 @@ BattleScript_PursuitDmgOnSwitchOut::
jumpifbyte CMP_EQUAL, gBattleCommunication, 0x0, BattleScript_PursuitDmgOnSwitchOutRet jumpifbyte CMP_EQUAL, gBattleCommunication, 0x0, BattleScript_PursuitDmgOnSwitchOutRet
setbyte sGIVEEXP_STATE, 0x0 setbyte sGIVEEXP_STATE, 0x0
getexp BS_TARGET getexp BS_TARGET
BattleScript_PursuitDmgOnSwitchOutRet:: BattleScript_PursuitDmgOnSwitchOutRet:
return return
BattleScript_Pausex20:: BattleScript_Pausex20::
@ -3968,17 +3967,17 @@ BattleScript_MoveEffectConfusion::
waitmessage 0x40 waitmessage 0x40
return return
BattleScript_MoveEffectRecoil33:: BattleScript_MoveEffectRecoil::
jumpifmove MOVE_STRUGGLE, BattleScript_DoRecoil33 jumpifmove MOVE_STRUGGLE, BattleScript_DoRecoil
jumpifability BS_ATTACKER, ABILITY_ROCK_HEAD, BattleScript_Recoil33End jumpifability BS_ATTACKER, ABILITY_ROCK_HEAD, BattleScript_RecoilEnd
BattleScript_DoRecoil33:: BattleScript_DoRecoil::
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
healthbarupdate BS_ATTACKER healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER datahpupdate BS_ATTACKER
printstring STRINGID_PKMNHITWITHRECOIL printstring STRINGID_PKMNHITWITHRECOIL
waitmessage 0x40 waitmessage 0x40
tryfaintmon BS_ATTACKER, FALSE, NULL tryfaintmon BS_ATTACKER, FALSE, NULL
BattleScript_Recoil33End:: BattleScript_RecoilEnd::
return return
BattleScript_ItemSteal:: BattleScript_ItemSteal::
@ -4048,38 +4047,37 @@ BattleScript_82DB4AF::
waitmessage 0x40 waitmessage 0x40
return return
BattleScript_82DB4B8:: BattleScript_IntimidateActivatesEnd3::
call BattleScript_82DB4BE call BattleScript_PauseIntimidateActivates
end3 end3
BattleScript_82DB4BE:: BattleScript_PauseIntimidateActivates:
pause 0x20 pause 0x20
BattleScript_82DB4C1:: BattleScript_IntimidateActivates::
setbyte gBattlerTarget, 0x0 setbyte gBattlerTarget, 0x0
setstatchanger STAT_ATK, 1, TRUE setstatchanger STAT_ATK, 1, TRUE
BattleScript_82DB4CD:: BattleScript_IntimidateActivatesLoop:
trygetintimidatetarget BattleScript_82DB51B trygetintimidatetarget BattleScript_IntimidateActivatesReturn
jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_82DB510 jumpifstatus2 BS_TARGET, STATUS2_SUBSTITUTE, BattleScript_IntimidateActivatesLoopIncrement
jumpifability BS_TARGET, ABILITY_CLEAR_BODY, BattleScript_82DB51C jumpifability BS_TARGET, ABILITY_CLEAR_BODY, BattleScript_IntimidatePrevented
jumpifability BS_TARGET, ABILITY_HYPER_CUTTER, BattleScript_82DB51C jumpifability BS_TARGET, ABILITY_HYPER_CUTTER, BattleScript_IntimidatePrevented
jumpifability BS_TARGET, ABILITY_WHITE_SMOKE, BattleScript_82DB51C jumpifability BS_TARGET, ABILITY_WHITE_SMOKE, BattleScript_IntimidatePrevented
statbuffchange 0x21, BattleScript_82DB510 statbuffchange 0x21, BattleScript_IntimidateActivatesLoopIncrement
jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, 0x1, BattleScript_82DB510 jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, 0x1, BattleScript_IntimidateActivatesLoopIncrement
setgraphicalstatchangevalues setgraphicalstatchangevalues
playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 playanimation BS_TARGET, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1
printstring STRINGID_PKMNCUTSATTACKWITH printstring STRINGID_PKMNCUTSATTACKWITH
waitmessage 0x40 waitmessage 0x40
BattleScript_82DB510:: BattleScript_IntimidateActivatesLoopIncrement:
addbyte gBattlerTarget, 0x1 addbyte gBattlerTarget, 0x1
goto BattleScript_82DB4CD goto BattleScript_IntimidateActivatesLoop
BattleScript_82DB51B:: BattleScript_IntimidateActivatesReturn:
return return
BattleScript_IntimidatePrevented:
BattleScript_82DB51C::
pause 0x20 pause 0x20
printstring STRINGID_PREVENTEDFROMWORKING printstring STRINGID_PREVENTEDFROMWORKING
waitmessage 0x40 waitmessage 0x40
goto BattleScript_82DB510 goto BattleScript_IntimidateActivatesLoopIncrement
BattleScript_DroughtActivates:: BattleScript_DroughtActivates::
pause 0x20 pause 0x20
@ -4252,7 +4250,7 @@ BattleScript_AbilityCuredStatus::
updatestatusicon BS_SCRIPTING updatestatusicon BS_SCRIPTING
return return
BattleScript_82DB695:: BattleScript_IgnoresWhileAsleep::
printstring STRINGID_PKMNIGNORESASLEEP printstring STRINGID_PKMNIGNORESASLEEP
waitmessage 0x40 waitmessage 0x40
setbyte sMOVEEND_STATE, 0x0 setbyte sMOVEEND_STATE, 0x0
@ -4285,7 +4283,7 @@ BattleScript_IgnoresAndFallsAsleep::
moveend 0x2, 0x10 moveend 0x2, 0x10
end end
BattleScript_82DB6F0:: BattleScript_IgnoresAndHitsItself::
printstring STRINGID_PKMNWONTOBEY printstring STRINGID_PKMNWONTOBEY
waitmessage 0x40 waitmessage 0x40
goto BattleScript_DoSelfConfusionDmg goto BattleScript_DoSelfConfusionDmg
@ -4463,7 +4461,7 @@ BattleScript_ActionSelectionItemsCantBeUsed::
printselectionstring STRINGID_ITEMSCANTBEUSEDNOW printselectionstring STRINGID_ITEMSCANTBEUSEDNOW
endselectionscript endselectionscript
BattleScript_82DB87D:: BattleScript_FlushMessageBox::
printstring STRINGID_EMPTYSTRING3 printstring STRINGID_EMPTYSTRING3
return return

View File

@ -26,16 +26,9 @@ extern const u8 BattleScript_LocalBattleLost[];
extern const u8 BattleScript_LocalBattleLostPrintWhiteOut[]; extern const u8 BattleScript_LocalBattleLostPrintWhiteOut[];
extern const u8 BattleScript_LocalBattleLostEnd[]; extern const u8 BattleScript_LocalBattleLostEnd[];
extern const u8 BattleScript_CheckDomeDrew[]; extern const u8 BattleScript_CheckDomeDrew[];
extern const u8 BattleScript_82DAA0B[]; extern const u8 BattleScript_FlushMessageBox[];
extern const u8 BattleScript_82DAA31[];
extern const u8 BattleScript_LinkBattleWonOrLost[]; extern const u8 BattleScript_LinkBattleWonOrLost[];
extern const u8 BattleScript_82DAA5C[];
extern const u8 BattleScript_82DAA83[];
extern const u8 BattleScript_FrontierTrainerBattleWon[]; extern const u8 BattleScript_FrontierTrainerBattleWon[];
extern const u8 BattleScript_82DAAAB[];
extern const u8 BattleScript_82DAAAE[];
extern const u8 BattleScript_82DAACB[];
extern const u8 BattleScript_82DAADA[];
extern const u8 BattleScript_SmokeBallEscape[]; extern const u8 BattleScript_SmokeBallEscape[];
extern const u8 BattleScript_RanAwayUsingMonAbility[]; extern const u8 BattleScript_RanAwayUsingMonAbility[];
extern const u8 BattleScript_GotAwaySafely[]; extern const u8 BattleScript_GotAwaySafely[];
@ -45,11 +38,6 @@ extern const u8 BattleScript_PrintFailedToRunString[];
extern const u8 BattleScript_PrintCantEscapeFromBattle[]; extern const u8 BattleScript_PrintCantEscapeFromBattle[];
extern const u8 BattleScript_PrintFullBox[]; extern const u8 BattleScript_PrintFullBox[];
extern const u8 BattleScript_ActionSwitch[]; extern const u8 BattleScript_ActionSwitch[];
extern const u8 BattleScript_82DAB35[];
extern const u8 BattleScript_82DAB37[];
extern const u8 BattleScript_82DAB44[];
extern const u8 BattleScript_82DAB77[];
extern const u8 BattleScript_82DABB8[];
extern const u8 BattleScript_Pausex20[]; extern const u8 BattleScript_Pausex20[];
extern const u8 BattleScript_LevelUp[]; extern const u8 BattleScript_LevelUp[];
extern const u8 BattleScript_RainContinuesOrEnds[]; extern const u8 BattleScript_RainContinuesOrEnds[];
@ -62,13 +50,10 @@ extern const u8 BattleScript_SideStatusWoreOff[];
extern const u8 BattleScript_SafeguardProtected[]; extern const u8 BattleScript_SafeguardProtected[];
extern const u8 BattleScript_SafeguardEnds[]; extern const u8 BattleScript_SafeguardEnds[];
extern const u8 BattleScript_LeechSeedTurnDrain[]; extern const u8 BattleScript_LeechSeedTurnDrain[];
extern const u8 BattleScript_82DAD47[];
extern const u8 BattleScript_82DAD4D[];
extern const u8 BattleScript_BideStoringEnergy[]; extern const u8 BattleScript_BideStoringEnergy[];
extern const u8 BattleScript_BideAttack[]; extern const u8 BattleScript_BideAttack[];
extern const u8 BattleScript_BideNoEnergyToAttack[]; extern const u8 BattleScript_BideNoEnergyToAttack[];
extern const u8 BattleScript_SuccessForceOut[]; extern const u8 BattleScript_SuccessForceOut[];
extern const u8 BattleScript_82DADF1[];
extern const u8 BattleScript_MistProtected[]; extern const u8 BattleScript_MistProtected[];
extern const u8 BattleScript_RageIsBuilding[]; extern const u8 BattleScript_RageIsBuilding[];
extern const u8 BattleScript_MoveUsedIsDisabled[]; extern const u8 BattleScript_MoveUsedIsDisabled[];
@ -79,32 +64,16 @@ extern const u8 BattleScript_SelectingUnusableMoveInPalace[];
extern const u8 BattleScript_EncoredNoMore[]; extern const u8 BattleScript_EncoredNoMore[];
extern const u8 BattleScript_DestinyBondTakesLife[]; extern const u8 BattleScript_DestinyBondTakesLife[];
extern const u8 BattleScript_SpikesOnAttacker[]; extern const u8 BattleScript_SpikesOnAttacker[];
extern const u8 BattleScript_82DAE7A[];
extern const u8 BattleScript_SpikesOnTarget[]; extern const u8 BattleScript_SpikesOnTarget[];
extern const u8 BattleScript_82DAEB1[];
extern const u8 BattleScript_SpikesOnFaintedBattler[]; extern const u8 BattleScript_SpikesOnFaintedBattler[];
extern const u8 BattleScript_82DAEE8[];
extern const u8 BattleScript_82DAEFE[];
extern const u8 BattleScript_PerishSongTakesLife[]; extern const u8 BattleScript_PerishSongTakesLife[];
extern const u8 BattleScript_PerishSongCountGoesDown[]; extern const u8 BattleScript_PerishSongCountGoesDown[];
extern const u8 BattleScript_AllStatsUp[]; extern const u8 BattleScript_AllStatsUp[];
extern const u8 BattleScript_82DAF54[];
extern const u8 BattleScript_82DAF72[];
extern const u8 BattleScript_82DAF86[];
extern const u8 BattleScript_82DAF9A[];
extern const u8 BattleScript_82DAFAE[];
extern const u8 BattleScript_82DAFC2[];
extern const u8 BattleScript_RapidSpinAway[]; extern const u8 BattleScript_RapidSpinAway[];
extern const u8 BattleScript_WrapFree[]; extern const u8 BattleScript_WrapFree[];
extern const u8 BattleScript_LeechSeedFree[]; extern const u8 BattleScript_LeechSeedFree[];
extern const u8 BattleScript_SpikesFree[]; extern const u8 BattleScript_SpikesFree[];
extern const u8 BattleScript_MonTookFutureAttack[]; extern const u8 BattleScript_MonTookFutureAttack[];
extern const u8 BattleScript_82DB001[];
extern const u8 BattleScript_82DB008[];
extern const u8 BattleScript_82DB020[];
extern const u8 BattleScript_82DB027[];
extern const u8 BattleScript_82DB03F[];
extern const u8 BattleScript_82DB058[];
extern const u8 BattleScript_NoMovesLeft[]; extern const u8 BattleScript_NoMovesLeft[];
extern const u8 BattleScript_SelectingMoveWithNoPP[]; extern const u8 BattleScript_SelectingMoveWithNoPP[];
extern const u8 BattleScript_NoPPForMove[]; extern const u8 BattleScript_NoPPForMove[];
@ -117,8 +86,6 @@ extern const u8 BattleScript_SelectingNotAllowedMoveTauntInPalace[];
extern const u8 BattleScript_WishComesTrue[]; extern const u8 BattleScript_WishComesTrue[];
extern const u8 BattleScript_IngrainTurnHeal[]; extern const u8 BattleScript_IngrainTurnHeal[];
extern const u8 BattleScript_AtkDefDown[]; extern const u8 BattleScript_AtkDefDown[];
extern const u8 BattleScript_82DB144[];
extern const u8 BattleScript_82DB167[];
extern const u8 BattleScript_KnockedOff[]; extern const u8 BattleScript_KnockedOff[];
extern const u8 BattleScript_MoveUsedIsImprisoned[]; extern const u8 BattleScript_MoveUsedIsImprisoned[];
extern const u8 BattleScript_SelectingImprisionedMove[]; extern const u8 BattleScript_SelectingImprisionedMove[];
@ -129,15 +96,11 @@ extern const u8 BattleScript_SnatchedMove[];
extern const u8 BattleScript_EnduredMsg[]; extern const u8 BattleScript_EnduredMsg[];
extern const u8 BattleScript_OneHitKOMsg[]; extern const u8 BattleScript_OneHitKOMsg[];
extern const u8 BattleScript_SAtkDown2[]; extern const u8 BattleScript_SAtkDown2[];
extern const u8 BattleScript_82DB1FE[];
extern const u8 BattleScript_FocusPunchSetUp[]; extern const u8 BattleScript_FocusPunchSetUp[];
extern const u8 BattleScript_MoveUsedIsAsleep[]; extern const u8 BattleScript_MoveUsedIsAsleep[];
extern const u8 BattleScript_MoveUsedWokeUp[]; extern const u8 BattleScript_MoveUsedWokeUp[];
extern const u8 BattleScript_MonWokeUpInUproar[]; extern const u8 BattleScript_MonWokeUpInUproar[];
extern const u8 BattleScript_PoisonTurnDmg[]; extern const u8 BattleScript_PoisonTurnDmg[];
extern const u8 BattleScript_82DB243[];
extern const u8 BattleScript_82DB245[];
extern const u8 BattleScript_82DB25E[];
extern const u8 BattleScript_BurnTurnDmg[]; extern const u8 BattleScript_BurnTurnDmg[];
extern const u8 BattleScript_MoveUsedIsFrozen[]; extern const u8 BattleScript_MoveUsedIsFrozen[];
extern const u8 BattleScript_MoveUsedUnfroze[]; extern const u8 BattleScript_MoveUsedUnfroze[];
@ -147,8 +110,6 @@ extern const u8 BattleScript_MoveUsedFlinched[];
extern const u8 BattleScript_PrintUproarOverTurns[]; extern const u8 BattleScript_PrintUproarOverTurns[];
extern const u8 BattleScript_ThrashConfuses[]; extern const u8 BattleScript_ThrashConfuses[];
extern const u8 BattleScript_MoveUsedIsConfused[]; extern const u8 BattleScript_MoveUsedIsConfused[];
extern const u8 BattleScript_82DB2D4[];
extern const u8 BattleScript_82DB2FF[];
extern const u8 BattleScript_MoveUsedIsConfusedNoMore[]; extern const u8 BattleScript_MoveUsedIsConfusedNoMore[];
extern const u8 BattleScript_PrintPayDayMoneyString[]; extern const u8 BattleScript_PrintPayDayMoneyString[];
extern const u8 BattleScript_WrapTurnDmg[]; extern const u8 BattleScript_WrapTurnDmg[];
@ -159,7 +120,6 @@ extern const u8 BattleScript_NightmareTurnDmg[];
extern const u8 BattleScript_CurseTurnDmg[]; extern const u8 BattleScript_CurseTurnDmg[];
extern const u8 BattleScript_TargetPRLZHeal[]; extern const u8 BattleScript_TargetPRLZHeal[];
extern const u8 BattleScript_MoveEffectSleep[]; extern const u8 BattleScript_MoveEffectSleep[];
extern const u8 BattleScript_82DB374[];
extern const u8 BattleScript_YawnMakesAsleep[]; extern const u8 BattleScript_YawnMakesAsleep[];
extern const u8 BattleScript_MoveEffectPoison[]; extern const u8 BattleScript_MoveEffectPoison[];
extern const u8 BattleScript_MoveEffectBurn[]; extern const u8 BattleScript_MoveEffectBurn[];
@ -170,7 +130,7 @@ extern const u8 BattleScript_MoveEffectToxic[];
extern const u8 BattleScript_MoveEffectPayDay[]; extern const u8 BattleScript_MoveEffectPayDay[];
extern const u8 BattleScript_MoveEffectWrap[]; extern const u8 BattleScript_MoveEffectWrap[];
extern const u8 BattleScript_MoveEffectConfusion[]; extern const u8 BattleScript_MoveEffectConfusion[];
extern const u8 BattleScript_MoveEffectRecoil33[]; extern const u8 BattleScript_MoveEffectRecoil[];
extern const u8 BattleScript_DoRecoil33[]; extern const u8 BattleScript_DoRecoil33[];
extern const u8 BattleScript_Recoil33End[]; extern const u8 BattleScript_Recoil33End[];
extern const u8 BattleScript_ItemSteal[]; extern const u8 BattleScript_ItemSteal[];
@ -183,14 +143,8 @@ extern const u8 BattleScript_ShedSkinActivates[];
extern const u8 BattleScript_WeatherFormChanges[]; extern const u8 BattleScript_WeatherFormChanges[];
extern const u8 BattleScript_WeatherFormChangesLoop[]; extern const u8 BattleScript_WeatherFormChangesLoop[];
extern const u8 BattleScript_CastformChange[]; extern const u8 BattleScript_CastformChange[];
extern const u8 BattleScript_82DB4AF[]; extern const u8 BattleScript_IntimidateActivatesEnd3[];
extern const u8 BattleScript_82DB4B8[]; extern const u8 BattleScript_IntimidateActivates[];
extern const u8 BattleScript_82DB4BE[];
extern const u8 BattleScript_82DB4C1[];
extern const u8 BattleScript_82DB4CD[];
extern const u8 BattleScript_82DB510[];
extern const u8 BattleScript_82DB51B[];
extern const u8 BattleScript_82DB51C[];
extern const u8 BattleScript_DroughtActivates[]; extern const u8 BattleScript_DroughtActivates[];
extern const u8 BattleScript_TookAttack[]; extern const u8 BattleScript_TookAttack[];
extern const u8 BattleScript_SturdyPreventsOHKO[]; extern const u8 BattleScript_SturdyPreventsOHKO[];
@ -218,12 +172,11 @@ extern const u8 BattleScript_ApplySecondaryEffect[];
extern const u8 BattleScript_SynchronizeActivates[]; extern const u8 BattleScript_SynchronizeActivates[];
extern const u8 BattleScript_NoItemSteal[]; extern const u8 BattleScript_NoItemSteal[];
extern const u8 BattleScript_AbilityCuredStatus[]; extern const u8 BattleScript_AbilityCuredStatus[];
extern const u8 BattleScript_82DB695[]; extern const u8 BattleScript_IgnoresWhileAsleep[];
extern const u8 BattleScript_IgnoresAndUsesRandomMove[]; extern const u8 BattleScript_IgnoresAndUsesRandomMove[];
extern const u8 BattleScript_MoveUsedLoafingAround[]; extern const u8 BattleScript_MoveUsedLoafingAround[];
extern const u8 BattleScript_82DB6C7[];
extern const u8 BattleScript_IgnoresAndFallsAsleep[]; extern const u8 BattleScript_IgnoresAndFallsAsleep[];
extern const u8 BattleScript_82DB6F0[]; extern const u8 BattleScript_IgnoresAndHitsItself[];
extern const u8 BattleScript_SubstituteFade[]; extern const u8 BattleScript_SubstituteFade[];
extern const u8 BattleScript_BerryCurePrlzEnd2[]; extern const u8 BattleScript_BerryCurePrlzEnd2[];
extern const u8 BattleScript_BerryCureParRet[]; extern const u8 BattleScript_BerryCureParRet[];
@ -249,18 +202,11 @@ extern const u8 BattleScript_SelectingNotAllowedMoveChoiceItem[];
extern const u8 BattleScript_HangedOnMsg[]; extern const u8 BattleScript_HangedOnMsg[];
extern const u8 BattleScript_BerryConfuseHealEnd2[]; extern const u8 BattleScript_BerryConfuseHealEnd2[];
extern const u8 BattleScript_BerryStatRaiseEnd2[]; extern const u8 BattleScript_BerryStatRaiseEnd2[];
extern const u8 BattleScript_82DB85B[];
extern const u8 BattleScript_BerryFocusEnergyEnd2[]; extern const u8 BattleScript_BerryFocusEnergyEnd2[];
extern const u8 BattleScript_ActionSelectionItemsCantBeUsed[]; extern const u8 BattleScript_ActionSelectionItemsCantBeUsed[];
extern const u8 BattleScript_82DB87D[];
extern const u8 BattleScript_82DB881[];
extern const u8 BattleScript_82DB887[];
extern const u8 BattleScript_82DB89D[];
extern const u8 BattleScript_ArenaTurnBeginning[]; extern const u8 BattleScript_ArenaTurnBeginning[];
extern const u8 BattleScript_82DB8E0[]; extern const u8 BattleScript_82DB881[];
extern const u8 BattleScript_82DB8F3[]; extern const u8 BattleScript_82DB8F3[];
extern const u8 BattleScript_82DB973[];
extern const u8 BattleScript_82DB992[];
extern const u8 BattleScript_AskIfWantsToForfeitMatch[]; extern const u8 BattleScript_AskIfWantsToForfeitMatch[];
extern const u8 BattleScript_PrintPlayerForfeited[]; extern const u8 BattleScript_PrintPlayerForfeited[];
extern const u8 BattleScript_PrintPlayerForfeitedLinkBattle[]; extern const u8 BattleScript_PrintPlayerForfeitedLinkBattle[];
@ -268,23 +214,12 @@ extern const u8 BattleScript_BallThrow[];
extern const u8 BattleScript_BallThrowByWally[]; extern const u8 BattleScript_BallThrowByWally[];
extern const u8 BattleScript_SafariBallThrow[]; extern const u8 BattleScript_SafariBallThrow[];
extern const u8 BattleScript_SuccessBallThrow[]; extern const u8 BattleScript_SuccessBallThrow[];
extern const u8 BattleScript_82DBD92[];
extern const u8 BattleScript_82DBDA5[];
extern const u8 BattleScript_82DBDC2[];
extern const u8 BattleScript_82DBDC3[];
extern const u8 BattleScript_WallyBallThrow[]; extern const u8 BattleScript_WallyBallThrow[];
extern const u8 BattleScript_ShakeBallThrow[]; extern const u8 BattleScript_ShakeBallThrow[];
extern const u8 BattleScript_82DBE01[];
extern const u8 BattleScript_TrainerBallBlock[]; extern const u8 BattleScript_TrainerBallBlock[];
extern const u8 BattleScript_82DBE12[];
extern const u8 BattleScript_82DBE1C[];
extern const u8 BattleScript_82DBE4B[];
extern const u8 BattleScript_82DBE6F[];
extern const u8 BattleScript_82DBE91[];
extern const u8 BattleScript_RunByUsingItem[]; extern const u8 BattleScript_RunByUsingItem[];
extern const u8 BattleScript_ActionWatchesCarefully[]; extern const u8 BattleScript_ActionWatchesCarefully[];
extern const u8 BattleScript_ActionGetNear[]; extern const u8 BattleScript_ActionGetNear[];
extern const u8 BattleScript_ActionThrowPokeblock[]; extern const u8 BattleScript_ActionThrowPokeblock[];
extern const u8 BattleScript_82DBEE3[];
#endif // GUARD_BATTLE_SCRIPTS_H #endif // GUARD_BATTLE_SCRIPTS_H

View File

@ -12,7 +12,7 @@
#define ABILITYEFFECT_ENDTURN 0x1 #define ABILITYEFFECT_ENDTURN 0x1
#define ABILITYEFFECT_MOVES_BLOCK 0x2 #define ABILITYEFFECT_MOVES_BLOCK 0x2
#define ABILITYEFFECT_ABSORBING 0x3 #define ABILITYEFFECT_ABSORBING 0x3
#define ABILITYEFFECT_CONTACT 0x4 #define ABILITYEFFECT_MOVE_END 0x4
#define ABILITYEFFECT_IMMUNITY 0x5 #define ABILITYEFFECT_IMMUNITY 0x5
#define ABILITYEFFECT_FORECAST 0x6 #define ABILITYEFFECT_FORECAST 0x6
#define ABILITYEFFECT_SYNCHRONIZE 0x7 #define ABILITYEFFECT_SYNCHRONIZE 0x7
@ -35,6 +35,8 @@
#define ABILITY_ON_FIELD2(abilityId)(AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, abilityId, 0, 0)) #define ABILITY_ON_FIELD2(abilityId)(AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, abilityId, 0, 0))
#define ITEMEFFECT_ON_SWITCH_IN 0x0 #define ITEMEFFECT_ON_SWITCH_IN 0x0
#define ITEMEFFECT_MOVE_END 0x3
#define ITEMEFFECT_KINGSROCK_SHELLBELL 0x4
#define WEATHER_HAS_EFFECT ((!ABILITY_ON_FIELD(ABILITY_CLOUD_NINE) && !ABILITY_ON_FIELD(ABILITY_AIR_LOCK))) #define WEATHER_HAS_EFFECT ((!ABILITY_ON_FIELD(ABILITY_CLOUD_NINE) && !ABILITY_ON_FIELD(ABILITY_AIR_LOCK)))
#define WEATHER_HAS_EFFECT2 ((!ABILITY_ON_FIELD2(ABILITY_CLOUD_NINE) && !ABILITY_ON_FIELD2(ABILITY_AIR_LOCK))) #define WEATHER_HAS_EFFECT2 ((!ABILITY_ON_FIELD2(ABILITY_CLOUD_NINE) && !ABILITY_ON_FIELD2(ABILITY_AIR_LOCK)))

View File

@ -252,7 +252,7 @@
#define MOVE_EFFECT_RAPIDSPIN 0x23 #define MOVE_EFFECT_RAPIDSPIN 0x23
#define MOVE_EFFECT_REMOVE_PARALYSIS 0x24 #define MOVE_EFFECT_REMOVE_PARALYSIS 0x24
#define MOVE_EFFECT_ATK_DEF_DOWN 0x25 #define MOVE_EFFECT_ATK_DEF_DOWN 0x25
#define MOVE_EFFECT_RECOIL_33_PARALYSIS 0x26 #define MOVE_EFFECT_RECOIL_33 0x26
#define MOVE_EFFECT_ATK_PLUS_2 0x27 #define MOVE_EFFECT_ATK_PLUS_2 0x27
#define MOVE_EFFECT_DEF_PLUS_2 0x28 #define MOVE_EFFECT_DEF_PLUS_2 0x28
#define MOVE_EFFECT_SPD_PLUS_2 0x29 #define MOVE_EFFECT_SPD_PLUS_2 0x29

View File

@ -3888,7 +3888,7 @@ static void TryDoEventsBeforeFirstTurn(void)
// Check all switch in items having effect from the fastest mon to slowest. // Check all switch in items having effect from the fastest mon to slowest.
while (gBattleStruct->switchInItemsCounter < gBattlersCount) while (gBattleStruct->switchInItemsCounter < gBattlersCount)
{ {
if (ItemBattleEffects(ITEMEFFECT_ON_SWITCH_IN, gBattlerByTurnOrder[gBattleStruct->switchInItemsCounter], 0) != 0) if (ItemBattleEffects(ITEMEFFECT_ON_SWITCH_IN, gBattlerByTurnOrder[gBattleStruct->switchInItemsCounter], FALSE))
effect++; effect++;
gBattleStruct->switchInItemsCounter++; gBattleStruct->switchInItemsCounter++;

View File

@ -700,7 +700,7 @@ static const u8* const sMoveEffectBS_Ptrs[] =
BattleScript_MoveEffectPayDay, // MOVE_EFFECT_PAYDAY BattleScript_MoveEffectPayDay, // MOVE_EFFECT_PAYDAY
BattleScript_MoveEffectSleep, // MOVE_EFFECT_CHARGING BattleScript_MoveEffectSleep, // MOVE_EFFECT_CHARGING
BattleScript_MoveEffectWrap, // MOVE_EFFECT_WRAP BattleScript_MoveEffectWrap, // MOVE_EFFECT_WRAP
BattleScript_MoveEffectRecoil33, // MOVE_EFFECT_RECOIL_25 BattleScript_MoveEffectRecoil, // MOVE_EFFECT_RECOIL_25
BattleScript_MoveEffectSleep, // MOVE_EFFECT_ATK_PLUS_1 BattleScript_MoveEffectSleep, // MOVE_EFFECT_ATK_PLUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_DEF_PLUS_1 BattleScript_MoveEffectSleep, // MOVE_EFFECT_DEF_PLUS_1
BattleScript_MoveEffectSleep, // MOVE_EFFECT_SPD_PLUS_1 BattleScript_MoveEffectSleep, // MOVE_EFFECT_SPD_PLUS_1
@ -724,7 +724,7 @@ static const u8* const sMoveEffectBS_Ptrs[] =
BattleScript_MoveEffectSleep, // MOVE_EFFECT_RAPIDSPIN BattleScript_MoveEffectSleep, // MOVE_EFFECT_RAPIDSPIN
BattleScript_MoveEffectSleep, // MOVE_EFFECT_REMOVE_PARALYSIS BattleScript_MoveEffectSleep, // MOVE_EFFECT_REMOVE_PARALYSIS
BattleScript_MoveEffectSleep, // MOVE_EFFECT_ATK_DEF_DOWN BattleScript_MoveEffectSleep, // MOVE_EFFECT_ATK_DEF_DOWN
BattleScript_MoveEffectRecoil33, // MOVE_EFFECT_RECOIL_33_PARALYSIS BattleScript_MoveEffectRecoil, // MOVE_EFFECT_RECOIL_33
}; };
static const struct WindowTemplate sUnusedWinTemplate = {0, 1, 3, 7, 0xF, 0x1F, 0x3F}; static const struct WindowTemplate sUnusedWinTemplate = {0, 1, 3, 7, 0xF, 0x1F, 0x3F};
@ -2843,7 +2843,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
BattleScriptPush(gBattlescriptCurrInstr + 1); BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_AtkDefDown; gBattlescriptCurrInstr = BattleScript_AtkDefDown;
break; break;
case MOVE_EFFECT_RECOIL_33_PARALYSIS: // Volt Tackle case MOVE_EFFECT_RECOIL_33: // Double Edge
gBattleMoveDamage = gHpDealt / 3; gBattleMoveDamage = gHpDealt / 3;
if (gBattleMoveDamage == 0) if (gBattleMoveDamage == 0)
gBattleMoveDamage = 1; gBattleMoveDamage = 1;
@ -4497,20 +4497,38 @@ static void atk48_playstatchangeanimation(void)
} }
} }
#define ATK49_LAST_CASE 17 enum
{
ATK49_RAGE,
ATK49_DEFROST,
ATK49_SYNCHRONIZE_TARGET,
ATK49_MOVE_END_ABILITIES,
ATK49_STATUS_IMMUNITY_ABILITIES,
ATK49_SYNCHRONIZE_ATTACKER,
ATK49_CHOICE_MOVE,
ATK49_CHANGED_ITEMS,
ATK49_ATTACKER_INVISIBLE,
ATK49_ATTACKER_VISIBLE,
ATK49_TARGET_VISIBLE,
ATK49_ITEM_EFFECTS_ALL,
ATK49_KINGSROCK_SHELLBELL,
ATK49_SUBSTITUTE,
ATK49_UPDATE_LAST_MOVES,
ATK49_MIRROR_MOVE,
ATK49_NEXT_TARGET,
ATK49_COUNT,
};
static void atk49_moveend(void) static void atk49_moveend(void)
{ {
s32 i; s32 i;
bool32 effect; bool32 effect = FALSE;
u8 moveType; u8 moveType = 0;
u8 holdEffectAtk; u8 holdEffectAtk = 0;
u16 *choicedMoveAtk; u16 *choicedMoveAtk = NULL;
u8 arg1, arg2; u8 arg1, arg2;
u16 originallyUsedMove; u16 originallyUsedMove;
effect = FALSE;
if (gChosenMove == 0xFFFF) if (gChosenMove == 0xFFFF)
originallyUsedMove = 0; originallyUsedMove = 0;
else else
@ -4531,7 +4549,7 @@ static void atk49_moveend(void)
{ {
switch (gBattleScripting.atk49_state) switch (gBattleScripting.atk49_state)
{ {
case 0: // rage check case ATK49_RAGE: // rage check
if (gBattleMons[gBattlerTarget].status2 & STATUS2_RAGE if (gBattleMons[gBattlerTarget].status2 & STATUS2_RAGE
&& gBattleMons[gBattlerTarget].hp != 0 && gBattlerAttacker != gBattlerTarget && gBattleMons[gBattlerTarget].hp != 0 && gBattlerAttacker != gBattlerTarget
&& GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gBattlerTarget) && GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gBattlerTarget)
@ -4545,7 +4563,7 @@ static void atk49_moveend(void)
} }
gBattleScripting.atk49_state++; gBattleScripting.atk49_state++;
break; break;
case 1: // defrosting check case ATK49_DEFROST: // defrosting check
if (gBattleMons[gBattlerTarget].status1 & STATUS1_FREEZE if (gBattleMons[gBattlerTarget].status1 & STATUS1_FREEZE
&& gBattleMons[gBattlerTarget].hp != 0 && gBattlerAttacker != gBattlerTarget && gBattleMons[gBattlerTarget].hp != 0 && gBattlerAttacker != gBattlerTarget
&& gSpecialStatuses[gBattlerTarget].specialDmg && gSpecialStatuses[gBattlerTarget].specialDmg
@ -4561,28 +4579,28 @@ static void atk49_moveend(void)
} }
gBattleScripting.atk49_state++; gBattleScripting.atk49_state++;
break; break;
case 2: // target synchronize case ATK49_SYNCHRONIZE_TARGET: // target synchronize
if (AbilityBattleEffects(ABILITYEFFECT_SYNCHRONIZE, gBattlerTarget, 0, 0, 0)) if (AbilityBattleEffects(ABILITYEFFECT_SYNCHRONIZE, gBattlerTarget, 0, 0, 0))
effect = TRUE; effect = TRUE;
gBattleScripting.atk49_state++; gBattleScripting.atk49_state++;
break; break;
case 3: // contact abilities case ATK49_MOVE_END_ABILITIES: // Such as abilities activating on contact(Poison Spore, Rough Skin, etc.).
if (AbilityBattleEffects(ABILITYEFFECT_CONTACT, gBattlerTarget, 0, 0, 0)) if (AbilityBattleEffects(ABILITYEFFECT_MOVE_END, gBattlerTarget, 0, 0, 0))
effect = TRUE; effect = TRUE;
gBattleScripting.atk49_state++; gBattleScripting.atk49_state++;
break; break;
case 4: // status immunities case ATK49_STATUS_IMMUNITY_ABILITIES: // status immunities
if (AbilityBattleEffects(ABILITYEFFECT_IMMUNITY, 0, 0, 0, 0)) if (AbilityBattleEffects(ABILITYEFFECT_IMMUNITY, 0, 0, 0, 0))
effect = TRUE; // it loops through all battlers, so we increment after its done with all battlers effect = TRUE; // it loops through all battlers, so we increment after its done with all battlers
else else
gBattleScripting.atk49_state++; gBattleScripting.atk49_state++;
break; break;
case 5: // attacker synchronize case ATK49_SYNCHRONIZE_ATTACKER: // attacker synchronize
if (AbilityBattleEffects(ABILITYEFFECT_ATK_SYNCHRONIZE, gBattlerAttacker, 0, 0, 0)) if (AbilityBattleEffects(ABILITYEFFECT_ATK_SYNCHRONIZE, gBattlerAttacker, 0, 0, 0))
effect = TRUE; effect = TRUE;
gBattleScripting.atk49_state++; gBattleScripting.atk49_state++;
break; break;
case 6: // update choice band move case ATK49_CHOICE_MOVE: // update choice band move
if (!(gHitMarker & HITMARKER_OBEYS) || holdEffectAtk != HOLD_EFFECT_CHOICE_BAND if (!(gHitMarker & HITMARKER_OBEYS) || holdEffectAtk != HOLD_EFFECT_CHOICE_BAND
|| gChosenMove == MOVE_STRUGGLE || (*choicedMoveAtk != 0 && *choicedMoveAtk != 0xFFFF)) || gChosenMove == MOVE_STRUGGLE || (*choicedMoveAtk != 0 && *choicedMoveAtk != 0xFFFF))
goto LOOP; goto LOOP;
@ -4605,7 +4623,7 @@ static void atk49_moveend(void)
gBattleScripting.atk49_state++; gBattleScripting.atk49_state++;
} }
break; break;
case 7: // changed held items case ATK49_CHANGED_ITEMS: // changed held items
for (i = 0; i < gBattlersCount; i++) for (i = 0; i < gBattlersCount; i++)
{ {
u16* changedItem = &gBattleStruct->changedItems[i]; u16* changedItem = &gBattleStruct->changedItems[i];
@ -4617,18 +4635,18 @@ static void atk49_moveend(void)
} }
gBattleScripting.atk49_state++; gBattleScripting.atk49_state++;
break; break;
case 11: // item effects for all battlers case ATK49_ITEM_EFFECTS_ALL: // item effects for all battlers
if (ItemBattleEffects(3, 0, FALSE)) if (ItemBattleEffects(ITEMEFFECT_MOVE_END, 0, FALSE))
effect = TRUE; effect = TRUE;
else else
gBattleScripting.atk49_state++; gBattleScripting.atk49_state++;
break; break;
case 12: // king's rock and shell bell case ATK49_KINGSROCK_SHELLBELL: // king's rock and shell bell
if (ItemBattleEffects(4, 0, FALSE)) if (ItemBattleEffects(ITEMEFFECT_KINGSROCK_SHELLBELL, 0, FALSE))
effect = TRUE; effect = TRUE;
gBattleScripting.atk49_state++; gBattleScripting.atk49_state++;
break; break;
case 8: // make attacker sprite invisible case ATK49_ATTACKER_INVISIBLE: // make attacker sprite invisible
if (gStatuses3[gBattlerAttacker] & (STATUS3_SEMI_INVULNERABLE) if (gStatuses3[gBattlerAttacker] & (STATUS3_SEMI_INVULNERABLE)
&& gHitMarker & HITMARKER_NO_ANIMATIONS) && gHitMarker & HITMARKER_NO_ANIMATIONS)
{ {
@ -4640,7 +4658,7 @@ static void atk49_moveend(void)
} }
gBattleScripting.atk49_state++; gBattleScripting.atk49_state++;
break; break;
case 9: // make attacker sprite visible case ATK49_ATTACKER_VISIBLE: // make attacker sprite visible
if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT
|| !(gStatuses3[gBattlerAttacker] & (STATUS3_SEMI_INVULNERABLE)) || !(gStatuses3[gBattlerAttacker] & (STATUS3_SEMI_INVULNERABLE))
|| WasUnableToUseMove(gBattlerAttacker)) || WasUnableToUseMove(gBattlerAttacker))
@ -4655,7 +4673,7 @@ static void atk49_moveend(void)
} }
gBattleScripting.atk49_state++; gBattleScripting.atk49_state++;
break; break;
case 10: // make target sprite visible case ATK49_TARGET_VISIBLE: // make target sprite visible
if (!gSpecialStatuses[gBattlerTarget].restoredBattlerSprite && gBattlerTarget < gBattlersCount if (!gSpecialStatuses[gBattlerTarget].restoredBattlerSprite && gBattlerTarget < gBattlersCount
&& !(gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE)) && !(gStatuses3[gBattlerTarget] & STATUS3_SEMI_INVULNERABLE))
{ {
@ -4668,7 +4686,7 @@ static void atk49_moveend(void)
} }
gBattleScripting.atk49_state++; gBattleScripting.atk49_state++;
break; break;
case 13: // update substitute case ATK49_SUBSTITUTE: // update substitute
for (i = 0; i < gBattlersCount; i++) for (i = 0; i < gBattlersCount; i++)
{ {
if (gDisableStructs[i].substituteHP == 0) if (gDisableStructs[i].substituteHP == 0)
@ -4676,7 +4694,7 @@ static void atk49_moveend(void)
} }
gBattleScripting.atk49_state++; gBattleScripting.atk49_state++;
break; break;
case 14: // This case looks interesting, although I am not certain what it does. Probably fine tunes edge cases. case ATK49_UPDATE_LAST_MOVES:
if (gHitMarker & HITMARKER_SWAP_ATTACKER_TARGET) if (gHitMarker & HITMARKER_SWAP_ATTACKER_TARGET)
{ {
gActiveBattler = gBattlerAttacker; gActiveBattler = gBattlerAttacker;
@ -4725,7 +4743,7 @@ static void atk49_moveend(void)
} }
gBattleScripting.atk49_state++; gBattleScripting.atk49_state++;
break; break;
case 15: // mirror move case ATK49_MIRROR_MOVE: // mirror move
if (!(gAbsentBattlerFlags & gBitTable[gBattlerAttacker]) && !(gBattleStruct->field_91 & gBitTable[gBattlerAttacker]) if (!(gAbsentBattlerFlags & gBitTable[gBattlerAttacker]) && !(gBattleStruct->field_91 & gBitTable[gBattlerAttacker])
&& gBattleMoves[originallyUsedMove].flags & FLAG_MIRROR_MOVE_AFFECTED && gHitMarker & HITMARKER_OBEYS && gBattleMoves[originallyUsedMove].flags & FLAG_MIRROR_MOVE_AFFECTED && gHitMarker & HITMARKER_OBEYS
&& gBattlerAttacker != gBattlerTarget && !(gHitMarker & HITMARKER_FAINTED(gBattlerTarget)) && gBattlerAttacker != gBattlerTarget && !(gHitMarker & HITMARKER_FAINTED(gBattlerTarget))
@ -4746,7 +4764,7 @@ static void atk49_moveend(void)
} }
gBattleScripting.atk49_state++; gBattleScripting.atk49_state++;
break; break;
case 16: // case ATK49_NEXT_TARGET: // For moves hitting two opposing Pokemon.
if (!(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) && gBattleTypeFlags & BATTLE_TYPE_DOUBLE if (!(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) && gBattleTypeFlags & BATTLE_TYPE_DOUBLE
&& !gProtectStructs[gBattlerAttacker].chargingTurn && gBattleMoves[gCurrentMove].target == MOVE_TARGET_BOTH && !gProtectStructs[gBattlerAttacker].chargingTurn && gBattleMoves[gCurrentMove].target == MOVE_TARGET_BOTH
&& !(gHitMarker & HITMARKER_NO_ATTACKSTRING)) && !(gHitMarker & HITMARKER_NO_ATTACKSTRING))
@ -4759,7 +4777,7 @@ static void atk49_moveend(void)
gBattleScripting.atk49_state = 0; gBattleScripting.atk49_state = 0;
MoveValuesCleanUp(); MoveValuesCleanUp();
BattleScriptPush(gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]); BattleScriptPush(gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]);
gBattlescriptCurrInstr = BattleScript_82DB87D; gBattlescriptCurrInstr = BattleScript_FlushMessageBox;
return; return;
} }
else else
@ -4769,18 +4787,18 @@ static void atk49_moveend(void)
} }
gBattleScripting.atk49_state++; gBattleScripting.atk49_state++;
break; break;
case ATK49_LAST_CASE: case ATK49_COUNT:
break; break;
} }
if (arg1 == 1 && effect == FALSE) if (arg1 == 1 && effect == FALSE)
gBattleScripting.atk49_state = ATK49_LAST_CASE; gBattleScripting.atk49_state = ATK49_COUNT;
if (arg1 == 2 && arg2 == gBattleScripting.atk49_state) if (arg1 == 2 && arg2 == gBattleScripting.atk49_state)
gBattleScripting.atk49_state = ATK49_LAST_CASE; gBattleScripting.atk49_state = ATK49_COUNT;
} while (gBattleScripting.atk49_state != ATK49_LAST_CASE && effect == FALSE); } while (gBattleScripting.atk49_state != ATK49_COUNT && effect == FALSE);
if (gBattleScripting.atk49_state == ATK49_LAST_CASE && effect == FALSE) if (gBattleScripting.atk49_state == ATK49_COUNT && effect == FALSE)
gBattlescriptCurrInstr += 3; gBattlescriptCurrInstr += 3;
} }
@ -5550,8 +5568,8 @@ static void atk52_switchineffects(void)
gDisableStructs[gActiveBattler].truantUnknownBit = 0; gDisableStructs[gActiveBattler].truantUnknownBit = 0;
if (AbilityBattleEffects(ABILITYEFFECT_ON_SWITCHIN, gActiveBattler, 0, 0, 0) == 0 && if (!AbilityBattleEffects(ABILITYEFFECT_ON_SWITCHIN, gActiveBattler, 0, 0, 0)
ItemBattleEffects(0, gActiveBattler, 0) == 0) && !ItemBattleEffects(ITEMEFFECT_ON_SWITCH_IN, gActiveBattler, FALSE))
{ {
gSideStatuses[GetBattlerSide(gActiveBattler)] &= ~(SIDE_STATUS_SPIKES_DAMAGED); gSideStatuses[GetBattlerSide(gActiveBattler)] &= ~(SIDE_STATUS_SPIKES_DAMAGED);

View File

@ -821,12 +821,12 @@ u8 DoBattlerEndTurnEffects(void)
gBattleStruct->turnEffectsTracker++; gBattleStruct->turnEffectsTracker++;
break; break;
case ENDTURN_ITEMS1: // item effects case ENDTURN_ITEMS1: // item effects
if (ItemBattleEffects(1, gActiveBattler, 0)) if (ItemBattleEffects(1, gActiveBattler, FALSE))
effect++; effect++;
gBattleStruct->turnEffectsTracker++; gBattleStruct->turnEffectsTracker++;
break; break;
case ENDTURN_ITEMS2: // item effects again case ENDTURN_ITEMS2: // item effects again
if (ItemBattleEffects(1, gActiveBattler, 1)) if (ItemBattleEffects(1, gActiveBattler, TRUE))
effect++; effect++;
gBattleStruct->turnEffectsTracker++; gBattleStruct->turnEffectsTracker++;
break; break;
@ -1280,7 +1280,7 @@ bool8 HandleFaintedMonActions(void)
gBattleStruct->faintedActionsState = 4; gBattleStruct->faintedActionsState = 4;
break; break;
case 6: case 6:
if (AbilityBattleEffects(ABILITYEFFECT_INTIMIDATE1, 0, 0, 0, 0) || AbilityBattleEffects(ABILITYEFFECT_TRACE, 0, 0, 0, 0) || ItemBattleEffects(1, 0, 1) || AbilityBattleEffects(ABILITYEFFECT_FORECAST, 0, 0, 0, 0)) if (AbilityBattleEffects(ABILITYEFFECT_INTIMIDATE1, 0, 0, 0, 0) || AbilityBattleEffects(ABILITYEFFECT_TRACE, 0, 0, 0, 0) || ItemBattleEffects(1, 0, TRUE) || AbilityBattleEffects(ABILITYEFFECT_FORECAST, 0, 0, 0, 0))
return TRUE; return TRUE;
gBattleStruct->faintedActionsState++; gBattleStruct->faintedActionsState++;
break; break;
@ -2083,7 +2083,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
} }
} }
break; break;
case ABILITYEFFECT_CONTACT: // 4 case ABILITYEFFECT_MOVE_END: // Think contact abilities.
switch (gLastUsedAbility) switch (gLastUsedAbility)
{ {
case ABILITY_COLOR_CHANGE: case ABILITY_COLOR_CHANGE:
@ -2343,7 +2343,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
{ {
gLastUsedAbility = ABILITY_INTIMIDATE; gLastUsedAbility = ABILITY_INTIMIDATE;
gStatuses3[i] &= ~(STATUS3_INTIMIDATE_POKES); gStatuses3[i] &= ~(STATUS3_INTIMIDATE_POKES);
BattleScriptPushCursorAndCallback(BattleScript_82DB4B8); BattleScriptPushCursorAndCallback(BattleScript_IntimidateActivatesEnd3);
gBattleStruct->intimidateBattler = i; gBattleStruct->intimidateBattler = i;
effect++; effect++;
break; break;
@ -2415,7 +2415,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
gLastUsedAbility = ABILITY_INTIMIDATE; gLastUsedAbility = ABILITY_INTIMIDATE;
gStatuses3[i] &= ~(STATUS3_INTIMIDATE_POKES); gStatuses3[i] &= ~(STATUS3_INTIMIDATE_POKES);
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_82DB4C1; gBattlescriptCurrInstr = BattleScript_IntimidateActivates;
gBattleStruct->intimidateBattler = i; gBattleStruct->intimidateBattler = i;
effect++; effect++;
break; break;
@ -3044,7 +3044,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
break; break;
case 2: case 2:
break; break;
case 3: case ITEMEFFECT_MOVE_END:
for (battlerId = 0; battlerId < gBattlersCount; battlerId++) for (battlerId = 0; battlerId < gBattlersCount; battlerId++)
{ {
gLastUsedItem = gBattleMons[battlerId].item; gLastUsedItem = gBattleMons[battlerId].item;
@ -3177,7 +3177,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
gPotentialItemEffectBattler = battlerId; gPotentialItemEffectBattler = battlerId;
BattleScriptPushCursor(); BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_WhiteHerbRet; gBattlescriptCurrInstr = BattleScript_WhiteHerbRet;
return effect; // unnecessary return return effect;
} }
break; break;
} }
@ -3192,7 +3192,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
} }
} }
break; break;
case 4: case ITEMEFFECT_KINGSROCK_SHELLBELL:
if (gBattleMoveDamage) if (gBattleMoveDamage)
{ {
switch (atkHoldEffect) switch (atkHoldEffect)
@ -3386,7 +3386,7 @@ u8 IsMonDisobedient(void)
gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_RAGE); gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_RAGE);
if (gBattleMons[gBattlerAttacker].status1 & STATUS1_SLEEP && (gCurrentMove == MOVE_SNORE || gCurrentMove == MOVE_SLEEP_TALK)) if (gBattleMons[gBattlerAttacker].status1 & STATUS1_SLEEP && (gCurrentMove == MOVE_SNORE || gCurrentMove == MOVE_SLEEP_TALK))
{ {
gBattlescriptCurrInstr = BattleScript_82DB695; gBattlescriptCurrInstr = BattleScript_IgnoresWhileAsleep;
return 1; return 1;
} }
@ -3440,7 +3440,7 @@ u8 IsMonDisobedient(void)
{ {
gBattleMoveDamage = CalculateBaseDamage(&gBattleMons[gBattlerAttacker], &gBattleMons[gBattlerAttacker], MOVE_POUND, 0, 40, 0, gBattlerAttacker, gBattlerAttacker); gBattleMoveDamage = CalculateBaseDamage(&gBattleMons[gBattlerAttacker], &gBattleMons[gBattlerAttacker], MOVE_POUND, 0, 40, 0, gBattlerAttacker, gBattlerAttacker);
gBattlerTarget = gBattlerAttacker; gBattlerTarget = gBattlerAttacker;
gBattlescriptCurrInstr = BattleScript_82DB6F0; gBattlescriptCurrInstr = BattleScript_IgnoresAndHitsItself;
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
return 2; return 2;
} }