![]() |
Routines |
| Prev: D639 | Up: Map | Next: D67D |
|
Send the collectible out of the room upward.
|
||||||||
| ScriptRoutine_CollectibleLeaveRoomUp | D65B | LD A,(IX+$04) | Load A with the current entity's room index. | |||||
| D65E | CP $05 | Is the current entity's room index equal to 05? If so, jump to ScriptRoutine_CollectibleLeaveRoomUp_SetDirBit2Script. | ||||||
| D660 | JR Z,ScriptRoutine_CollectibleLeaveRoomUp_SetDirBit2Script | |||||||
| D662 | CALL Test_EntityOverlap_AtDepth | Call Test_EntityOverlap_AtDepth to test collectible / room collision. | ||||||
| D665 | JR C,ScriptRoutine_CollectibleLeaveRoomUp_IncYAndRoom | Jump to ScriptRoutine_CollectibleLeaveRoomUp_IncYAndRoom if the result underflowed. | ||||||
|
Blocked leaving upward: set direction bit 02 and run the stop script at D3D6.
|
||||||||
| ScriptRoutine_CollectibleLeaveRoomUp_SetDirBit2Script | D667 | SET 2,(IX+$09) | Set bit 02 of the current entity's direction / state. | |||||
| D66B | LD HL,$D3D6 | Point HL at the dialogue/message table (D3D6). | ||||||
| D66E | 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 | D671 | INC (IX+$05) | Move this entity one character down. | |||||
| D674 | INC (IX+$06) | |||||||
| D677 | INC (IX+$04) | Advance this entity into the next room. | ||||||
| D67A | JP AdvanceScriptInstruction | Jump to AdvanceScriptInstruction to run the next script instruction. | ||||||
| Prev: D639 | Up: Map | Next: D67D |