![]() |
Routines |
H | Number of stricken character (183-209) |
30102 | LD L,19 | Byte 19 of the character's buffer holds the knockout delay counter |
30104 | DEC (HL) | Has the character already got up? |
30105 | JP Z,25492 | Remove the address of this routine from the character's buffer if so |
30108 | LD A,(HL) | A=knockout delay counter |
30109 | DEC A | Is it time for the character to get up yet? |
30110 | JR NZ,30121 | Jump if not |
30112 | CALL 25012 | Update SRB for the character's current animatory state |
30115 | LD L,20 | Byte 20 of the character's buffer holds the animatory state saved earlier |
30117 | LD A,(HL) | Pick this up in A |
30118 | JP 24880 | Update SRB for the character's new animatory state |
30121 | DEC A | Jump forward unless the knockout delay counter has reached 2 |
30122 | JR NZ,30137 | |
30124 | LD A,H | A=number of stricken character |
30125 | CP 205 | Is it ALBERT? |
30127 | RET NZ | Return if not |
30128 | LD A,(32740) | 32740 holds the MSB of the lesson time counter |
30131 | AND A | Is the lesson nearly over? |
30132 | RET Z | Return if so |
30133 | LD L,19 | Set the knockout delay counter to 3 so that ALBERT will not get up until the lesson's almost over |
30135 | INC (HL) | |
30136 | RET |
30137 | CP 15 | Is it time for the character to fall over? |
30139 | JR NZ,30180 | Jump if not |
30141 | LD A,H | A=number of stricken character |
30142 | LD DE,32740 | 32740 holds the MSB of the lesson time counter |
30145 | CP 205 | Was ALBERT struck? |
30147 | JR NZ,30155 | Jump if not |
30149 | LD A,(DE) | Add 12 to the MSB of the lesson time counter if ALBERT was knocked down, thus giving ERIC some extra time to work with |
30150 | ADD A,12 | |
30152 | LD (DE),A | |
30153 | JR 30167 | Knock ALBERT down |
30155 | CP 209 | Was HAYLEY struck? |
30157 | JR NZ,30167 | Jump if not |
30159 | LD E,226 | DE=32738 (number of kisses left) |
30161 | LD A,(DE) | Pick this up in A |
30162 | AND A | Are there any kisses left? |
30163 | JR Z,30167 | Jump if not |
30165 | DEC A | Otherwise decrease the number of kisses left by 1 |
30166 | LD (DE),A |
30167 | CALL 25012 | Update SRB for the character's current animatory state |
30170 | LD L,20 | Store the character's current animatory state in byte 20 of the buffer for retrieval later |
30172 | LD (HL),A | |
30173 | AND 248 | A=animatory state of character knocked down |
30175 | ADD A,6 | |
30177 | JP 24880 | Update SRB for the character's new animatory state |
30180 | CP 8 | Is it time for a felled teacher to give lines? |
30182 | RET NZ | Return if not |
30183 | LD A,H | A=number of stricken character |
30184 | CP 200 | Return if it's not a teacher |
30186 | RET C | |
30187 | CP 205 | |
30189 | RET NC | |
30190 | PUSH HL | |
30191 | CALL 28029 | Find the main kid who is closest to the teacher and within lines-giving range (if any) |
30194 | POP HL | |
30195 | AND A | Is there a main kid close enough to the felled teacher? |
30196 | RET Z | Return if not |
30197 | LD B,15 | Message number 15: NOW DON'T DO IT AGAIN |
30199 | JP 29716 | Give lines to the nearest main kid |