![]() |
Routines |
| Prev: F011 | Up: Map | Next: F190 |
|
Drop one of the objects the player named.
|
||||
| Action_Drop | F03A | CALL Parser_ValidateDirectObject | Call Parser_ValidateDirectObject. | |
| F03D | RET C | Return if the direct object is malformed. | ||
|
Start by calling the chain of items to check...
|
||||
| F03E | CP $03 | Jump to Validate_Drop_MarasBody if A is less than 03. | ||
| F040 | JR C,Validate_Drop_MarasBody | |||
| F042 | JP Response_PleaseRephraseThat_GameLoop | Jump to Response_PleaseRephraseThat_GameLoop. | ||
|
Check if the player is holding the requested item?
|
||||
| Drop_IsPlayerHoldingItem | F045 | CALL IsObjectCarried | Call IsObjectCarried. | |
| F048 | JR Z,DropItem | Jump to DropItem if the player is holding the requested item. | ||
|
Print "You're not carrying ".
|
||||
| F04A | LD HL,$BD7F | HL=Messaging_YoureNotCarrying. | ||
| F04D | CALL PrintString | Call PrintString. | ||
| F050 | LD A,E | Copy the object ID back into A. | ||
| F051 | LD HL,$EEEB | HL=Table_ItemsWhichArePlural. | ||
| F054 | LD BC,$0002 | BC=0002. | ||
| F057 | CPIR | Search for the item ID among the plural items. | ||
| F059 | JR Z,Drop_NotCarrying_Them | Jump to Drop_NotCarrying_Them if the item is plural. | ||
|
Print "it.".
|
||||
| F05B | LD HL,$BCFB | HL=Messaging_It. | ||
| F05E | JP PrintResponse | Jump to PrintResponse. | ||
|
Print "them.".
|
||||
| Drop_NotCarrying_Them | F061 | LD HL,$BCFF | HL=Messaging_Them. | |
| F064 | JP PrintResponse | Jump to PrintResponse. | ||
|
The player has the item in their inventory so drop it.
|
||||
| DropItem | F067 | LD B,E | Copy the item ID into B. | |
| F068 | LD A,($BA9B) | C=*CurrentRoom. | ||
| F06B | LD C,A | |||
|
Alter the items location from the players inventory to the current room ID.
|
||||
| F06C | CALL UpdateObjectLocation | Call UpdateObjectLocation. | ||
| F06F | LD HL,$BA68 | Decrease *Count_InventoryItems by one. | ||
| F072 | DEC (HL) | |||
|
Print "O.K.".
|
||||
| F073 | LD HL,$BCDB | HL=Messaging_OK. | ||
| F076 | JP PrintResponse | Jump to PrintResponse. | ||
|
Was the player trying to drop Mara's body (the sword)?
|
||||
| Validate_Drop_MarasBody | F079 | LD HL,$E812 | Call Parser_AdvanceToSeparator with E812. | |
| F07C | CALL Parser_AdvanceToSeparator | |||
| F07F | JR NZ,Validate_Drop_Witch | Jump to Validate_Drop_Witch if the token isn't for Mara's body. | ||
| F081 | LD A,$33 | Call Handler_DestroyItem with item 33: "A glowing rock". | ||
| F083 | CALL Handler_DestroyItem | |||
| F086 | LD A,$0A | A=0A; jump to Drop_IsPlayerHoldingItem. | ||
| F088 | JP Drop_IsPlayerHoldingItem | |||
|
Was the player trying to drop ... the witch?
|
||||
| Validate_Drop_Witch | F08B | LD HL,$E814 | Call Parser_AdvanceToSeparator with E814. | |
| F08E | CALL Parser_AdvanceToSeparator | |||
| F091 | JR NZ,Validate_Drop_Food | Jump to Validate_Drop_Food if the token isn't for the witch. | ||
| F093 | LD HL,$E6FF | Call Parser_SkipToken with E6FF. | ||
| F096 | CALL Parser_SkipToken | |||
| F099 | JP Drop_IsPlayerHoldingItem | Jump to Drop_IsPlayerHoldingItem. | ||
|
Was the player trying to drop ... the food?
|
||||
| Validate_Drop_Food | F09C | LD HL,$E816 | Call Parser_AdvanceToSeparator with E816. | |
| F09F | CALL Parser_AdvanceToSeparator | |||
| F0A2 | JR NZ,Validate_Drop_SilverCoin | Jump to Validate_Drop_SilverCoin if the token isn't for the food. | ||
| F0A4 | LD A,$00 | A=00; jump to Drop_IsPlayerHoldingItem. | ||
| F0A6 | JP Drop_IsPlayerHoldingItem | |||
|
Was the player trying to drop ... the silver coin?
|
||||
| Validate_Drop_SilverCoin | F0A9 | LD HL,$E818 | Call Parser_AdvanceToSeparator with E818. | |
| F0AC | CALL Parser_AdvanceToSeparator | |||
| F0AF | JR NZ,Validate_Drop_Bow | Jump to Validate_Drop_Bow if the token isn't for the silver coin. | ||
| F0B1 | LD A,$02 | A=02; jump to Drop_IsPlayerHoldingItem. | ||
| F0B3 | JP Drop_IsPlayerHoldingItem | |||
|
Was the player trying to drop ... the bow?
|
||||
| Validate_Drop_Bow | F0B6 | LD HL,$E81D | Call Parser_AdvanceToSeparator with E81D. | |
| F0B9 | CALL Parser_AdvanceToSeparator | |||
| F0BC | JR NZ,Validate_Drop_Arrows | Jump to Validate_Drop_Arrows if the token isn't for the bow. | ||
| F0BE | LD A,$03 | A=03; jump to Drop_IsPlayerHoldingItem. | ||
| F0C0 | JP Drop_IsPlayerHoldingItem | |||
|
Was the player trying to drop ... the arrows?
|
||||
| Validate_Drop_Arrows | F0C3 | LD HL,$E81F | Call Parser_AdvanceToSeparator with E81F. | |
| F0C6 | CALL Parser_AdvanceToSeparator | |||
| F0C9 | JR NZ,Validate_Drop_Furnace | Jump to Validate_Drop_Furnace if the token isn't for the arrows. | ||
| F0CB | LD A,$04 | A=04; jump to Drop_IsPlayerHoldingItem. | ||
| F0CD | JP Drop_IsPlayerHoldingItem | |||
|
Was the player trying to drop ... the furnace (worn ring)?
|
||||
| Validate_Drop_Furnace | F0D0 | LD HL,$E821 | Call Parser_AdvanceToSeparator with E821. | |
| F0D3 | CALL Parser_AdvanceToSeparator | |||
| F0D6 | JR NZ,Validate_Drop_Rope | Jump to Validate_Drop_Rope if the token isn't for the furnace. | ||
| F0D8 | LD A,$43 | Call IsObjectCarried with item 43: "A ring,which you are wearing". | ||
| F0DA | CALL IsObjectCarried | |||
| F0DD | JR NZ,Validate_Drop_Furnace_Ring | Jump to Validate_Drop_Furnace_Ring if "A ring,which you are wearing" isn't held. | ||
| F0DF | LD BC,$4307 | Call TransformItem to transform "A ring,which you are wearing" into "A ring". | ||
| F0E2 | CALL TransformItem | |||
| Validate_Drop_Furnace_Ring | F0E5 | LD A,$07 | A=07; jump to Drop_IsPlayerHoldingItem. | |
| F0E7 | JP Drop_IsPlayerHoldingItem | |||
|
Was the player trying to drop ... the rope?
|
||||
| Validate_Drop_Rope | F0EA | LD HL,$E823 | Call Parser_AdvanceToSeparator with E823. | |
| F0ED | CALL Parser_AdvanceToSeparator | |||
| F0F0 | JR NZ,Validate_Drop_LogToken | Jump to Validate_Drop_LogToken if the token isn't for the rope. | ||
| F0F2 | LD A,$08 | A=08; jump to Drop_IsPlayerHoldingItem. | ||
| F0F4 | JP Drop_IsPlayerHoldingItem | |||
|
Was the player trying to drop ... the log?
|
||||
| Validate_Drop_LogToken | F0F7 | LD HL,$E825 | Call Parser_AdvanceToSeparator with E825. | |
| F0FA | CALL Parser_AdvanceToSeparator | |||
| F0FD | JR NZ,Validate_Drop_LogBridge | Jump to Validate_Drop_LogBridge if the token isn't for the log. | ||
| F0FF | LD A,$44 | A=44; jump to Drop_IsPlayerHoldingItem. | ||
| F101 | JP Drop_IsPlayerHoldingItem | |||
|
Was the player trying to drop the log to bridge the chasm?
|
||||
| Validate_Drop_LogBridge | F104 | LD HL,$E839 | Call Parser_AdvanceToSeparator with E839. | |
| F107 | CALL Parser_AdvanceToSeparator | |||
| F10A | JR NZ,Validate_Drop_Horn | Jump to Validate_Drop_Horn if the token isn't for bridging the chasm. | ||
| F10C | LD A,$44 | Jump to Validate_Drop_LogBridge_Held if ValidateItemPresent reports that "A log" is in the current room. | ||
| F10E | CALL ValidateItemPresent | |||
| F111 | JR Z,Validate_Drop_LogBridge_Held | |||
|
Print "It already is!".
|
||||
| F113 | LD HL,$DC8B | HL=Messaging_ItAlreadyIs. | ||
| F116 | JP PrintResponse | Jump to PrintResponse. | ||
| Validate_Drop_LogBridge_Held | F119 | LD A,$44 | Call IsObjectCarried with item 44: "A log". | |
| F11B | CALL IsObjectCarried | |||
| F11E | JR NZ,Validate_Drop_LogBridge_Place | Jump to Validate_Drop_LogBridge_Place if "A log" isn't held. | ||
| F120 | LD HL,$BA68 | Decrease *Count_InventoryItems by one. | ||
| F123 | DEC (HL) | |||
| Validate_Drop_LogBridge_Place | F124 | LD A,$44 | Call Handler_DestroyItem with item 44: "A log". | |
| F126 | CALL Handler_DestroyItem | |||
| F129 | LD BC,$4515 | Call UpdateObjectLocation to place "A log,bridging the chasm" in room 15: " The Western Edge of a Chasm". | ||
| F12C | CALL UpdateObjectLocation | |||
| F12F | LD BC,$4616 | Call UpdateObjectLocation to place "A log,bridging the chasm" in room 16: " The Eastern Edge of a Chasm". | ||
| F132 | CALL UpdateObjectLocation | |||
| F135 | LD A,$11 | Call Handler_DestroyItem with item 11: "It seems too wide to jump across". | ||
| F137 | CALL Handler_DestroyItem | |||
| F13A | LD A,$12 | Call Handler_DestroyItem with item 12: "It seems too wide to jump across". | ||
| F13C | CALL Handler_DestroyItem | |||
|
This action changes the map:
|
||||
| F13F | LD A,$16 | Write 16 to *Exit_WesternChasmEast to open up eastbound access to The Eastern Edge of a Chasm from The Western Edge of a Chasm. | ||
| F141 | LD ($E9B4),A | |||
| F144 | LD A,$15 | Write 15 to *Exit_EasternChasmWest to open up westbound access to The Western Edge of a Chasm from The Eastern Edge of a Chasm. | ||
| F146 | LD ($E9BB),A | |||
|
Print "The log now spans the chasm,
forming an effective bridge.".
|
||||
| F149 | LD HL,$DCFE | HL=Messaging_TheLogNowSpansTheChasm. | ||
| F14C | JP PrintResponse | Jump to PrintResponse. | ||
|
Was the player trying to drop ... the horn?
|
||||
| Validate_Drop_Horn | F14F | LD HL,$E827 | Call Parser_AdvanceToSeparator with E827. | |
| F152 | CALL Parser_AdvanceToSeparator | |||
| F155 | JR NZ,Validate_Drop_OpenChest | Jump to Validate_Drop_OpenChest if the token isn't for the horn. | ||
| F157 | LD A,$09 | A=09; jump to Drop_IsPlayerHoldingItem. | ||
| F159 | JP Drop_IsPlayerHoldingItem | |||
|
Was the player trying to drop ... the open chest?
|
||||
| Validate_Drop_OpenChest | F15C | LD HL,$E829 | Call Parser_AdvanceToSeparator with E829. | |
| F15F | CALL Parser_AdvanceToSeparator | |||
| F162 | JR NZ,Validate_Drop_Key | Jump to Validate_Drop_Key if the token isn't for the open chest. | ||
| F164 | LD A,$0D | Call IsObjectCarried with item 0D: "An open chest containing the Crystals of Vulcan". | ||
| F166 | CALL IsObjectCarried | |||
| F169 | JR NZ,Validate_Drop_OpenChest_Drop | Jump to Validate_Drop_OpenChest_Drop if "An open chest containing the Crystals of Vulcan" isn't held. | ||
| F16B | LD BC,$0F01 | Call UpdateObjectLocation to place "The Crystals of Vulcan" in the inventory (01). | ||
| F16E | CALL UpdateObjectLocation | |||
| F171 | LD BC,$0D0E | Call TransformItem to transform "An open chest containing the Crystals of Vulcan" into "An empty chest". | ||
| F174 | CALL TransformItem | |||
| F177 | LD HL,$BA68 | Increment *Count_InventoryItems by one. | ||
| F17A | INC (HL) | |||
| Validate_Drop_OpenChest_Drop | F17B | LD A,$0F | A=0F; jump to Drop_IsPlayerHoldingItem. | |
| F17D | JP Drop_IsPlayerHoldingItem | |||
|
Was the player trying to drop ... the key?
|
||||
| Validate_Drop_Key | F180 | LD HL,$E82F | Call Parser_AdvanceToSeparator with E82F. | |
| F183 | CALL Parser_AdvanceToSeparator | |||
| F186 | JR NZ,Drop_YouCant | Jump to Drop_YouCant if the token isn't for the key. | ||
| F188 | LD A,$10 | A=10; jump to Drop_IsPlayerHoldingItem. | ||
| F18A | JP Drop_IsPlayerHoldingItem | |||
|
Nothing else is valid.
|
||||
| Drop_YouCant | F18D | JP Response_YouCant_GameLoop | Jump to Response_YouCant_GameLoop. | |
|
View the equivalent code in;
|
||||
| Prev: F011 | Up: Map | Next: F190 |