Prev: EF32 Up: Map Next: F03A
EF54: Routine at EF54
Input
A Room ID
EF54 LD HL,$BC6F HL=Flag_EventState.
EF57 BIT 0,(HL) Jump to EF7B if bit 0 of *HL is unset.
EF59 JR Z,$EF7B
EF5B LD HL,$BC67 Initialise Counter_Crab to 06.
EF5E LD (HL),$06
EF60 CP $2C Jump to EF7B if A is not equal to 2C.
EF62 JR NZ,$EF7B
EF64 LD HL,$BC6F Reset bit 0 of *Flag_EventState.
EF67 RES 0,(HL)
EF69 PUSH AF Stash AF on the stack.
Spawn the giant crab in The Rockpool.
EF6A LD BC,$2930 Call Handler_UpdateObjectLocation using item "A giant crab" to create it in The Rockpool.
EF6D CALL Handler_UpdateObjectLocation
EF70 POP AF Restore AF from the stack.
EF71 LD HL,$EC27 Write 2F to *EC27 to open up westbound access to The Secluded Beach from The Canyon.
EF74 LD (HL),$2F
EF76 LD HL,$EC2A Write 30 to *EC2A to open up northbound access to The Rockpool from The Secluded Beach.
EF79 LD (HL),$30
EF7B CALL $C520 Call C520.
EF7E LD E,$00 E=00.
EF80 CALL Handler_DisplayRoomImage Call Handler_DisplayRoomImage.
EF83 LD A,($BCCB) Jump to EFA7 if *CurrentRoom is not room 30: " The Rockpool".
EF86 CP $30
EF88 JR NZ,$EFA7
EF8A LD A,$29 Call ValidateItemPresent with "A giant crab".
EF8C CALL ValidateItemPresent
EF8F JR NZ,$EFA7 Jump to EFA7 if A is not equal to 29.
EF91 LD HL,$BC6F Set bit 0 of *Flag_EventState.
EF94 SET 0,(HL)
EF96 XOR A Write 00 to *EC27 to remove access to The Secluded Beach from The Canyon.
EF97 LD ($EC27),A
EF9A LD ($EC2A),A Write 00 to *EC2A to remove access to The Rockpool from The Secluded Beach.
EF9D LD HL,$BC66 Set bit 0 of *Flag_TurnBasedEventState which relates to the crab being active.
EFA0 SET 0,(HL)
EFA2 LD A,$06 Write 06 to *Counter_Crab.
EFA4 LD ($BC67),A
EFA7 LD A,$2B Call ValidateItemPresent with "A giant octopus".
EFA9 CALL ValidateItemPresent
EFAC JR NZ,$EFB8 Jump to EFB8 if "A giant octopus" isn't in the current room.
EFAE LD HL,$BC66 Set bit 1 of *Flag_TurnBasedEventState which relates to the tentacle being active.
EFB1 SET 1,(HL)
EFB3 LD A,$05 Write 05 to *Counter_Tentacle.
EFB5 LD ($BC68),A
EFB8 LD A,$2A Call ValidateItemPresent with "A lion".
EFBA CALL ValidateItemPresent
EFBD JR NZ,$EFC9 Jump to EFC9 if "A lion" isn't in the current room.
EFBF LD HL,$BC66 Set bit 3 of *Flag_TurnBasedEventState which relates to the lion being active.
EFC2 SET 3,(HL)
EFC4 LD A,$07 Write 07 to *Counter_Lion.
EFC6 LD ($BC6A),A
EFC9 LD HL,$E8C1 Call CheckActiveScenicEvents with Data_ItemGroup_Crocodile.
EFCC CALL CheckActiveScenicEvents
EFCF JR NZ,$EFDB Jump to EFDB if A is not equal to 07.
EFD1 LD HL,$BC66 Set bit 4 of *Flag_TurnBasedEventState which relates to the crocodile being active.
EFD4 SET 4,(HL)
EFD6 LD A,$0B Write 0B to *Counter_Crocodile.
EFD8 LD ($BC6B),A
EFDB LD A,$18 Call ValidateItemPresent with "Surrounded by natives".
EFDD CALL ValidateItemPresent
EFE0 JR NZ,$EFEC Jump to EFEC if "Surrounded by natives" isn't in the current room.
EFE2 LD HL,$BC66 Set bit 5 of *Flag_TurnBasedEventState which relates to the cannibals being active.
EFE5 SET 5,(HL)
EFE7 LD A,$09 Initialise the turn counter at *Counter_Cannibals with 09.
EFE9 LD ($BC6C),A
EFEC LD A,($BCCB) Jump to EFFF if *CurrentRoom is not room 03: " Your Ship".
EFEF CP $03
EFF1 JR NZ,$EFFF
EFF3 LD A,$1D Call ValidateItemPresent with "The Jewels of Babylon".
EFF5 CALL ValidateItemPresent
EFF8 JR NZ,$EFFF Jump to EFFF if "The Jewels of Babylon" isn't in the current room.
EFFA POP HL Restore HL and HL from the stack.
EFFB POP HL
EFFC JP GameComplete Jump to GameComplete.
EFFF LD A,($BCCB) Jump to F019 if *CurrentRoom is not room 02: " The Open Sea".
F002 CP $02
F004 JR NZ,$F019
F006 LD HL,$BC54 Jump to F019 if bit 5 of *GameFlags_Help is set.
F009 BIT 5,(HL)
F00B JR NZ,$F019
F00D SET 5,(HL) Set bit 5 of *HL.
F00F LD HL,$BC66 Set bit 7 of *Flag_TurnBasedEventState which relates to the wave being active.
F012 SET 7,(HL)
F014 LD A,$05 Write 05 to *Counter_Wave.
F016 LD ($BC6E),A
F019 LD A,($BCCB) Jump to F039 if *CurrentRoom is not room 6C: " The Bridge".
F01C CP $6C
F01E JR NZ,$F039
F020 LD A,$1D Call ValidateItemPresent with "The Jewels of Babylon".
F022 CALL ValidateItemPresent
F025 JR NZ,$F039 Jump to F039 if "The Jewels of Babylon" isn't in the current room.
Print "The bridge begins to shake...".
F027 LD HL,$E5CF HL=Messaging_TheBridgeBeginsToShake.
F02A CALL PrintStringAndNewline Call PrintStringAndNewline.
F02D POP HL Restore HL from the stack.
Bad luck!
F02E LD HL,$EDD7 Switch GameOver onto the stack so the next return actions a "game over".
F031 EX (SP),HL
Print "Suddenly,it collapses.".
F032 LD HL,$E5ED HL=Messaging_SuddenlyItCollapses.
F035 CALL PausePrintStringAndScroll Call PausePrintStringAndScroll.
F038 RET Return.
F039 RET Return.
Prev: EF32 Up: Map Next: F03A