From fbe82a7fe0f310ade7436d4d8f352ee04e05a1ec Mon Sep 17 00:00:00 2001 From: Rangi Date: Tue, 12 Jun 2018 23:29:15 -0400 Subject: Note which labels are only needed for locating banks (relevant to issue #485) --- engine/battle/effect_commands.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engine/battle/effect_commands.asm') diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm index 2723bba6b..ff114d870 100644 --- a/engine/battle/effect_commands.asm +++ b/engine/battle/effect_commands.asm @@ -7394,7 +7394,7 @@ PlayOpponentBattleAnim: ; 37e54 CallBattleCore: ; 37e73 - ld a, BANK(BattleCore) + ld a, BANK("Battle Core") rst FarCall ret @@ -7467,7 +7467,7 @@ GetMoveData: ; 37ead ld hl, Moves ld bc, MOVE_LENGTH call AddNTimes - ld a, Bank(Moves) + ld a, BANK(Moves) jp FarCopyBytes ; 37ebb -- cgit v1.2.3 From 1d9a68dbdd0132035f1fc7b7ea8f7fdc24741507 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Sun, 24 Jun 2018 16:09:41 +0200 Subject: Remove all address comments --- engine/battle/effect_commands.asm | 612 +++++++++++++------------------------- 1 file changed, 215 insertions(+), 397 deletions(-) (limited to 'engine/battle/effect_commands.asm') diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm index ff114d870..07e8b3a2a 100644 --- a/engine/battle/effect_commands.asm +++ b/engine/battle/effect_commands.asm @@ -1,4 +1,4 @@ -DoPlayerTurn: ; 34000 +DoPlayerTurn: call SetPlayerTurn ld a, [wBattlePlayerAction] @@ -7,10 +7,9 @@ DoPlayerTurn: ; 34000 jr DoTurn -; 3400a -DoEnemyTurn: ; 3400a +DoEnemyTurn: call SetEnemyTurn ld a, [wLinkMode] @@ -24,10 +23,9 @@ DoEnemyTurn: ; 3400a ret nc ; fallthrough -; 3401d -DoTurn: ; 3401d +DoTurn: ; Read in and execute the user's move effects for this turn. xor a @@ -41,10 +39,9 @@ DoTurn: ; 3401d ret nz call UpdateMoveData -; 3402c -DoMove: ; 3402c +DoMove: ; Get the user's move effect. ld a, BATTLE_VARS_MOVE_EFFECT call GetBattleVar @@ -115,11 +112,10 @@ DoMove: ; 3402c .DoMoveEffectCommand: jp hl -; 34084 CheckTurn: -BattleCommand_CheckTurn: ; 34084 +BattleCommand_CheckTurn: ; checkturn ; Repurposed as hardcoded turn handling. Useless as a command. @@ -353,10 +349,9 @@ CheckPlayerTurn: call CantMove jp EndTurn -; 341f0 -CantMove: ; 341f0 +CantMove: ld a, BATTLE_VARS_SUBSTATUS1 call GetBattleVarAddr res SUBSTATUS_ROLLOUT, [hl] @@ -382,20 +377,18 @@ CantMove: ; 341f0 res SUBSTATUS_FLYING, [hl] jp AppearUserRaiseSub -; 34216 -OpponentCantMove: ; 34216 +OpponentCantMove: call BattleCommand_SwitchTurn call CantMove jp BattleCommand_SwitchTurn -; 3421f -CheckEnemyTurn: ; 3421f +CheckEnemyTurn: ld hl, wEnemySubStatus4 bit SUBSTATUS_RECHARGE, [hl] @@ -621,18 +614,16 @@ CheckEnemyTurn: ; 3421f call CantMove ; fallthrough -; 34385 -EndTurn: ; 34385 +EndTurn: ld a, $1 ld [wTurnEnded], a jp ResetDamage -; 3438d -MoveDisabled: ; 3438d +MoveDisabled: ; Make sure any charged moves fail ld a, BATTLE_VARS_SUBSTATUS3 @@ -647,10 +638,9 @@ MoveDisabled: ; 3438d ld hl, DisabledMoveText jp StdBattleTextBox -; 343a5 -HitConfusion: ; 343a5 +HitConfusion: ld hl, HurtItselfText call StdBattleTextBox @@ -680,10 +670,9 @@ HitConfusion: ; 343a5 call DoPlayerDamage jp BattleCommand_RaiseSub -; 343db -BattleCommand_CheckObedience: ; 343db +BattleCommand_CheckObedience: ; checkobedience ; Enemy can't disobey @@ -984,10 +973,9 @@ BattleCommand_CheckObedience: ; 343db jp EndMoveEffect -; 3451f -IgnoreSleepOnly: ; 3451f +IgnoreSleepOnly: ld a, BATTLE_VARS_MOVE_ANIM call GetBattleVar @@ -1015,18 +1003,16 @@ IgnoreSleepOnly: ; 3451f scf ret -; 34541 -BattleCommand_UsedMoveText: ; 34541 +BattleCommand_UsedMoveText: ; usedmovetext farcall DisplayUsedMoveText ret -; 34548 -CheckUserIsCharging: ; 34548 +CheckUserIsCharging: ld a, [hBattleTurn] and a @@ -1037,10 +1023,9 @@ CheckUserIsCharging: ; 34548 and a ret -; 34555 -BattleCommand_DoTurn: ; 34555 +BattleCommand_DoTurn: call CheckUserIsCharging ret nz @@ -1165,9 +1150,8 @@ BattleCommand_DoTurn: ; 34555 ld b, 1 ret -; 34602 -.continuousmoves ; 34602 +.continuousmoves db EFFECT_RAZOR_WIND db EFFECT_SKY_ATTACK db EFFECT_SKULL_BASH @@ -1177,9 +1161,8 @@ BattleCommand_DoTurn: ; 34555 db EFFECT_BIDE db EFFECT_RAMPAGE db -1 -; 3460b -CheckMimicUsed: ; 3460b +CheckMimicUsed: ld a, [hBattleTurn] and a ld a, [wCurMoveNum] @@ -1209,10 +1192,9 @@ CheckMimicUsed: ; 3460b and a ret -; 34631 -BattleCommand_Critical: ; 34631 +BattleCommand_Critical: ; critical ; Determine whether this attack's hit will be critical. @@ -1303,13 +1285,12 @@ BattleCommand_Critical: ; 34631 ret INCLUDE "data/battle/critical_hits.asm" -; 346b2 INCLUDE "engine/battle/move_effects/triple_kick.asm" -BattleCommand_Stab: ; 346d2 +BattleCommand_Stab: ; STAB = Same Type Attack Bonus ld a, BATTLE_VARS_MOVE_ANIM call GetBattleVar @@ -1493,16 +1474,15 @@ BattleCommand_Stab: ; 346d2 ld [wTypeModifier], a ret -; 347c8 -BattleCheckTypeMatchup: ; 347c8 +BattleCheckTypeMatchup: ld hl, wEnemyMonType1 ld a, [hBattleTurn] and a jr z, CheckTypeMatchup ld hl, wBattleMonType1 -CheckTypeMatchup: ; 347d3 +CheckTypeMatchup: ; There is an incorrect assumption about this function made in the AI related code: when ; the AI calls CheckTypeMatchup (not BattleCheckTypeMatchup), it assumes that placing the ; offensive type in a will make this function do the right thing. Since a is overwritten, @@ -1575,10 +1555,9 @@ CheckTypeMatchup: ; 347d3 pop hl ret -; 34833 -BattleCommand_ResetTypeMatchup: ; 34833 +BattleCommand_ResetTypeMatchup: ; Reset the type matchup multiplier to 1.0, if the type matchup is not 0. ; If there is immunity in play, the move automatically misses. call BattleCheckTypeMatchup @@ -1597,7 +1576,6 @@ BattleCommand_ResetTypeMatchup: ; 34833 ld [wTypeMatchup], a ret -; 3484e INCLUDE "engine/battle/ai/switch.asm" @@ -1605,7 +1583,7 @@ INCLUDE "engine/battle/ai/switch.asm" INCLUDE "data/types/type_matchups.asm" -BattleCommand_DamageVariation: ; 34cfd +BattleCommand_DamageVariation: ; damagevariation ; Modify the damage spread between 85% and 100%. @@ -1658,10 +1636,9 @@ BattleCommand_DamageVariation: ; 34cfd ld [hl], a ret -; 34d32 -BattleCommand_CheckHit: ; 34d32 +BattleCommand_CheckHit: ; checkhit call .DreamEater @@ -1977,10 +1954,9 @@ BattleCommand_CheckHit: ; 34d32 ret INCLUDE "data/battle/accuracy_multipliers.asm" -; 34ecc -BattleCommand_EffectChance: ; 34ecc +BattleCommand_EffectChance: ; effectchance xor a @@ -2007,10 +1983,9 @@ BattleCommand_EffectChance: ; 34ecc and a ret -; 34eee -BattleCommand_LowerSub: ; 34eee +BattleCommand_LowerSub: ; lowersub ld a, BATTLE_VARS_SUBSTATUS4 @@ -2078,19 +2053,17 @@ BattleCommand_LowerSub: ; 34eee ld [wSomeoneIsRampaging], a ret -; 34f57 -BattleCommand_MoveAnim: ; 34f57 +BattleCommand_MoveAnim: ; moveanim call BattleCommand_LowerSub call BattleCommand_MoveAnimNoSub jp BattleCommand_RaiseSub -; 34f60 -BattleCommand_MoveAnimNoSub: ; 34f60 +BattleCommand_MoveAnimNoSub: ld a, [wAttackMissed] and a jp nz, BattleCommand_MoveDelay @@ -2154,10 +2127,9 @@ BattleCommand_MoveAnimNoSub: ; 34f60 ld [wNumHits], a jp PlayFXAnimID -; 34fd1 -BattleCommand_StatUpAnim: ; 34fd1 +BattleCommand_StatUpAnim: ld a, [wAttackMissed] and a jp nz, BattleCommand_MoveDelay @@ -2165,10 +2137,9 @@ BattleCommand_StatUpAnim: ; 34fd1 xor a jr BattleCommand_StatUpDownAnim -; 34fdb -BattleCommand_StatDownAnim: ; 34fdb +BattleCommand_StatDownAnim: ld a, [wAttackMissed] and a jp nz, BattleCommand_MoveDelay @@ -2180,10 +2151,9 @@ BattleCommand_StatDownAnim: ; 34fdb ld a, BATTLEANIM_WOBBLE ; fallthrough -; 34feb -BattleCommand_StatUpDownAnim: ; 34feb +BattleCommand_StatUpDownAnim: ld [wNumHits], a xor a ld [wKickCounter], a @@ -2193,10 +2163,9 @@ BattleCommand_StatUpDownAnim: ; 34feb ld d, 0 jp PlayFXAnimID -; 34ffd -BattleCommand_SwitchTurn: ; 34ffd +BattleCommand_SwitchTurn: ; switchturn ld a, [hBattleTurn] @@ -2204,10 +2173,9 @@ BattleCommand_SwitchTurn: ; 34ffd ld [hBattleTurn], a ret -; 35004 -BattleCommand_RaiseSub: ; 35004 +BattleCommand_RaiseSub: ; raisesub ld a, BATTLE_VARS_SUBSTATUS4 @@ -2226,10 +2194,9 @@ BattleCommand_RaiseSub: ; 35004 ld a, SUBSTITUTE jp LoadAnim -; 35023 -BattleCommand_FailureText: ; 35023 +BattleCommand_FailureText: ; failuretext ; If the move missed or failed, load the appropriate ; text, and end the effects of multi-turn or multi- @@ -2271,10 +2238,9 @@ BattleCommand_FailureText: ; 35023 call AppearUserRaiseSub jp EndMoveEffect -; 3505e -BattleCommand_ApplyDamage: ; 3505e +BattleCommand_ApplyDamage: ; applydamage ld a, BATTLE_VARS_SUBSTATUS1_OPP @@ -2366,10 +2332,9 @@ BattleCommand_ApplyDamage: ; 3505e ld [de], a ret -; 350e4 -GetFailureResultText: ; 350e4 +GetFailureResultText: ld hl, DoesntAffectText ld de, DoesntAffectText ld a, [wTypeModifier] @@ -2427,7 +2392,7 @@ endr jp nz, DoEnemyDamage jp DoPlayerDamage -FailText_CheckOpponentProtect: ; 35157 +FailText_CheckOpponentProtect: ld a, BATTLE_VARS_SUBSTATUS1_OPP call GetBattleVar bit SUBSTATUS_PROTECT, a @@ -2437,10 +2402,9 @@ FailText_CheckOpponentProtect: ; 35157 .not_protected jp StdBattleTextBox -; 35165 -BattleCommand_BideFailText: ; 35165 +BattleCommand_BideFailText: ld a, [wAttackMissed] and a ret z @@ -2450,10 +2414,9 @@ BattleCommand_BideFailText: ; 35165 jp z, PrintDoesntAffect jp PrintButItFailed -; 35175 -BattleCommand_CriticalText: ; 35175 +BattleCommand_CriticalText: ; criticaltext ; Prints the message for critical hits or one-hit KOs. @@ -2483,10 +2446,9 @@ BattleCommand_CriticalText: ; 35175 .texts dw CriticalHitText dw OneHitKOText -; 35197 -BattleCommand_StartLoop: ; 35197 +BattleCommand_StartLoop: ; startloop ld hl, wPlayerRolloutCount @@ -2499,10 +2461,9 @@ BattleCommand_StartLoop: ; 35197 ld [hl], a ret -; 351a5 -BattleCommand_SuperEffectiveLoopText: ; 351a5 +BattleCommand_SuperEffectiveLoopText: ; supereffectivelooptext ld a, BATTLE_VARS_SUBSTATUS3 @@ -2511,10 +2472,9 @@ BattleCommand_SuperEffectiveLoopText: ; 351a5 ret nz ; fallthrough -; 351ad -BattleCommand_SuperEffectiveText: ; 351ad +BattleCommand_SuperEffectiveText: ; supereffectivetext ld a, [wTypeModifier] @@ -2527,10 +2487,9 @@ BattleCommand_SuperEffectiveText: ; 351ad .print jp StdBattleTextBox -; 351c0 -BattleCommand_CheckDestinyBond: ; 351c0 +BattleCommand_CheckDestinyBond: ; checkdestinybond ; Faint the user if it fainted an opponent using Destiny Bond. @@ -2617,10 +2576,9 @@ BattleCommand_CheckDestinyBond: ; 351c0 .finish jp EndMoveEffect -; 35250 -BattleCommand_BuildOpponentRage: ; 35250 +BattleCommand_BuildOpponentRage: ; buildopponentrage jp .start @@ -2651,10 +2609,9 @@ BattleCommand_BuildOpponentRage: ; 35250 call StdBattleTextBox jp BattleCommand_SwitchTurn -; 3527b -BattleCommand_RageDamage: ; 3527b +BattleCommand_RageDamage: ; ragedamage ld a, [wCurDamage] @@ -2682,10 +2639,9 @@ BattleCommand_RageDamage: ; 3527b ld [wCurDamage + 1], a ret -; 352a3 -EndMoveEffect: ; 352a3 +EndMoveEffect: ld a, [wBattleScriptBufferAddress] ld l, a ld a, [wBattleScriptBufferAddress + 1] @@ -2696,10 +2652,9 @@ EndMoveEffect: ; 352a3 ld [hl], a ret -; 352b1 -DittoMetalPowder: ; 352b1 +DittoMetalPowder: ld a, MON_SPECIES call BattlePartyAttr ld a, [hBattleTurn] @@ -2735,10 +2690,9 @@ DittoMetalPowder: ; 352b1 rr c ret -; 352dc -BattleCommand_DamageStats: ; 352dc +BattleCommand_DamageStats: ; damagestats ld a, [hBattleTurn] @@ -2746,10 +2700,9 @@ BattleCommand_DamageStats: ; 352dc jp nz, EnemyAttackDamage ; fallthrough -; 352e2 -PlayerAttackDamage: ; 352e2 +PlayerAttackDamage: ; Return move power d, player level e, enemy defense c and player attack b. call ResetDamage @@ -2831,10 +2784,9 @@ PlayerAttackDamage: ; 352e2 and a ret -; 3534d -TruncateHL_BC: ; 3534d +TruncateHL_BC: .loop ; Truncate 16-bit values hl and bc to 8-bit values b and c respectively. ; b = hl, c = bc @@ -2879,10 +2831,9 @@ TruncateHL_BC: ; 3534d ld b, l ret -; 35378 -GetDamageStatsCritical: ; 35378 +GetDamageStatsCritical: ; Return carry if non-critical. ld a, [wCriticalHit] @@ -2891,10 +2842,9 @@ GetDamageStatsCritical: ; 35378 ret z ; fallthrough -; 3537e -GetDamageStats: ; 3537e +GetDamageStats: ; Return the attacker's offensive stat and the defender's defensive ; stat based on whether the attacking type is physical or special. @@ -2934,10 +2884,9 @@ GetDamageStats: ; 3537e pop hl ret -; 353b5 -ThickClubBoost: ; 353b5 +ThickClubBoost: ; Return in hl the stat value at hl. ; If the attacking monster is Cubone or Marowak and @@ -2952,10 +2901,9 @@ ThickClubBoost: ; 353b5 pop bc ret -; 353c3 -LightBallBoost: ; 353c3 +LightBallBoost: ; Return in hl the stat value at hl. ; If the attacking monster is Pikachu and it's @@ -2970,10 +2918,9 @@ LightBallBoost: ; 353c3 pop bc ret -; 353d1 -SpeciesItemBoost: ; 353d1 +SpeciesItemBoost: ; Return in hl the stat value at hl. ; If the attacking monster is species b or c and @@ -3013,10 +2960,9 @@ SpeciesItemBoost: ; 353d1 rl h ret -; 353f6 -EnemyAttackDamage: ; 353f6 +EnemyAttackDamage: call ResetDamage ; No damage dealt with 0 power. @@ -3094,13 +3040,12 @@ EnemyAttackDamage: ; 353f6 and a ret -; 35461 INCLUDE "engine/battle/move_effects/beat_up.asm" -BattleCommand_ClearMissDamage: ; 355d5 +BattleCommand_ClearMissDamage: ; clearmissdamage ld a, [wAttackMissed] and a @@ -3108,10 +3053,9 @@ BattleCommand_ClearMissDamage: ; 355d5 jp ResetDamage -; 355dd -HitSelfInConfusion: ; 355dd +HitSelfInConfusion: call ResetDamage ld a, [hBattleTurn] and a @@ -3147,10 +3091,9 @@ HitSelfInConfusion: ; 355dd ld e, a ret -; 35612 -BattleCommand_DamageCalc: ; 35612 +BattleCommand_DamageCalc: ; damagecalc ; Return a damage value for move power d, player level e, enemy defense c and player attack b. @@ -3382,13 +3325,12 @@ BattleCommand_DamageCalc: ; 35612 ret -; 35703 INCLUDE "data/types/type_boost_items.asm" -BattleCommand_ConstantDamage: ; 35726 +BattleCommand_ConstantDamage: ; constantdamage ld hl, wBattleMonLevel @@ -3564,7 +3506,7 @@ INCLUDE "engine/battle/move_effects/lock_on.asm" INCLUDE "engine/battle/move_effects/sketch.asm" -BattleCommand_DefrostOpponent: ; 35b16 +BattleCommand_DefrostOpponent: ; defrostopponent ; Thaw the opponent if frozen, and ; raise the user's Attack one stage. @@ -3590,7 +3532,6 @@ BattleCommand_DefrostOpponent: ; 35b16 ld [hl], a ret -; 35b33 INCLUDE "engine/battle/move_effects/sleep_talk.asm" @@ -3604,7 +3545,7 @@ INCLUDE "engine/battle/move_effects/false_swipe.asm" INCLUDE "engine/battle/move_effects/heal_bell.asm" -FarPlayBattleAnimation: ; 35d00 +FarPlayBattleAnimation: ; play animation de ld a, BATTLE_VARS_SUBSTATUS3 @@ -3613,9 +3554,8 @@ FarPlayBattleAnimation: ; 35d00 ret nz ; fallthrough -; 35d08 -PlayFXAnimID: ; 35d08 +PlayFXAnimID: ld a, e ld [wFXAnimID], a ld a, d @@ -3626,10 +3566,9 @@ PlayFXAnimID: ; 35d08 callfar PlayBattleAnim ret -; 35d1c -DoEnemyDamage: ; 35d1c +DoEnemyDamage: ld hl, wCurDamage ld a, [hli] ld b, a @@ -3689,10 +3628,9 @@ DoEnemyDamage: ; 35d1c .did_no_damage jp RefreshBattleHuds -; 35d7e -DoPlayerDamage: ; 35d7e +DoPlayerDamage: ld hl, wCurDamage ld a, [hli] ld b, a @@ -3752,10 +3690,9 @@ DoPlayerDamage: ; 35d7e .did_no_damage jp RefreshBattleHuds -; 35de0 -DoSubstituteDamage: ; 35de0 +DoSubstituteDamage: ld hl, SubTookDamageText call StdBattleTextBox @@ -3812,10 +3749,9 @@ DoSubstituteDamage: ; 35de0 .done jp ResetDamage -; 35e40 -UpdateMoveData: ; 35e40 +UpdateMoveData: ld a, BATTLE_VARS_MOVE_ANIM call GetBattleVarAddr @@ -3832,10 +3768,9 @@ UpdateMoveData: ; 35e40 call GetMoveName jp CopyName1 -; 35e5c -BattleCommand_SleepTarget: ; 35e5c +BattleCommand_SleepTarget: ; sleeptarget call GetOpponentItem @@ -3906,10 +3841,9 @@ BattleCommand_SleepTarget: ; 35e5c pop hl jp StdBattleTextBox -; 35ece -.CheckAIRandomFail: ; 35ece +.CheckAIRandomFail: ; Enemy turn ld a, [hBattleTurn] and a @@ -3937,10 +3871,9 @@ BattleCommand_SleepTarget: ; 35e5c xor a ret -; 35eee -BattleCommand_PoisonTarget: ; 35eee +BattleCommand_PoisonTarget: ; poisontarget call CheckSubstituteOpp @@ -3975,10 +3908,9 @@ BattleCommand_PoisonTarget: ; 35eee farcall UseHeldStatusHealingItem ret -; 35f2c -BattleCommand_Poison: ; 35f2c +BattleCommand_Poison: ; poison ld hl, DoesntAffectText @@ -4066,18 +3998,16 @@ BattleCommand_Poison: ; 35f2c pop hl jp StdBattleTextBox -; 35fc0 -.apply_poison ; 35fc0 +.apply_poison call AnimateCurrentMove call PoisonOpponent jp RefreshBattleHuds -; 35fc9 -.check_toxic ; 35fc9 +.check_toxic ld a, BATTLE_VARS_SUBSTATUS5_OPP call GetBattleVarAddr ld a, [hBattleTurn] @@ -4091,10 +4021,9 @@ BattleCommand_Poison: ; 35f2c cp EFFECT_TOXIC ret -; 35fe1 -CheckIfTargetIsPoisonType: ; 35fe1 +CheckIfTargetIsPoisonType: ld de, wEnemyMonType1 ld a, [hBattleTurn] and a @@ -4109,37 +4038,33 @@ CheckIfTargetIsPoisonType: ; 35fe1 cp POISON ret -; 35ff5 -PoisonOpponent: ; 35ff5 +PoisonOpponent: ld a, BATTLE_VARS_STATUS_OPP call GetBattleVarAddr set PSN, [hl] jp UpdateOpponentInParty -; 35fff -BattleCommand_DrainTarget: ; 35fff +BattleCommand_DrainTarget: ; draintarget call SapHealth ld hl, SuckedHealthText jp StdBattleTextBox -; 36008 -BattleCommand_EatDream: ; 36008 +BattleCommand_EatDream: ; eatdream call SapHealth ld hl, DreamEatenText jp StdBattleTextBox -; 36011 -SapHealth: ; 36011 +SapHealth: ; Divide damage by 2, store it in hDividend ld hl, wCurDamage ld a, [hli] @@ -4232,10 +4157,9 @@ SapHealth: ; 36011 call RefreshBattleHuds jp UpdateBattleMonInParty -; 3608c -BattleCommand_BurnTarget: ; 3608c +BattleCommand_BurnTarget: ; burntarget xor a @@ -4276,10 +4200,9 @@ BattleCommand_BurnTarget: ; 3608c farcall UseHeldStatusHealingItem ret -; 360dd -Defrost: ; 360dd +Defrost: ld a, [hl] and 1 << FRZ ret z @@ -4304,10 +4227,9 @@ Defrost: ; 360dd ld hl, DefrostedOpponentText jp StdBattleTextBox -; 36102 -BattleCommand_FreezeTarget: ; 36102 +BattleCommand_FreezeTarget: ; freezetarget xor a @@ -4360,10 +4282,9 @@ BattleCommand_FreezeTarget: ; 36102 ld [hl], $1 ret -; 36165 -BattleCommand_ParalyzeTarget: ; 36165 +BattleCommand_ParalyzeTarget: ; paralyzetarget xor a @@ -4399,80 +4320,79 @@ BattleCommand_ParalyzeTarget: ; 36165 ld hl, UseHeldStatusHealingItem jp CallBattleCore -; 361ac -BattleCommand_AttackUp: ; 361ac +BattleCommand_AttackUp: ; attackup ld b, ATTACK jr BattleCommand_StatUp -BattleCommand_DefenseUp: ; 361b0 +BattleCommand_DefenseUp: ; defenseup ld b, DEFENSE jr BattleCommand_StatUp -BattleCommand_SpeedUp: ; 361b4 +BattleCommand_SpeedUp: ; speedup ld b, SPEED jr BattleCommand_StatUp -BattleCommand_SpecialAttackUp: ; 361b8 +BattleCommand_SpecialAttackUp: ; specialattackup ld b, SP_ATTACK jr BattleCommand_StatUp -BattleCommand_SpecialDefenseUp: ; 361bc +BattleCommand_SpecialDefenseUp: ; specialdefenseup ld b, SP_DEFENSE jr BattleCommand_StatUp -BattleCommand_AccuracyUp: ; 361c0 +BattleCommand_AccuracyUp: ; accuracyup ld b, ACCURACY jr BattleCommand_StatUp -BattleCommand_EvasionUp: ; 361c4 +BattleCommand_EvasionUp: ; evasionup ld b, EVASION jr BattleCommand_StatUp -BattleCommand_AttackUp2: ; 361c8 +BattleCommand_AttackUp2: ; attackup2 ld b, $10 | ATTACK jr BattleCommand_StatUp -BattleCommand_DefenseUp2: ; 361cc +BattleCommand_DefenseUp2: ; defenseup2 ld b, $10 | DEFENSE jr BattleCommand_StatUp -BattleCommand_SpeedUp2: ; 361d0 +BattleCommand_SpeedUp2: ; speedup2 ld b, $10 | SPEED jr BattleCommand_StatUp -BattleCommand_SpecialAttackUp2: ; 361d4 +BattleCommand_SpecialAttackUp2: ; specialattackup2 ld b, $10 | SP_ATTACK jr BattleCommand_StatUp -BattleCommand_SpecialDefenseUp2: ; 361d8 +BattleCommand_SpecialDefenseUp2: ; specialdefenseup2 ld b, $10 | SP_DEFENSE jr BattleCommand_StatUp -BattleCommand_AccuracyUp2: ; 361dc +BattleCommand_AccuracyUp2: ; accuracyup2 ld b, $10 | ACCURACY jr BattleCommand_StatUp -BattleCommand_EvasionUp2: ; 361e0 +BattleCommand_EvasionUp2: ; evasionup2 ld b, $10 | EVASION jr BattleCommand_StatUp -BattleCommand_StatUp: ; 361e4 +BattleCommand_StatUp: ; statup call CheckIfStatCanBeRaised ld a, [wFailedMessage] @@ -4480,10 +4400,9 @@ BattleCommand_StatUp: ; 361e4 ret nz jp StatUpAnimation -; 361ef -CheckIfStatCanBeRaised: ; 361ef +CheckIfStatCanBeRaised: ld a, b ld [wLoweredStat], a ld hl, wPlayerStatLevels @@ -4562,35 +4481,31 @@ CheckIfStatCanBeRaised: ; 361ef ld [wFailedMessage], a ret -; 3626e -.stats_already_max ; 3626e +.stats_already_max pop hl dec [hl] ; fallthrough -; 36270 -.cant_raise_stat ; 36270 +.cant_raise_stat ld a, $2 ld [wFailedMessage], a ld a, $1 ld [wAttackMissed], a ret -; 3627b -.stat_raise_failed ; 3627b +.stat_raise_failed ld a, $1 ld [wFailedMessage], a ret -; 36281 -StatUpAnimation: ; 36281 +StatUpAnimation: ld bc, wPlayerMinimized ld hl, DropPlayerSub ld a, [hBattleTurn] @@ -4615,79 +4530,78 @@ StatUpAnimation: ; 36281 call WaitBGMap jp BattleCommand_MoveDelay -; 362ad -BattleCommand_AttackDown: ; 362ad +BattleCommand_AttackDown: ; attackdown ld a, ATTACK jr BattleCommand_StatDown -BattleCommand_DefenseDown: ; 362b1 +BattleCommand_DefenseDown: ; defensedown ld a, DEFENSE jr BattleCommand_StatDown -BattleCommand_SpeedDown: ; 362b5 +BattleCommand_SpeedDown: ; speeddown ld a, SPEED jr BattleCommand_StatDown -BattleCommand_SpecialAttackDown: ; 362b9 +BattleCommand_SpecialAttackDown: ; specialattackdown ld a, SP_ATTACK jr BattleCommand_StatDown -BattleCommand_SpecialDefenseDown: ; 362bd +BattleCommand_SpecialDefenseDown: ; specialdefensedown ld a, SP_DEFENSE jr BattleCommand_StatDown -BattleCommand_AccuracyDown: ; 362c1 +BattleCommand_AccuracyDown: ; accuracydown ld a, ACCURACY jr BattleCommand_StatDown -BattleCommand_EvasionDown: ; 362c5 +BattleCommand_EvasionDown: ; evasiondown ld a, EVASION jr BattleCommand_StatDown -BattleCommand_AttackDown2: ; 362c9 +BattleCommand_AttackDown2: ; attackdown2 ld a, $10 | ATTACK jr BattleCommand_StatDown -BattleCommand_DefenseDown2: ; 362cd +BattleCommand_DefenseDown2: ; defensedown2 ld a, $10 | DEFENSE jr BattleCommand_StatDown -BattleCommand_SpeedDown2: ; 362d1 +BattleCommand_SpeedDown2: ; speeddown2 ld a, $10 | SPEED jr BattleCommand_StatDown -BattleCommand_SpecialAttackDown2: ; 362d5 +BattleCommand_SpecialAttackDown2: ; specialattackdown2 ld a, $10 | SP_ATTACK jr BattleCommand_StatDown -BattleCommand_SpecialDefenseDown2: ; 362d9 +BattleCommand_SpecialDefenseDown2: ; specialdefensedown2 ld a, $10 | SP_DEFENSE jr BattleCommand_StatDown -BattleCommand_AccuracyDown2: ; 362dd +BattleCommand_AccuracyDown2: ; accuracydown2 ld a, $10 | ACCURACY jr BattleCommand_StatDown -BattleCommand_EvasionDown2: ; 362e1 +BattleCommand_EvasionDown2: ; evasiondown2 ld a, $10 | EVASION -BattleCommand_StatDown: ; 362e3 +BattleCommand_StatDown: ; statdown ld [wLoweredStat], a @@ -4810,10 +4724,9 @@ BattleCommand_StatDown: ; 362e3 ld [wAttackMissed], a ret -; 36391 -CheckMist: ; 36391 +CheckMist: ld a, BATTLE_VARS_MOVE_EFFECT call GetBattleVar cp EFFECT_ATTACK_DOWN @@ -4838,10 +4751,9 @@ CheckMist: ; 36391 bit SUBSTATUS_MIST, a ret -; 363b8 -BattleCommand_StatUpMessage: ; 363b8 +BattleCommand_StatUpMessage: ld a, [wFailedMessage] and a ret nz @@ -4871,10 +4783,9 @@ BattleCommand_StatUpMessage: ; 363b8 text_jump UnknownText_0x1c0ce0 db "@" -; 363e9 -BattleCommand_StatDownMessage: ; 363e9 +BattleCommand_StatDownMessage: ld a, [wFailedMessage] and a ret nz @@ -4903,10 +4814,9 @@ BattleCommand_StatDownMessage: ; 363e9 text_jump UnknownText_0x1c0d06 db "@" -; 3641a -TryLowerStat: ; 3641a +TryLowerStat: ; Lower stat c from stat struct hl (buffer de). push bc @@ -4949,10 +4859,9 @@ TryLowerStat: ; 3641a and a ret -; 3644c -BattleCommand_StatUpFailText: ; 3644c +BattleCommand_StatUpFailText: ; statupfailtext ld a, [wFailedMessage] and a @@ -4970,10 +4879,9 @@ BattleCommand_StatUpFailText: ; 3644c ld hl, WontRiseAnymoreText jp StdBattleTextBox -; 3646a -BattleCommand_StatDownFailText: ; 3646a +BattleCommand_StatDownFailText: ; statdownfailtext ld a, [wFailedMessage] and a @@ -4994,10 +4902,9 @@ BattleCommand_StatDownFailText: ; 3646a ld hl, WontDropAnymoreText jp StdBattleTextBox -; 3648f -GetStatName: ; 3648f +GetStatName: ld hl, StatNames ld c, "@" .CheckName: @@ -5020,7 +4927,7 @@ INCLUDE "data/battle/stat_names.asm" INCLUDE "data/battle/stat_multipliers.asm" -BattleCommand_AllStatsUp: ; 36500 +BattleCommand_AllStatsUp: ; allstatsup ; Attack @@ -5047,18 +4954,16 @@ BattleCommand_AllStatsUp: ; 36500 call ResetMiss call BattleCommand_SpecialDefenseUp jp BattleCommand_StatUpMessage -; 3652d -ResetMiss: ; 3652d +ResetMiss: xor a ld [wAttackMissed], a ret -; 36532 -LowerStat: ; 36532 +LowerStat: ld [wLoweredStat], a ld hl, wPlayerStatLevels @@ -5129,10 +5034,9 @@ LowerStat: ; 36532 ld [wFailedMessage], a ret -; 3658f -BattleCommand_TriStatusChance: ; 3658f +BattleCommand_TriStatusChance: ; tristatuschance call BattleCommand_EffectChance @@ -5152,20 +5056,18 @@ BattleCommand_TriStatusChance: ; 3658f dw BattleCommand_ParalyzeTarget ; paralyze dw BattleCommand_FreezeTarget ; freeze dw BattleCommand_BurnTarget ; burn -; 365a7 -BattleCommand_Curl: ; 365a7 +BattleCommand_Curl: ; curl ld a, BATTLE_VARS_SUBSTATUS2 call GetBattleVarAddr set SUBSTATUS_CURLED, [hl] ret -; 365af -BattleCommand_RaiseSubNoAnim: ; 365af +BattleCommand_RaiseSubNoAnim: ld hl, GetBattleMonBackpic ld a, [hBattleTurn] and a @@ -5177,10 +5079,9 @@ BattleCommand_RaiseSubNoAnim: ; 365af call CallBattleCore jp WaitBGMap -; 365c3 -BattleCommand_LowerSubNoAnim: ; 365c3 +BattleCommand_LowerSubNoAnim: ld hl, DropPlayerSub ld a, [hBattleTurn] and a @@ -5192,10 +5093,9 @@ BattleCommand_LowerSubNoAnim: ; 365c3 call CallBattleCore jp WaitBGMap -; 365d7 -CalcPlayerStats: ; 365d7 +CalcPlayerStats: ld hl, wPlayerAtkLevel ld de, wPlayerStats ld bc, wBattleMonAttack @@ -5216,10 +5116,9 @@ CalcPlayerStats: ; 365d7 jp BattleCommand_SwitchTurn -; 365fd -CalcEnemyStats: ; 365fd +CalcEnemyStats: ld hl, wEnemyAtkLevel ld de, wEnemyStats ld bc, wEnemyMonAttack @@ -5237,10 +5136,9 @@ CalcEnemyStats: ; 365fd jp BattleCommand_SwitchTurn -; 3661d -CalcStats: ; 3661d +CalcStats: .loop push af ld a, [hli] @@ -5309,13 +5207,12 @@ CalcStats: ; 3661d ret -; 36671 INCLUDE "engine/battle/move_effects/bide.asm" -BattleCommand_CheckRampage: ; 3671a +BattleCommand_CheckRampage: ; checkrampage ld de, wPlayerRolloutCount @@ -5352,10 +5249,9 @@ BattleCommand_CheckRampage: ; 3671a ld b, rampage_command jp SkipToBattleCommand -; 36751 -BattleCommand_Rampage: ; 36751 +BattleCommand_Rampage: ; rampage ; No rampage during Sleep Talk. @@ -5382,23 +5278,21 @@ BattleCommand_Rampage: ; 36751 ld [wSomeoneIsRampaging], a ret -; 36778 INCLUDE "engine/battle/move_effects/teleport.asm" -SetBattleDraw: ; 36804 +SetBattleDraw: ld a, [wBattleResult] and BATTLERESULT_BITMASK or DRAW ld [wBattleResult], a ret -; 3680f -BattleCommand_ForceSwitch: ; 3680f +BattleCommand_ForceSwitch: ; forceswitch ld a, [wBattleType] @@ -5617,10 +5511,9 @@ BattleCommand_ForceSwitch: ; 3680f .do_text jp StdBattleTextBox -; 36994 -CheckPlayerHasMonToSwitchTo: ; 36994 +CheckPlayerHasMonToSwitchTo: ld a, [wPartyCount] ld d, a ld e, 0 @@ -5649,10 +5542,9 @@ CheckPlayerHasMonToSwitchTo: ; 36994 and a ret -; 369b6 -BattleCommand_EndLoop: ; 369b6 +BattleCommand_EndLoop: ; endloop ; Loop back to 'critical'. @@ -5786,10 +5678,9 @@ BattleCommand_EndLoop: ; 369b6 ld [wBattleScriptBufferAddress], a ret -; 36a82 -BattleCommand_FakeOut: ; 36a82 +BattleCommand_FakeOut: ld a, [wAttackMissed] and a ret nz @@ -5810,10 +5701,9 @@ BattleCommand_FakeOut: ; 36a82 ld [wAttackMissed], a ret -; 36aa0 -BattleCommand_FlinchTarget: ; 36aa0 +BattleCommand_FlinchTarget: call CheckSubstituteOpp ret nz @@ -5830,19 +5720,17 @@ BattleCommand_FlinchTarget: ; 36aa0 ret nz ; fallthrough -; 36ab5 -FlinchTarget: ; 36ab5 +FlinchTarget: ld a, BATTLE_VARS_SUBSTATUS3_OPP call GetBattleVarAddr set SUBSTATUS_FLINCHED, [hl] jp EndRechargeOpp -; 36abf -CheckOpponentWentFirst: ; 36abf +CheckOpponentWentFirst: ; Returns a=0, z if user went first ; Returns a=1, nz if opponent went first push bc @@ -5853,10 +5741,9 @@ CheckOpponentWentFirst: ; 36abf pop bc ret -; 36ac9 -BattleCommand_HeldFlinch: ; 36ac9 +BattleCommand_HeldFlinch: ; kingsrock ld a, [wAttackMissed] @@ -5884,10 +5771,9 @@ BattleCommand_HeldFlinch: ; 36ac9 set SUBSTATUS_FLINCHED, [hl] ret -; 36af3 -BattleCommand_OHKO: ; 36af3 +BattleCommand_OHKO: ; ohko call ResetDamage @@ -5933,10 +5819,9 @@ BattleCommand_OHKO: ; 36af3 ld [wAttackMissed], a ret -; 36b3a -BattleCommand_CheckCharge: ; 36b3a +BattleCommand_CheckCharge: ; checkcharge ld a, BATTLE_VARS_SUBSTATUS3 @@ -5949,10 +5834,9 @@ BattleCommand_CheckCharge: ; 36b3a ld b, charge_command jp SkipToBattleCommand -; 36b4d -BattleCommand_Charge: ; 36b4d +BattleCommand_Charge: ; charge call BattleCommand_ClearText @@ -6092,17 +5976,15 @@ BattleCommand_Charge: ; 36b4d ; 'dug a hole!' text_jump UnknownText_0x1c0d6c db "@" -; 36c2c -BattleCommand3c: ; 36c2c +BattleCommand3c: ; unused ret -; 36c2d -BattleCommand_TrapTarget: ; 36c2d +BattleCommand_TrapTarget: ; traptarget ld a, [wAttackMissed] @@ -6157,7 +6039,6 @@ BattleCommand_TrapTarget: ; 36c2d dbw FIRE_SPIN, FireSpinTrapText ; 'was trapped!' dbw CLAMP, ClampedByText ; 'was CLAMPED by' dbw WHIRLPOOL, WhirlpoolTrapText ; 'was trapped!' -; 36c7e INCLUDE "engine/battle/move_effects/mist.asm" @@ -6165,7 +6046,7 @@ INCLUDE "engine/battle/move_effects/mist.asm" INCLUDE "engine/battle/move_effects/focus_energy.asm" -BattleCommand_Recoil: ; 36cb2 +BattleCommand_Recoil: ; recoil ld hl, wBattleMonMaxHP @@ -6229,10 +6110,9 @@ BattleCommand_Recoil: ; 36cb2 ld hl, RecoilText jp StdBattleTextBox -; 36d1d -BattleCommand_ConfuseTarget: ; 36d1d +BattleCommand_ConfuseTarget: ; confusetarget call GetOpponentItem @@ -6253,7 +6133,7 @@ BattleCommand_ConfuseTarget: ; 36d1d jr BattleCommand_FinishConfusingTarget -BattleCommand_Confuse: ; 36d3b +BattleCommand_Confuse: ; confuse call GetOpponentItem @@ -6282,7 +6162,7 @@ BattleCommand_Confuse: ; 36d3b ld a, [wAttackMissed] and a jr nz, BattleCommand_Confuse_CheckSnore_Swagger_ConfuseHit -BattleCommand_FinishConfusingTarget: ; 36d70 +BattleCommand_FinishConfusingTarget: ld bc, wEnemyConfuseCount ld a, [hBattleTurn] and a @@ -6325,9 +6205,8 @@ BattleCommand_FinishConfusingTarget: ; 36d70 ld hl, UseConfusionHealingItem jp CallBattleCore -; 36db6 -BattleCommand_Confuse_CheckSnore_Swagger_ConfuseHit: ; 36db6 +BattleCommand_Confuse_CheckSnore_Swagger_ConfuseHit: ld a, BATTLE_VARS_MOVE_EFFECT call GetBattleVar cp EFFECT_CONFUSE_HIT @@ -6338,10 +6217,9 @@ BattleCommand_Confuse_CheckSnore_Swagger_ConfuseHit: ; 36db6 ret z jp PrintDidntAffect2 -; 36dc7 -BattleCommand_Paralyze: ; 36dc7 +BattleCommand_Paralyze: ; paralyze ld a, BATTLE_VARS_STATUS_OPP @@ -6421,10 +6299,9 @@ BattleCommand_Paralyze: ; 36dc7 call AnimateFailedMove jp PrintDoesntAffect -; 36e5b -CheckMoveTypeMatchesTarget: ; 36e5b +CheckMoveTypeMatchesTarget: ; Compare move type to opponent type. ; Return z if matching the opponent type, ; unless the move is Normal (Tri Attack). @@ -6459,23 +6336,21 @@ CheckMoveTypeMatchesTarget: ; 36e5b pop hl ret -; 36e7c INCLUDE "engine/battle/move_effects/substitute.asm" -BattleCommand_RechargeNextTurn: ; 36f0b +BattleCommand_RechargeNextTurn: ; rechargenextturn ld a, BATTLE_VARS_SUBSTATUS4 call GetBattleVarAddr set SUBSTATUS_RECHARGE, [hl] ret -; 36f13 -EndRechargeOpp: ; 36f13 +EndRechargeOpp: push hl ld a, BATTLE_VARS_SUBSTATUS4_OPP call GetBattleVarAddr @@ -6483,13 +6358,12 @@ EndRechargeOpp: ; 36f13 pop hl ret -; 36f1d INCLUDE "engine/battle/move_effects/rage.asm" -BattleCommand_DoubleFlyingDamage: ; 36f25 +BattleCommand_DoubleFlyingDamage: ; doubleflyingdamage ld a, BATTLE_VARS_SUBSTATUS3_OPP call GetBattleVar @@ -6497,10 +6371,9 @@ BattleCommand_DoubleFlyingDamage: ; 36f25 ret z jr DoubleDamage -; 36f2f -BattleCommand_DoubleUndergroundDamage: ; 36f2f +BattleCommand_DoubleUndergroundDamage: ; doubleundergrounddamage ld a, BATTLE_VARS_SUBSTATUS3_OPP call GetBattleVar @@ -6508,10 +6381,9 @@ BattleCommand_DoubleUndergroundDamage: ; 36f2f ret z ; fallthrough -; 36f37 -DoubleDamage: ; 36f37 +DoubleDamage: ld hl, wCurDamage + 1 sla [hl] dec hl @@ -6524,7 +6396,6 @@ DoubleDamage: ; 36f37 .quit ret -; 36f46 INCLUDE "engine/battle/move_effects/mimic.asm" @@ -6540,7 +6411,7 @@ INCLUDE "engine/battle/move_effects/pay_day.asm" INCLUDE "engine/battle/move_effects/conversion.asm" -BattleCommand_ResetStats: ; 3710e +BattleCommand_ResetStats: ; resetstats ld a, 7 ; neutral @@ -6573,10 +6444,9 @@ BattleCommand_ResetStats: ; 3710e jr nz, .next ret -; 3713e -BattleCommand_Heal: ; 3713e +BattleCommand_Heal: ; heal ld de, wBattleMonHP @@ -6658,13 +6528,12 @@ BattleCommand_Heal: ; 3713e ld hl, HPIsFullText jp StdBattleTextBox -; 371cd INCLUDE "engine/battle/move_effects/transform.asm" -BattleSideCopy: ; 372c6 +BattleSideCopy: ; Copy bc bytes from hl to de if it's the player's turn. ; Copy bc bytes from de to hl if it's the enemy's turn. ld a, [hBattleTurn] @@ -6679,17 +6548,15 @@ BattleSideCopy: ; 372c6 .copy jp CopyBytes -; 372d2 -BattleEffect_ButItFailed: ; 372d2 +BattleEffect_ButItFailed: call AnimateFailedMove jp PrintButItFailed -; 372d8 -ClearLastMove: ; 372d8 +ClearLastMove: ld a, BATTLE_VARS_LAST_COUNTER_MOVE call GetBattleVarAddr xor a @@ -6701,10 +6568,9 @@ ClearLastMove: ; 372d8 ld [hl], a ret -; 372e7 -ResetActorDisable: ; 372e7 +ResetActorDisable: ld a, [hBattleTurn] and a jr z, .player @@ -6720,10 +6586,9 @@ ResetActorDisable: ; 372e7 ld [wDisabledMove], a ret -; 372fc -BattleCommand_Screen: ; 372fc +BattleCommand_Screen: ; screen ld hl, wPlayerScreens @@ -6768,87 +6633,76 @@ BattleCommand_Screen: ; 372fc call AnimateFailedMove jp PrintButItFailed -; 3733d -PrintDoesntAffect: ; 3733d +PrintDoesntAffect: ; 'it doesn't affect' ld hl, DoesntAffectText jp StdBattleTextBox -; 37343 -PrintNothingHappened: ; 37343 +PrintNothingHappened: ; 'but nothing happened!' ld hl, NothingHappenedText jp StdBattleTextBox -; 37349 -TryPrintButItFailed: ; 37349 +TryPrintButItFailed: ld a, [wAlreadyFailed] and a ret nz ; fallthrough -; 3734e -PrintButItFailed: ; 3734e +PrintButItFailed: ; 'but it failed!' ld hl, ButItFailedText jp StdBattleTextBox -; 37354 FailMove: call AnimateFailedMove ; fallthrough -; 37357 -FailMimic: ; 37357 +FailMimic: ld hl, ButItFailedText ; 'but it failed!' ld de, ItFailedText ; 'it failed!' jp FailText_CheckOpponentProtect -; 37360 -PrintDidntAffect: ; 37360 +PrintDidntAffect: ; 'it didn't affect' ld hl, DidntAffect1Text jp StdBattleTextBox -; 37366 -PrintDidntAffect2: ; 37366 +PrintDidntAffect2: call AnimateFailedMove ld hl, DidntAffect1Text ; 'it didn't affect' ld de, DidntAffect2Text ; 'it didn't affect' jp FailText_CheckOpponentProtect -; 37372 -PrintParalyze: ; 37372 +PrintParalyze: ; 'paralyzed! maybe it can't attack!' ld hl, ParalyzedText jp StdBattleTextBox -; 37378 -CheckSubstituteOpp: ; 37378 +CheckSubstituteOpp: ld a, BATTLE_VARS_SUBSTATUS4_OPP call GetBattleVar bit SUBSTATUS_SUBSTITUTE, a ret -; 37380 INCLUDE "engine/battle/move_effects/selfdestruct.asm" @@ -6858,7 +6712,7 @@ INCLUDE "engine/battle/move_effects/mirror_move.asm" INCLUDE "engine/battle/move_effects/metronome.asm" -CheckUserMove: ; 37462 +CheckUserMove: ; Return z if the user has move a. ld b, a ld de, wBattleMonMoves @@ -6882,10 +6736,9 @@ CheckUserMove: ; 37462 and a ret -; 3747b -ResetTurn: ; 3747b +ResetTurn: ld hl, wPlayerCharging ld a, [hBattleTurn] and a @@ -6899,13 +6752,12 @@ ResetTurn: ; 3747b call DoMove jp EndMoveEffect -; 37492 INCLUDE "engine/battle/move_effects/thief.asm" -BattleCommand_ArenaTrap: ; 37517 +BattleCommand_ArenaTrap: ; arenatrap ; Doesn't work on an absent opponent. @@ -6931,13 +6783,12 @@ BattleCommand_ArenaTrap: ; 37517 call AnimateFailedMove jp PrintButItFailed -; 37536 INCLUDE "engine/battle/move_effects/nightmare.asm" -BattleCommand_Defrost: ; 37563 +BattleCommand_Defrost: ; defrost ; Thaw the user. @@ -6968,7 +6819,6 @@ BattleCommand_Defrost: ; 37563 ld hl, WasDefrostedText jp StdBattleTextBox -; 37588 INCLUDE "engine/battle/move_effects/curse.asm" @@ -6988,11 +6838,10 @@ INCLUDE "engine/battle/move_effects/sandstorm.asm" INCLUDE "engine/battle/move_effects/rollout.asm" -BattleCommand5d: ; 37791 +BattleCommand5d: ; unused ret -; 37792 INCLUDE "engine/battle/move_effects/fury_cutter.asm" @@ -7008,7 +6857,7 @@ INCLUDE "engine/battle/move_effects/frustration.asm" INCLUDE "engine/battle/move_effects/safeguard.asm" -SafeCheckSafeguard: ; 37962 +SafeCheckSafeguard: push hl ld hl, wEnemyScreens ld a, [hBattleTurn] @@ -7021,10 +6870,9 @@ SafeCheckSafeguard: ; 37962 pop hl ret -; 37972 -BattleCommand_CheckSafeguard: ; 37972 +BattleCommand_CheckSafeguard: ; checksafeguard ld hl, wEnemyScreens ld a, [hBattleTurn] @@ -7041,7 +6889,6 @@ BattleCommand_CheckSafeguard: ; 37972 call StdBattleTextBox jp EndMoveEffect -; 37991 INCLUDE "engine/battle/move_effects/magnitude.asm" @@ -7053,27 +6900,24 @@ INCLUDE "engine/battle/move_effects/pursuit.asm" INCLUDE "engine/battle/move_effects/rapid_spin.asm" -BattleCommand_HealMorn: ; 37b74 +BattleCommand_HealMorn: ; healmorn ld b, MORN_F jr BattleCommand_TimeBasedHealContinue -; 37b78 -BattleCommand_HealDay: ; 37b78 +BattleCommand_HealDay: ; healday ld b, DAY_F jr BattleCommand_TimeBasedHealContinue -; 37b7c -BattleCommand_HealNite: ; 37b7c +BattleCommand_HealNite: ; healnite ld b, NITE_F ; fallthrough -; 37b7e -BattleCommand_TimeBasedHealContinue: ; 37b7e +BattleCommand_TimeBasedHealContinue: ; Time- and weather-sensitive heal. ld hl, wBattleMonMaxHP @@ -7154,7 +6998,6 @@ BattleCommand_TimeBasedHealContinue: ; 37b7e dw GetQuarterMaxHP dw GetHalfMaxHP dw GetMaxHP -; 37be8 INCLUDE "engine/battle/move_effects/hidden_power.asm" @@ -7170,7 +7013,7 @@ INCLUDE "engine/battle/move_effects/psych_up.asm" INCLUDE "engine/battle/move_effects/mirror_coat.asm" -BattleCommand_DoubleMinimizeDamage: ; 37ce6 +BattleCommand_DoubleMinimizeDamage: ; doubleminimizedamage ld hl, wEnemyMinimized @@ -7192,10 +7035,9 @@ BattleCommand_DoubleMinimizeDamage: ; 37ce6 ld [hl], a ret -; 37d02 -BattleCommand_SkipSunCharge: ; 37d02 +BattleCommand_SkipSunCharge: ; mimicsuncharge ld a, [wBattleWeather] cp WEATHER_SUN @@ -7203,7 +7045,6 @@ BattleCommand_SkipSunCharge: ; 37d02 ld b, charge_command jp SkipToBattleCommand -; 37d0d INCLUDE "engine/battle/move_effects/future_sight.asm" @@ -7211,17 +7052,16 @@ INCLUDE "engine/battle/move_effects/future_sight.asm" INCLUDE "engine/battle/move_effects/thunder.asm" -CheckHiddenOpponent: ; 37daa +CheckHiddenOpponent: ; BUG: This routine should account for Lock-On and Mind Reader. ld a, BATTLE_VARS_SUBSTATUS3_OPP call GetBattleVar and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND ret -; 37db2 -GetUserItem: ; 37db2 +GetUserItem: ; Return the effect of the user's item in bc, and its id at hl. ld hl, wBattleMonItem ld a, [hBattleTurn] @@ -7232,10 +7072,9 @@ GetUserItem: ; 37db2 ld b, [hl] jp GetItemHeldEffect -; 37dc1 -GetOpponentItem: ; 37dc1 +GetOpponentItem: ; Return the effect of the opponent's item in bc, and its id at hl. ld hl, wEnemyMonItem ld a, [hBattleTurn] @@ -7246,10 +7085,9 @@ GetOpponentItem: ; 37dc1 ld b, [hl] jp GetItemHeldEffect -; 37dd0 -GetItemHeldEffect: ; 37dd0 +GetItemHeldEffect: ; Return the effect of item b in bc. ld a, b and a @@ -7269,10 +7107,9 @@ GetItemHeldEffect: ; 37dd0 pop hl ret -; 37de9 -AnimateCurrentMoveEitherSide: ; 37de9 +AnimateCurrentMoveEitherSide: push hl push de push bc @@ -7288,10 +7125,9 @@ AnimateCurrentMoveEitherSide: ; 37de9 pop hl ret -; 37e01 -AnimateCurrentMove: ; 37e01 +AnimateCurrentMove: push hl push de push bc @@ -7307,10 +7143,9 @@ AnimateCurrentMove: ; 37e01 pop hl ret -; 37e19 -PlayDamageAnim: ; 37e19 +PlayDamageAnim: xor a ld [wFXAnimID + 1], a @@ -7332,10 +7167,9 @@ PlayDamageAnim: ; 37e19 jp PlayUserBattleAnim -; 37e36 -LoadMoveAnim: ; 37e36 +LoadMoveAnim: xor a ld [wNumHits], a ld [wFXAnimID + 1], a @@ -7346,17 +7180,15 @@ LoadMoveAnim: ; 37e36 ret z ; fallthrough -; 37e44 -LoadAnim: ; 37e44 +LoadAnim: ld [wFXAnimID], a ; fallthrough -; 37e47 -PlayUserBattleAnim: ; 37e47 +PlayUserBattleAnim: push hl push de push bc @@ -7366,10 +7198,9 @@ PlayUserBattleAnim: ; 37e47 pop hl ret -; 37e54 -PlayOpponentBattleAnim: ; 37e54 +PlayOpponentBattleAnim: ld a, e ld [wFXAnimID], a ld a, d @@ -7390,35 +7221,31 @@ PlayOpponentBattleAnim: ; 37e54 pop hl ret -; 37e73 -CallBattleCore: ; 37e73 +CallBattleCore: ld a, BANK("Battle Core") rst FarCall ret -; 37e77 -AnimateFailedMove: ; 37e77 +AnimateFailedMove: call BattleCommand_LowerSub call BattleCommand_MoveDelay jp BattleCommand_RaiseSub -; 37e80 -BattleCommand_MoveDelay: ; 37e80 +BattleCommand_MoveDelay: ; movedelay ; Wait 40 frames. ld c, 40 jp DelayFrames -; 37e85 -BattleCommand_ClearText: ; 37e85 +BattleCommand_ClearText: ; cleartext ; Used in multi-hit moves. @@ -7427,10 +7254,9 @@ BattleCommand_ClearText: ; 37e85 .text db "@" -; 37e8c -SkipToBattleCommand: ; 37e8c +SkipToBattleCommand: ; Skip over commands until reaching command b. ld a, [wBattleScriptBufferAddress + 1] ld h, a @@ -7447,10 +7273,9 @@ SkipToBattleCommand: ; 37e8c ld [wBattleScriptBufferAddress], a ret -; 37ea1 -GetMoveAttr: ; 37ea1 +GetMoveAttr: ; Assuming hl = Moves + x, return attribute x of move a. push bc ld bc, MOVE_LENGTH @@ -7459,10 +7284,9 @@ GetMoveAttr: ; 37ea1 pop bc ret -; 37ead -GetMoveData: ; 37ead +GetMoveData: ; Copy move struct a to de. ld hl, Moves ld bc, MOVE_LENGTH @@ -7470,38 +7294,33 @@ GetMoveData: ; 37ead ld a, BANK(Moves) jp FarCopyBytes -; 37ebb -GetMoveByte: ; 37ebb +GetMoveByte: ld a, BANK(Moves) jp GetFarByte -; 37ec0 -DisappearUser: ; 37ec0 +DisappearUser: farcall _DisappearUser ret -; 37ec7 -AppearUserLowerSub: ; 37ec7 +AppearUserLowerSub: farcall _AppearUserLowerSub ret -; 37ece -AppearUserRaiseSub: ; 37ece +AppearUserRaiseSub: farcall _AppearUserRaiseSub ret -; 37ed5 -_CheckBattleScene: ; 37ed5 +_CheckBattleScene: ; Checks the options. Returns carry if battle animations are disabled. push hl push de @@ -7512,4 +7331,3 @@ _CheckBattleScene: ; 37ed5 pop hl ret -; 37ee2 -- cgit v1.2.3 From 67d1364c7acfd5e8e2256080e16a14cfa59a5abc Mon Sep 17 00:00:00 2001 From: Rangi Date: Sun, 24 Jun 2018 23:22:50 -0400 Subject: Fix triple newlines left over from removing address comments --- engine/battle/effect_commands.asm | 249 -------------------------------------- 1 file changed, 249 deletions(-) (limited to 'engine/battle/effect_commands.asm') diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm index 07e8b3a2a..e19cce189 100644 --- a/engine/battle/effect_commands.asm +++ b/engine/battle/effect_commands.asm @@ -8,7 +8,6 @@ DoPlayerTurn: jr DoTurn - DoEnemyTurn: call SetEnemyTurn @@ -24,7 +23,6 @@ DoEnemyTurn: ; fallthrough - DoTurn: ; Read in and execute the user's move effects for this turn. @@ -40,7 +38,6 @@ DoTurn: call UpdateMoveData - DoMove: ; Get the user's move effect. ld a, BATTLE_VARS_MOVE_EFFECT @@ -113,7 +110,6 @@ DoMove: jp hl - CheckTurn: BattleCommand_CheckTurn: ; checkturn @@ -141,7 +137,6 @@ BattleCommand_CheckTurn: and a jp nz, CheckEnemyTurn - CheckPlayerTurn: ld hl, wPlayerSubStatus4 @@ -156,7 +151,6 @@ CheckPlayerTurn: .no_recharge - ld hl, wBattleMonStatus ld a, [hl] and SLP @@ -202,7 +196,6 @@ CheckPlayerTurn: .not_asleep - ld hl, wBattleMonStatus bit FRZ, [hl] jr z, .not_frozen @@ -222,7 +215,6 @@ CheckPlayerTurn: .not_frozen - ld hl, wPlayerSubStatus3 bit SUBSTATUS_FLINCHED, [hl] jr z, .not_flinched @@ -236,7 +228,6 @@ CheckPlayerTurn: .not_flinched - ld hl, wPlayerDisableCount ld a, [hl] and a @@ -254,7 +245,6 @@ CheckPlayerTurn: .not_disabled - ld a, [wPlayerSubStatus3] add a jr nc, .not_confused @@ -293,7 +283,6 @@ CheckPlayerTurn: .not_confused - ld a, [wPlayerSubStatus1] add a ; bit SUBSTATUS_ATTRACT jr nc, .not_infatuated @@ -317,7 +306,6 @@ CheckPlayerTurn: .not_infatuated - ; We can't disable a move that doesn't exist. ld a, [wDisabledMove] and a @@ -334,7 +322,6 @@ CheckPlayerTurn: .no_disabled_move - ld hl, wBattleMonStatus bit PAR, [hl] ret z @@ -350,7 +337,6 @@ CheckPlayerTurn: jp EndTurn - CantMove: ld a, BATTLE_VARS_SUBSTATUS1 call GetBattleVarAddr @@ -379,7 +365,6 @@ CantMove: - OpponentCantMove: call BattleCommand_SwitchTurn call CantMove @@ -387,7 +372,6 @@ OpponentCantMove: - CheckEnemyTurn: ld hl, wEnemySubStatus4 @@ -402,7 +386,6 @@ CheckEnemyTurn: .no_recharge - ld hl, wEnemyMonStatus ld a, [hl] and SLP @@ -446,7 +429,6 @@ CheckEnemyTurn: .not_asleep - ld hl, wEnemyMonStatus bit FRZ, [hl] jr z, .not_frozen @@ -465,7 +447,6 @@ CheckEnemyTurn: .not_frozen - ld hl, wEnemySubStatus3 bit SUBSTATUS_FLINCHED, [hl] jr z, .not_flinched @@ -479,7 +460,6 @@ CheckEnemyTurn: .not_flinched - ld hl, wEnemyDisableCount ld a, [hl] and a @@ -498,7 +478,6 @@ CheckEnemyTurn: .not_disabled - ld a, [wEnemySubStatus3] add a ; bit SUBSTATUS_CONFUSED jr nc, .not_confused @@ -513,7 +492,6 @@ CheckEnemyTurn: call StdBattleTextBox jr .not_confused - .confused ld hl, IsConfusedText call StdBattleTextBox @@ -557,7 +535,6 @@ CheckEnemyTurn: .not_confused - ld a, [wEnemySubStatus1] add a ; bit SUBSTATUS_ATTRACT jr nc, .not_infatuated @@ -581,7 +558,6 @@ CheckEnemyTurn: .not_infatuated - ; We can't disable a move that doesn't exist. ld a, [wEnemyDisabledMove] and a @@ -599,7 +575,6 @@ CheckEnemyTurn: .no_disabled_move - ld hl, wEnemyMonStatus bit PAR, [hl] ret z @@ -615,14 +590,12 @@ CheckEnemyTurn: ; fallthrough - EndTurn: ld a, $1 ld [wTurnEnded], a jp ResetDamage - MoveDisabled: ; Make sure any charged moves fail @@ -639,7 +612,6 @@ MoveDisabled: jp StdBattleTextBox - HitConfusion: ld hl, HurtItselfText @@ -671,7 +643,6 @@ HitConfusion: jp BattleCommand_RaiseSub - BattleCommand_CheckObedience: ; checkobedience @@ -714,7 +685,6 @@ BattleCommand_CheckObedience: cp [hl] ret z - .obeylevel ; The maximum obedience level is constrained by owned badges: ld hl, wJohtoBadges @@ -742,7 +712,6 @@ BattleCommand_CheckObedience: ; no badges ld a, 10 - .getlevel ; c = obedience level ; d = monster level @@ -761,14 +730,12 @@ BattleCommand_CheckObedience: jr nc, .checklevel ld b, $ff - .checklevel ; If the monster's level is lower than the obedience level, it will obey. ld a, c cp d ret nc - ; Random number from 0 to obedience level + monster level .rand1 call BattleRandom @@ -786,7 +753,6 @@ BattleCommand_CheckObedience: call IgnoreSleepOnly ret c - ; Another random number from 0 to obedience level + monster level .rand2 call BattleRandom @@ -797,7 +763,6 @@ BattleCommand_CheckObedience: cp c jr c, .UseInstead - ; No hope of using a move now. ; b = number of levels the monster is above the obedience level @@ -820,7 +785,6 @@ BattleCommand_CheckObedience: call HitConfusion jp .EndDisobedience - .Nap: call BattleRandom add a @@ -833,7 +797,6 @@ BattleCommand_CheckObedience: ld hl, BeganToNapText jr .Print - .DoNothing: ; 4 random choices call BattleRandom @@ -857,7 +820,6 @@ BattleCommand_CheckObedience: call StdBattleTextBox jp .EndDisobedience - .UseInstead: ; Can't use another move if the monster only has one! @@ -870,7 +832,6 @@ BattleCommand_CheckObedience: and a jr nz, .DoNothing - ld hl, wBattleMonPP ld de, wBattleMonMoves ld b, 0 @@ -891,7 +852,6 @@ BattleCommand_CheckObedience: and a jr nz, .GetTotalPP - .CheckMovePP: ld hl, wBattleMonPP ld a, [wCurMoveNum] @@ -905,7 +865,6 @@ BattleCommand_CheckObedience: cp b jr z, .DoNothing - ; Make sure we can actually use the move once we get there. ld a, 1 ld [wAlreadyDisobeyed], a @@ -918,7 +877,6 @@ BattleCommand_CheckObedience: ld c, a push af - .RandomMove: call BattleRandom maskbits NUM_MOVES @@ -940,7 +898,6 @@ BattleCommand_CheckObedience: and PP_MASK jr z, .RandomMove - ; Use it. ld a, [wCurMoveNum] ld c, a @@ -954,12 +911,10 @@ BattleCommand_CheckObedience: call UpdateMoveData call DoMove - ; Restore original move choice. pop af ld [wCurMoveNum], a - .EndDisobedience: xor a ld [wLastPlayerMove], a @@ -974,7 +929,6 @@ BattleCommand_CheckObedience: jp EndMoveEffect - IgnoreSleepOnly: ld a, BATTLE_VARS_MOVE_ANIM @@ -1004,14 +958,12 @@ IgnoreSleepOnly: ret - BattleCommand_UsedMoveText: ; usedmovetext farcall DisplayUsedMoveText ret - CheckUserIsCharging: ld a, [hBattleTurn] @@ -1024,7 +976,6 @@ CheckUserIsCharging: ret - BattleCommand_DoTurn: call CheckUserIsCharging ret nz @@ -1150,7 +1101,6 @@ BattleCommand_DoTurn: ld b, 1 ret - .continuousmoves db EFFECT_RAZOR_WIND db EFFECT_SKY_ATTACK @@ -1193,7 +1143,6 @@ CheckMimicUsed: ret - BattleCommand_Critical: ; critical @@ -1286,10 +1235,8 @@ BattleCommand_Critical: INCLUDE "data/battle/critical_hits.asm" - INCLUDE "engine/battle/move_effects/triple_kick.asm" - BattleCommand_Stab: ; STAB = Same Type Attack Bonus ld a, BATTLE_VARS_MOVE_ANIM @@ -1475,7 +1422,6 @@ BattleCommand_Stab: ret - BattleCheckTypeMatchup: ld hl, wEnemyMonType1 ld a, [hBattleTurn] @@ -1556,7 +1502,6 @@ CheckTypeMatchup: ret - BattleCommand_ResetTypeMatchup: ; Reset the type matchup multiplier to 1.0, if the type matchup is not 0. ; If there is immunity in play, the move automatically misses. @@ -1577,12 +1522,10 @@ BattleCommand_ResetTypeMatchup: ret - INCLUDE "engine/battle/ai/switch.asm" INCLUDE "data/types/type_matchups.asm" - BattleCommand_DamageVariation: ; damagevariation @@ -1592,7 +1535,6 @@ BattleCommand_DamageVariation: ; is not consistent. This makes the highest damage multipliers ; rarer than normal. - ; No point in reducing 1 or 0 damage. ld hl, wCurDamage ld a, [hli] @@ -1637,7 +1579,6 @@ BattleCommand_DamageVariation: ret - BattleCommand_CheckHit: ; checkhit @@ -1706,7 +1647,6 @@ BattleCommand_CheckHit: .Hit: ret - .Miss: ; Keep the damage value intact if we're using (Hi) Jump Kick. ld a, BATTLE_VARS_MOVE_EFFECT @@ -1720,7 +1660,6 @@ BattleCommand_CheckHit: ld [wAttackMissed], a ret - .DreamEater: ; Return z if we're trying to eat the dream of ; a monster that isn't sleeping. @@ -1734,7 +1673,6 @@ BattleCommand_CheckHit: and SLP ret - .Protect: ; Return nz if the opponent is protected. ld a, BATTLE_VARS_SUBSTATUS1_OPP @@ -1756,7 +1694,6 @@ BattleCommand_CheckHit: and a ret - .LockOn: ; Return nz if we are locked-on and aren't trying to use Earthquake, ; Fissure or Magnitude on a monster that is flying. @@ -1786,7 +1723,6 @@ BattleCommand_CheckHit: and a ret - .DrainSub: ; Return z if using an HP drain move on a substitute. call CheckSubstituteOpp @@ -1805,7 +1741,6 @@ BattleCommand_CheckHit: and a ret - .FlyDigMoves: ; Check for moves that can hit underground/flying opponents. ; Return z if the current move can hit the opponent. @@ -1841,7 +1776,6 @@ BattleCommand_CheckHit: cp MAGNITUDE ret - .ThunderRain: ; Return z if the current move always hits in rain, and it is raining. ld a, BATTLE_VARS_MOVE_EFFECT @@ -1853,14 +1787,12 @@ BattleCommand_CheckHit: cp WEATHER_RAIN ret - .XAccuracy: ld a, BATTLE_VARS_SUBSTATUS4 call GetBattleVar bit SUBSTATUS_X_ACCURACY, a ret - .StatModifiers: ld a, [hBattleTurn] @@ -1955,7 +1887,6 @@ BattleCommand_CheckHit: INCLUDE "data/battle/accuracy_multipliers.asm" - BattleCommand_EffectChance: ; effectchance @@ -1984,7 +1915,6 @@ BattleCommand_EffectChance: ret - BattleCommand_LowerSub: ; lowersub @@ -2054,7 +1984,6 @@ BattleCommand_LowerSub: ret - BattleCommand_MoveAnim: ; moveanim call BattleCommand_LowerSub @@ -2062,7 +1991,6 @@ BattleCommand_MoveAnim: jp BattleCommand_RaiseSub - BattleCommand_MoveAnimNoSub: ld a, [wAttackMissed] and a @@ -2128,7 +2056,6 @@ BattleCommand_MoveAnimNoSub: jp PlayFXAnimID - BattleCommand_StatUpAnim: ld a, [wAttackMissed] and a @@ -2138,7 +2065,6 @@ BattleCommand_StatUpAnim: jr BattleCommand_StatUpDownAnim - BattleCommand_StatDownAnim: ld a, [wAttackMissed] and a @@ -2152,7 +2078,6 @@ BattleCommand_StatDownAnim: ; fallthrough - BattleCommand_StatUpDownAnim: ld [wNumHits], a xor a @@ -2164,7 +2089,6 @@ BattleCommand_StatUpDownAnim: jp PlayFXAnimID - BattleCommand_SwitchTurn: ; switchturn @@ -2174,7 +2098,6 @@ BattleCommand_SwitchTurn: ret - BattleCommand_RaiseSub: ; raisesub @@ -2195,7 +2118,6 @@ BattleCommand_RaiseSub: jp LoadAnim - BattleCommand_FailureText: ; failuretext ; If the move missed or failed, load the appropriate @@ -2239,7 +2161,6 @@ BattleCommand_FailureText: jp EndMoveEffect - BattleCommand_ApplyDamage: ; applydamage @@ -2333,7 +2254,6 @@ BattleCommand_ApplyDamage: ret - GetFailureResultText: ld hl, DoesntAffectText ld de, DoesntAffectText @@ -2403,7 +2323,6 @@ FailText_CheckOpponentProtect: jp StdBattleTextBox - BattleCommand_BideFailText: ld a, [wAttackMissed] and a @@ -2415,7 +2334,6 @@ BattleCommand_BideFailText: jp PrintButItFailed - BattleCommand_CriticalText: ; criticaltext ; Prints the message for critical hits or one-hit KOs. @@ -2447,7 +2365,6 @@ BattleCommand_CriticalText: dw CriticalHitText dw OneHitKOText - BattleCommand_StartLoop: ; startloop @@ -2462,7 +2379,6 @@ BattleCommand_StartLoop: ret - BattleCommand_SuperEffectiveLoopText: ; supereffectivelooptext @@ -2473,7 +2389,6 @@ BattleCommand_SuperEffectiveLoopText: ; fallthrough - BattleCommand_SuperEffectiveText: ; supereffectivetext @@ -2488,7 +2403,6 @@ BattleCommand_SuperEffectiveText: jp StdBattleTextBox - BattleCommand_CheckDestinyBond: ; checkdestinybond @@ -2577,7 +2491,6 @@ BattleCommand_CheckDestinyBond: jp EndMoveEffect - BattleCommand_BuildOpponentRage: ; buildopponentrage @@ -2610,7 +2523,6 @@ BattleCommand_BuildOpponentRage: jp BattleCommand_SwitchTurn - BattleCommand_RageDamage: ; ragedamage @@ -2640,7 +2552,6 @@ BattleCommand_RageDamage: ret - EndMoveEffect: ld a, [wBattleScriptBufferAddress] ld l, a @@ -2653,7 +2564,6 @@ EndMoveEffect: ret - DittoMetalPowder: ld a, MON_SPECIES call BattlePartyAttr @@ -2691,7 +2601,6 @@ DittoMetalPowder: ret - BattleCommand_DamageStats: ; damagestats @@ -2701,7 +2610,6 @@ BattleCommand_DamageStats: ; fallthrough - PlayerAttackDamage: ; Return move power d, player level e, enemy defense c and player attack b. @@ -2785,7 +2693,6 @@ PlayerAttackDamage: ret - TruncateHL_BC: .loop ; Truncate 16-bit values hl and bc to 8-bit values b and c respectively. @@ -2832,7 +2739,6 @@ TruncateHL_BC: ret - GetDamageStatsCritical: ; Return carry if non-critical. @@ -2843,7 +2749,6 @@ GetDamageStatsCritical: ; fallthrough - GetDamageStats: ; Return the attacker's offensive stat and the defender's defensive ; stat based on whether the attacking type is physical or special. @@ -2885,7 +2790,6 @@ GetDamageStats: ret - ThickClubBoost: ; Return in hl the stat value at hl. @@ -2902,7 +2806,6 @@ ThickClubBoost: ret - LightBallBoost: ; Return in hl the stat value at hl. @@ -2919,7 +2822,6 @@ LightBallBoost: ret - SpeciesItemBoost: ; Return in hl the stat value at hl. @@ -2961,7 +2863,6 @@ SpeciesItemBoost: ret - EnemyAttackDamage: call ResetDamage @@ -3041,10 +2942,8 @@ EnemyAttackDamage: ret - INCLUDE "engine/battle/move_effects/beat_up.asm" - BattleCommand_ClearMissDamage: ; clearmissdamage ld a, [wAttackMissed] @@ -3054,7 +2953,6 @@ BattleCommand_ClearMissDamage: jp ResetDamage - HitSelfInConfusion: call ResetDamage ld a, [hBattleTurn] @@ -3092,7 +2990,6 @@ HitSelfInConfusion: ret - BattleCommand_DamageCalc: ; damagecalc @@ -3221,7 +3118,6 @@ BattleCommand_DamageCalc: ; Critical hits call .CriticalMultiplier - ; Update wCurDamage (capped at 997). ld hl, wCurDamage ld b, [hl] @@ -3286,7 +3182,6 @@ BattleCommand_DamageCalc: ld a, LOW(MAX_STAT_VALUE - MIN_NEUTRAL_DAMAGE) ld [hld], a - .dont_cap_3 ; Minimum neutral damage is 2 (bringing the cap to 999). inc hl @@ -3301,7 +3196,6 @@ BattleCommand_DamageCalc: and a ret - .CriticalMultiplier: ld a, [wCriticalHit] and a @@ -3326,10 +3220,8 @@ BattleCommand_DamageCalc: ret - INCLUDE "data/types/type_boost_items.asm" - BattleCommand_ConstantDamage: ; constantdamage @@ -3490,7 +3382,6 @@ BattleCommand_ConstantDamage: INCLUDE "data/moves/flail_reversal_power.asm" - INCLUDE "engine/battle/move_effects/counter.asm" INCLUDE "engine/battle/move_effects/encore.asm" @@ -3505,7 +3396,6 @@ INCLUDE "engine/battle/move_effects/lock_on.asm" INCLUDE "engine/battle/move_effects/sketch.asm" - BattleCommand_DefrostOpponent: ; defrostopponent ; Thaw the opponent if frozen, and @@ -3533,7 +3423,6 @@ BattleCommand_DefrostOpponent: ret - INCLUDE "engine/battle/move_effects/sleep_talk.asm" INCLUDE "engine/battle/move_effects/destiny_bond.asm" @@ -3544,7 +3433,6 @@ INCLUDE "engine/battle/move_effects/false_swipe.asm" INCLUDE "engine/battle/move_effects/heal_bell.asm" - FarPlayBattleAnimation: ; play animation de @@ -3567,7 +3455,6 @@ PlayFXAnimID: ret - DoEnemyDamage: ld hl, wCurDamage ld a, [hli] @@ -3629,7 +3516,6 @@ DoEnemyDamage: jp RefreshBattleHuds - DoPlayerDamage: ld hl, wCurDamage ld a, [hli] @@ -3691,7 +3577,6 @@ DoPlayerDamage: jp RefreshBattleHuds - DoSubstituteDamage: ld hl, SubTookDamageText call StdBattleTextBox @@ -3750,7 +3635,6 @@ DoSubstituteDamage: jp ResetDamage - UpdateMoveData: ld a, BATTLE_VARS_MOVE_ANIM @@ -3769,7 +3653,6 @@ UpdateMoveData: jp CopyName1 - BattleCommand_SleepTarget: ; sleeptarget @@ -3842,7 +3725,6 @@ BattleCommand_SleepTarget: jp StdBattleTextBox - .CheckAIRandomFail: ; Enemy turn ld a, [hBattleTurn] @@ -3872,7 +3754,6 @@ BattleCommand_SleepTarget: ret - BattleCommand_PoisonTarget: ; poisontarget @@ -3909,7 +3790,6 @@ BattleCommand_PoisonTarget: ret - BattleCommand_Poison: ; poison @@ -3999,14 +3879,12 @@ BattleCommand_Poison: jp StdBattleTextBox - .apply_poison call AnimateCurrentMove call PoisonOpponent jp RefreshBattleHuds - .check_toxic ld a, BATTLE_VARS_SUBSTATUS5_OPP call GetBattleVarAddr @@ -4022,7 +3900,6 @@ BattleCommand_Poison: ret - CheckIfTargetIsPoisonType: ld de, wEnemyMonType1 ld a, [hBattleTurn] @@ -4039,7 +3916,6 @@ CheckIfTargetIsPoisonType: ret - PoisonOpponent: ld a, BATTLE_VARS_STATUS_OPP call GetBattleVarAddr @@ -4047,7 +3923,6 @@ PoisonOpponent: jp UpdateOpponentInParty - BattleCommand_DrainTarget: ; draintarget call SapHealth @@ -4055,7 +3930,6 @@ BattleCommand_DrainTarget: jp StdBattleTextBox - BattleCommand_EatDream: ; eatdream call SapHealth @@ -4063,7 +3937,6 @@ BattleCommand_EatDream: jp StdBattleTextBox - SapHealth: ; Divide damage by 2, store it in hDividend ld hl, wCurDamage @@ -4158,7 +4031,6 @@ SapHealth: jp UpdateBattleMonInParty - BattleCommand_BurnTarget: ; burntarget @@ -4201,7 +4073,6 @@ BattleCommand_BurnTarget: ret - Defrost: ld a, [hl] and 1 << FRZ @@ -4228,7 +4099,6 @@ Defrost: jp StdBattleTextBox - BattleCommand_FreezeTarget: ; freezetarget @@ -4283,7 +4153,6 @@ BattleCommand_FreezeTarget: ret - BattleCommand_ParalyzeTarget: ; paralyzetarget @@ -4321,7 +4190,6 @@ BattleCommand_ParalyzeTarget: jp CallBattleCore - BattleCommand_AttackUp: ; attackup ld b, ATTACK @@ -4401,7 +4269,6 @@ BattleCommand_StatUp: jp StatUpAnimation - CheckIfStatCanBeRaised: ld a, b ld [wLoweredStat], a @@ -4482,13 +4349,11 @@ CheckIfStatCanBeRaised: ret - .stats_already_max pop hl dec [hl] ; fallthrough - .cant_raise_stat ld a, $2 ld [wFailedMessage], a @@ -4497,14 +4362,12 @@ CheckIfStatCanBeRaised: ret - .stat_raise_failed ld a, $1 ld [wFailedMessage], a ret - StatUpAnimation: ld bc, wPlayerMinimized ld hl, DropPlayerSub @@ -4531,7 +4394,6 @@ StatUpAnimation: jp BattleCommand_MoveDelay - BattleCommand_AttackDown: ; attackdown ld a, ATTACK @@ -4725,7 +4587,6 @@ BattleCommand_StatDown: ret - CheckMist: ld a, BATTLE_VARS_MOVE_EFFECT call GetBattleVar @@ -4752,7 +4613,6 @@ CheckMist: ret - BattleCommand_StatUpMessage: ld a, [wFailedMessage] and a @@ -4784,7 +4644,6 @@ BattleCommand_StatUpMessage: db "@" - BattleCommand_StatDownMessage: ld a, [wFailedMessage] and a @@ -4815,7 +4674,6 @@ BattleCommand_StatDownMessage: db "@" - TryLowerStat: ; Lower stat c from stat struct hl (buffer de). @@ -4860,7 +4718,6 @@ TryLowerStat: ret - BattleCommand_StatUpFailText: ; statupfailtext ld a, [wFailedMessage] @@ -4880,7 +4737,6 @@ BattleCommand_StatUpFailText: jp StdBattleTextBox - BattleCommand_StatDownFailText: ; statdownfailtext ld a, [wFailedMessage] @@ -4903,7 +4759,6 @@ BattleCommand_StatDownFailText: jp StdBattleTextBox - GetStatName: ld hl, StatNames ld c, "@" @@ -4923,10 +4778,8 @@ GetStatName: INCLUDE "data/battle/stat_names.asm" - INCLUDE "data/battle/stat_multipliers.asm" - BattleCommand_AllStatsUp: ; allstatsup @@ -4955,14 +4808,12 @@ BattleCommand_AllStatsUp: call BattleCommand_SpecialDefenseUp jp BattleCommand_StatUpMessage - ResetMiss: xor a ld [wAttackMissed], a ret - LowerStat: ld [wLoweredStat], a @@ -5035,7 +4886,6 @@ LowerStat: ret - BattleCommand_TriStatusChance: ; tristatuschance @@ -5057,7 +4907,6 @@ BattleCommand_TriStatusChance: dw BattleCommand_FreezeTarget ; freeze dw BattleCommand_BurnTarget ; burn - BattleCommand_Curl: ; curl ld a, BATTLE_VARS_SUBSTATUS2 @@ -5066,7 +4915,6 @@ BattleCommand_Curl: ret - BattleCommand_RaiseSubNoAnim: ld hl, GetBattleMonBackpic ld a, [hBattleTurn] @@ -5080,7 +4928,6 @@ BattleCommand_RaiseSubNoAnim: jp WaitBGMap - BattleCommand_LowerSubNoAnim: ld hl, DropPlayerSub ld a, [hBattleTurn] @@ -5094,7 +4941,6 @@ BattleCommand_LowerSubNoAnim: jp WaitBGMap - CalcPlayerStats: ld hl, wPlayerAtkLevel ld de, wPlayerStats @@ -5117,7 +4963,6 @@ CalcPlayerStats: jp BattleCommand_SwitchTurn - CalcEnemyStats: ld hl, wEnemyAtkLevel ld de, wEnemyStats @@ -5137,7 +4982,6 @@ CalcEnemyStats: jp BattleCommand_SwitchTurn - CalcStats: .loop push af @@ -5208,10 +5052,8 @@ CalcStats: ret - INCLUDE "engine/battle/move_effects/bide.asm" - BattleCommand_CheckRampage: ; checkrampage @@ -5250,7 +5092,6 @@ BattleCommand_CheckRampage: jp SkipToBattleCommand - BattleCommand_Rampage: ; rampage @@ -5279,10 +5120,8 @@ BattleCommand_Rampage: ret - INCLUDE "engine/battle/move_effects/teleport.asm" - SetBattleDraw: ld a, [wBattleResult] and BATTLERESULT_BITMASK @@ -5291,7 +5130,6 @@ SetBattleDraw: ret - BattleCommand_ForceSwitch: ; forceswitch @@ -5512,7 +5350,6 @@ BattleCommand_ForceSwitch: jp StdBattleTextBox - CheckPlayerHasMonToSwitchTo: ld a, [wPartyCount] ld d, a @@ -5543,7 +5380,6 @@ CheckPlayerHasMonToSwitchTo: ret - BattleCommand_EndLoop: ; endloop @@ -5679,7 +5515,6 @@ BattleCommand_EndLoop: ret - BattleCommand_FakeOut: ld a, [wAttackMissed] and a @@ -5702,7 +5537,6 @@ BattleCommand_FakeOut: ret - BattleCommand_FlinchTarget: call CheckSubstituteOpp ret nz @@ -5721,7 +5555,6 @@ BattleCommand_FlinchTarget: ; fallthrough - FlinchTarget: ld a, BATTLE_VARS_SUBSTATUS3_OPP call GetBattleVarAddr @@ -5729,7 +5562,6 @@ FlinchTarget: jp EndRechargeOpp - CheckOpponentWentFirst: ; Returns a=0, z if user went first ; Returns a=1, nz if opponent went first @@ -5742,7 +5574,6 @@ CheckOpponentWentFirst: ret - BattleCommand_HeldFlinch: ; kingsrock @@ -5772,7 +5603,6 @@ BattleCommand_HeldFlinch: ret - BattleCommand_OHKO: ; ohko @@ -5820,7 +5650,6 @@ BattleCommand_OHKO: ret - BattleCommand_CheckCharge: ; checkcharge @@ -5835,7 +5664,6 @@ BattleCommand_CheckCharge: jp SkipToBattleCommand - BattleCommand_Charge: ; charge @@ -5977,13 +5805,11 @@ BattleCommand_Charge: text_jump UnknownText_0x1c0d6c db "@" - BattleCommand3c: ; unused ret - BattleCommand_TrapTarget: ; traptarget @@ -6040,12 +5866,10 @@ BattleCommand_TrapTarget: dbw CLAMP, ClampedByText ; 'was CLAMPED by' dbw WHIRLPOOL, WhirlpoolTrapText ; 'was trapped!' - INCLUDE "engine/battle/move_effects/mist.asm" INCLUDE "engine/battle/move_effects/focus_energy.asm" - BattleCommand_Recoil: ; recoil @@ -6111,7 +5935,6 @@ BattleCommand_Recoil: jp StdBattleTextBox - BattleCommand_ConfuseTarget: ; confusetarget @@ -6132,7 +5955,6 @@ BattleCommand_ConfuseTarget: ret nz jr BattleCommand_FinishConfusingTarget - BattleCommand_Confuse: ; confuse @@ -6205,7 +6027,6 @@ BattleCommand_FinishConfusingTarget: ld hl, UseConfusionHealingItem jp CallBattleCore - BattleCommand_Confuse_CheckSnore_Swagger_ConfuseHit: ld a, BATTLE_VARS_MOVE_EFFECT call GetBattleVar @@ -6218,7 +6039,6 @@ BattleCommand_Confuse_CheckSnore_Swagger_ConfuseHit: jp PrintDidntAffect2 - BattleCommand_Paralyze: ; paralyze @@ -6300,7 +6120,6 @@ BattleCommand_Paralyze: jp PrintDoesntAffect - CheckMoveTypeMatchesTarget: ; Compare move type to opponent type. ; Return z if matching the opponent type, @@ -6337,10 +6156,8 @@ CheckMoveTypeMatchesTarget: ret - INCLUDE "engine/battle/move_effects/substitute.asm" - BattleCommand_RechargeNextTurn: ; rechargenextturn ld a, BATTLE_VARS_SUBSTATUS4 @@ -6349,7 +6166,6 @@ BattleCommand_RechargeNextTurn: ret - EndRechargeOpp: push hl ld a, BATTLE_VARS_SUBSTATUS4_OPP @@ -6359,10 +6175,8 @@ EndRechargeOpp: ret - INCLUDE "engine/battle/move_effects/rage.asm" - BattleCommand_DoubleFlyingDamage: ; doubleflyingdamage ld a, BATTLE_VARS_SUBSTATUS3_OPP @@ -6372,7 +6186,6 @@ BattleCommand_DoubleFlyingDamage: jr DoubleDamage - BattleCommand_DoubleUndergroundDamage: ; doubleundergrounddamage ld a, BATTLE_VARS_SUBSTATUS3_OPP @@ -6382,7 +6195,6 @@ BattleCommand_DoubleUndergroundDamage: ; fallthrough - DoubleDamage: ld hl, wCurDamage + 1 sla [hl] @@ -6397,7 +6209,6 @@ DoubleDamage: ret - INCLUDE "engine/battle/move_effects/mimic.asm" INCLUDE "engine/battle/move_effects/leech_seed.asm" @@ -6410,7 +6221,6 @@ INCLUDE "engine/battle/move_effects/pay_day.asm" INCLUDE "engine/battle/move_effects/conversion.asm" - BattleCommand_ResetStats: ; resetstats @@ -6445,7 +6255,6 @@ BattleCommand_ResetStats: ret - BattleCommand_Heal: ; heal @@ -6529,10 +6338,8 @@ BattleCommand_Heal: jp StdBattleTextBox - INCLUDE "engine/battle/move_effects/transform.asm" - BattleSideCopy: ; Copy bc bytes from hl to de if it's the player's turn. ; Copy bc bytes from de to hl if it's the enemy's turn. @@ -6549,13 +6356,11 @@ BattleSideCopy: jp CopyBytes - BattleEffect_ButItFailed: call AnimateFailedMove jp PrintButItFailed - ClearLastMove: ld a, BATTLE_VARS_LAST_COUNTER_MOVE call GetBattleVarAddr @@ -6569,7 +6374,6 @@ ClearLastMove: ret - ResetActorDisable: ld a, [hBattleTurn] and a @@ -6587,7 +6391,6 @@ ResetActorDisable: ret - BattleCommand_Screen: ; screen @@ -6634,21 +6437,18 @@ BattleCommand_Screen: jp PrintButItFailed - PrintDoesntAffect: ; 'it doesn't affect' ld hl, DoesntAffectText jp StdBattleTextBox - PrintNothingHappened: ; 'but nothing happened!' ld hl, NothingHappenedText jp StdBattleTextBox - TryPrintButItFailed: ld a, [wAlreadyFailed] and a @@ -6656,14 +6456,12 @@ TryPrintButItFailed: ; fallthrough - PrintButItFailed: ; 'but it failed!' ld hl, ButItFailedText jp StdBattleTextBox - FailMove: call AnimateFailedMove ; fallthrough @@ -6674,14 +6472,12 @@ FailMimic: jp FailText_CheckOpponentProtect - PrintDidntAffect: ; 'it didn't affect' ld hl, DidntAffect1Text jp StdBattleTextBox - PrintDidntAffect2: call AnimateFailedMove ld hl, DidntAffect1Text ; 'it didn't affect' @@ -6689,14 +6485,12 @@ PrintDidntAffect2: jp FailText_CheckOpponentProtect - PrintParalyze: ; 'paralyzed! maybe it can't attack!' ld hl, ParalyzedText jp StdBattleTextBox - CheckSubstituteOpp: ld a, BATTLE_VARS_SUBSTATUS4_OPP call GetBattleVar @@ -6704,14 +6498,12 @@ CheckSubstituteOpp: ret - INCLUDE "engine/battle/move_effects/selfdestruct.asm" INCLUDE "engine/battle/move_effects/mirror_move.asm" INCLUDE "engine/battle/move_effects/metronome.asm" - CheckUserMove: ; Return z if the user has move a. ld b, a @@ -6737,7 +6529,6 @@ CheckUserMove: ret - ResetTurn: ld hl, wPlayerCharging ld a, [hBattleTurn] @@ -6753,10 +6544,8 @@ ResetTurn: jp EndMoveEffect - INCLUDE "engine/battle/move_effects/thief.asm" - BattleCommand_ArenaTrap: ; arenatrap @@ -6784,10 +6573,8 @@ BattleCommand_ArenaTrap: jp PrintButItFailed - INCLUDE "engine/battle/move_effects/nightmare.asm" - BattleCommand_Defrost: ; defrost @@ -6820,7 +6607,6 @@ BattleCommand_Defrost: jp StdBattleTextBox - INCLUDE "engine/battle/move_effects/curse.asm" INCLUDE "engine/battle/move_effects/protect.asm" @@ -6837,13 +6623,11 @@ INCLUDE "engine/battle/move_effects/sandstorm.asm" INCLUDE "engine/battle/move_effects/rollout.asm" - BattleCommand5d: ; unused ret - INCLUDE "engine/battle/move_effects/fury_cutter.asm" INCLUDE "engine/battle/move_effects/attract.asm" @@ -6856,7 +6640,6 @@ INCLUDE "engine/battle/move_effects/frustration.asm" INCLUDE "engine/battle/move_effects/safeguard.asm" - SafeCheckSafeguard: push hl ld hl, wEnemyScreens @@ -6871,7 +6654,6 @@ SafeCheckSafeguard: ret - BattleCommand_CheckSafeguard: ; checksafeguard ld hl, wEnemyScreens @@ -6890,7 +6672,6 @@ BattleCommand_CheckSafeguard: jp EndMoveEffect - INCLUDE "engine/battle/move_effects/magnitude.asm" INCLUDE "engine/battle/move_effects/baton_pass.asm" @@ -6899,19 +6680,16 @@ INCLUDE "engine/battle/move_effects/pursuit.asm" INCLUDE "engine/battle/move_effects/rapid_spin.asm" - BattleCommand_HealMorn: ; healmorn ld b, MORN_F jr BattleCommand_TimeBasedHealContinue - BattleCommand_HealDay: ; healday ld b, DAY_F jr BattleCommand_TimeBasedHealContinue - BattleCommand_HealNite: ; healnite ld b, NITE_F @@ -6999,7 +6777,6 @@ BattleCommand_TimeBasedHealContinue: dw GetHalfMaxHP dw GetMaxHP - INCLUDE "engine/battle/move_effects/hidden_power.asm" INCLUDE "engine/battle/move_effects/rain_dance.asm" @@ -7012,7 +6789,6 @@ INCLUDE "engine/battle/move_effects/psych_up.asm" INCLUDE "engine/battle/move_effects/mirror_coat.asm" - BattleCommand_DoubleMinimizeDamage: ; doubleminimizedamage @@ -7036,7 +6812,6 @@ BattleCommand_DoubleMinimizeDamage: ret - BattleCommand_SkipSunCharge: ; mimicsuncharge ld a, [wBattleWeather] @@ -7046,12 +6821,10 @@ BattleCommand_SkipSunCharge: jp SkipToBattleCommand - INCLUDE "engine/battle/move_effects/future_sight.asm" INCLUDE "engine/battle/move_effects/thunder.asm" - CheckHiddenOpponent: ; BUG: This routine should account for Lock-On and Mind Reader. ld a, BATTLE_VARS_SUBSTATUS3_OPP @@ -7060,7 +6833,6 @@ CheckHiddenOpponent: ret - GetUserItem: ; Return the effect of the user's item in bc, and its id at hl. ld hl, wBattleMonItem @@ -7073,7 +6845,6 @@ GetUserItem: jp GetItemHeldEffect - GetOpponentItem: ; Return the effect of the opponent's item in bc, and its id at hl. ld hl, wEnemyMonItem @@ -7086,7 +6857,6 @@ GetOpponentItem: jp GetItemHeldEffect - GetItemHeldEffect: ; Return the effect of item b in bc. ld a, b @@ -7108,7 +6878,6 @@ GetItemHeldEffect: ret - AnimateCurrentMoveEitherSide: push hl push de @@ -7126,7 +6895,6 @@ AnimateCurrentMoveEitherSide: ret - AnimateCurrentMove: push hl push de @@ -7144,7 +6912,6 @@ AnimateCurrentMove: ret - PlayDamageAnim: xor a ld [wFXAnimID + 1], a @@ -7168,7 +6935,6 @@ PlayDamageAnim: jp PlayUserBattleAnim - LoadMoveAnim: xor a ld [wNumHits], a @@ -7181,13 +6947,11 @@ LoadMoveAnim: ; fallthrough - LoadAnim: ld [wFXAnimID], a ; fallthrough - PlayUserBattleAnim: push hl push de @@ -7199,7 +6963,6 @@ PlayUserBattleAnim: ret - PlayOpponentBattleAnim: ld a, e ld [wFXAnimID], a @@ -7222,21 +6985,18 @@ PlayOpponentBattleAnim: ret - CallBattleCore: ld a, BANK("Battle Core") rst FarCall ret - AnimateFailedMove: call BattleCommand_LowerSub call BattleCommand_MoveDelay jp BattleCommand_RaiseSub - BattleCommand_MoveDelay: ; movedelay ; Wait 40 frames. @@ -7244,7 +7004,6 @@ BattleCommand_MoveDelay: jp DelayFrames - BattleCommand_ClearText: ; cleartext @@ -7255,7 +7014,6 @@ BattleCommand_ClearText: .text db "@" - SkipToBattleCommand: ; Skip over commands until reaching command b. ld a, [wBattleScriptBufferAddress + 1] @@ -7274,7 +7032,6 @@ SkipToBattleCommand: ret - GetMoveAttr: ; Assuming hl = Moves + x, return attribute x of move a. push bc @@ -7285,7 +7042,6 @@ GetMoveAttr: ret - GetMoveData: ; Copy move struct a to de. ld hl, Moves @@ -7295,31 +7051,26 @@ GetMoveData: jp FarCopyBytes - GetMoveByte: ld a, BANK(Moves) jp GetFarByte - DisappearUser: farcall _DisappearUser ret - AppearUserLowerSub: farcall _AppearUserLowerSub ret - AppearUserRaiseSub: farcall _AppearUserRaiseSub ret - _CheckBattleScene: ; Checks the options. Returns carry if battle animations are disabled. push hl -- cgit v1.2.3 From 9f3e9145f9466ba93810dc6cd34fee7e7e835832 Mon Sep 17 00:00:00 2001 From: Rangi Date: Mon, 25 Jun 2018 12:01:02 -0400 Subject: Remove more triple newlines --- engine/battle/effect_commands.asm | 154 -------------------------------------- 1 file changed, 154 deletions(-) (limited to 'engine/battle/effect_commands.asm') diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm index e19cce189..35e94ee2d 100644 --- a/engine/battle/effect_commands.asm +++ b/engine/battle/effect_commands.asm @@ -7,7 +7,6 @@ DoPlayerTurn: jr DoTurn - DoEnemyTurn: call SetEnemyTurn @@ -109,7 +108,6 @@ DoMove: .DoMoveEffectCommand: jp hl - CheckTurn: BattleCommand_CheckTurn: ; checkturn @@ -336,7 +334,6 @@ CheckPlayerTurn: call CantMove jp EndTurn - CantMove: ld a, BATTLE_VARS_SUBSTATUS1 call GetBattleVarAddr @@ -363,15 +360,11 @@ CantMove: res SUBSTATUS_FLYING, [hl] jp AppearUserRaiseSub - - OpponentCantMove: call BattleCommand_SwitchTurn call CantMove jp BattleCommand_SwitchTurn - - CheckEnemyTurn: ld hl, wEnemySubStatus4 @@ -595,7 +588,6 @@ EndTurn: ld [wTurnEnded], a jp ResetDamage - MoveDisabled: ; Make sure any charged moves fail @@ -611,7 +603,6 @@ MoveDisabled: ld hl, DisabledMoveText jp StdBattleTextBox - HitConfusion: ld hl, HurtItselfText @@ -642,7 +633,6 @@ HitConfusion: call DoPlayerDamage jp BattleCommand_RaiseSub - BattleCommand_CheckObedience: ; checkobedience @@ -928,7 +918,6 @@ BattleCommand_CheckObedience: jp EndMoveEffect - IgnoreSleepOnly: ld a, BATTLE_VARS_MOVE_ANIM @@ -957,13 +946,11 @@ IgnoreSleepOnly: scf ret - BattleCommand_UsedMoveText: ; usedmovetext farcall DisplayUsedMoveText ret - CheckUserIsCharging: ld a, [hBattleTurn] @@ -975,7 +962,6 @@ CheckUserIsCharging: and a ret - BattleCommand_DoTurn: call CheckUserIsCharging ret nz @@ -1142,7 +1128,6 @@ CheckMimicUsed: and a ret - BattleCommand_Critical: ; critical @@ -1421,7 +1406,6 @@ BattleCommand_Stab: ld [wTypeModifier], a ret - BattleCheckTypeMatchup: ld hl, wEnemyMonType1 ld a, [hBattleTurn] @@ -1501,7 +1485,6 @@ CheckTypeMatchup: pop hl ret - BattleCommand_ResetTypeMatchup: ; Reset the type matchup multiplier to 1.0, if the type matchup is not 0. ; If there is immunity in play, the move automatically misses. @@ -1521,7 +1504,6 @@ BattleCommand_ResetTypeMatchup: ld [wTypeMatchup], a ret - INCLUDE "engine/battle/ai/switch.asm" INCLUDE "data/types/type_matchups.asm" @@ -1578,7 +1560,6 @@ BattleCommand_DamageVariation: ld [hl], a ret - BattleCommand_CheckHit: ; checkhit @@ -1914,7 +1895,6 @@ BattleCommand_EffectChance: and a ret - BattleCommand_LowerSub: ; lowersub @@ -1983,14 +1963,12 @@ BattleCommand_LowerSub: ld [wSomeoneIsRampaging], a ret - BattleCommand_MoveAnim: ; moveanim call BattleCommand_LowerSub call BattleCommand_MoveAnimNoSub jp BattleCommand_RaiseSub - BattleCommand_MoveAnimNoSub: ld a, [wAttackMissed] and a @@ -2055,7 +2033,6 @@ BattleCommand_MoveAnimNoSub: ld [wNumHits], a jp PlayFXAnimID - BattleCommand_StatUpAnim: ld a, [wAttackMissed] and a @@ -2064,7 +2041,6 @@ BattleCommand_StatUpAnim: xor a jr BattleCommand_StatUpDownAnim - BattleCommand_StatDownAnim: ld a, [wAttackMissed] and a @@ -2088,7 +2064,6 @@ BattleCommand_StatUpDownAnim: ld d, 0 jp PlayFXAnimID - BattleCommand_SwitchTurn: ; switchturn @@ -2097,7 +2072,6 @@ BattleCommand_SwitchTurn: ld [hBattleTurn], a ret - BattleCommand_RaiseSub: ; raisesub @@ -2117,7 +2091,6 @@ BattleCommand_RaiseSub: ld a, SUBSTITUTE jp LoadAnim - BattleCommand_FailureText: ; failuretext ; If the move missed or failed, load the appropriate @@ -2160,7 +2133,6 @@ BattleCommand_FailureText: call AppearUserRaiseSub jp EndMoveEffect - BattleCommand_ApplyDamage: ; applydamage @@ -2253,7 +2225,6 @@ BattleCommand_ApplyDamage: ld [de], a ret - GetFailureResultText: ld hl, DoesntAffectText ld de, DoesntAffectText @@ -2322,7 +2293,6 @@ FailText_CheckOpponentProtect: .not_protected jp StdBattleTextBox - BattleCommand_BideFailText: ld a, [wAttackMissed] and a @@ -2333,7 +2303,6 @@ BattleCommand_BideFailText: jp z, PrintDoesntAffect jp PrintButItFailed - BattleCommand_CriticalText: ; criticaltext ; Prints the message for critical hits or one-hit KOs. @@ -2378,7 +2347,6 @@ BattleCommand_StartLoop: ld [hl], a ret - BattleCommand_SuperEffectiveLoopText: ; supereffectivelooptext @@ -2402,7 +2370,6 @@ BattleCommand_SuperEffectiveText: .print jp StdBattleTextBox - BattleCommand_CheckDestinyBond: ; checkdestinybond @@ -2490,7 +2457,6 @@ BattleCommand_CheckDestinyBond: .finish jp EndMoveEffect - BattleCommand_BuildOpponentRage: ; buildopponentrage @@ -2522,7 +2488,6 @@ BattleCommand_BuildOpponentRage: call StdBattleTextBox jp BattleCommand_SwitchTurn - BattleCommand_RageDamage: ; ragedamage @@ -2551,7 +2516,6 @@ BattleCommand_RageDamage: ld [wCurDamage + 1], a ret - EndMoveEffect: ld a, [wBattleScriptBufferAddress] ld l, a @@ -2563,7 +2527,6 @@ EndMoveEffect: ld [hl], a ret - DittoMetalPowder: ld a, MON_SPECIES call BattlePartyAttr @@ -2600,7 +2563,6 @@ DittoMetalPowder: rr c ret - BattleCommand_DamageStats: ; damagestats @@ -2692,7 +2654,6 @@ PlayerAttackDamage: and a ret - TruncateHL_BC: .loop ; Truncate 16-bit values hl and bc to 8-bit values b and c respectively. @@ -2738,7 +2699,6 @@ TruncateHL_BC: ld b, l ret - GetDamageStatsCritical: ; Return carry if non-critical. @@ -2789,7 +2749,6 @@ GetDamageStats: pop hl ret - ThickClubBoost: ; Return in hl the stat value at hl. @@ -2805,7 +2764,6 @@ ThickClubBoost: pop bc ret - LightBallBoost: ; Return in hl the stat value at hl. @@ -2821,7 +2779,6 @@ LightBallBoost: pop bc ret - SpeciesItemBoost: ; Return in hl the stat value at hl. @@ -2862,7 +2819,6 @@ SpeciesItemBoost: rl h ret - EnemyAttackDamage: call ResetDamage @@ -2941,7 +2897,6 @@ EnemyAttackDamage: and a ret - INCLUDE "engine/battle/move_effects/beat_up.asm" BattleCommand_ClearMissDamage: @@ -2952,7 +2907,6 @@ BattleCommand_ClearMissDamage: jp ResetDamage - HitSelfInConfusion: call ResetDamage ld a, [hBattleTurn] @@ -2989,7 +2943,6 @@ HitSelfInConfusion: ld e, a ret - BattleCommand_DamageCalc: ; damagecalc @@ -3219,7 +3172,6 @@ BattleCommand_DamageCalc: ret - INCLUDE "data/types/type_boost_items.asm" BattleCommand_ConstantDamage: @@ -3422,7 +3374,6 @@ BattleCommand_DefrostOpponent: ld [hl], a ret - INCLUDE "engine/battle/move_effects/sleep_talk.asm" INCLUDE "engine/battle/move_effects/destiny_bond.asm" @@ -3454,7 +3405,6 @@ PlayFXAnimID: callfar PlayBattleAnim ret - DoEnemyDamage: ld hl, wCurDamage ld a, [hli] @@ -3515,7 +3465,6 @@ DoEnemyDamage: .did_no_damage jp RefreshBattleHuds - DoPlayerDamage: ld hl, wCurDamage ld a, [hli] @@ -3576,7 +3525,6 @@ DoPlayerDamage: .did_no_damage jp RefreshBattleHuds - DoSubstituteDamage: ld hl, SubTookDamageText call StdBattleTextBox @@ -3634,7 +3582,6 @@ DoSubstituteDamage: .done jp ResetDamage - UpdateMoveData: ld a, BATTLE_VARS_MOVE_ANIM @@ -3652,7 +3599,6 @@ UpdateMoveData: call GetMoveName jp CopyName1 - BattleCommand_SleepTarget: ; sleeptarget @@ -3724,7 +3670,6 @@ BattleCommand_SleepTarget: pop hl jp StdBattleTextBox - .CheckAIRandomFail: ; Enemy turn ld a, [hBattleTurn] @@ -3753,7 +3698,6 @@ BattleCommand_SleepTarget: xor a ret - BattleCommand_PoisonTarget: ; poisontarget @@ -3789,7 +3733,6 @@ BattleCommand_PoisonTarget: farcall UseHeldStatusHealingItem ret - BattleCommand_Poison: ; poison @@ -3878,13 +3821,11 @@ BattleCommand_Poison: pop hl jp StdBattleTextBox - .apply_poison call AnimateCurrentMove call PoisonOpponent jp RefreshBattleHuds - .check_toxic ld a, BATTLE_VARS_SUBSTATUS5_OPP call GetBattleVarAddr @@ -3899,7 +3840,6 @@ BattleCommand_Poison: cp EFFECT_TOXIC ret - CheckIfTargetIsPoisonType: ld de, wEnemyMonType1 ld a, [hBattleTurn] @@ -3915,28 +3855,24 @@ CheckIfTargetIsPoisonType: cp POISON ret - PoisonOpponent: ld a, BATTLE_VARS_STATUS_OPP call GetBattleVarAddr set PSN, [hl] jp UpdateOpponentInParty - BattleCommand_DrainTarget: ; draintarget call SapHealth ld hl, SuckedHealthText jp StdBattleTextBox - BattleCommand_EatDream: ; eatdream call SapHealth ld hl, DreamEatenText jp StdBattleTextBox - SapHealth: ; Divide damage by 2, store it in hDividend ld hl, wCurDamage @@ -4030,7 +3966,6 @@ SapHealth: call RefreshBattleHuds jp UpdateBattleMonInParty - BattleCommand_BurnTarget: ; burntarget @@ -4072,7 +4007,6 @@ BattleCommand_BurnTarget: farcall UseHeldStatusHealingItem ret - Defrost: ld a, [hl] and 1 << FRZ @@ -4098,7 +4032,6 @@ Defrost: ld hl, DefrostedOpponentText jp StdBattleTextBox - BattleCommand_FreezeTarget: ; freezetarget @@ -4152,7 +4085,6 @@ BattleCommand_FreezeTarget: ld [hl], $1 ret - BattleCommand_ParalyzeTarget: ; paralyzetarget @@ -4189,7 +4121,6 @@ BattleCommand_ParalyzeTarget: ld hl, UseHeldStatusHealingItem jp CallBattleCore - BattleCommand_AttackUp: ; attackup ld b, ATTACK @@ -4268,7 +4199,6 @@ BattleCommand_StatUp: ret nz jp StatUpAnimation - CheckIfStatCanBeRaised: ld a, b ld [wLoweredStat], a @@ -4348,7 +4278,6 @@ CheckIfStatCanBeRaised: ld [wFailedMessage], a ret - .stats_already_max pop hl dec [hl] @@ -4361,13 +4290,11 @@ CheckIfStatCanBeRaised: ld [wAttackMissed], a ret - .stat_raise_failed ld a, $1 ld [wFailedMessage], a ret - StatUpAnimation: ld bc, wPlayerMinimized ld hl, DropPlayerSub @@ -4393,7 +4320,6 @@ StatUpAnimation: call WaitBGMap jp BattleCommand_MoveDelay - BattleCommand_AttackDown: ; attackdown ld a, ATTACK @@ -4586,7 +4512,6 @@ BattleCommand_StatDown: ld [wAttackMissed], a ret - CheckMist: ld a, BATTLE_VARS_MOVE_EFFECT call GetBattleVar @@ -4612,7 +4537,6 @@ CheckMist: bit SUBSTATUS_MIST, a ret - BattleCommand_StatUpMessage: ld a, [wFailedMessage] and a @@ -4643,7 +4567,6 @@ BattleCommand_StatUpMessage: text_jump UnknownText_0x1c0ce0 db "@" - BattleCommand_StatDownMessage: ld a, [wFailedMessage] and a @@ -4673,7 +4596,6 @@ BattleCommand_StatDownMessage: text_jump UnknownText_0x1c0d06 db "@" - TryLowerStat: ; Lower stat c from stat struct hl (buffer de). @@ -4717,7 +4639,6 @@ TryLowerStat: and a ret - BattleCommand_StatUpFailText: ; statupfailtext ld a, [wFailedMessage] @@ -4736,7 +4657,6 @@ BattleCommand_StatUpFailText: ld hl, WontRiseAnymoreText jp StdBattleTextBox - BattleCommand_StatDownFailText: ; statdownfailtext ld a, [wFailedMessage] @@ -4758,7 +4678,6 @@ BattleCommand_StatDownFailText: ld hl, WontDropAnymoreText jp StdBattleTextBox - GetStatName: ld hl, StatNames ld c, "@" @@ -4813,7 +4732,6 @@ ResetMiss: ld [wAttackMissed], a ret - LowerStat: ld [wLoweredStat], a @@ -4885,7 +4803,6 @@ LowerStat: ld [wFailedMessage], a ret - BattleCommand_TriStatusChance: ; tristatuschance @@ -4914,7 +4831,6 @@ BattleCommand_Curl: set SUBSTATUS_CURLED, [hl] ret - BattleCommand_RaiseSubNoAnim: ld hl, GetBattleMonBackpic ld a, [hBattleTurn] @@ -4927,7 +4843,6 @@ BattleCommand_RaiseSubNoAnim: call CallBattleCore jp WaitBGMap - BattleCommand_LowerSubNoAnim: ld hl, DropPlayerSub ld a, [hBattleTurn] @@ -4940,7 +4855,6 @@ BattleCommand_LowerSubNoAnim: call CallBattleCore jp WaitBGMap - CalcPlayerStats: ld hl, wPlayerAtkLevel ld de, wPlayerStats @@ -4962,7 +4876,6 @@ CalcPlayerStats: jp BattleCommand_SwitchTurn - CalcEnemyStats: ld hl, wEnemyAtkLevel ld de, wEnemyStats @@ -4981,7 +4894,6 @@ CalcEnemyStats: jp BattleCommand_SwitchTurn - CalcStats: .loop push af @@ -5051,7 +4963,6 @@ CalcStats: ret - INCLUDE "engine/battle/move_effects/bide.asm" BattleCommand_CheckRampage: @@ -5091,7 +5002,6 @@ BattleCommand_CheckRampage: ld b, rampage_command jp SkipToBattleCommand - BattleCommand_Rampage: ; rampage @@ -5119,7 +5029,6 @@ BattleCommand_Rampage: ld [wSomeoneIsRampaging], a ret - INCLUDE "engine/battle/move_effects/teleport.asm" SetBattleDraw: @@ -5129,7 +5038,6 @@ SetBattleDraw: ld [wBattleResult], a ret - BattleCommand_ForceSwitch: ; forceswitch @@ -5349,7 +5257,6 @@ BattleCommand_ForceSwitch: .do_text jp StdBattleTextBox - CheckPlayerHasMonToSwitchTo: ld a, [wPartyCount] ld d, a @@ -5379,7 +5286,6 @@ CheckPlayerHasMonToSwitchTo: and a ret - BattleCommand_EndLoop: ; endloop @@ -5514,7 +5420,6 @@ BattleCommand_EndLoop: ld [wBattleScriptBufferAddress], a ret - BattleCommand_FakeOut: ld a, [wAttackMissed] and a @@ -5536,7 +5441,6 @@ BattleCommand_FakeOut: ld [wAttackMissed], a ret - BattleCommand_FlinchTarget: call CheckSubstituteOpp ret nz @@ -5561,7 +5465,6 @@ FlinchTarget: set SUBSTATUS_FLINCHED, [hl] jp EndRechargeOpp - CheckOpponentWentFirst: ; Returns a=0, z if user went first ; Returns a=1, nz if opponent went first @@ -5573,7 +5476,6 @@ CheckOpponentWentFirst: pop bc ret - BattleCommand_HeldFlinch: ; kingsrock @@ -5602,7 +5504,6 @@ BattleCommand_HeldFlinch: set SUBSTATUS_FLINCHED, [hl] ret - BattleCommand_OHKO: ; ohko @@ -5649,7 +5550,6 @@ BattleCommand_OHKO: ld [wAttackMissed], a ret - BattleCommand_CheckCharge: ; checkcharge @@ -5663,7 +5563,6 @@ BattleCommand_CheckCharge: ld b, charge_command jp SkipToBattleCommand - BattleCommand_Charge: ; charge @@ -5809,7 +5708,6 @@ BattleCommand3c: ; unused ret - BattleCommand_TrapTarget: ; traptarget @@ -5934,7 +5832,6 @@ BattleCommand_Recoil: ld hl, RecoilText jp StdBattleTextBox - BattleCommand_ConfuseTarget: ; confusetarget @@ -6038,7 +5935,6 @@ BattleCommand_Confuse_CheckSnore_Swagger_ConfuseHit: ret z jp PrintDidntAffect2 - BattleCommand_Paralyze: ; paralyze @@ -6119,7 +6015,6 @@ BattleCommand_Paralyze: call AnimateFailedMove jp PrintDoesntAffect - CheckMoveTypeMatchesTarget: ; Compare move type to opponent type. ; Return z if matching the opponent type, @@ -6155,7 +6050,6 @@ CheckMoveTypeMatchesTarget: pop hl ret - INCLUDE "engine/battle/move_effects/substitute.asm" BattleCommand_RechargeNextTurn: @@ -6165,7 +6059,6 @@ BattleCommand_RechargeNextTurn: set SUBSTATUS_RECHARGE, [hl] ret - EndRechargeOpp: push hl ld a, BATTLE_VARS_SUBSTATUS4_OPP @@ -6174,7 +6067,6 @@ EndRechargeOpp: pop hl ret - INCLUDE "engine/battle/move_effects/rage.asm" BattleCommand_DoubleFlyingDamage: @@ -6185,7 +6077,6 @@ BattleCommand_DoubleFlyingDamage: ret z jr DoubleDamage - BattleCommand_DoubleUndergroundDamage: ; doubleundergrounddamage ld a, BATTLE_VARS_SUBSTATUS3_OPP @@ -6208,7 +6099,6 @@ DoubleDamage: .quit ret - INCLUDE "engine/battle/move_effects/mimic.asm" INCLUDE "engine/battle/move_effects/leech_seed.asm" @@ -6254,7 +6144,6 @@ BattleCommand_ResetStats: jr nz, .next ret - BattleCommand_Heal: ; heal @@ -6337,7 +6226,6 @@ BattleCommand_Heal: ld hl, HPIsFullText jp StdBattleTextBox - INCLUDE "engine/battle/move_effects/transform.asm" BattleSideCopy: @@ -6355,12 +6243,10 @@ BattleSideCopy: .copy jp CopyBytes - BattleEffect_ButItFailed: call AnimateFailedMove jp PrintButItFailed - ClearLastMove: ld a, BATTLE_VARS_LAST_COUNTER_MOVE call GetBattleVarAddr @@ -6373,7 +6259,6 @@ ClearLastMove: ld [hl], a ret - ResetActorDisable: ld a, [hBattleTurn] and a @@ -6390,7 +6275,6 @@ ResetActorDisable: ld [wDisabledMove], a ret - BattleCommand_Screen: ; screen @@ -6436,19 +6320,16 @@ BattleCommand_Screen: call AnimateFailedMove jp PrintButItFailed - PrintDoesntAffect: ; 'it doesn't affect' ld hl, DoesntAffectText jp StdBattleTextBox - PrintNothingHappened: ; 'but nothing happened!' ld hl, NothingHappenedText jp StdBattleTextBox - TryPrintButItFailed: ld a, [wAlreadyFailed] and a @@ -6461,7 +6342,6 @@ PrintButItFailed: ld hl, ButItFailedText jp StdBattleTextBox - FailMove: call AnimateFailedMove ; fallthrough @@ -6471,33 +6351,28 @@ FailMimic: ld de, ItFailedText ; 'it failed!' jp FailText_CheckOpponentProtect - PrintDidntAffect: ; 'it didn't affect' ld hl, DidntAffect1Text jp StdBattleTextBox - PrintDidntAffect2: call AnimateFailedMove ld hl, DidntAffect1Text ; 'it didn't affect' ld de, DidntAffect2Text ; 'it didn't affect' jp FailText_CheckOpponentProtect - PrintParalyze: ; 'paralyzed! maybe it can't attack!' ld hl, ParalyzedText jp StdBattleTextBox - CheckSubstituteOpp: ld a, BATTLE_VARS_SUBSTATUS4_OPP call GetBattleVar bit SUBSTATUS_SUBSTITUTE, a ret - INCLUDE "engine/battle/move_effects/selfdestruct.asm" INCLUDE "engine/battle/move_effects/mirror_move.asm" @@ -6528,7 +6403,6 @@ CheckUserMove: and a ret - ResetTurn: ld hl, wPlayerCharging ld a, [hBattleTurn] @@ -6543,7 +6417,6 @@ ResetTurn: call DoMove jp EndMoveEffect - INCLUDE "engine/battle/move_effects/thief.asm" BattleCommand_ArenaTrap: @@ -6572,7 +6445,6 @@ BattleCommand_ArenaTrap: call AnimateFailedMove jp PrintButItFailed - INCLUDE "engine/battle/move_effects/nightmare.asm" BattleCommand_Defrost: @@ -6606,7 +6478,6 @@ BattleCommand_Defrost: ld hl, WasDefrostedText jp StdBattleTextBox - INCLUDE "engine/battle/move_effects/curse.asm" INCLUDE "engine/battle/move_effects/protect.asm" @@ -6627,7 +6498,6 @@ BattleCommand5d: ; unused ret - INCLUDE "engine/battle/move_effects/fury_cutter.asm" INCLUDE "engine/battle/move_effects/attract.asm" @@ -6653,7 +6523,6 @@ SafeCheckSafeguard: pop hl ret - BattleCommand_CheckSafeguard: ; checksafeguard ld hl, wEnemyScreens @@ -6671,7 +6540,6 @@ BattleCommand_CheckSafeguard: call StdBattleTextBox jp EndMoveEffect - INCLUDE "engine/battle/move_effects/magnitude.asm" INCLUDE "engine/battle/move_effects/baton_pass.asm" @@ -6811,7 +6679,6 @@ BattleCommand_DoubleMinimizeDamage: ld [hl], a ret - BattleCommand_SkipSunCharge: ; mimicsuncharge ld a, [wBattleWeather] @@ -6820,7 +6687,6 @@ BattleCommand_SkipSunCharge: ld b, charge_command jp SkipToBattleCommand - INCLUDE "engine/battle/move_effects/future_sight.asm" INCLUDE "engine/battle/move_effects/thunder.asm" @@ -6832,7 +6698,6 @@ CheckHiddenOpponent: and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND ret - GetUserItem: ; Return the effect of the user's item in bc, and its id at hl. ld hl, wBattleMonItem @@ -6844,7 +6709,6 @@ GetUserItem: ld b, [hl] jp GetItemHeldEffect - GetOpponentItem: ; Return the effect of the opponent's item in bc, and its id at hl. ld hl, wEnemyMonItem @@ -6856,7 +6720,6 @@ GetOpponentItem: ld b, [hl] jp GetItemHeldEffect - GetItemHeldEffect: ; Return the effect of item b in bc. ld a, b @@ -6877,7 +6740,6 @@ GetItemHeldEffect: pop hl ret - AnimateCurrentMoveEitherSide: push hl push de @@ -6894,7 +6756,6 @@ AnimateCurrentMoveEitherSide: pop hl ret - AnimateCurrentMove: push hl push de @@ -6911,7 +6772,6 @@ AnimateCurrentMove: pop hl ret - PlayDamageAnim: xor a ld [wFXAnimID + 1], a @@ -6934,7 +6794,6 @@ PlayDamageAnim: jp PlayUserBattleAnim - LoadMoveAnim: xor a ld [wNumHits], a @@ -6962,7 +6821,6 @@ PlayUserBattleAnim: pop hl ret - PlayOpponentBattleAnim: ld a, e ld [wFXAnimID], a @@ -6984,26 +6842,22 @@ PlayOpponentBattleAnim: pop hl ret - CallBattleCore: ld a, BANK("Battle Core") rst FarCall ret - AnimateFailedMove: call BattleCommand_LowerSub call BattleCommand_MoveDelay jp BattleCommand_RaiseSub - BattleCommand_MoveDelay: ; movedelay ; Wait 40 frames. ld c, 40 jp DelayFrames - BattleCommand_ClearText: ; cleartext @@ -7031,7 +6885,6 @@ SkipToBattleCommand: ld [wBattleScriptBufferAddress], a ret - GetMoveAttr: ; Assuming hl = Moves + x, return attribute x of move a. push bc @@ -7041,7 +6894,6 @@ GetMoveAttr: pop bc ret - GetMoveData: ; Copy move struct a to de. ld hl, Moves @@ -7050,27 +6902,22 @@ GetMoveData: ld a, BANK(Moves) jp FarCopyBytes - GetMoveByte: ld a, BANK(Moves) jp GetFarByte - DisappearUser: farcall _DisappearUser ret - AppearUserLowerSub: farcall _AppearUserLowerSub ret - AppearUserRaiseSub: farcall _AppearUserRaiseSub ret - _CheckBattleScene: ; Checks the options. Returns carry if battle animations are disabled. push hl @@ -7081,4 +6928,3 @@ _CheckBattleScene: pop de pop hl ret - -- cgit v1.2.3 From 1caa50a6474edd3896911409d548faa0731621b7 Mon Sep 17 00:00:00 2001 From: Rangi Date: Mon, 25 Jun 2018 12:24:18 -0400 Subject: No space between labels and bodies --- engine/battle/effect_commands.asm | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'engine/battle/effect_commands.asm') diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm index 35e94ee2d..3e6d928d2 100644 --- a/engine/battle/effect_commands.asm +++ b/engine/battle/effect_commands.asm @@ -68,7 +68,6 @@ DoMove: ld [wBattleScriptBufferAddress + 1], a .ReadMoveEffectCommand: - ; ld a, [wBattleScriptBufferAddress++] ld a, [wBattleScriptBufferAddress] ld l, a @@ -136,7 +135,6 @@ BattleCommand_CheckTurn: jp nz, CheckEnemyTurn CheckPlayerTurn: - ld hl, wPlayerSubStatus4 bit SUBSTATUS_RECHARGE, [hl] jr z, .no_recharge @@ -366,7 +364,6 @@ OpponentCantMove: jp BattleCommand_SwitchTurn CheckEnemyTurn: - ld hl, wEnemySubStatus4 bit SUBSTATUS_RECHARGE, [hl] jr z, .no_recharge @@ -589,7 +586,6 @@ EndTurn: jp ResetDamage MoveDisabled: - ; Make sure any charged moves fail ld a, BATTLE_VARS_SUBSTATUS3 call GetBattleVarAddr @@ -604,7 +600,6 @@ MoveDisabled: jp StdBattleTextBox HitConfusion: - ld hl, HurtItselfText call StdBattleTextBox @@ -811,7 +806,6 @@ BattleCommand_CheckObedience: jp .EndDisobedience .UseInstead: - ; Can't use another move if the monster only has one! ld a, [wBattleMonMoves + 1] and a @@ -919,7 +913,6 @@ BattleCommand_CheckObedience: jp EndMoveEffect IgnoreSleepOnly: - ld a, BATTLE_VARS_MOVE_ANIM call GetBattleVar @@ -952,7 +945,6 @@ BattleCommand_UsedMoveText: ret CheckUserIsCharging: - ld a, [hBattleTurn] and a ld a, [wPlayerCharging] ; player @@ -1775,7 +1767,6 @@ BattleCommand_CheckHit: ret .StatModifiers: - ld a, [hBattleTurn] and a @@ -3066,8 +3057,8 @@ BattleCommand_DamageCalc: ld [hDivisor], a ld b, 4 call Divide -.DoneItem: +.DoneItem: ; Critical hits call .CriticalMultiplier @@ -3583,7 +3574,6 @@ DoSubstituteDamage: jp ResetDamage UpdateMoveData: - ld a, BATTLE_VARS_MOVE_ANIM call GetBattleVarAddr ld d, h -- cgit v1.2.3 From b565e6a9dc5f54fad37f750ae546e2334a6c66e5 Mon Sep 17 00:00:00 2001 From: Rangi Date: Wed, 4 Jul 2018 02:42:11 -0400 Subject: Miscellaneous reorganization fixes --- engine/battle/effect_commands.asm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engine/battle/effect_commands.asm') diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm index 3e6d928d2..eb30af88b 100644 --- a/engine/battle/effect_commands.asm +++ b/engine/battle/effect_commands.asm @@ -1210,7 +1210,9 @@ BattleCommand_Critical: ld [wCriticalHit], a ret -INCLUDE "data/battle/critical_hits.asm" +INCLUDE "data/moves/critical_hit_moves.asm" + +INCLUDE "data/battle/critical_hit_chances.asm" INCLUDE "engine/battle/move_effects/triple_kick.asm" -- cgit v1.2.3