Prev: 55347 Up: Map Next: 55502
55474: Set up active spell-based room event checks
Used by the routines at 55283 and 55347.
event checking while the servant spell is active event checking while a cursor aiming spell is active
Follows previous SERVANT routine - these instructions are run if the servant ISN'T moving over Maroc, and ISN'T holding an object.
In this state, the servant sprite needs to be open to room event checks (e.g. picking up/manipulating objects). So this routine creates an entry in the room's event checks data table at 32691.
There's also a jump here from the routine at 55341, which relates to other cast spells that involve the controllable cursor (e.g. OPEN, FIND, REVEAL) that aren't missile-related. These spells will also need an event check to be added to the room event check table, as they take effect when they're moved over specific room items.
55474 LD HL,(60077) Address pointer to room item event data at 32691
55477 LD (HL),1 Set the first byte of the set to 1, which means the event will be checked for 1 game cycle (this is partly in case items are moving around).
55479 INC HL
55480 LD A,(60362) Action/event value associated with this spell (e.g. SERVANT, OPEN) is active
55483 LD (HL),A Store as byte 2 of set
55484 INC HL
55485 LD A,(60160) Servant sprite horizontal (X) co-ordinate in pixels
55488 LD (HL),A Store as byte 3 of set
55489 INC HL
55490 LD A,(60159) Servant sprite horizontal (Y) co-ordinate in pixels
55493 LD (HL),A Store as byte 4 of set
55494 INC HL Move along to the start of the next data set
55495 LD (60077),HL Store the address pointer to the start of the next event data set at 32691
55498 LD (HL),255 Set an end-of-data marker
Jump from previous routine if there aren't any events to check. For example, the servant can't manipulate other room objects if it's already carrying an object (the event check in this case is object 1 on object 2).
55500 JR 55553
Prev: 55347 Up: Map Next: 55502