Skool Daze Routines
Prev: 27297 Up: Map Next: 27351
27303: Deal with ERIC if he's been hit by fist or pellet
Used by the routine at 27353 when bit 4 of ERIC's status flags at 32763 is set by the routine at 28569, 27932 or 27543.
27303 LD HL,32757 32757 holds the delay counter used when ERIC has been knocked out; pick up its value in A
27306 LD A,(HL)
27307 AND A Has ERIC just been hit?
27308 JR Z,27319 Adjust his animatory state if so
27310 DEC (HL) Decrement the delay counter
27311 JP NZ,65111 Make a knocked-out sound effect if ERIC's just been hit
27314 LD L,251 HL=32763 (ERIC's status flags)
27316 LD (HL),128 Set bit 7 (indicating that ERIC is sitting or lying down)
27318 RET
ERIC has just been hit.
27319 LD (HL),40 Initialise the delay counter at 32757 to 40
27321 LD L,233 Set 32745 to 0, indicating that ERIC is not midstride
27323 LD (HL),A
27324 LD L,251 HL=32763 (ERIC's status flags)
27326 LD (HL),144 Set bits 7 and 4
27328 LD H,172 172=ERIC
27330 CALL 25108 Update SRB for ERIC's current location
27333 CP 5 5=animatory state of ERIC sitting on a chair
27335 JR Z,27341 Jump if ERIC's sitting on a chair
27337 AND 128
27339 ADD A,6
27341 INC A A=6/134 (sitting on the floor) or 7/135 (lying on back)
27342 LD B,A Store ERIC's new animatory state in B temporarily
27343 LD A,D A=ERIC's y-coordinate
27344 CALL 31242 Get the y-coordinate of the floor ERIC's on in D
27347 LD A,B Restore ERIC's new animatory state to A
27348 JP 25008 Update ERIC's animatory state and update SRB
Prev: 27297 Up: Map Next: 27351