Routines

30102: Deal with character who has been knocked over


The address of this routine is placed in bytes 17 and 18 of the stricken character's buffer by the routine at 29987

H Number of stricken character (183-209)

30102 2E13 LD L,19
30104 35 DEC (HL) Has the character got up?
30105 CA9463 JP Z,25492 Jump if so
30108 7E LD A,(HL)
30109 3D DEC A Is it time for the character to get up yet?
30110 2009 JR NZ,30121 Jump if not

This entry point is used by the routine at 63801:
30112 CDB461 CALL 25012 Update SRB for character's current animatory state

This entry point is used by the routine at 28978:
30115 2E14 LD L,20
30117 7E LD A,(HL) A=character's original animatory state
30118 C33061 JP 24880 Update SRB for character's new animatory state

It's not time for the character to get up yet.
30121 3D DEC A
30122 200D JR NZ,30137
30124 7C LD A,H
30125 FECD CP 205 Was ALBERT knocked over?
30127 C0 RET NZ Return if not
30128 3AE47F LD A,(32740)
30131 A7 AND A
30132 C8 RET Z Return if near end of lesson
30133 2E13 LD L,19
30135 34 INC (HL) ALBERT will not get up until the lesson's almost over
30136 C9 RET
30137 FE0F CP 15 Is it time for the character to fall over?
30139 2027 JR NZ,30180 Jump if not
30141 7C LD A,H
30142 11E47F LD DE,32740
30145 FECD CP 205 Was ALBERT knocked down?
30147 2006 JR NZ,30155 Jump if not
30149 1A LD A,(DE) Add 12 to the MSB of the lesson time counter if ALBERT was knocked down
30150 C60C ADD A,12
30152 12 LD (DE),A
30153 180C JR 30167
30155 FED1 CP 209 Was HAYLEY knocked down?
30157 2008 JR NZ,30167 Jump if not
30159 1EE2 LD E,226 DE=32738
30161 1A LD A,(DE) A=number of kisses left
30162 A7 AND A Are there any kisses left?
30163 2802 JR Z,30167 Jump if not
30165 3D DEC A Otherwise decrease the number of kisses left by 1
30166 12 LD (DE),A
30167 CDB461 CALL 25012 Update SRB for character's current animatory state
30170 2E14 LD L,20 Store character's current animatory state in byte 20 of the buffer for retrieval later
30172 77 LD (HL),A
30173 E6F8 AND 248
30175 C606 ADD A,6 A=animatory state of character knocked down
30177 C33061 JP 24880 Update SRB for character's new animatory state
30180 FE08 CP 8 Is it time for a felled teacher to give lines?
30182 C0 RET NZ Return if not
30183 7C LD A,H A=number of stricken character
30184 FEC8 CP 200 Return if not a teacher
30186 D8 RET C
30187 FECD CP 205
30189 D0 RET NC
30190 E5 PUSH HL
30191 CD7D6D CALL 28029 Find main kid nearest teacher (if any)
30194 E1 POP HL
30195 A7 AND A Was there a main kid near the felled teacher?
30196 C8 RET Z Return if not
30197 060F LD B,15 Message no. 15: NOW DON'T DO IT AGAIN
30199 C31474 JP 29716 Give lines to the nearest main kid