Prev: F999 Up: Map Next: FA3C
F9E4: Action: Drink
Action_Drink F9E4 CALL Parser_ValidateDirectObject Call Parser_ValidateDirectObject.
F9E7 RET C Return if the direct object is malformed.
Was the player trying to drink the rum?
F9E8 LD HL,$EAB8 Call MatchPhraseTokens with PhraseTokens_Rum.
F9EB CALL MatchPhraseTokens
F9EE JR NZ,Handler_DrinkWater Jump to Handler_DrinkWater if the token isn't for the rum.
The player was trying to drink the rum.
F9F0 LD HL,$E87A Call CheckActiveScenicEvents with Data_ItemGroup_Bottle_1.
F9F3 CALL CheckActiveScenicEvents
F9F6 LD B,A Load the bottle into B as the source item.
F9F7 LD C,$0D Load item 0D: "A bottle" into C as the destination item.
F9F9 PUSH BC Stash the source/ destination items on the stack briefly.
Is the player either carrying the bottle of rum, or is it in the current room?
F9FA CALL CheckObjectInInventory Call CheckObjectInInventory.
F9FD POP BC Restore the source/ destination items from the stack.
F9FE JP NZ,Response_YoureNotCarryingIt Jump to Response_YoureNotCarryingIt if the bottle of rum is not in the room or the players inventory.
Change the bottle state!
FA01 CALL TransformItem Call TransformItem.
FA04 LD HL,$BC66 Set bit 2 of *Flag_TurnBasedEventState which relates to the player being drunk.
FA07 SET 2,(HL)
Set a turn counter, which means the player should keep away from particularly high places.
FA09 LD A,$06 Write 06 turns to *Counter_Drunk.
FA0B LD ($BC69),A
Print "You drink the golden liquid. It was delicious..hic.. You feel decidedly light-headed.".
FA0E LD HL,$E238 HL=E238.
FA11 JP PrintStringAndNewline_Alias Jump to PrintStringAndNewline_Alias.
Handle drinking water.
Handler_DrinkWater FA14 LD HL,$EABA Call MatchPhraseTokens with PhraseTokens_Water.
FA17 CALL MatchPhraseTokens
FA1A JR NZ,Drink_Invalid Jump to Drink_Invalid if the token isn't for drinking the water.
The player wants to drink water but determine what type of water...
FA1C LD A,($BCCB) Load A with *CurrentRoom.
FA1F LD HL,$FA35 Set HL to point to Table_RoomsFreshWater.
FA22 LD BC,$0004 Set a counter in BC of 0004 which is the number of rooms in the table.
FA25 CPIR Search for the current room in the "rooms with water" table.
FA27 JR Z,Action_DrinkFreshWater Jump to Action_DrinkFreshWater if the current room contains fresh water.
Else it must be salt water - so report this.
Print "You can't. That's salt water.".
FA29 LD HL,$E28E HL=Messaging_YouCantThatsSaltWater.
FA2C JP PrintStringAndNewline_Alias Jump to PrintStringAndNewline_Alias.
Print "You take a refreshing drink.".
Action_DrinkFreshWater FA2F LD HL,$E2AC HL=Messaging_YouTakeARefreshingDrink.
FA32 JP PrintStringAndNewline_Alias Jump to PrintStringAndNewline_Alias.
Any room ID which contains fresh, drinkable water.
Table_RoomsFreshWater FA35 DEFB $14 Room 14: The Waterfall.
FA36 DEFB $11 Room 11: The Pool Of Water.
FA37 DEFB $12 Room 12: The Narrow Gulley.
FA38 DEFB $64 Room 64: The Damp Passage.
Nothing else is valid.
Drink_Invalid FA39 JP Response_YouCant_Duplicate Jump to Response_YouCant_Duplicate.
Prev: F999 Up: Map Next: FA3C