![]() |
Routines |
62495 | LD HL,32758 | 32758 holds the action timer (initially 24) |
62498 | DEC (HL) | Has ERIC finished firing the catapult? |
62499 | JR NZ,62516 | Jump if not |
62501 | XOR A | Clear all of ERIC's status flags |
62502 | LD (32763),A | |
62505 | LD H,172 | 172=ERIC |
62507 | CALL 25108 | Update SRB for current location of ERIC |
62510 | LD L,102 | Restore ERIC's animatory state to what it was before he fired the catapult, jumped, or threw the punch |
62512 | LD A,(HL) | |
62513 | JP 25008 | Update ERIC's animatory state and location and update SRB |
62516 | LD A,(HL) | Pick up the contents of the action timer in A |
62517 | LD H,172 | 172=ERIC |
62519 | CP 18 | Is it time to raise the catapult to eye level? |
62521 | JP Z,28737 | Jump if so |
62524 | CP 6 | Is it time to start lowering the catapult? |
62526 | JP Z,28779 | Jump if so |
62529 | CP 12 | Is it time to launch the pellet? |
62531 | RET NZ | Return if not |
62532 | LD L,96 | Byte 96 holds ERIC's animatory state |
62534 | LD A,(HL) | Pick this up in A |
62535 | OR 127 | A=127 or 255 (catapult pellet) |
62537 | INC L | Pick up ERIC's coordinates in DE; they will be the initial coordinates of the catapult pellet |
62538 | LD D,(HL) | |
62539 | INC L | |
62540 | LD E,(HL) | |
62541 | DEC H | H=171 (ERIC's catapult pellet) |
62542 | CALL 28759 | Launch the catapult pellet |
62545 | CALL 65141 | Play catapult sound effect |
62548 | LD B,13 | Lines message 13: CATAPULTS ARE FORBIDDEN |
62550 | LD H,172 | 172=ERIC |
62552 | PUSH BC | |
62553 | CALL 28220 | Did any teachers see ERIC throw a punch, fire his catapult, or jump? |
62556 | POP BC | |
62557 | RET NC | Return if not |
62558 | EXX | |
62559 | LD L,97 | Byte 97 holds the teacher's y-coordinate |
62561 | LD D,(HL) | Pick up the coordinates of the teacher who saw ERIC in DE |
62562 | INC L | |
62563 | LD E,(HL) | |
62564 | PUSH DE | |
62565 | EXX | |
62566 | POP DE | DE=coordinates of teacher who saw ERIC |
62567 | LD A,H | A=172 (ERIC) |
62568 | JP 30464 | Make the teacher give lines |