| Routines

30739: Deal with ANGELFACE when he is hitting

The address of this uninterruptible subcommand routine is placed into bytes 17 and 18 of ANGELFACE's buffer by the routine at 30706. It controls ANGELFACE from the beginning to the end of the swing, and knocks over any unfortunate kid whose face comes into contact with the fist.
Input
H | 207 (ANGELFACE)
30739 | CALL 25012 | Update the SRB for ANGELFACE's current animatory state and location
30742 | LD L,20 | Store ANGELFACE's current (pre-punch) animatory state in byte 20 of his buffer temporarily
30744 | LD (HL),A
30745 | AND 240 |
30747 | ADD A,8 | A=40 or 168: ANGELFACE raising his arm
30749 | CALL 30534 | Update ANGELFACE's animatory state and return to 30752 (below) next time
This entry point is used by the routine at 24263 to check whether ERIC has hit anyone.
30752 | LD B,2 | Is there anyone 2 spaces in front of the puncher and facing him?
30754 | CALL 30664
30757 | JR C,30778 | Jump if not
30759 | CALL 29987 | Knock the punched character over
30762 | EX DE,HL | H=puncher's character number, D=victim's character number
30763 | LD A,H | A=puncher's character number
30764 | CP 210 | Was ERIC the assailant?
30766 | JR NZ,30778 | Jump if not
30768 | LD A,D | D=victim's character number
30769 | CP 207 | Did ERIC knock ANGELFACE over?
30771 | JR NZ,30778 | Jump if not
30773 | LD A,3 | ERIC has punched ANGELFACE; add 30 to the score and print it
30775 | CALL 29621
30778 | CALL 25012 | Update the SRB for the punching character's current animatory state
30781 | INC A | A=animatory state of the punching character with his fist fully raised
30782 | JP 30647 | Update the punching character's animatory state, then start the process of lowering the puncher's arm (if it was ANGELFACE)