Prev: EFB1 Up: Map Next: F069
F014: Script Routine: (04) Move entity up one character
Shift the current entity one character up.
Input
IX Address of complex state data for an entity
ScriptRoutine_MoveUp F014 LD A,(IX+$06) Load A with the current entity's y-extent.
F017 CP $1B Is A equal to 1B? If not, jump to ScriptRoutine_MoveUp_AfterCeilingExit.
F019 JR NZ,ScriptRoutine_MoveUp_AfterCeilingExit
F01B LD HL,$B9CD Point HL at Berk's left-facing idle script (B9CD).
F01E JP ScriptInstruction Jump to ScriptInstruction to execute the script instruction at HL.
Past the ceiling band: optionally step back one room, then move up.
ScriptRoutine_MoveUp_AfterCeilingExit F021 LD A,(IX+$04) Load A with the current entity's room index.
F024 CP $00 Is A equal to 00? If so, jump to ScriptRoutine_MoveUp_DecY.
F026 JR Z,ScriptRoutine_MoveUp_DecY
F028 DEC (IX+$04) Move this entity back one room.
Move the entity (and any carried partner) one character up.
ScriptRoutine_MoveUp_DecY F02B DEC (IX+$05) Move this entity one character up.
F02E DEC (IX+$06)
F031 BIT 4,(IX+$03) Is bit 04 of flags byte 3 (IX+03) set? If not, jump to ScriptRoutine_MoveUp_CheckHoldingLock.
F035 JR Z,ScriptRoutine_MoveUp_CheckHoldingLock
F037 LD IY,($72AC) Load IY with the current-entity pointer (Pointer_CurrentEntity).
F03B CP $00 Is A equal to 00? If so, jump to ScriptRoutine_MoveUp_DecHeldY.
F03D JR Z,ScriptRoutine_MoveUp_DecHeldY
F03F DEC (IY+$04) Decrease the referenced entity's room index.
Move the carried entity one character up to match Berk.
ScriptRoutine_MoveUp_DecHeldY F042 DEC (IY+$05) Move the referenced entity one character up.
F045 DEC (IY+$06)
F048 JP AdvanceScriptInstruction Jump to AdvanceScriptInstruction to run the next script instruction.
If a linked camera-follow partner is locked (bit 03), clear the lock and lift it too.
ScriptRoutine_MoveUp_CheckHoldingLock F04B BIT 3,(IX+$03) Is bit 03 of flags byte 3 (IX+03) set? If not, jump to AdvanceScriptInstruction.
F04F JP Z,AdvanceScriptInstruction
F052 RES 3,(IX+$03) Reset bit 03 of the current entity's flags byte 3.
F056 LD IY,($90A7) Load IY from the camera-follow entity's extra-state pointer (90A7 = StateData_Berk+0C).
F05A CP $00 Is A equal to 00? If so, jump to ScriptRoutine_MoveUp_DecLinkedY.
F05C JR Z,ScriptRoutine_MoveUp_DecLinkedY
F05E DEC (IY+$04) Decrease the referenced entity's room index.
Move the linked partner one character up, then clear its pointer and thud.
ScriptRoutine_MoveUp_DecLinkedY F061 DEC (IY+$05) Move the referenced entity one character up.
F064 DEC (IY+$06)
F067 JR ScriptRoutine_Move_ClearLinkedAndThud Jump to ScriptRoutine_Move_ClearLinkedAndThud to continue this routine.
Prev: EFB1 Up: Map Next: F069