Prev: CE71 Up: Map Next: CED4
CEB1: Maroc has offered an object of insufficient value to a warlock
Used by the routine at CE71.
If an item is not of interest to a warlock (checked in the routine at CE79):
  • the warlock fires a bolt/missile at Maroc (almost guaranteed to hit, as the player will be controlling the servant, so Maroc will be stationary!)
  • the offered item is teleported to another room, namely [current room number] + 3)
item of insufficient value offered to warlock
CEB1 LD C,D Retrieve the object number (from table at 736F) that Maroc has offered
CEB2 LD B,$00 The upcoming CALL performs one of two functions, depending on whether the B or C register contains a non-zero value.
By setting the B register to zero, it tells the routine that we want to get the item's data using the object number (in the C register) rather than the room number (B register).
CEB4 LD HL,($DAF3) Address pointer to the start of the room object data sets at 736F
CEB7 LD A,$00
CEB9 LD ($EB84),A Set the data set counter to zero for the next CALL
CEBC CALL $DE4C This routine finds an object's data set (in table at 736F), and copies its data into the object data buffer at EB85.
Teleport the rejected item to current-room-number-plus-three
CEBF LD A,($EAB7) Current room number
CEC2 LD C,A
CEC3 ADD A,$03 Add 3 to it
CEC5 LD HL,($EB82) Get address pointer to the start of the item's data set
CEC8 LD (HL),A The first byte in the set is the item's room number, so stick the updated value (room number plus 3) in here
CEC9 INC HL
CECA LD (HL),$1A Sets the object horizontal position (in half-pixel steps) in the room to a standard 26. This ensures that the object will be within the new room boundaries regardless of source & destination room sizes.
The item's final vertical position would've been where the warlock was positioned on the room wall, so the object's vertical position will probably also be on the wall.
CECC LD A,$00
CECE LD ($EBAE),A Set the object-number-held-by-warlock byte to 0, as the offered item has just been teleported to a different room
CED1 JP $CF58 ...Warlock isn't impressed with the item offering...! Jump to the 'set up missile' routine...
Prev: CE71 Up: Map Next: CED4