Prev: 54841 Up: Map Next: 54909
54875: Script Routine: (59) Collectible action
Send the collectible out of the room upward.
Input
IX Address of complex state data for an entity
ScriptRoutine_CollectibleLeaveRoomUp 54875 LD A,(IX+4) Load A with the current entity's room index.
54878 CP 5 Is the current entity's room index equal to 5? If so, jump to ScriptRoutine_CollectibleLeaveRoomUp_SetDirBit2Script.
54880 JR Z,ScriptRoutine_CollectibleLeaveRoomUp_SetDirBit2Script
54882 CALL Test_EntityOverlap_AtDepth Call Test_EntityOverlap_AtDepth to test collectible / room collision.
54885 JR C,ScriptRoutine_CollectibleLeaveRoomUp_IncYAndRoom Jump to ScriptRoutine_CollectibleLeaveRoomUp_IncYAndRoom if the result underflowed.
Blocked leaving upward: set direction bit 2 and run the stop script at 54230.
ScriptRoutine_CollectibleLeaveRoomUp_SetDirBit2Script 54887 SET 2,(IX+9) Set bit 2 of the current entity's direction / state.
54891 LD HL,54230 Point HL at the dialogue/message table (54230).
54894 JP ScriptInstruction Jump to ScriptInstruction to execute the script instruction at HL.
Leave upward: move down one character and into the next room.
ScriptRoutine_CollectibleLeaveRoomUp_IncYAndRoom 54897 INC (IX+5) Move this entity one character down.
54900 INC (IX+6)
54903 INC (IX+4) Advance this entity into the next room.
54906 JP AdvanceScriptInstruction Jump to AdvanceScriptInstruction to run the next script instruction.
Prev: 54841 Up: Map Next: 54909