![]() |
Routines |
| Prev: EDD5 | Up: Map | Next: EDF8 |
|
Used by the routines at Berk_Interact_With_Entity and ScriptRoutine_CloseTrapDoor.
Close the trap door: queue a sound, switch the lever graphic layout to closed facing right, and update the related scenery entity types.
|
||||
| Close_TrapDoor | EDDB | PUSH IX | Stash IX, HL and DE on the stack. | |
| EDDD | PUSH HL | |||
| EDDE | PUSH DE | |||
| EDDF | LD HL,$72B3 | Point HL at the game event flags (GameEventFlags). | ||
| EDE2 | BIT 4,(HL) | Is "task-two / upstairs event latch" (bit 04 of GameEventFlags) set? If so, jump to TrapDoor_RestoreAndReturn. | ||
| EDE4 | JR NZ,TrapDoor_RestoreAndReturn | |||
| EDE6 | RES 1,(HL) | Clear "trap door is open / trap door event armed" (bit 01 of GameEventFlags). | ||
|
|
||||
| EDE8 | LD A,$06 | Load A with sound index 06. | ||
| EDEA | CALL Queue_Sound | Call Queue_Sound to queue sound. | ||
| EDED | LD HL,$A809 | Point HL at the lever closed, facing right (GraphicLayout_LeverClosedRight). | ||
| EDF0 | LD ($9177),HL | Store HL in the lever layout pointer (Pointer_TrapDoorLayout). | ||
| EDF3 | LD HL,$EDC9 | Point HL at the closed-trap type list (Data_TrapDoorClosedTypes). | ||
| EDF6 | JR UpdateTrapDoorEntityTypes | Jump to UpdateTrapDoorEntityTypes to handle the trap door. | ||
| Prev: EDD5 | Up: Map | Next: EDF8 |