Skool Daze Routines
28569: Check whether anyone was hit by fist
Continues from 28558, and is also used by the routine at 62628.
H 168 (ANGELFACE) or 172 (ERIC)
28569 LD L,98 Byte 98 holds the puncher's x-coordinate
28571 LD A,(HL) Pick this up in A
28572 DEC L L=97
28573 LD D,(HL) Pick up the puncher's y-coordinate in D
28574 DEC L L=96
28575 LD C,(HL) Pick up the puncher's animatory state in C
28576 SUB 2 Get the x-coordinate of the location two spaces in front of the puncher in A
28578 BIT 7,(HL)
28580 JR Z,28584
28582 ADD A,4
28584 LD E,A Store the potential victim's x-coordinate in E
28585 LD A,(32763) Pick up ERIC's status flags in A
28588 AND A Is ERIC doing the punching?
28589 JR NZ,28606 Jump if so
28591 LD H,172 172=ERIC
28593 CALL 28416 Was ERIC punched?
28596 JR NC,28606 Jump if not
28598 LD DE,32763 32763 holds ERIC's status flags
28601 EX DE,HL
28602 SET 4,(HL) Signal: ERIC was hit
28604 EX DE,HL
28605 RET
Now we check to see if anyone was punched. We start with the three main kids.
28606 LD B,3 There are three main kids
28608 LD H,169 169=EINSTEIN
28610 CALL 28416 Was this main kid punched?
28613 JR NC,28626 Jump if not
28615 LD L,111 Place the address of the routine at 27206 in bytes 111 and 112 of the victim's character buffer
28617 LD (HL),70
28619 INC L
28620 LD (HL),106
28622 INC L Initialise the parameter determining how long the character will stay down (in byte 113)
28623 LD (HL),20
28625 RET
28626 DEC H Next main kid
28627 DJNZ 28610 Jump back until three main kids have been considered
So none of the main kids was hit. What about the little boys?
28629 LD H,152 152=character number of little boy no. 1
28631 LD B,11 There are 11 little boys
28633 CALL 28416 Was this little boy hit?
28636 JR C,28615 Jump if so
28638 INC H Next little boy
28639 DJNZ 28633 Jump back until all 11 little boys have been considered
28641 RET