Prev: 52263 Up: Map Next: 52392
52338: Check if Maroc has picked up (or been given) a spell or item
Used by the routine at 52263.
Jump from 52284 (objects with state value = 15 = 'collectable'), or follow on from previous instructions.
Check if Maroc has picked up this item (or given it by servant). "Acted-upon-item" event byte value at 60302 = 15 = object collection by Maroc.
52338 LD A,(60238) Get item properties byte
52341 LD C,A
52342 AND 16 Is the item carried by the servant (bit 4 set)?
52344 JR Z,52354
52346 LD A,(60337) If so, check if the servant is currently carrying an object
52349 CP 1
52351 JP NZ,52613 If not, jump to the next routine to check for servant based pick-ups/interactions
52354 LD A,C Get item properties byte
52355 AND 64 Bit 6 (64) = the item is collectable (e.g. inventory object, spell)
52357 JP Z,52613 If it isn't, skip to next routine for servant interactions
52360 LD C,0 Collision type to check = 0 (collision with Maroc)
52362 CALL 57293 Check for Maroc related events/collisions to see if Maroc is collecting the object
52365 CP 0
52367 JP Z,52513 Jump to 52513 if no events/collisions
Maroc has picked up or been given a spell or item
52370 LD A,(60238) Item properties byte
52373 OR 5 Set bits 0 (item is visible) and 2 (item will need to be erased before re-drawing)
52375 LD (60238),A ...and re-store
52378 CALL 58878 Trigger pick-up sound effect
52381 LD A,(60298) Get item spell number
52384 CP 0 If it's 0, it's not a spell, so skip the following "spell collected" routine
52386 JR Z,52445
The next two instructions send any spell number over 224 is sent down the 'item' (rather than spell) route here. These may be special sorts of item originally been designed to restore or drain energy (e.g. food).
However, no spell number value gets anywhere near number 224. A later check remains in the code (at 52445), but will never occur. It's likely that this is a remnant of old code before game design relating to restorative/draining objects was changed.
52388 CP 224 -
52390 JR NC,52445 -
Prev: 52263 Up: Map Next: 52392