Prev: 61798 Up: Map Next: 61857
61811: Script Routine: (17) Have entity face right after putting down
After a put-down, face the entity right.
Input
IX Address of complex state data for an entity
ScriptRoutine_FaceRightAfterPutDown 61811 BIT 4,(IX+3) Is bit 4 of flags byte 3 (IX+3) set? If not, jump to AdvanceScriptInstruction.
61815 JP Z,AdvanceScriptInstruction
61818 CALL Script_FaceAfterPutDown_Apply Call Script_FaceAfterPutDown_Apply to script Face After Put Down Apply.
This entry point is used by the routine at ScriptRoutine_FaceLeftAfterPutDown.
Write the held entity's room after facing, then continue the script.
ScriptRoutine_FaceLeftAfterPutDown_ApplyFacing 61821 LD (IY+4),A Set the referenced entity's room index.
61824 JP AdvanceScriptInstruction Jump to AdvanceScriptInstruction to run the next script instruction.
This entry point is used by the routine at ScriptRoutine_FaceLeftAfterPutDown.
Aim the held entity's X at Berk's BerkXCoordinateCopy using the saved width in CameraYCoordinate.
Script_FaceAfterPutDown_Apply 61827 LD IY,(29356) Load IY with the current-entity pointer (Pointer_CurrentEntity).
61831 LD A,(29421) Load A with the saved held-entity width from CameraYCoordinate.
61834 LD E,1 Load E with 1.
61836 LD D,A Copy A into D as a saved coordinate / value.
61837 SRL A Shift A right logical.
61839 JR NZ,ScriptRoutine_FaceRightAfterPutDown_WriteHeldX Jump to ScriptRoutine_FaceRightAfterPutDown_WriteHeldX to continue if the comparison did not match.
61841 INC E Advance the low byte of the pointer/offset in DE.
Write the held entity's X and X-extent beside Berk after put-down facing.
ScriptRoutine_FaceRightAfterPutDown_WriteHeldX 61842 LD A,(29443) Load A with Berk's X-coordinate copy (BerkXCoordinateCopy).
61845 ADD A,E Add E to A.
61846 LD (IY+7),A Set the referenced entity's x-coordinate.
61849 ADD A,D Add D into A while building a 16-bit entity/screen address.
61850 LD (IY+8),A Set the referenced entity's x-extent.
61853 LD A,(IX+4) Load A with the current entity's room index.
61856 RET Return.
Prev: 61798 Up: Map Next: 61857