diff options
Diffstat (limited to 'engine/battle/effect_commands.asm')
-rw-r--r-- | engine/battle/effect_commands.asm | 249 |
1 files changed, 0 insertions, 249 deletions
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 |