| Routines

7813: Deal with ANGELFACE when he is hitting

The address of this uninterruptible subcommand routine is placed into bytes 0x11 and 0x12 of ANGELFACE's buffer by the routine at 77F2. 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 | 0xCF (ANGELFACE)
7813 | CALL $61B4 | Update the SRB for ANGELFACE's current animatory state and location
7816 | LD L,$14 | Store ANGELFACE's current (pre-punch) animatory state in byte 0x14 of his buffer temporarily
7818 | LD (HL),A
7819 | AND $F0 |
781B | ADD A,$08 | A=0x28 or 0xA8: ANGELFACE raising his arm
781D | CALL $7746 | Update ANGELFACE's animatory state and return to 7820 (below) next time
This entry point is used by the routine at 5EC7 to check whether ERIC has hit anyone.
7820 | LD B,$02 | Is there anyone 2 spaces in front of the puncher and facing him?
7822 | CALL $77C8
7825 | JR C,$783A | Jump if not
7827 | CALL $7523 | Knock the punched character over
782A | EX DE,HL | H=puncher's character number, D=victim's character number
782B | LD A,H | A=puncher's character number
782C | CP $D2 | Was ERIC the assailant?
782E | JR NZ,$783A | Jump if not
7830 | LD A,D | D=victim's character number
7831 | CP $CF | Did ERIC knock ANGELFACE over?
7833 | JR NZ,$783A | Jump if not
7835 | LD A,$03 | ERIC has punched ANGELFACE; add 30 to the score and print it
7837 | CALL $73B5
783A | CALL $61B4 | Update the SRB for the punching character's current animatory state
783D | INC A | A=animatory state of the punching character with his fist fully raised
783E | JP $77B7 | Update the punching character's animatory state, then start the process of lowering the puncher's arm (if it was ANGELFACE)