More battle commentary/labels/constans and fix some spacing issues

Conflicts:
	engine/battle/core.asm
This commit is contained in:
xCrystal 2015-01-31 18:26:05 +01:00 committed by yenatch
parent 01e314f4f5
commit 97637e7ce7
2 changed files with 160 additions and 149 deletions

View file

@ -2,6 +2,7 @@ BattleCore:
; These are move effects (second value from the Moves table in bank $E). ; These are move effects (second value from the Moves table in bank $E).
ResidualEffects1: ; 3c000 (f:4000) ResidualEffects1: ; 3c000 (f:4000)
; most non-side effects
db CONVERSION_EFFECT db CONVERSION_EFFECT
db HAZE_EFFECT db HAZE_EFFECT
db SWITCH_AND_TELEPORT_EFFECT db SWITCH_AND_TELEPORT_EFFECT
@ -26,6 +27,7 @@ SetDamageEffects: ; 3c011 (f:4011)
db SPECIAL_DAMAGE_EFFECT db SPECIAL_DAMAGE_EFFECT
db -1 db -1
ResidualEffects2: ; 3c014 (f:4014) ResidualEffects2: ; 3c014 (f:4014)
; non-side effects not included in ResidualEffects1
; stat-affecting moves, sleep-inflicting moves, and Bide ; stat-affecting moves, sleep-inflicting moves, and Bide
; e.g., Meditate, Bide, Hypnosis ; e.g., Meditate, Bide, Hypnosis
db $01 db $01
@ -846,7 +848,7 @@ FaintEnemyPokemon ; 0x3c567
ld [W_ENEMYDISABLEDMOVE], a ld [W_ENEMYDISABLEDMOVE], a
ld [wccef], a ld [wccef], a
ld [wccf3], a ld [wccf3], a
ld hl, wccf1 ld hl, wPlayerUsedMove
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
hlCoord 12, 5 hlCoord 12, 5
@ -1371,7 +1373,7 @@ EnemySendOutFirstMon: ; 3c92a (f:492a)
ld [W_ENEMYDISABLEDMOVE],a ld [W_ENEMYDISABLEDMOVE],a
ld [wccef],a ld [wccef],a
ld [wccf3],a ld [wccf3],a
ld hl,wccf1 ld hl,wPlayerUsedMove
ld [hli],a ld [hli],a
ld [hl],a ld [hl],a
dec a dec a
@ -1808,7 +1810,7 @@ SendOutMon: ; 3cc91 (f:4c91)
ld [wcc5b], a ld [wcc5b], a
ld [wd05b], a ld [wd05b], a
ld [W_PLAYERMOVENUM], a ld [W_PLAYERMOVENUM], a
ld hl, wccf1 ld hl, wPlayerUsedMove
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
ld hl, wd060 ld hl, wd060
@ -2547,7 +2549,7 @@ MoveSelectionMenu: ; 3d219 (f:5219)
ret ret
.regularmenu .regularmenu
call Func_3d3f5 call AnyMoveToSelect
ret z ret z
ld hl, wBattleMonMoves ld hl, wBattleMonMoves
call .loadmoves call .loadmoves
@ -2636,8 +2638,9 @@ MoveSelectionMenu: ; 3d219 (f:5219)
inc a inc a
.movelistindex1 .movelistindex1
ld [hl], a ld [hl], a
; fallthrough
Func_3d2fe: ; 3d2fe (f:52fe) SelectMenuItem: ; 3d2fe (f:52fe)
ld a, [wMoveMenuType] ld a, [wMoveMenuType]
and a and a
jr z, .battleselect jr z, .battleselect
@ -2651,7 +2654,7 @@ Func_3d2fe: ; 3d2fe (f:52fe)
ld a, [W_FLAGS_D733] ld a, [W_FLAGS_D733]
bit 0, a bit 0, a
jr nz, .select jr nz, .select
call Func_3d4b6 call PrintMenuItem
ld a, [wMenuItemToSwap] ld a, [wMenuItemToSwap]
and a and a
jr z, .select jr z, .select
@ -2667,9 +2670,9 @@ Func_3d2fe: ; 3d2fe (f:52fe)
ld hl, $fff6 ld hl, $fff6
res 1, [hl] res 1, [hl]
bit 6, a bit 6, a
jp nz, Func_3d3c9 ; up jp nz, CursorUp ; up
bit 7, a bit 7, a
jp nz, Func_3d3dd ; down jp nz, CursorDown ; down
bit 2, a bit 2, a
jp nz, SwapMovesInMenu ; select jp nz, SwapMovesInMenu ; select
bit 1, a ; B, but was it reset above? bit 1, a ; B, but was it reset above?
@ -2743,30 +2746,32 @@ MoveDisabledText: ; 3d3b3 (f:53b3)
WhichTechniqueString: ; 3d3b8 (f:53b8) WhichTechniqueString: ; 3d3b8 (f:53b8)
db "WHICH TECHNIQUE?@" db "WHICH TECHNIQUE?@"
Func_3d3c9: ; 3d3c9 (f:53c9) CursorUp: ; 3d3c9 (f:53c9)
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
and a and a
jp nz, Func_3d2fe jp nz, SelectMenuItem
call EraseMenuCursor call EraseMenuCursor
ld a, [wcd6c] ld a, [wcd6c]
inc a inc a
ld [wCurrentMenuItem], a ld [wCurrentMenuItem], a
jp Func_3d2fe jp SelectMenuItem
Func_3d3dd: ; 3d3dd (f:53dd) CursorDown: ; 3d3dd (f:53dd)
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
ld b, a ld b, a
ld a, [wcd6c] ld a, [wcd6c]
inc a inc a
inc a inc a
cp b cp b
jp nz, Func_3d2fe jp nz, SelectMenuItem
call EraseMenuCursor call EraseMenuCursor
ld a, $1 ld a, $1
ld [wCurrentMenuItem], a ld [wCurrentMenuItem], a
jp Func_3d2fe jp SelectMenuItem
AnyMoveToSelect: ; 3d3f5 (f:53f5)
; return z and Struggle as the selected move if all moves have 0 PP and/or are disabled
Func_3d3f5: ; 3d3f5 (f:53f5)
ld a, STRUGGLE ld a, STRUGGLE
ld [wPlayerSelectedMove], a ld [wPlayerSelectedMove], a
ld a, [W_PLAYERDISABLEDMOVE] ld a, [W_PLAYERDISABLEDMOVE]
@ -2888,7 +2893,7 @@ SwapMovesInMenu: ; 3d435 (f:5435)
ld [wMenuItemToSwap], a ; select the current menu item for swapping ld [wMenuItemToSwap], a ; select the current menu item for swapping
jp MoveSelectionMenu jp MoveSelectionMenu
Func_3d4b6: ; 3d4b6 (f:54b6) PrintMenuItem: ; 3d4b6 (f:54b6)
xor a xor a
ld [H_AUTOBGTRANSFERENABLED], a ld [H_AUTOBGTRANSFERENABLED], a
hlCoord 0, 8 hlCoord 0, 8
@ -2897,18 +2902,18 @@ Func_3d4b6: ; 3d4b6 (f:54b6)
call TextBoxBorder call TextBoxBorder
ld a, [W_PLAYERDISABLEDMOVE] ld a, [W_PLAYERDISABLEDMOVE]
and a and a
jr z, .asm_3d4df jr z, .notDisabled
swap a swap a
and $f and $f
ld b, a ld b, a
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
cp b cp b
jr nz, .asm_3d4df jr nz, .notDisabled
hlCoord 1, 10 hlCoord 1, 10
ld de, DisabledText ld de, DisabledText
call PlaceString call PlaceString
jr .asm_3d54e jr .moveDisabled
.asm_3d4df .notDisabled
ld hl, wCurrentMenuItem ld hl, wCurrentMenuItem
dec [hl] dec [hl]
xor a xor a
@ -2916,10 +2921,11 @@ Func_3d4b6: ; 3d4b6 (f:54b6)
ld hl, wBattleMonMoves ld hl, wBattleMonMoves
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
ld c, a ld c, a
ld b, $0 ld b, $0 ; which item in the menu is the cursor pointing to? (0-3)
add hl, bc add hl, bc ; point to the item (move) in memory
ld a, [hl] ld a, [hl]
ld [wPlayerSelectedMove], a ld [wPlayerSelectedMove], a ; update wPlayerSelectedMove even if the move
; isn't actually selected (just pointed to by the cursor)
ld a, [wPlayerMonNumber] ld a, [wPlayerMonNumber]
ld [wWhichPokemon], a ld [wWhichPokemon], a
ld a, $4 ld a, $4
@ -2934,6 +2940,7 @@ Func_3d4b6: ; 3d4b6 (f:54b6)
ld a, [hl] ld a, [hl]
and $3f and $3f
ld [wcd6d], a ld [wcd6d], a
; print TYPE/<type> and <curPP>/<maxPP>
hlCoord 1, 9 hlCoord 1, 9
ld de, TypeText ld de, TypeText
call PlaceString call PlaceString
@ -2952,7 +2959,7 @@ Func_3d4b6: ; 3d4b6 (f:54b6)
call GetCurrentMove call GetCurrentMove
hlCoord 2, 10 hlCoord 2, 10
predef Func_27d98 predef Func_27d98
.asm_3d54e .moveDisabled
ld a, $1 ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a ld [H_AUTOBGTRANSFERENABLED], a
jp Delay3 jp Delay3
@ -3125,9 +3132,9 @@ ExecutePlayerMove: ; 3d65e (f:565e)
call PrintGhostText call PrintGhostText
jp z, ExecutePlayerMoveDone jp z, ExecutePlayerMoveDone
call CheckPlayerStatusConditions call CheckPlayerStatusConditions
jr nz, .asm_3d68a jr nz, .playerHasNoSpecialCondition
jp [hl] jp [hl]
.asm_3d68a .playerHasNoSpecialCondition
call GetCurrentMove call GetCurrentMove
ld hl, W_PLAYERBATTSTATUS1 ld hl, W_PLAYERBATTSTATUS1
bit 4, [hl] ; charging up for attack bit 4, [hl] ; charging up for attack
@ -3147,8 +3154,8 @@ Func_3d69a: ; 3d69a (f:569a)
PlayerCanExecuteChargingMove: ; 3d6a9 (f:56a9) PlayerCanExecuteChargingMove: ; 3d6a9 (f:56a9)
ld hl,W_PLAYERBATTSTATUS1 ld hl,W_PLAYERBATTSTATUS1
res 4,[hl] ; reset charging up and invulnerability statuses if mon was charging up for an attack res 4,[hl] ; reset charging up and invulnerability statuses if mon was charging up for an attack
; being fully paralyzed or hurting oneself in confusion removes charging up status ; being fully paralyzed or hurting oneself in confusion removes charging up status
; resulting in the Pokemon being invulnerable for the whole battle ; resulting in the Pokemon being invulnerable for the whole battle
res 6,[hl] res 6,[hl]
PlayerCanExecuteMove: ; 3d6b0 (f:56b0) PlayerCanExecuteMove: ; 3d6b0 (f:56b0)
call PrintMonName1Text call PrintMonName1Text
@ -3161,13 +3168,13 @@ PlayerCanExecuteMove: ; 3d6b0 (f:56b0)
ld de,1 ld de,1
call IsInArray call IsInArray
jp c,JumpMoveEffect ; ResidualEffects1 moves skip damage calculation and accuracy tests jp c,JumpMoveEffect ; ResidualEffects1 moves skip damage calculation and accuracy tests
; unless executed as part of their exclusive effect functions ; unless executed as part of their exclusive effect functions
ld a,[W_PLAYERMOVEEFFECT] ld a,[W_PLAYERMOVEEFFECT]
ld hl,SpecialEffectsCont ld hl,SpecialEffectsCont
ld de,1 ld de,1
call IsInArray call IsInArray
call c,JumpMoveEffect ; execute the effects of SpecialEffectsCont moves (e.g. Wrap, Thrash) but don't skip anything call c,JumpMoveEffect ; execute the effects of SpecialEffectsCont moves (e.g. Wrap, Thrash) but don't skip anything
CalcMoveDamage: ; 3d6dc (f:56dc) PlayerCalcMoveDamage: ; 3d6dc (f:56dc)
ld a,[W_PLAYERMOVEEFFECT] ld a,[W_PLAYERMOVEEFFECT]
ld hl,SetDamageEffects ld hl,SetDamageEffects
ld de,1 ld de,1
@ -3179,7 +3186,7 @@ CalcMoveDamage: ; 3d6dc (f:56dc)
call GetDamageVarsForPlayerAttack call GetDamageVarsForPlayerAttack
call CalculateDamage call CalculateDamage
jp z,asm_3d74b ; for moves with 0 BP, skip any further damage calculation and, for now, skip MoveHitTest jp z,asm_3d74b ; for moves with 0 BP, skip any further damage calculation and, for now, skip MoveHitTest
; for these moves, accuracy tests will only occur if they are called as part of the effect itself ; for these moves, accuracy tests will only occur if they are called as part of the effect itself
call AdjustDamageForMoveType call AdjustDamageForMoveType
call RandomizeDamage call RandomizeDamage
.moveHitTest .moveHitTest
@ -3189,7 +3196,7 @@ asm_3d705
and a and a
jr z,asm_3d714 jr z,asm_3d714
ld a,[W_PLAYERMOVEEFFECT] ld a,[W_PLAYERMOVEEFFECT]
sub a,7 ; Explosion effect sub a,EXPLODE_EFFECT
jr z,asm_3d71e ; don't play any animation if the move missed, unless it was EXPLODE_EFFECT jr z,asm_3d71e ; don't play any animation if the move missed, unless it was EXPLODE_EFFECT
jr asm_3d74b jr asm_3d74b
asm_3d714 asm_3d714
@ -3285,7 +3292,7 @@ MirrorMoveCheck
dec a dec a
ld [wPlayerNumAttacksLeft],a ld [wPlayerNumAttacksLeft],a
jp nz,asm_3d714 ; for multi-hit moves, apply attack until PlayerNumAttacksLeft hits 0 or the enemy faints. jp nz,asm_3d714 ; for multi-hit moves, apply attack until PlayerNumAttacksLeft hits 0 or the enemy faints.
; damage calculation and accuracy tests only happen for the first hit ; damage calculation and accuracy tests only happen for the first hit
res 2,[hl] res 2,[hl]
ld hl,MultiHitText ld hl,MultiHitText
call PrintText call PrintText
@ -3298,10 +3305,10 @@ MirrorMoveCheck
ld hl,SpecialEffects ld hl,SpecialEffects
ld de,1 ld de,1
call IsInArray call IsInArray
call nc,JumpMoveEffect ; move effects not included in SpecialEffects, which are the effects not covered yet. call nc,JumpMoveEffect ; move effects not included in SpecialEffects or in either of the ResidualEffect arrays,
; the only exception is Rage, whose effect will be executed for a second time (although it's irrelevant) ; which are the effects not covered yet. Rage's effect will be executed for a second time (although it's irrelevant).
; includes some side effects and all non-volatile status effects but sleep. ; Includes side effects that only need to be called if the target didn't faint.
; responsible for executing Twineedle's second effect (poison) ; Responsible for executing Twineedle's second effect (poison)
jp ExecutePlayerMoveDone jp ExecutePlayerMoveDone
MultiHitText: ; 3d805 (f:5805) MultiHitText: ; 3d805 (f:5805)
@ -3385,7 +3392,7 @@ CheckPlayerStatusConditions: ; 3d854 (f:5854)
call PrintText call PrintText
.sleepDone .sleepDone
xor a xor a
ld [wccf1],a ld [wPlayerUsedMove],a
ld hl,ExecutePlayerMoveDone ; player can't move this turn ld hl,ExecutePlayerMoveDone ; player can't move this turn
jp .returnToHL jp .returnToHL
@ -3395,7 +3402,7 @@ CheckPlayerStatusConditions: ; 3d854 (f:5854)
ld hl,IsFrozenText ld hl,IsFrozenText
call PrintText call PrintText
xor a xor a
ld [wccf1],a ld [wPlayerUsedMove],a
ld hl,ExecutePlayerMoveDone ; player can't move this turn ld hl,ExecutePlayerMoveDone ; player can't move this turn
jp .returnToHL jp .returnToHL
@ -3446,7 +3453,7 @@ CheckPlayerStatusConditions: ; 3d854 (f:5854)
ld a,[W_PLAYERBATTSTATUS1] ld a,[W_PLAYERBATTSTATUS1]
add a ; is player confused? add a ; is player confused?
jr nc,.TriedToUseDisabledMoveCheck jr nc,.TriedToUseDisabledMoveCheck
ld hl,wd06b ld hl,W_PLAYERCONFUSEDCOUNTER
dec [hl] dec [hl]
jr nz,.IsConfused jr nz,.IsConfused
ld hl,W_PLAYERBATTSTATUS1 ld hl,W_PLAYERBATTSTATUS1
@ -3572,7 +3579,7 @@ CheckPlayerStatusConditions: ; 3d854 (f:5854)
call PrintText call PrintText
ld hl,wPlayerNumAttacksLeft ld hl,wPlayerNumAttacksLeft
dec [hl] ; did Trashing About counter hit 0? dec [hl] ; did Trashing About counter hit 0?
ld hl,CalcMoveDamage ; skip DecrementPP ld hl,PlayerCalcMoveDamage ; skip DecrementPP
jp nz,.returnToHL jp nz,.returnToHL
push hl push hl
ld hl,W_PLAYERBATTSTATUS1 ld hl,W_PLAYERBATTSTATUS1
@ -3582,7 +3589,7 @@ CheckPlayerStatusConditions: ; 3d854 (f:5854)
and a,3 and a,3
inc a inc a
inc a ; confused for 2-5 turns inc a ; confused for 2-5 turns
ld [wd06b],a ld [W_PLAYERCONFUSEDCOUNTER],a
pop hl ; skip DecrementPP pop hl ; skip DecrementPP
jp .returnToHL jp .returnToHL
@ -3601,7 +3608,7 @@ CheckPlayerStatusConditions: ; 3d854 (f:5854)
.RageCheck .RageCheck
ld a, [W_PLAYERBATTSTATUS2] ld a, [W_PLAYERBATTSTATUS2]
bit 6, a ; is mon using rage? bit 6, a ; is mon using rage?
jp z, .CanUseMove ; if we made it this far, mon can move normally this turn jp z, .checkPlayerStatusConditionsDone ; if we made it this far, mon can move normally this turn
ld a, RAGE ld a, RAGE
ld [wd11e], a ld [wd11e], a
call GetMoveName call GetMoveName
@ -3615,7 +3622,7 @@ CheckPlayerStatusConditions: ; 3d854 (f:5854)
xor a xor a
ret ret
.CanUseMove .checkPlayerStatusConditionsDone
ld a, $1 ld a, $1
and a and a
ret ret
@ -3755,10 +3762,10 @@ MonName1Text: ; 3dafb (f:5afb)
ld a, [H_WHOSETURN] ld a, [H_WHOSETURN]
and a and a
ld a, [W_PLAYERMOVENUM] ld a, [W_PLAYERMOVENUM]
ld hl, wccf1 ld hl, wPlayerUsedMove
jr z, .asm_3db11 jr z, .asm_3db11
ld a, [W_ENEMYMOVENUM] ld a, [W_ENEMYMOVENUM]
ld hl, wccf2 ld hl, wEnemyUsedMove
.asm_3db11 .asm_3db11
ld [hl], a ld [hl], a
ld [wd11e], a ld [wd11e], a
@ -3906,7 +3913,7 @@ PrintMoveFailureText: ; 3dbe2 (f:5be2)
; if you get here, the mon used jump kick or hi jump kick and missed ; if you get here, the mon used jump kick or hi jump kick and missed
ld hl, W_DAMAGE ; since the move missed, W_DAMAGE will always contain 0 at this point. ld hl, W_DAMAGE ; since the move missed, W_DAMAGE will always contain 0 at this point.
; Thus, recoil damage will always be equal to 1 even if it was intended to be potential damage/8. ; Thus, recoil damage will always be equal to 1 even if it was intended to be potential damage/8.
ld a, [hli] ld a, [hli]
ld b, [hl] ld b, [hl]
srl a srl a
@ -4756,8 +4763,8 @@ HandleCounterMove: ; 3e093 (f:6093)
ld a,[hli] ld a,[hli]
or [hl] or [hl]
ret z ; If we made it here, Counter still misses if the last move used in battle did no damage to its target. ret z ; If we made it here, Counter still misses if the last move used in battle did no damage to its target.
; W_DAMAGE is shared by both players, so Counter may strike back damage dealt by the Counter user itself ; W_DAMAGE is shared by both players, so Counter may strike back damage dealt by the Counter user itself
; if the conditions meet, even though 99% of the times damage will come from the target. ; if the conditions meet, even though 99% of the times damage will come from the target.
; if it did damage, double it ; if it did damage, double it
ld a,[hl] ld a,[hl]
add a add a
@ -5124,7 +5131,8 @@ BuildingRageText: ; 3e2f8 (f:62f8)
; copy last move for Mirror Move ; copy last move for Mirror Move
; sets zero flag on failure and unsets zero flag on success ; sets zero flag on failure and unsets zero flag on success
MirrorMoveCopyMove: ; 3e2fd (f:62fd) MirrorMoveCopyMove: ; 3e2fd (f:62fd)
; Mirror Move makes use of ccf1 and ccf2 addresses, which are mainly used to print the "[Pokemon] used [Move]" text. ; Mirror Move makes use of ccf1 (wPlayerUsedMove) and ccf2 (wEnemyUsedMove) addresses,
; which are mainly used to print the "[Pokemon] used [Move]" text.
; Both are set to 0 whenever a new Pokemon is sent out ; Both are set to 0 whenever a new Pokemon is sent out
; ccf1 is also set to 0 whenever the player is fast asleep or frozen solid. ; ccf1 is also set to 0 whenever the player is fast asleep or frozen solid.
; ccf2 is also set to 0 whenever the enemy is fast asleep or frozen solid. ; ccf2 is also set to 0 whenever the enemy is fast asleep or frozen solid.
@ -5132,19 +5140,19 @@ MirrorMoveCopyMove: ; 3e2fd (f:62fd)
ld a,[H_WHOSETURN] ld a,[H_WHOSETURN]
and a and a
; values for player turn ; values for player turn
ld a,[wccf2] ld a,[wEnemyUsedMove]
ld hl,wPlayerSelectedMove ld hl,wPlayerSelectedMove
ld de,W_PLAYERMOVENUM ld de,W_PLAYERMOVENUM
jr z,.next jr z,.next
; values for enemy turn ; values for enemy turn
ld a,[wccf1] ld a,[wPlayerUsedMove]
ld de,W_ENEMYMOVENUM ld de,W_ENEMYMOVENUM
ld hl,wEnemySelectedMove ld hl,wEnemySelectedMove
.next .next
ld [hl],a ld [hl],a
cp a,MIRROR_MOVE ; did the target Pokemon last use Mirror Move, and miss? cp a,MIRROR_MOVE ; did the target Pokemon last use Mirror Move, and miss?
jr z,.mirrorMoveFailed jr z,.mirrorMoveFailed
and a ; null move? and a ; has the target selected any move yet?
jr nz,ReloadMoveData jr nz,ReloadMoveData
.mirrorMoveFailed .mirrorMoveFailed
ld hl,MirrorMoveFailedText ld hl,MirrorMoveFailedText
@ -5618,9 +5626,9 @@ RandomizeDamage: ; 3e687 (f:6687)
ExecuteEnemyMove: ; 3e6bc (f:66bc) ExecuteEnemyMove: ; 3e6bc (f:66bc)
ld a, [wEnemySelectedMove] ld a, [wEnemySelectedMove]
inc a inc a
jp z, Func_3e88c jp z, ExecuteEnemyMoveDone
call PrintGhostText call PrintGhostText
jp z, Func_3e88c jp z, ExecuteEnemyMoveDone
ld a, [W_ISLINKBATTLE] ld a, [W_ISLINKBATTLE]
cp $4 cp $4
jr nz, .asm_3e6dc jr nz, .asm_3e6dc
@ -5639,12 +5647,12 @@ ExecuteEnemyMove: ; 3e6bc (f:66bc)
ld a, $a ld a, $a
ld [wd05b], a ld [wd05b], a
call CheckEnemyStatusConditions call CheckEnemyStatusConditions
jr nz, .canUseMove jr nz, .enemyHasNoSpecialConditions
jp [hl] jp [hl]
.canUseMove .enemyHasNoSpecialConditions
ld hl, W_ENEMYBATTSTATUS1 ld hl, W_ENEMYBATTSTATUS1
bit 4, [hl] ; is the enemy charging up for attack? bit 4, [hl] ; is the enemy charging up for attack?
jr nz, asm_3e70b ; if so, jump jr nz, enemyCanExecuteChargingMove ; if so, jump
call GetCurrentMove call GetCurrentMove
Func_3e6fc: ; 3e6fc (f:66fc) Func_3e6fc: ; 3e6fc (f:66fc)
@ -5653,8 +5661,8 @@ Func_3e6fc: ; 3e6fc (f:66fc)
jp z, JumpMoveEffect jp z, JumpMoveEffect
cp FLY_EFFECT cp FLY_EFFECT
jp z, JumpMoveEffect jp z, JumpMoveEffect
jr asm_3e72b jr enemyCanExecuteMove
asm_3e70b: ; 3e70b (f:670b) enemyCanExecuteChargingMove: ; 3e70b (f:670b)
ld hl, W_ENEMYBATTSTATUS1 ld hl, W_ENEMYBATTSTATUS1
res 4, [hl] ; no longer charging up for attack res 4, [hl] ; no longer charging up for attack
res 6, [hl] ; no longer invulnerable to typical attacks res 6, [hl] ; no longer invulnerable to typical attacks
@ -5667,7 +5675,7 @@ asm_3e70b: ; 3e70b (f:670b)
call GetName call GetName
ld de, wcd6d ld de, wcd6d
call CopyStringToCF4B call CopyStringToCF4B
asm_3e72b: ; 3e72b (f:672b) enemyCanExecuteMove: ; 3e72b (f:672b)
xor a xor a
ld [wcced], a ld [wcced], a
call PrintMonName1Text call PrintMonName1Text
@ -5681,7 +5689,7 @@ asm_3e72b: ; 3e72b (f:672b)
ld de, $1 ld de, $1
call IsInArray call IsInArray
call c, JumpMoveEffect call c, JumpMoveEffect
asm_3e750: ; 3e750 (f:6750) EnemyCalcMoveDamage: ; 3e750 (f:6750)
call SwapPlayerAndEnemyLevels call SwapPlayerAndEnemyLevels
ld a, [W_ENEMYMOVEEFFECT] ld a, [W_ENEMYMOVEEFFECT]
ld hl, SetDamageEffects ld hl, SetDamageEffects
@ -5762,7 +5770,7 @@ asm_3e7ef: ; 3e7ef (f:67ef)
cp MIRROR_MOVE_EFFECT cp MIRROR_MOVE_EFFECT
jr nz, .notMirrorMoveEffect jr nz, .notMirrorMoveEffect
call MirrorMoveCopyMove call MirrorMoveCopyMove
jp z, Func_3e88c jp z, ExecuteEnemyMoveDone
jp Func_3e6fc jp Func_3e6fc
.notMirrorMoveEffect .notMirrorMoveEffect
cp METRONOME_EFFECT cp METRONOME_EFFECT
@ -5782,7 +5790,7 @@ asm_3e7ef: ; 3e7ef (f:67ef)
ld a, [W_ENEMYMOVEEFFECT] ld a, [W_ENEMYMOVEEFFECT]
cp EXPLODE_EFFECT cp EXPLODE_EFFECT
jr z, .asm_3e83e jr z, .asm_3e83e
jp Func_3e88c jp ExecuteEnemyMoveDone
.asm_3e82b .asm_3e82b
call ApplyAttackToPlayerPokemon call ApplyAttackToPlayerPokemon
call PrintCriticalOHKOText call PrintCriticalOHKOText
@ -5817,18 +5825,18 @@ asm_3e7ef: ; 3e7ef (f:67ef)
.asm_3e873 .asm_3e873
ld a, [W_ENEMYMOVEEFFECT] ld a, [W_ENEMYMOVEEFFECT]
and a and a
jr z, Func_3e88c jr z, ExecuteEnemyMoveDone
ld hl, SpecialEffects ld hl, SpecialEffects
ld de, $1 ld de, $1
call IsInArray call IsInArray
call nc, JumpMoveEffect call nc, JumpMoveEffect
jr Func_3e88c jr ExecuteEnemyMoveDone
HitXTimesText: ; 3e887 (f:6887) HitXTimesText: ; 3e887 (f:6887)
TX_FAR _HitXTimesText TX_FAR _HitXTimesText
db "@" db "@"
Func_3e88c: ; 3e88c (f:688c) ExecuteEnemyMoveDone: ; 3e88c (f:688c)
ld b, $1 ld b, $1
ret ret
@ -5855,26 +5863,26 @@ CheckEnemyStatusConditions: ; 3e88f (f:688f)
call PrintText call PrintText
.next1 .next1
xor a xor a
ld [wccf2], a ld [wEnemyUsedMove], a
ld hl, Func_3e88c ld hl, ExecuteEnemyMoveDone
jp .cannotUseMove jp .enemyReturnToHL
.checkIfFrozen .checkIfFrozen
bit FRZ, [hl] bit FRZ, [hl]
jr z, .checkIfTrapped jr z, .checkIfTrapped
ld hl, IsFrozenText ld hl, IsFrozenText
call PrintText call PrintText
xor a xor a
ld [wccf2], a ld [wEnemyUsedMove], a
ld hl, Func_3e88c ld hl, ExecuteEnemyMoveDone
jp .cannotUseMove jp .enemyReturnToHL
.checkIfTrapped .checkIfTrapped
ld a, [W_PLAYERBATTSTATUS1] ld a, [W_PLAYERBATTSTATUS1]
bit 5, a ; is the player using a multi-turn attack like warp bit 5, a ; is the player using a multi-turn attack like warp
jp z, .checkIfFlinched jp z, .checkIfFlinched
ld hl, CantMoveText ld hl, CantMoveText
call PrintText call PrintText
ld hl, Func_3e88c ld hl, ExecuteEnemyMoveDone
jp .cannotUseMove jp .enemyReturnToHL
.checkIfFlinched .checkIfFlinched
ld hl, W_ENEMYBATTSTATUS1 ld hl, W_ENEMYBATTSTATUS1
bit 3, [hl] ; check if enemy mon flinched bit 3, [hl] ; check if enemy mon flinched
@ -5882,8 +5890,8 @@ CheckEnemyStatusConditions: ; 3e88f (f:688f)
res 3, [hl] res 3, [hl]
ld hl, FlinchedText ld hl, FlinchedText
call PrintText call PrintText
ld hl, Func_3e88c ld hl, ExecuteEnemyMoveDone
jp .cannotUseMove jp .enemyReturnToHL
.checkIfMustRecharge .checkIfMustRecharge
ld hl, W_ENEMYBATTSTATUS2 ld hl, W_ENEMYBATTSTATUS2
bit 5, [hl] ; check if enemy mon has to recharge after using a move bit 5, [hl] ; check if enemy mon has to recharge after using a move
@ -5891,8 +5899,8 @@ CheckEnemyStatusConditions: ; 3e88f (f:688f)
res 5, [hl] res 5, [hl]
ld hl, MustRechargeText ld hl, MustRechargeText
call PrintText call PrintText
ld hl, Func_3e88c ld hl, ExecuteEnemyMoveDone
jp .cannotUseMove jp .enemyReturnToHL
.checkIfAnyMoveDisabled .checkIfAnyMoveDisabled
ld hl, W_ENEMYDISABLEDMOVE ld hl, W_ENEMYDISABLEDMOVE
ld a, [hl] ld a, [hl]
@ -5910,7 +5918,7 @@ CheckEnemyStatusConditions: ; 3e88f (f:688f)
ld a, [W_ENEMYBATTSTATUS1] ld a, [W_ENEMYBATTSTATUS1]
add a ; check if enemy mon is confused add a ; check if enemy mon is confused
jp nc, .checkIfTriedToUseDisabledMove jp nc, .checkIfTriedToUseDisabledMove
ld hl, wd070 ld hl, W_ENEMYCONFUSEDCOUNTER
dec [hl] dec [hl]
jr nz, .isConfused jr nz, .isConfused
ld hl, W_ENEMYBATTSTATUS1 ld hl, W_ENEMYBATTSTATUS1
@ -5981,8 +5989,8 @@ CheckEnemyStatusConditions: ; 3e88f (f:688f)
cp [hl] cp [hl]
jr nz, .checkIfParalysed jr nz, .checkIfParalysed
call PrintMoveIsDisabledText call PrintMoveIsDisabledText
ld hl, Func_3e88c ld hl, ExecuteEnemyMoveDone
jp .cannotUseMove jp .enemyReturnToHL
.checkIfParalysed .checkIfParalysed
ld hl, wEnemyMonStatus ld hl, wEnemyMonStatus
bit PAR, [hl] bit PAR, [hl]
@ -6009,8 +6017,8 @@ CheckEnemyStatusConditions: ; 3e88f (f:688f)
ld a, STATUS_AFFECTED_ANIM ld a, STATUS_AFFECTED_ANIM
call PlayMoveAnimation call PlayMoveAnimation
.notFlyOrChargeEffect .notFlyOrChargeEffect
ld hl, Func_3e88c ld hl, ExecuteEnemyMoveDone
jp .cannotUseMove jp .enemyReturnToHL
.checkIfUsingBide .checkIfUsingBide
ld hl, W_ENEMYBATTSTATUS1 ld hl, W_ENEMYBATTSTATUS1
bit 0, [hl] ; is mon using bide? bit 0, [hl] ; is mon using bide?
@ -6031,8 +6039,8 @@ CheckEnemyStatusConditions: ; 3e88f (f:688f)
ld hl, wEnemyNumAttacksLeft ld hl, wEnemyNumAttacksLeft
dec [hl] dec [hl]
jr z, .unleashEnergy jr z, .unleashEnergy
ld hl, Func_3e88c ld hl, ExecuteEnemyMoveDone
jp .cannotUseMove jp .enemyReturnToHL
.unleashEnergy .unleashEnergy
ld hl, W_ENEMYBATTSTATUS1 ld hl, W_ENEMYBATTSTATUS1
res 0, [hl] ; not using bide any more res 0, [hl] ; not using bide any more
@ -6060,7 +6068,7 @@ CheckEnemyStatusConditions: ; 3e88f (f:688f)
ld [W_ENEMYMOVENUM], a ld [W_ENEMYMOVENUM], a
call SwapPlayerAndEnemyLevels call SwapPlayerAndEnemyLevels
ld hl, asm_3e782 ld hl, asm_3e782
jp .cannotUseMove jp .enemyReturnToHL
.checkIfThrashingAbout .checkIfThrashingAbout
bit 1, [hl] ; is mon using thrash or petal dance? bit 1, [hl] ; is mon using thrash or petal dance?
jr z, .checkIfUsingMultiturnMove jr z, .checkIfUsingMultiturnMove
@ -6070,8 +6078,8 @@ CheckEnemyStatusConditions: ; 3e88f (f:688f)
call PrintText call PrintText
ld hl, wEnemyNumAttacksLeft ld hl, wEnemyNumAttacksLeft
dec [hl] dec [hl]
ld hl, asm_3e750 ld hl, EnemyCalcMoveDamage
jp nz, .cannotUseMove jp nz, .enemyReturnToHL
push hl push hl
ld hl, W_ENEMYBATTSTATUS1 ld hl, W_ENEMYBATTSTATUS1
res 1, [hl] ; mon is no longer using thrash or petal dance res 1, [hl] ; mon is no longer using thrash or petal dance
@ -6080,9 +6088,9 @@ CheckEnemyStatusConditions: ; 3e88f (f:688f)
and $3 and $3
inc a inc a
inc a inc a
ld [wd070], a ld [W_ENEMYCONFUSEDCOUNTER], a
pop hl pop hl
jp .cannotUseMove jp .enemyReturnToHL
.checkIfUsingMultiturnMove .checkIfUsingMultiturnMove
bit 5, [hl] ; is mon using multi-turn move? bit 5, [hl] ; is mon using multi-turn move?
jp z, .checkIfUsingRage jp z, .checkIfUsingRage
@ -6091,24 +6099,24 @@ CheckEnemyStatusConditions: ; 3e88f (f:688f)
ld hl, wEnemyNumAttacksLeft ld hl, wEnemyNumAttacksLeft
dec [hl] dec [hl]
ld hl, Func_3e794 ld hl, Func_3e794
jp nz, .cannotUseMove jp nz, .enemyReturnToHL
jp .cannotUseMove jp .enemyReturnToHL
.checkIfUsingRage .checkIfUsingRage
ld a, [W_ENEMYBATTSTATUS2] ld a, [W_ENEMYBATTSTATUS2]
bit 6, a ; is mon using rage? bit 6, a ; is mon using rage?
jp z, .canUseMove jp z, .checkEnemyStatusConditionsDone
ld a, RAGE ld a, RAGE
ld [wd11e], a ld [wd11e], a
call GetMoveName call GetMoveName
call CopyStringToCF4B call CopyStringToCF4B
xor a xor a
ld [W_ENEMYMOVEEFFECT], a ld [W_ENEMYMOVEEFFECT], a
ld hl, asm_3e72b ld hl, enemyCanExecuteMove
jp .cannotUseMove jp .enemyReturnToHL
.cannotUseMove .enemyReturnToHL
xor a ; set Z flag xor a ; set Z flag
ret ret
.canUseMove .checkEnemyStatusConditionsDone
ld a, $1 ld a, $1
and a ; clear Z flag and a ; clear Z flag
ret ret
@ -7114,13 +7122,13 @@ MoveEffectPointerTable: ; 3f150 (f:7150)
dw SwitchAndTeleportEffect ; SWITCH_AND_TELEPORT_EFFECT dw SwitchAndTeleportEffect ; SWITCH_AND_TELEPORT_EFFECT
dw TwoToFiveAttacksEffect ; TWO_TO_FIVE_ATTACKS_EFFECT dw TwoToFiveAttacksEffect ; TWO_TO_FIVE_ATTACKS_EFFECT
dw TwoToFiveAttacksEffect ; unused effect dw TwoToFiveAttacksEffect ; unused effect
dw FlichSideEffect ; FLINCH_SIDE_EFFECT1 dw FlinchSideEffect ; FLINCH_SIDE_EFFECT1
dw SleepEffect ; SLEEP_EFFECT dw SleepEffect ; SLEEP_EFFECT
dw PoisonEffect ; POISON_SIDE_EFFECT2 dw PoisonEffect ; POISON_SIDE_EFFECT2
dw FreezeBurnParalyzeEffect ; BURN_SIDE_EFFECT2 dw FreezeBurnParalyzeEffect ; BURN_SIDE_EFFECT2
dw FreezeBurnParalyzeEffect ; unused effect dw FreezeBurnParalyzeEffect ; unused effect
dw FreezeBurnParalyzeEffect ; PARALYZE_SIDE_EFFECT2 dw FreezeBurnParalyzeEffect ; PARALYZE_SIDE_EFFECT2
dw FlichSideEffect ; FLINCH_SIDE_EFFECT2 dw FlinchSideEffect ; FLINCH_SIDE_EFFECT2
dw OneHitKOEffect ; OHKO_EFFECT dw OneHitKOEffect ; OHKO_EFFECT
dw ChargeEffect ; CHARGE_EFFECT dw ChargeEffect ; CHARGE_EFFECT
dw $0000 ; SUPER_FANG_EFFECT dw $0000 ; SUPER_FANG_EFFECT
@ -7186,7 +7194,7 @@ SleepEffect: ; 3f1fc (f:71fc)
res 5, a ; target no longer needs to recharge res 5, a ; target no longer needs to recharge
ld [bc], a ld [bc], a
jr nz, .setSleepCounter ; if the target had to recharge, all hit tests will be skipped jr nz, .setSleepCounter ; if the target had to recharge, all hit tests will be skipped
; including the event where the target already has another status ; including the event where the target already has another status
ld a, [de] ld a, [de]
ld b, a ld b, a
and $7 and $7
@ -7393,7 +7401,7 @@ FreezeBurnParalyzeEffect: ; 3f30c (f:730c)
ld hl, BurnedText ld hl, BurnedText
jp PrintText jp PrintText
.freeze .freeze
call ClearHyperBeam ; resets hyper beam (recharge) condition from both players call ClearHyperBeam ; resets hyper beam (recharge) condition from target
ld a, 1 << FRZ ld a, 1 << FRZ
ld [wEnemyMonStatus], a ld [wEnemyMonStatus], a
ld a, ANIM_A9 ld a, ANIM_A9
@ -7556,7 +7564,7 @@ StatModifierUpEffect: ; 3f428 (f:7428)
sbc $3 sbc $3
jp z, Func_3f520 jp z, Func_3f520
.recalculateStat ; recalculate affected stat .recalculateStat ; recalculate affected stat
; paralysis and burn penalties, as well as badge boosts are ignored ; paralysis and burn penalties, as well as badge boosts are ignored
push hl push hl
push bc push bc
ld hl, StatModifierRatios ld hl, StatModifierRatios
@ -7639,7 +7647,7 @@ UpdateStatDone: ; 3f4ca (f:74ca)
ld a, [H_WHOSETURN] ld a, [H_WHOSETURN]
and a and a
call z, ApplyBadgeStatBoosts ; whenever the player uses a stat-up move, badge boosts get reapplied again to every stat, call z, ApplyBadgeStatBoosts ; whenever the player uses a stat-up move, badge boosts get reapplied again to every stat,
; even to those not affected by the stat-up move (will be boosted further) ; even to those not affected by the stat-up move (will be boosted further)
ld hl, MonsStatsRoseText ld hl, MonsStatsRoseText
call PrintText call PrintText
@ -7829,7 +7837,7 @@ UpdateStat2Done: ; 3f62c (f:762c)
ld a, [H_WHOSETURN] ld a, [H_WHOSETURN]
and a and a
call nz, ApplyBadgeStatBoosts ; whenever the player uses a stat-down move, badge boosts get reapplied again to every stat, call nz, ApplyBadgeStatBoosts ; whenever the player uses a stat-down move, badge boosts get reapplied again to every stat,
; even to those not affected by the stat-up move (will be boosted further) ; even to those not affected by the stat-up move (will be boosted further)
ld hl, MonsStatsFellText ld hl, MonsStatsFellText
call PrintText call PrintText
@ -8128,23 +8136,23 @@ TwoToFiveAttacksEffect: ; 3f811 (f:7811)
ld [hl], a ; set Twineedle's effect to poison effect ld [hl], a ; set Twineedle's effect to poison effect
jr .saveNumberOfHits jr .saveNumberOfHits
FlichSideEffect: ; 3f85b (f:785b) FlinchSideEffect: ; 3f85b (f:785b)
call CheckTargetSubstitute call CheckTargetSubstitute
ret nz ret nz
ld hl, W_ENEMYBATTSTATUS1 ld hl, W_ENEMYBATTSTATUS1
ld de, W_PLAYERMOVEEFFECT ld de, W_PLAYERMOVEEFFECT
ld a, [H_WHOSETURN] ld a, [H_WHOSETURN]
and a and a
jr z, .asm_3f870 jr z, .flinchSideEffect
ld hl, W_PLAYERBATTSTATUS1 ld hl, W_PLAYERBATTSTATUS1
ld de, W_ENEMYMOVEEFFECT ld de, W_ENEMYMOVEEFFECT
.asm_3f870 .flinchSideEffect
ld a, [de] ld a, [de]
cp FLINCH_SIDE_EFFECT1 cp FLINCH_SIDE_EFFECT1
ld b, $1a ; ~10% chance of flinch ld b, $1a ; ~10% chance of flinch
jr z, .asm_3f879 jr z, .gotEffectChance
ld b, $4d ; ~30% chance of flinch ld b, $4d ; ~30% chance of flinch
.asm_3f879 .gotEffectChance
call BattleRandom call BattleRandom
cp b cp b
ret nc ret nc
@ -8163,25 +8171,25 @@ ChargeEffect: ; 3f88c (f:788c)
ld a, [H_WHOSETURN] ld a, [H_WHOSETURN]
and a and a
ld b, XSTATITEM_ANIM ld b, XSTATITEM_ANIM
jr z, .asm_3f8a1 jr z, .chargeEffect
ld hl, W_ENEMYBATTSTATUS1 ld hl, W_ENEMYBATTSTATUS1
ld de, W_ENEMYMOVEEFFECT ld de, W_ENEMYMOVEEFFECT
ld b, ANIM_AF ld b, ANIM_AF
.asm_3f8a1 .chargeEffect
set 4, [hl] set 4, [hl]
ld a, [de] ld a, [de]
dec de ; de contains enemy or player MOVENUM dec de ; de contains enemy or player MOVENUM
cp FLY_EFFECT cp FLY_EFFECT
jr nz, .asm_3f8ad jr nz, .notFly
set 6, [hl] ; mon is now invulnerable to typical attacks (fly/dig) set 6, [hl] ; mon is now invulnerable to typical attacks (fly/dig)
ld b, TELEPORT ld b, TELEPORT ; load Teleport's animation
.asm_3f8ad .notFly
ld a, [de] ld a, [de]
cp DIG cp DIG
jr nz, .asm_3f8b6 jr nz, .notDigOrFly
set 6, [hl] ; mon is now invulnerable to typical attacks (fly/dig) set 6, [hl] ; mon is now invulnerable to typical attacks (fly/dig)
ld b, ANIM_C0 ld b, ANIM_C0
.asm_3f8b6 .notDigOrFly
xor a xor a
ld [wcc5b], a ld [wcc5b], a
ld a, b ld a, b
@ -8244,21 +8252,22 @@ TrappingEffect: ; 3f917 (f:7917)
ld de, wPlayerNumAttacksLeft ld de, wPlayerNumAttacksLeft
ld a, [H_WHOSETURN] ld a, [H_WHOSETURN]
and a and a
jr z, .asm_3f928 jr z, .trappingEffect
ld hl, W_ENEMYBATTSTATUS1 ld hl, W_ENEMYBATTSTATUS1
ld de, wEnemyNumAttacksLeft ld de, wEnemyNumAttacksLeft
.asm_3f928 .trappingEffect
bit 5, [hl] bit 5, [hl]
ret nz ret nz
call ClearHyperBeam call ClearHyperBeam ; since this effect is called before testing whether the move will hit,
set 5, [hl] ; the target won't need to recharge even if the trapping move missed
call BattleRandom set 5, [hl] ; mon is now using a trapping move
call BattleRandom ; 3/8 chance for 2 and 3 attacks, and 1/8 chance for 4 and 5 attacks
and $3 and $3
cp $2 cp $2
jr c, .asm_3f93e jr c, .setTrappingCounter
call BattleRandom call BattleRandom
and $3 and $3
.asm_3f93e .setTrappingCounter
inc a inc a
ld [de], a ld [de], a
ret ret
@ -8282,36 +8291,36 @@ ConfusionSideEffect: ; 3f959 (f:7959)
call BattleRandom call BattleRandom
cp $19 cp $19
ret nc ret nc
jr Func_3f96f jr ConfusionSideEffectSuccess
ConfusionEffect: ; 3f961 (f:7961) ConfusionEffect: ; 3f961 (f:7961)
call CheckTargetSubstitute call CheckTargetSubstitute
jr nz, Func_3f9a6 jr nz, ConfusionEffectFailed
call MoveHitTest call MoveHitTest
ld a, [W_MOVEMISSED] ld a, [W_MOVEMISSED]
and a and a
jr nz, Func_3f9a6 jr nz, ConfusionEffectFailed
Func_3f96f: ; 3f96f (f:796f) ConfusionSideEffectSuccess: ; 3f96f (f:796f)
ld a, [H_WHOSETURN] ld a, [H_WHOSETURN]
and a and a
ld hl, W_ENEMYBATTSTATUS1 ld hl, W_ENEMYBATTSTATUS1
ld bc, wd070 ld bc, W_ENEMYCONFUSEDCOUNTER
ld a, [W_PLAYERMOVEEFFECT] ld a, [W_PLAYERMOVEEFFECT]
jr z, .asm_3f986 jr z, .confuseTarget
ld hl, W_PLAYERBATTSTATUS1 ld hl, W_PLAYERBATTSTATUS1
ld bc, wd06b ld bc, W_PLAYERCONFUSEDCOUNTER
ld a, [W_ENEMYMOVEEFFECT] ld a, [W_ENEMYMOVEEFFECT]
.asm_3f986 .confuseTarget
bit 7, [hl] ; is mon confused? bit 7, [hl] ; is mon confused?
jr nz, Func_3f9a6 jr nz, ConfusionEffectFailed
set 7, [hl] ; mon is now confused set 7, [hl] ; mon is now confused
push af push af
call BattleRandom call BattleRandom
and $3 and $3
inc a inc a
inc a inc a
ld [bc], a ld [bc], a ; confusion status will last 2-5 turns
pop af pop af
cp CONFUSION_SIDE_EFFECT cp CONFUSION_SIDE_EFFECT
call nz, Func_3fb89 call nz, Func_3fb89
@ -8322,7 +8331,7 @@ BecameConfusedText: ; 3f9a1 (f:79a1)
TX_FAR _BecameConfusedText TX_FAR _BecameConfusedText
db "@" db "@"
Func_3f9a6: ; 3f9a6 (f:79a6) ConfusionEffectFailed: ; 3f9a6 (f:79a6)
cp CONFUSION_SIDE_EFFECT cp CONFUSION_SIDE_EFFECT
ret z ret z
ld c, $32 ld c, $32
@ -8343,9 +8352,9 @@ HyperBeamEffect: ; 3f9c1 (f:79c1)
ld hl, W_PLAYERBATTSTATUS2 ld hl, W_PLAYERBATTSTATUS2
ld a, [H_WHOSETURN] ld a, [H_WHOSETURN]
and a and a
jr z, .asm_3f9cc jr z, .hyperBeamEffect
ld hl, W_ENEMYBATTSTATUS2 ld hl, W_ENEMYBATTSTATUS2
.asm_3f9cc .hyperBeamEffect
set 5, [hl] ; mon now needs to recharge set 5, [hl] ; mon now needs to recharge
ret ret

View file

@ -379,8 +379,8 @@ wcced:: ds 1
wccee:: ds 1 wccee:: ds 1
wccef:: ds 1 wccef:: ds 1
wccf0:: ds 1 wccf0:: ds 1
wccf1:: ds 1 wPlayerUsedMove:: ds 1
wccf2:: ds 1 wEnemyUsedMove:: ds 1
wccf3:: ds 1 wccf3:: ds 1
wccf4:: ds 1 wccf4:: ds 1
@ -935,7 +935,8 @@ wPlayerNumAttacksLeft::
; when the player is attacking multiple times, the number of attacks left ; when the player is attacking multiple times, the number of attacks left
ds 1 ds 1
wd06b:: ds 1 W_PLAYERCONFUSEDCOUNTER:: ; wd06b
ds 1
W_PLAYERTOXICCOUNTER:: ; d06c W_PLAYERTOXICCOUNTER:: ; d06c
ds 1 ds 1
@ -945,10 +946,11 @@ W_PLAYERDISABLEDMOVE:: ; d06d
ds 1 ds 1
wEnemyNumAttacksLeft:: wEnemyNumAttacksLeft::
; when the player is attacking multiple times, the number of attacks left ; when the enemy is attacking multiple times, the number of attacks left
ds 1 ds 1
wd070:: ds 1 W_ENEMYCONFUSEDCOUNTER:: ; wd070
ds 1
W_ENEMYTOXICCOUNTER:: ; d071 W_ENEMYTOXICCOUNTER:: ; d071
ds 1 ds 1