Prev: BEE6 Up: Map Next: BF8F
BF77: Script Routine: (28) Task-two entity action
Mark the bird script as active so later task-two steps can run.
ScriptRoutine_TaskTwoArmScriptFlags BF77 PUSH HL Stash HL on the stack.
BF78 LD HL,$72B3 Point HL at the game event flags (GameEventFlags).
BF7B SET 7,(HL) Set "task entity script is active" (bit 07 of GameEventFlags).
BF7D SET 4,(HL) Set "task-two / upstairs event latch" (bit 04 of GameEventFlags).
BF7F LD A,($72C0) Load A with the entity spawn timer (EntitySpawnTimer).
BF82 CP $04 Is entity spawn timer equal to 04? If not, jump to ScriptRoutine_TaskTwoArmScriptFlags_NextInstruction.
BF84 JR NZ,ScriptRoutine_TaskTwoArmScriptFlags_NextInstruction
BF86 LD HL,$72B5 Point HL at the task-two flags (TaskTwoFlags).
BF89 SET 2,(HL) Set "spawn / random-walk latch" (bit 02 of TaskTwoFlags).
Flags armed: restore HL and continue at the next script instruction.
ScriptRoutine_TaskTwoArmScriptFlags_NextInstruction BF8B POP HL Restore HL from the stack.
BF8C JP AdvanceScriptInstruction Jump to AdvanceScriptInstruction to run the next script instruction.
Prev: BEE6 Up: Map Next: BF8F