Prev: 54813 Up: Map Next: 54875
54841: Script Routine: (58) Collectible action
Send the collectible out of the room downward.
Input
IX Address of complex state data for an entity
ScriptRoutine_CollectibleLeaveRoomDown 54841 LD A,(IX+4) Load A with the current entity's room index.
54844 CP 1 Is the current entity's room index equal to 1? If so, jump to ScriptRoutine_CollectibleLeaveRoomDown_SetDirBit3Script.
54846 JR Z,ScriptRoutine_CollectibleLeaveRoomDown_SetDirBit3Script
54848 CALL Adjust_CameraX Call Adjust_CameraX to adjust the camera X coordinate.
54851 JR C,ScriptRoutine_CollectibleLeaveRoomDown_DecYAndRoom Jump to ScriptRoutine_CollectibleLeaveRoomDown_DecYAndRoom if the result underflowed.
Blocked leaving downward: set direction bit 3 and run the stop script at 54230.
ScriptRoutine_CollectibleLeaveRoomDown_SetDirBit3Script 54853 SET 3,(IX+9) Set bit 3 of the current entity's direction / state.
54857 LD HL,54230 Point HL at the dialogue/message table (54230).
54860 JP ScriptInstruction Jump to ScriptInstruction to execute the script instruction at HL.
Leave downward: move up one character and back one room.
ScriptRoutine_CollectibleLeaveRoomDown_DecYAndRoom 54863 DEC (IX+5) Move this entity one character up.
54866 DEC (IX+6)
54869 DEC (IX+4) Move this entity back one room.
54872 JP AdvanceScriptInstruction Jump to AdvanceScriptInstruction to run the next script instruction.
Prev: 54813 Up: Map Next: 54875