![]() |
Routines |
Prev: F246 | Up: Map | Next: F481 |
Used by the routine at Action_Get.
|
||||
Action_Take | F263 | CALL Parser_ValidateDirectObject | Call Parser_ValidateDirectObject. | |
F266 | RET C | Return if the direct object is malformed. | ||
Start by calling the chain of items to check...
|
||||
F267 | JP Validate_Take_BottleOfRum | Jump to Validate_Take_BottleOfRum. | ||
Check if the player is holding the requested item?
|
||||
Take_IsPlayerHoldingItem | F26A | CALL CheckObjectInInventory | Call CheckObjectInInventory. | |
F26D | JR NZ,Action_Take_1 | Jump to Action_Take_1 if A is not equal to 59. | ||
F26F | POP HL | Restore HL from the stack. | ||
Print "You're already carrying ".
|
||||
F270 | LD HL,$BF10 | HL=Messaging_YoureAlreadyCarrying. | ||
F273 | CALL PrintString | Call PrintString. | ||
F276 | LD HL,$F29B | HL=Table_ItemsWhichArePlural. | ||
F279 | LD A,E | A=E. | ||
F27A | LD BC,$0001 | BC=0001. | ||
F27D | CPIR | CPIR. | ||
F27F | JR Z,Action_Take_0 | Jump to Action_Take_0 if A is equal to 59. | ||
Print "it.".
|
||||
F281 | LD HL,$BF2B | HL=Messaging_It. | ||
F284 | JP PrintStringAndNewline_Alias | Jump to PrintStringAndNewline_Alias. | ||
Print "them.".
|
||||
Action_Take_0 | F287 | LD HL,$BF2F | HL=Messaging_Them. | |
F28A | JP PrintStringAndNewline_Alias | Jump to PrintStringAndNewline_Alias. | ||
Action_Take_1 | F28D | LD A,($BC98) | Compare *Count_InventoryItems with 05... | |
F290 | CP $05 | |||
F292 | LD B,E | B=E. | ||
F293 | RET NZ | Return if *Count_InventoryItems is not equal to 05. | ||
F294 | POP HL | Restore HL from the stack. | ||
Print "You can't carry any more.".
|
||||
F295 | LD HL,$BF35 | HL=Messaging_YouCantCarryAnyMore. | ||
F298 | JP PrintStringAndNewline_Alias | Jump to PrintStringAndNewline_Alias. | ||
Table: All the items in the game which are plural.
Which is ... the jewels.
|
||||
Table_ItemsWhichArePlural | F29B | DEFB $1D | Item 1D: "The Jewels of Babylon". | |
The player can take the item.
|
||||
TakeItem | F29C | LD C,$01 | Load C with 01 which indicates the item will be in the players inventory. | |
F29E | CALL Handler_UpdateObjectLocation | Call Handler_UpdateObjectLocation. | ||
F2A1 | LD HL,$BC98 | Increment *Count_InventoryItems by one. | ||
F2A4 | INC (HL) | |||
F2A5 | JP Response_OK_Duplicate | Jump to Response_OK_Duplicate. | ||
Was the player trying to take the bottle of rum?
|
||||
Validate_Take_BottleOfRum | F2A8 | LD HL,$E9E7 | Call MatchPhraseTokens with PhraseTokens_BottleOfRum. | |
F2AB | CALL MatchPhraseTokens | |||
F2AE | JR NZ,Validate_Take_Fish | Jump to Validate_Take_Fish if the token isn't for the bottle of rum. | ||
F2B0 | LD HL,$E87A | Call CheckActiveScenicEvents with Data_ItemGroup_Bottle_1. | ||
F2B3 | CALL CheckActiveScenicEvents | |||
F2B6 | CALL Take_IsPlayerHoldingItem | Call Take_IsPlayerHoldingItem. | ||
F2B9 | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the fish?
|
||||
Validate_Take_Fish | F2BC | LD HL,$E9CC | Call MatchPhraseTokens with PhraseTokens_Fish. | |
F2BF | CALL MatchPhraseTokens | |||
F2C2 | JR NZ,Validate_Take_Watch | Jump to Validate_Take_Watch if the token isn't for the fish. | ||
F2C4 | LD HL,$E895 | Call CheckActiveScenicEvents with Data_ItemGroup_Fish. | ||
F2C7 | CALL CheckActiveScenicEvents | |||
F2CA | CALL Take_IsPlayerHoldingItem | Call Take_IsPlayerHoldingItem. | ||
F2CD | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the watch?
|
||||
Validate_Take_Watch | F2D0 | LD HL,$E9D1 | Call MatchPhraseTokens with PhraseTokens_Watch. | |
F2D3 | CALL MatchPhraseTokens | |||
F2D6 | JR NZ,Validate_Take_Shoe | Jump to Validate_Take_Shoe if the token isn't for the watch. | ||
F2D8 | LD A,$19 | Call ValidateItemPresent with "The distracted natives". | ||
F2DA | CALL ValidateItemPresent | |||
F2DD | JR NZ,Action_Take_2 | Jump to Action_Take_2 if "The distracted natives" isn't in the current room. | ||
Print "That's not such a good idea.".
|
||||
F2DF | LD HL,$DB5F | HL=DB5F. | ||
F2E2 | JP PrintStringAndNewline_Alias | Jump to PrintStringAndNewline_Alias. | ||
Action_Take_2 | F2E5 | LD A,$17 | Call Take_IsPlayerHoldingItem with "A watch". | |
F2E7 | CALL Take_IsPlayerHoldingItem | |||
F2EA | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the shoe?
|
||||
Validate_Take_Shoe | F2ED | LD HL,$E9D3 | Call MatchPhraseTokens with PhraseTokens_Shoe. | |
F2F0 | CALL MatchPhraseTokens | |||
F2F3 | JR NZ,Validate_Take_Fruit | Jump to Validate_Take_Fruit if the token isn't for the shoe. | ||
F2F5 | LD A,$15 | Call Take_IsPlayerHoldingItem with "A shoe". | ||
F2F7 | CALL Take_IsPlayerHoldingItem | |||
F2FA | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the fruit?
|
||||
Validate_Take_Fruit | F2FD | LD HL,$E9D7 | Call MatchPhraseTokens with PhraseTokens_Fruit. | |
F300 | CALL MatchPhraseTokens | |||
F303 | JR NZ,Validate_Take_Rod | Jump to Validate_Take_Rod if the token isn't for the fruit. | ||
F305 | LD A,$0E | Call Take_IsPlayerHoldingItem with "Some fruit". | ||
F307 | CALL Take_IsPlayerHoldingItem | |||
F30A | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the rod?
|
||||
Validate_Take_Rod | F30D | LD HL,$E9D5 | Call MatchPhraseTokens with PhraseTokens_Rod. | |
F310 | CALL MatchPhraseTokens | |||
F313 | JR NZ,Validate_Take_Jewels | Jump to Validate_Take_Jewels if the token isn't for the rod. | ||
F315 | LD A,$08 | Call Take_IsPlayerHoldingItem with "A rod". | ||
F317 | CALL Take_IsPlayerHoldingItem | |||
F31A | LD A,B | A=B. | ||
F31B | CALL ValidateItemPresent | Call ValidateItemPresent. | ||
F31E | LD B,$08 | B=08. | ||
F320 | JP Z,TakeItem | Jump to TakeItem if *HL is equal to 08. | ||
F323 | LD BC,$0A09 | Call TransformItem to transform item 0A ("A hole with a rod inserted to the side of the door") into item 09 ("A small round hole to the side of the door"). | ||
F326 | CALL TransformItem | |||
F329 | LD BC,$3132 | Call TransformItem to transform item 31 ("The door is open") into item 32 ("The door is closed"). | ||
F32C | CALL TransformItem | |||
F32F | LD BC,$3315 | Call Handler_UpdateObjectLocation using item "A slab of rock" to create it in The Narrow Path. | ||
F332 | CALL Handler_UpdateObjectLocation | |||
F335 | XOR A | Write 00 to *EB90 to remove access to The Mighty Rock Door from The Narrow Path. | ||
F336 | LD ($EB90),A | |||
F339 | LD ($ED8D),A | Write 00 to *ED8D to remove access to The Narrow Path from The Mighty Rock Door. | ||
F33C | LD B,$08 | B=08. | ||
F33E | CALL TakeItem | Call TakeItem. | ||
Print "The door rolls shut.".
|
||||
F341 | LD HL,$DB7C | HL=DB7C. | ||
F344 | JP PrintStringAndNewline_Alias | Jump to PrintStringAndNewline_Alias. | ||
Was the player trying to take the jewels?
|
||||
Validate_Take_Jewels | F347 | LD HL,$E9DB | Call MatchPhraseTokens with PhraseTokens_Jewels. | |
F34A | CALL MatchPhraseTokens | |||
F34D | JR NZ,Validate_Take_Match | Jump to Validate_Take_Match if the token isn't for the jewels. | ||
F34F | LD A,$1D | Call Take_IsPlayerHoldingItem with "The Jewels of Babylon". | ||
F351 | CALL Take_IsPlayerHoldingItem | |||
F354 | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the match?
|
||||
Validate_Take_Match | F357 | LD HL,$E9E1 | Call MatchPhraseTokens with PhraseTokens_Match. | |
F35A | CALL MatchPhraseTokens | |||
F35D | JR NZ,Validate_Take_Plank | Jump to Validate_Take_Plank if the token isn't for the match. | ||
F35F | LD HL,$E86E | Call CheckActiveScenicEvents with Data_ItemGroup_Match. | ||
F362 | CALL CheckActiveScenicEvents | |||
F365 | CALL Take_IsPlayerHoldingItem | Call Take_IsPlayerHoldingItem. | ||
F368 | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the plank?
|
||||
Validate_Take_Plank | F36B | LD HL,$E9E3 | Call MatchPhraseTokens with PhraseTokens_Plank. | |
F36E | CALL MatchPhraseTokens | |||
F371 | JR NZ,Validate_Take_Coconut | Jump to Validate_Take_Coconut if the token isn't for the plank. | ||
F373 | LD HL,$E871 | Call CheckActiveScenicEvents with Data_ItemGroup_Plank. | ||
F376 | CALL CheckActiveScenicEvents | |||
F379 | CALL Take_IsPlayerHoldingItem | Call Take_IsPlayerHoldingItem. | ||
F37C | LD A,B | A=B. | ||
F37D | CP $04 | Jump to TakeItem if A is equal to 04. | ||
F37F | JP Z,TakeItem | |||
F382 | LD A,$05 | A=05 (event ID: 05). | ||
F384 | CALL Handler_DestroyItemEvent | Call Handler_DestroyItemEvent. | ||
F387 | LD A,$06 | A=06 (event ID: 06). | ||
F389 | CALL Handler_DestroyItemEvent | Call Handler_DestroyItemEvent. | ||
F38C | LD B,$04 | B=04. | ||
F38E | XOR A | Write 00 to: | ||
F38F | LD ($ED75),A | |||
F392 | LD ($ED80),A | |||
F395 | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the coconut?
|
||||
Validate_Take_Coconut | F398 | LD HL,$E9E5 | Call MatchPhraseTokens with PhraseTokens_Coconut. | |
F39B | CALL MatchPhraseTokens | |||
F39E | JR NZ,Validate_Take_Gun | Jump to Validate_Take_Gun if the token isn't for the coconut. | ||
F3A0 | LD A,$07 | Call Take_IsPlayerHoldingItem with "A coconut". | ||
F3A2 | CALL Take_IsPlayerHoldingItem | |||
F3A5 | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the gun?
|
||||
Validate_Take_Gun | F3A8 | LD HL,$E9EF | Call MatchPhraseTokens with PhraseTokens_Gun. | |
F3AB | CALL MatchPhraseTokens | |||
F3AE | JR NZ,Validate_Take_Eyepatch | Jump to Validate_Take_Eyepatch if the token isn't for the gun. | ||
F3B0 | LD A,$0F | Call Take_IsPlayerHoldingItem with "A gun". | ||
F3B2 | CALL Take_IsPlayerHoldingItem | |||
F3B5 | LD A,$27 | Call ValidateItemPresent with "A parrot (alive)". | ||
F3B7 | CALL ValidateItemPresent | |||
F3BA | JR Z,Action_Take_3 | Jump to Action_Take_3 if "A parrot (alive)" is present in the current room. | ||
F3BC | LD A,$22 | A=22 (event ID: 22). | ||
F3BE | CALL Handler_DestroyItemEvent | Call Handler_DestroyItemEvent. | ||
F3C1 | LD A,$88 | A=88. | ||
F3C3 | CALL ScenicEventTriggered | Call ScenicEventTriggered. | ||
F3C6 | LD B,$0F | B=0F. | ||
F3C8 | JP TakeItem | Jump to TakeItem. | ||
Bad luck!
|
||||
Action_Take_3 | F3CB | LD HL,$EDD7 | Switch GameOver onto the stack so the next return actions a "game over". | |
F3CE | EX (SP),HL | |||
Print "As you start to move,
the parrot squawks...
The pirate wakes
and quickly shoots you.".
|
||||
F3CF | LD HL,$DBCC | HL=DBCC. | ||
F3D2 | JP PrintStringAndNewline_Alias | Jump to PrintStringAndNewline_Alias. | ||
Was the player trying to take the eyepatch?
|
||||
Validate_Take_Eyepatch | F3D5 | LD HL,$E9F1 | Call MatchPhraseTokens with PhraseTokens_Eyepatch. | |
F3D8 | CALL MatchPhraseTokens | |||
F3DB | JR NZ,Validate_Take_KegOfGunpowder | Jump to Validate_Take_KegOfGunpowder if the token isn't for the eyepatch. | ||
F3DD | LD HL,$E885 | Call CheckActiveScenicEvents with Data_ItemGroup_Eyepatch. | ||
F3E0 | CALL CheckActiveScenicEvents | |||
F3E3 | CALL Take_IsPlayerHoldingItem | Call Take_IsPlayerHoldingItem. | ||
F3E6 | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the keg of gunpowder?
|
||||
Validate_Take_KegOfGunpowder | F3E9 | LD HL,$E9F3 | Call MatchPhraseTokens with PhraseTokens_KegGunPowder. | |
F3EC | CALL MatchPhraseTokens | |||
F3EF | JR NZ,Validate_Take_Sextant | Jump to Validate_Take_Sextant if the token isn't for the keg of gunpowder. | ||
F3F1 | LD HL,$E888 | Call CheckActiveScenicEvents with Data_ItemGroup_CrocodileWithKeg_1. | ||
F3F4 | CALL CheckActiveScenicEvents | |||
F3F7 | CALL Take_IsPlayerHoldingItem | Call Take_IsPlayerHoldingItem. | ||
F3FA | LD A,B | A=B. | ||
F3FB | CP $12 | Compare A with 12. | ||
F3FD | JP Z,TakeItem | Jump to TakeItem if A is equal to 12. | ||
F400 | JP Response_YouCant_Duplicate | Jump to Response_YouCant_Duplicate. | ||
Was the player trying to take the sextant?
|
||||
Validate_Take_Sextant | F403 | LD HL,$E9FB | Call MatchPhraseTokens with PhraseTokens_Sextant. | |
F406 | CALL MatchPhraseTokens | |||
F409 | JR NZ,Validate_Take_Crowbar | Jump to Validate_Take_Crowbar if the token isn't for the sextant. | ||
F40B | LD A,$16 | Call Take_IsPlayerHoldingItem with "A sextant". | ||
F40D | CALL Take_IsPlayerHoldingItem | |||
F410 | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the crowbar?
|
||||
Validate_Take_Crowbar | F413 | LD HL,$E9FD | Call MatchPhraseTokens with PhraseTokens_Crowbar. | |
F416 | CALL MatchPhraseTokens | |||
F419 | JR NZ,Validate_Take_Key | Jump to Validate_Take_Key if the token isn't for the crowbar. | ||
F41B | LD A,$1E | Call Take_IsPlayerHoldingItem with "A crowbar". | ||
F41D | CALL Take_IsPlayerHoldingItem | |||
F420 | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the key?
|
||||
Validate_Take_Key | F423 | LD HL,$E9FF | Call MatchPhraseTokens with PhraseTokens_Key. | |
F426 | CALL MatchPhraseTokens | |||
F429 | JR NZ,Validate_Take_Skull | Jump to Validate_Take_Skull if the token isn't for the key. | ||
F42B | LD A,$1F | Call Take_IsPlayerHoldingItem with "A key". | ||
F42D | CALL Take_IsPlayerHoldingItem | |||
F430 | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the skull?
|
||||
Validate_Take_Skull | F433 | LD HL,$EA01 | Call MatchPhraseTokens with PhraseTokens_Skull. | |
F436 | CALL MatchPhraseTokens | |||
F439 | JR NZ,Validate_Take_Spear | Jump to Validate_Take_Spear if the token isn't for the skull. | ||
F43B | LD A,$20 | Call Take_IsPlayerHoldingItem with "A human skull". | ||
F43D | CALL Take_IsPlayerHoldingItem | |||
F440 | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the spear?
|
||||
Validate_Take_Spear | F443 | LD HL,$EA06 | Call MatchPhraseTokens with PhraseTokens_Spear. | |
F446 | CALL MatchPhraseTokens | |||
F449 | JR NZ,Validate_Take_Parrot | Jump to Validate_Take_Parrot if the token isn't for the spear. | ||
F44B | LD HL,$E8A0 | Call CheckActiveScenicEvents with Data_ItemGroup_CannibalsWithSpear. | ||
F44E | CALL CheckActiveScenicEvents | |||
F451 | CALL Take_IsPlayerHoldingItem | Call Take_IsPlayerHoldingItem. | ||
F454 | LD A,B | A=B. | ||
F455 | CP $1A | Compare A with 1A. | ||
F457 | JP Z,TakeItem | Jump to TakeItem if A is equal to 1A. | ||
F45A | JP Response_YouCant_Duplicate | Jump to Response_YouCant_Duplicate. | ||
Was the player trying to take the parrot?
|
||||
Validate_Take_Parrot | F45D | LD HL,$EA08 | Call MatchPhraseTokens with PhraseTokens_Parrot. | |
F460 | CALL MatchPhraseTokens | |||
F463 | JR NZ,Take_Invalid | Jump to Take_Invalid if the token isn't for the parrot. | ||
F465 | LD HL,$E8BC | Call CheckActiveScenicEvents with Data_ItemGroup_Parrot. | ||
F468 | CALL CheckActiveScenicEvents | |||
F46B | CALL Take_IsPlayerHoldingItem | Call Take_IsPlayerHoldingItem. | ||
F46E | LD A,B | A=B. | ||
F46F | CP $28 | Compare A with 28. | ||
F471 | JP Z,TakeItem | Jump to TakeItem if A is equal to 28. | ||
Bad luck!
|
||||
F474 | LD HL,$EDD7 | Switch GameOver onto the stack so the next return actions a "game over". | ||
F477 | EX (SP),HL | |||
Print "As you start to move,
the parrot squawks...
The pirate wakes
and quickly shoots you.".
|
||||
F478 | LD HL,$DBCC | HL=DBCC. | ||
F47B | JP PrintStringAndNewline_Alias | Jump to PrintStringAndNewline_Alias. | ||
Nothing else is valid.
|
||||
Take_Invalid | F47E | JP Response_YouCant_Duplicate | Jump to Response_YouCant_Duplicate. |
Prev: F246 | Up: Map | Next: F481 |