Prev: 61457 Up: Map Next: 61840
61498: Action: Drop
Drop one of the objects the player named.
Action_Drop 61498 CALL Parser_ValidateDirectObject Call Parser_ValidateDirectObject.
61501 RET C Return if the direct object is malformed.
Start by calling the chain of items to check...
61502 CP 3 Jump to Validate_Drop_MarasBody if A is less than 3.
61504 JR C,Validate_Drop_MarasBody
61506 JP Response_PleaseRephraseThat_GameLoop Jump to Response_PleaseRephraseThat_GameLoop.
Check if the player is holding the requested item?
Drop_IsPlayerHoldingItem 61509 CALL IsObjectCarried Call IsObjectCarried.
61512 JR Z,DropItem Jump to DropItem if the player is holding the requested item.
Print "You're not carrying ".
61514 LD HL,48511 HL=Messaging_YoureNotCarrying.
61517 CALL PrintString Call PrintString.
61520 LD A,E Copy the object ID back into A.
61521 LD HL,61163 HL=Table_ItemsWhichArePlural.
61524 LD BC,2 BC=0002.
61527 CPIR Search for the item ID among the plural items.
61529 JR Z,Drop_NotCarrying_Them Jump to Drop_NotCarrying_Them if the item is plural.
Print "it.".
61531 LD HL,48379 HL=Messaging_It.
61534 JP PrintResponse Jump to PrintResponse.
Print "them.".
Drop_NotCarrying_Them 61537 LD HL,48383 HL=Messaging_Them.
61540 JP PrintResponse Jump to PrintResponse.
The player has the item in their inventory so drop it.
DropItem 61543 LD B,E Copy the item ID into B.
61544 LD A,(47771) C=*CurrentRoom.
61547 LD C,A
Alter the items location from the players inventory to the current room ID.
61548 CALL UpdateObjectLocation Call UpdateObjectLocation.
61551 LD HL,47720 Decrease *Count_InventoryItems by one.
61554 DEC (HL)
Print "O.K.".
61555 LD HL,48347 HL=Messaging_OK.
61558 JP PrintResponse Jump to PrintResponse.
Was the player trying to drop Mara's body (the sword)?
Validate_Drop_MarasBody 61561 LD HL,59410 Call Parser_AdvanceToSeparator with 59410.
61564 CALL Parser_AdvanceToSeparator
61567 JR NZ,Validate_Drop_Witch Jump to Validate_Drop_Witch if the token isn't for Mara's body.
61569 LD A,51 Call Handler_DestroyItem with item 51: "A glowing rock".
61571 CALL Handler_DestroyItem
61574 LD A,10 A=10; jump to Drop_IsPlayerHoldingItem.
61576 JP Drop_IsPlayerHoldingItem
Was the player trying to drop ... the witch?
Validate_Drop_Witch 61579 LD HL,59412 Call Parser_AdvanceToSeparator with 59412.
61582 CALL Parser_AdvanceToSeparator
61585 JR NZ,Validate_Drop_Food Jump to Validate_Drop_Food if the token isn't for the witch.
61587 LD HL,59135 Call Parser_SkipToken with 59135.
61590 CALL Parser_SkipToken
61593 JP Drop_IsPlayerHoldingItem Jump to Drop_IsPlayerHoldingItem.
Was the player trying to drop ... the food?
Validate_Drop_Food 61596 LD HL,59414 Call Parser_AdvanceToSeparator with 59414.
61599 CALL Parser_AdvanceToSeparator
61602 JR NZ,Validate_Drop_SilverCoin Jump to Validate_Drop_SilverCoin if the token isn't for the food.
61604 LD A,0 A=0; jump to Drop_IsPlayerHoldingItem.
61606 JP Drop_IsPlayerHoldingItem
Was the player trying to drop ... the silver coin?
Validate_Drop_SilverCoin 61609 LD HL,59416 Call Parser_AdvanceToSeparator with 59416.
61612 CALL Parser_AdvanceToSeparator
61615 JR NZ,Validate_Drop_Bow Jump to Validate_Drop_Bow if the token isn't for the silver coin.
61617 LD A,2 A=2; jump to Drop_IsPlayerHoldingItem.
61619 JP Drop_IsPlayerHoldingItem
Was the player trying to drop ... the bow?
Validate_Drop_Bow 61622 LD HL,59421 Call Parser_AdvanceToSeparator with 59421.
61625 CALL Parser_AdvanceToSeparator
61628 JR NZ,Validate_Drop_Arrows Jump to Validate_Drop_Arrows if the token isn't for the bow.
61630 LD A,3 A=3; jump to Drop_IsPlayerHoldingItem.
61632 JP Drop_IsPlayerHoldingItem
Was the player trying to drop ... the arrows?
Validate_Drop_Arrows 61635 LD HL,59423 Call Parser_AdvanceToSeparator with 59423.
61638 CALL Parser_AdvanceToSeparator
61641 JR NZ,Validate_Drop_Furnace Jump to Validate_Drop_Furnace if the token isn't for the arrows.
61643 LD A,4 A=4; jump to Drop_IsPlayerHoldingItem.
61645 JP Drop_IsPlayerHoldingItem
Was the player trying to drop ... the furnace (worn ring)?
Validate_Drop_Furnace 61648 LD HL,59425 Call Parser_AdvanceToSeparator with 59425.
61651 CALL Parser_AdvanceToSeparator
61654 JR NZ,Validate_Drop_Rope Jump to Validate_Drop_Rope if the token isn't for the furnace.
61656 LD A,67 Call IsObjectCarried with item 67: "A ring,which you are wearing".
61658 CALL IsObjectCarried
61661 JR NZ,Validate_Drop_Furnace_Ring Jump to Validate_Drop_Furnace_Ring if "A ring,which you are wearing" isn't held.
61663 LD BC,17159 Call TransformItem to transform "A ring,which you are wearing" into "A ring".
61666 CALL TransformItem
Validate_Drop_Furnace_Ring 61669 LD A,7 A=7; jump to Drop_IsPlayerHoldingItem.
61671 JP Drop_IsPlayerHoldingItem
Was the player trying to drop ... the rope?
Validate_Drop_Rope 61674 LD HL,59427 Call Parser_AdvanceToSeparator with 59427.
61677 CALL Parser_AdvanceToSeparator
61680 JR NZ,Validate_Drop_LogToken Jump to Validate_Drop_LogToken if the token isn't for the rope.
61682 LD A,8 A=8; jump to Drop_IsPlayerHoldingItem.
61684 JP Drop_IsPlayerHoldingItem
Was the player trying to drop ... the log?
Validate_Drop_LogToken 61687 LD HL,59429 Call Parser_AdvanceToSeparator with 59429.
61690 CALL Parser_AdvanceToSeparator
61693 JR NZ,Validate_Drop_LogBridge Jump to Validate_Drop_LogBridge if the token isn't for the log.
61695 LD A,68 A=68; jump to Drop_IsPlayerHoldingItem.
61697 JP Drop_IsPlayerHoldingItem
Was the player trying to drop the log to bridge the chasm?
Validate_Drop_LogBridge 61700 LD HL,59449 Call Parser_AdvanceToSeparator with 59449.
61703 CALL Parser_AdvanceToSeparator
61706 JR NZ,Validate_Drop_Horn Jump to Validate_Drop_Horn if the token isn't for bridging the chasm.
61708 LD A,68 Jump to Validate_Drop_LogBridge_Held if ValidateItemPresent reports that "A log" is in the current room.
61710 CALL ValidateItemPresent
61713 JR Z,Validate_Drop_LogBridge_Held
Print "It already is!".
61715 LD HL,56459 HL=Messaging_ItAlreadyIs.
61718 JP PrintResponse Jump to PrintResponse.
Validate_Drop_LogBridge_Held 61721 LD A,68 Call IsObjectCarried with item 68: "A log".
61723 CALL IsObjectCarried
61726 JR NZ,Validate_Drop_LogBridge_Place Jump to Validate_Drop_LogBridge_Place if "A log" isn't held.
61728 LD HL,47720 Decrease *Count_InventoryItems by one.
61731 DEC (HL)
Validate_Drop_LogBridge_Place 61732 LD A,68 Call Handler_DestroyItem with item 68: "A log".
61734 CALL Handler_DestroyItem
61737 LD BC,17685 Call UpdateObjectLocation to place "A log,bridging the chasm" in room 21: " The Western Edge of a Chasm".
61740 CALL UpdateObjectLocation
61743 LD BC,17942 Call UpdateObjectLocation to place "A log,bridging the chasm" in room 22: " The Eastern Edge of a Chasm".
61746 CALL UpdateObjectLocation
61749 LD A,17 Call Handler_DestroyItem with item 17: "It seems too wide to jump across".
61751 CALL Handler_DestroyItem
61754 LD A,18 Call Handler_DestroyItem with item 18: "It seems too wide to jump across".
61756 CALL Handler_DestroyItem
This action changes the map:
61759 LD A,22 Write 22 to *Exit_WesternChasmEast to open up eastbound access to The Eastern Edge of a Chasm from The Western Edge of a Chasm.
61761 LD (59828),A
61764 LD A,21 Write 21 to *Exit_EasternChasmWest to open up westbound access to The Western Edge of a Chasm from The Eastern Edge of a Chasm.
61766 LD (59835),A
Print "The log now spans the chasm, forming an effective bridge.".
61769 LD HL,56574 HL=Messaging_TheLogNowSpansTheChasm.
61772 JP PrintResponse Jump to PrintResponse.
Was the player trying to drop ... the horn?
Validate_Drop_Horn 61775 LD HL,59431 Call Parser_AdvanceToSeparator with 59431.
61778 CALL Parser_AdvanceToSeparator
61781 JR NZ,Validate_Drop_OpenChest Jump to Validate_Drop_OpenChest if the token isn't for the horn.
61783 LD A,9 A=9; jump to Drop_IsPlayerHoldingItem.
61785 JP Drop_IsPlayerHoldingItem
Was the player trying to drop ... the open chest?
Validate_Drop_OpenChest 61788 LD HL,59433 Call Parser_AdvanceToSeparator with 59433.
61791 CALL Parser_AdvanceToSeparator
61794 JR NZ,Validate_Drop_Key Jump to Validate_Drop_Key if the token isn't for the open chest.
61796 LD A,13 Call IsObjectCarried with item 13: "An open chest containing the Crystals of Vulcan".
61798 CALL IsObjectCarried
61801 JR NZ,Validate_Drop_OpenChest_Drop Jump to Validate_Drop_OpenChest_Drop if "An open chest containing the Crystals of Vulcan" isn't held.
61803 LD BC,3841 Call UpdateObjectLocation to place "The Crystals of Vulcan" in the inventory (1).
61806 CALL UpdateObjectLocation
61809 LD BC,3342 Call TransformItem to transform "An open chest containing the Crystals of Vulcan" into "An empty chest".
61812 CALL TransformItem
61815 LD HL,47720 Increment *Count_InventoryItems by one.
61818 INC (HL)
Validate_Drop_OpenChest_Drop 61819 LD A,15 A=15; jump to Drop_IsPlayerHoldingItem.
61821 JP Drop_IsPlayerHoldingItem
Was the player trying to drop ... the key?
Validate_Drop_Key 61824 LD HL,59439 Call Parser_AdvanceToSeparator with 59439.
61827 CALL Parser_AdvanceToSeparator
61830 JR NZ,Drop_YouCant Jump to Drop_YouCant if the token isn't for the key.
61832 LD A,16 A=16; jump to Drop_IsPlayerHoldingItem.
61834 JP Drop_IsPlayerHoldingItem
Nothing else is valid.
Drop_YouCant 61837 JP Response_YouCant_GameLoop Jump to Response_YouCant_GameLoop.
View the equivalent code in;
Prev: 61457 Up: Map Next: 61840