![]() |
Routines |
Prev: 28442 | Up: Map | Next: 28533 |
The address of this continual subcommand routine is placed into bytes 124 and 125 of ANGELFACE's buffer by command lists 142, 150, 158, 166, 174, 180 and 182. It decides whether ANGELFACE should throw a punch, and gets the punching action under way if so.
|
||||
28446 | LD L,112 | Return now if there is an uninterruptible subcommand routine address in bytes 111 and 112 of ANGELFACE's buffer (meaning he is currently occupied) | ||
28448 | LD A,(HL) | |||
28449 | AND A | |||
28450 | RET NZ | |||
28451 | LD L,96 | Byte 96 holds ANGELFACE's animatory state | ||
28453 | BIT 0,(HL) | Is ANGELFACE midstride? | ||
28455 | RET NZ | Return if so | ||
28456 | INC L | Byte 97 holds ANGELFACE's y-coordinate | ||
28457 | LD A,(HL) | Pick this up in A | ||
28458 | CALL 26185 | Is ANGELFACE on a staircase? | ||
28461 | RET NZ | Return if so | ||
28462 | CALL 28220 | Can any teachers see ANGELFACE? | ||
28465 | RET C | Return if so | ||
ANGELFACE is not on a staircase, and there are no teachers nearby. Are there any potential victims nearby?
|
||||
28466 | LD L,98 | Byte 98 holds ANGELFACE's x-coordinate | ||
28468 | LD A,(HL) | Pick this up in A | ||
28469 | DEC L | Pick up ANGELFACE's y-coordinate in D | ||
28470 | LD D,(HL) | |||
28471 | DEC L | L=96 (which byte holds ANGELFACE's animatory state) | ||
28472 | SUB 3 | Set A equal to the 'target' x-coordinate (i.e. where a character would have to be in order to receive ANGELFACE's punch) | ||
28474 | BIT 7,(HL) | |||
28476 | JR Z,28480 | |||
28478 | ADD A,6 | |||
28480 | LD E,A | Place the target x-coordinate in E | ||
28481 | LD C,(HL) | C=ANGELFACE's animatory state | ||
28482 | LD H,172 | 172=ERIC | ||
28484 | CALL 28416 | Is ERIC a potential target? | ||
28487 | JR NC,28502 | Jump if not | ||
28489 | NOP | |||
If we get here, there is a potential victim in front of ANGELFACE for him to take a swing at.
|
||||
28490 | POP HL | Drop the return address (25172) from the stack; this makes the character-moving routine at 25126 skip any further consideration of ANGELFACE on this pass, thus preventing him from moving midstride before throwing the punch | ||
28491 | LD HL,43121 | Point HL at byte 113 of ANGELFACE's buffer | ||
28494 | LD (HL),C | Store his current animatory state there | ||
28495 | DEC L | Place the address of the uninterruptible subcommand routine at 28544 (throw a punch) into bytes 111 and 112 of ANGELFACE's buffer | ||
28496 | LD (HL),111 | |||
28498 | DEC L | |||
28499 | LD (HL),128 | |||
28501 | RET | |||
ERIC is not a potential target for ANGELFACE's fist. What about the other main kids?
|
||||
28502 | LD H,169 | 169=EINSTEIN | ||
28504 | LD B,3 | There are three main kids | ||
28506 | CALL 28416 | Is this main kid a potential target? | ||
28509 | JR NC,28513 | Jump if not | ||
28511 | JR 28490 | Otherwise throw a punch | ||
28513 | DEC H | Next main kid | ||
28514 | DJNZ 28506 | Jump back until the three main kids have been checked | ||
EINSTEIN and BOY WANDER weren't potential targets either. What about the little boys?
|
||||
28516 | LD H,152 | 152=little boy no. 1 | ||
28518 | LD B,7 | We check only the first seven little boys - interesting! | ||
28520 | CALL 28416 | Is this little boy a potential target? | ||
28523 | JR NC,28527 | Jump if not | ||
28525 | JR 28490 | Otherwise throw a punch | ||
28527 | INC H | Next little boy | ||
28528 | DJNZ 28520 | Jump back until the seven little boys have been checked | ||
28530 | LD H,168 | Restore ANGELFACE's character number to H | ||
28532 | RET |
Prev: 28442 | Up: Map | Next: 28533 |