Prev: EC72 Up: Map Next: ECDB
ECB0: Script Routine: (20) Have Berk open a door in front of him
Let Berk open the door directly in front of him.
ScriptRoutine_BerkOpenDoorInFront ECB0 LD IY,($72AC) Load IY with the current-entity pointer (Pointer_CurrentEntity).
ECB4 LD (IY+$02),$02 Write 02 to the referenced entity's flags byte 2.
ECB8 LD A,(IY+$00) Load A with the referenced entity's entity type.
ECBB CP $05 Is A equal to 05? If so, jump to Script_OpenDoor_Hit.
ECBD JR Z,Script_OpenDoor_Hit
ECBF CP $03 Is A equal to 03? If so, jump to Script_OpenDoor_Basket.
ECC1 JR Z,Script_OpenDoor_Basket
ECC3 CP $10 Is A equal to 10? If so, jump to Script_OpenDoor_TaskProp.
ECC5 JR Z,Script_OpenDoor_TaskProp
ECC7 LD BC,$9DA2 Point BC at entity-type-08 layout GraphicLayout_WormCan.
ECCA JR Script_DoorInteract_Found Jump to Script_DoorInteract_Found to script Door Interact Found.
Open the type-05 yellow cup using layout GraphicLayout_YellowCup, then store via Script_DoorInteract_StoreDoorSlot.
Script_OpenDoor_Hit ECCC LD BC,$9D69 Point BC at yellow cup layout GraphicLayout_YellowCup.
ECCF JR Script_DoorInteract_StoreDoorSlot Jump to Script_DoorInteract_StoreDoorSlot to script Door Interact Next.
Open the type-03 basket using layout GraphicLayout_Basket, then store via Script_DoorInteract_Scan.
Script_OpenDoor_Basket ECD1 LD BC,$9D0F Point BC at basket layout GraphicLayout_Basket.
ECD4 JR Script_DoorInteract_Scan Jump to Script_DoorInteract_Scan to continue scanning.
Open the type-10 prop using layout GraphicLayout_SeedBox, then store via Script_DoorInteract_StoreAltDoorSlot.
Script_OpenDoor_TaskProp ECD6 LD BC,$A13F Point BC at task-prop layout GraphicLayout_SeedBox.
ECD9 JR Script_DoorInteract_StoreAltDoorSlot Jump to Script_DoorInteract_StoreAltDoorSlot to finish this handler.
Prev: EC72 Up: Map Next: ECDB