Prev: 49039 Up: Map Next: 49130
49087: Script Routine: (41) Task-two entity action
Lift the task-two entity when its matching game-event bit is set.
Input
IX Address of complex state data for an entity
ScriptRoutine_TaskTwoRiseOnEvent 49087 LD A,(29363) Load A with the game event flags (GameEventFlags).
49090 BIT 1,A Is bit 1 of game event flags set? If not, jump to ScriptRoutine_TaskTwoRiseOnEvent_RunStartScript.
49092 JR Z,ScriptRoutine_TaskTwoRiseOnEvent_RunStartScript
49094 LD A,(IX+5) Load A with the current entity's y-coordinate.
49097 INC A Advance the current entity's y-coordinate by one.
49098 CP 39 Is the current entity's y-coordinate equal to 39? If so, jump to Update_TaskTwo_ClearTrapFlags.
49100 JP Z,Update_TaskTwo_ClearTrapFlags
49103 CP 27 Is the current entity's y-coordinate equal to 27? If not, jump to ScriptRoutine_TaskTwoRiseOnEvent_IncY.
49105 JR NZ,ScriptRoutine_TaskTwoRiseOnEvent_IncY
49107 LD A,(29363) Load A with the game event flags (GameEventFlags).
49110 SET 4,A Set bit 4 of game event flags.
49112 LD (29363),A Set the game event flags (GameEventFlags).
Keep lowering the rising helper one row, then continue the script.
ScriptRoutine_TaskTwoRiseOnEvent_IncY 49115 INC (IX+5) Move this entity one character down.
49118 INC (IX+6)
49121 JP AdvanceScriptInstruction Jump to AdvanceScriptInstruction to run the next script instruction.
Trap closed: restart the rise routine from script BirdScript_RiseLoop.
ScriptRoutine_TaskTwoRiseOnEvent_RunStartScript 49124 LD HL,48761 Point HL at bird script data BirdScript_RiseLoop.
49127 JP ScriptInstruction Jump to ScriptInstruction to execute the script instruction at HL.
Prev: 49039 Up: Map Next: 49130