Prev: CAF0 Up: Map Next: CB1E
CAFE: Script Routine: (48) Task-four entity action
Snap the task-four creature onto its target position.
Input
IX Address of complex state data for an entity
ScriptRoutine_TaskFourAlignCreature CAFE LD IY,$9071 Point IY at the vat entity at StateData_Complex_28.
CB02 LD A,(IX+$07) Load A with the current entity's x-coordinate.
CB05 CP (IY+$07) Does this entity's x match the referenced entity's x (IY+07)? If not, jump to AdvanceScriptInstruction.
CB08 JP NZ,AdvanceScriptInstruction
CB0B LD A,(IX+$04) Load A with the current entity's room index.
CB0E CP (IY+$04) Does this entity share the referenced entity's room (IY+04)? If not, jump to AdvanceScriptInstruction.
CB11 JP NZ,AdvanceScriptInstruction
CB14 SET 2,(IX+$0D) Set bit 02 of the current entity's extra state.
CB18 LD HL,$CA79 Point HL at task-four script entry CA79.
CB1B JP ScriptInstruction Jump to ScriptInstruction to execute the script instruction at HL.
Prev: CAF0 Up: Map Next: CB1E