Routines
Prev:
37639
Up:
Map
Next:
37753
37718: Script routine: (41) Move spider up one character and, if home, reset its timer and make it wait
Used by the routine at
48096
.
Input
IX
Address of complex state data for an entity
Output
HL
New address in script data
37718
LD A,(IX+6)
If y-coordinate of bottom of entity
IX
(spider) is not 106...
37721
CP 106
...
37723
JP NZ,
48541
...then move entity up one character and return
37726
LD C,20
Load
C
with 20
37728
LD A,(IX+8)
If entity class is not 27 (right-most spider, level 1)...
37731
CP 27
...
37733
JR NZ,37744
...then skip ahead to
37744
The following code affects the behaviour of the right-most spider depending upon how many times Berk has been killed by a spider. See (
trivia
) and (
pokes
).
37735
LD A,(34223)
Load number of times Berk has been killed by a spider into
A
...
37738
SRL A
...and divide by four, discarding remainder...
37740
SRL A
...
37742
ADD A,C
Add this value to
C
, in
C
...
37743
LD C,A
...
37744
LD (IX+12),C
Load spider's timer with this value
37747
LD HL,37792
Point
HL
at script data for spider waiting...
37750
JP
48098
...and execute
Prev:
37639
Up:
Map
Next:
37753