summaryrefslogtreecommitdiff
path: root/engine/battle/14.asm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/battle/14.asm')
-rwxr-xr-xengine/battle/14.asm64
1 files changed, 32 insertions, 32 deletions
diff --git a/engine/battle/14.asm b/engine/battle/14.asm
index cabaae07..1b2d7462 100755
--- a/engine/battle/14.asm
+++ b/engine/battle/14.asm
@@ -1,4 +1,4 @@
-Func_525af: ; 525af (14:65af)
+InitBattleVariables: ; 525af (14:65af)
ld a, [hTilesetType]
ld [wd0d4], a
xor a
@@ -9,7 +9,7 @@ Func_525af: ; 525af (14:65af)
ld [hli], a
ld [hli], a
ld [hl], a
- ld [wListScrollOffset], a ; wcc36
+ ld [wListScrollOffset], a
ld [wCriticalHitOrOHKO], a
ld [wBattleMonSpecies], a
ld [wPartyGainExpFlags], a
@@ -21,73 +21,73 @@ Func_525af: ; 525af (14:65af)
ld [hl], a
ld hl, wccd3
ld b, $3c
-.asm_525e1
+.loop
ld [hli], a
dec b
- jr nz, .asm_525e1
+ jr nz, .loop
inc a
ld [wccd9], a
ld a, [W_CURMAP]
cp SAFARI_ZONE_EAST
- jr c, .asm_525f9
+ jr c, .notSafariBattle
cp SAFARI_ZONE_REST_HOUSE_1
- jr nc, .asm_525f9
- ld a, $2
- ld [W_BATTLETYPE], a ; wd05a
-.asm_525f9
+ jr nc, .notSafariBattle
+ ld a, $2 ; safari battle
+ ld [W_BATTLETYPE], a
+.notSafariBattle
ld hl, PlayBattleMusic
ld b, BANK(PlayBattleMusic)
jp Bankswitch
ParalyzeEffect_: ; 52601 (14:6601)
- ld hl, wEnemyMonStatus ; wcfe9
- ld de, W_PLAYERMOVETYPE ; wcfd5
- ld a, [H_WHOSETURN] ; $fff3
+ ld hl, wEnemyMonStatus
+ ld de, W_PLAYERMOVETYPE
+ ld a, [H_WHOSETURN]
and a
- jp z, .asm_52613
+ jp z, .next
ld hl, wBattleMonStatus
- ld de, W_ENEMYMOVETYPE ; wcfcf
-
-.asm_52613
+ ld de, W_ENEMYMOVETYPE
+.next
ld a, [hl]
- and a
- jr nz, .asm_52659
+ and a ; does the target already have a status ailment?
+ jr nz, .didntAffect
+; check if the target is immune due to types
ld a, [de]
- cp EVASION_DOWN1_EFFECT
- jr nz, .asm_5262a
+ cp ELECTRIC
+ jr nz, .hitTest
ld b, h
ld c, l
inc bc
ld a, [bc]
- cp $4
- jr z, .asm_52666
+ cp GROUND
+ jr z, .doesntAffect
inc bc
ld a, [bc]
- cp $4
- jr z, .asm_52666
-.asm_5262a
+ cp GROUND
+ jr z, .doesntAffect
+.hitTest
push hl
callab MoveHitTest
pop hl
ld a, [W_MOVEMISSED]
and a
- jr nz, .asm_52659
+ jr nz, .didntAffect
set PAR, [hl]
callab QuarterSpeedDueToParalysis
- ld c, $1e
+ ld c, 30
call DelayFrames
- callab Func_3fba8
+ callab PlayCurrentMoveAnimation
ld hl, PrintMayNotAttackText
ld b, BANK(PrintMayNotAttackText)
jp Bankswitch
-.asm_52659
- ld c, $32
+.didntAffect
+ ld c, 50
call DelayFrames
ld hl, PrintDidntAffectText
ld b, BANK(PrintDidntAffectText)
jp Bankswitch
-.asm_52666
- ld c, $32
+.doesntAffect
+ ld c, 50
call DelayFrames
ld hl, PrintDoesntAffectText
ld b, BANK(PrintDoesntAffectText)