Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pret
GitHub Repository: pret/pokered
Path: blob/master/engine/battle/move_effects/paralyze.asm
1271 views
1
ParalyzeEffect_:
2
ld hl, wEnemyMonStatus
3
ld de, wPlayerMoveType
4
ldh a, [hWhoseTurn]
5
and a
6
jp z, .next
7
ld hl, wBattleMonStatus
8
ld de, wEnemyMoveType
9
.next
10
ld a, [hl]
11
and a ; does the target already have a status ailment?
12
jr nz, .didntAffect
13
; check if the target is immune due to types
14
ld a, [de]
15
cp ELECTRIC
16
jr nz, .hitTest
17
ld b, h
18
ld c, l
19
inc bc
20
ld a, [bc]
21
cp GROUND
22
jr z, .doesntAffect
23
inc bc
24
ld a, [bc]
25
cp GROUND
26
jr z, .doesntAffect
27
.hitTest
28
push hl
29
callfar MoveHitTest
30
pop hl
31
ld a, [wMoveMissed]
32
and a
33
jr nz, .didntAffect
34
set PAR, [hl]
35
callfar QuarterSpeedDueToParalysis
36
ld c, 30
37
call DelayFrames
38
callfar PlayCurrentMoveAnimation
39
jpfar PrintMayNotAttackText
40
.didntAffect
41
ld c, 50
42
call DelayFrames
43
jpfar PrintDidntAffectText
44
.doesntAffect
45
ld c, 50
46
call DelayFrames
47
jpfar PrintDoesntAffectText
48
49