![]() |
Routines |
Prev: 62022 | Up: Map | Next: 62593 |
Used by the routine at Action_Get.
|
||||
Action_Take | 62051 | CALL Parser_ValidateDirectObject | Call Parser_ValidateDirectObject. | |
62054 | RET C | Return if the direct object is malformed. | ||
Start by calling the chain of items to check...
|
||||
62055 | JP Validate_Take_BottleOfRum | Jump to Validate_Take_BottleOfRum. | ||
Check if the player is holding the requested item?
|
||||
Take_IsPlayerHoldingItem | 62058 | CALL CheckObjectInInventory | Call CheckObjectInInventory. | |
62061 | JR NZ,Action_Take_1 | Jump to Action_Take_1 if A is not equal to 89. | ||
62063 | POP HL | Restore HL from the stack. | ||
Print "You're already carrying ".
|
||||
62064 | LD HL,48912 | HL=Messaging_YoureAlreadyCarrying. | ||
62067 | CALL PrintString | Call PrintString. | ||
62070 | LD HL,62107 | HL=Table_ItemsWhichArePlural. | ||
62073 | LD A,E | A=E. | ||
62074 | LD BC,1 | BC=0001. | ||
62077 | CPIR | CPIR. | ||
62079 | JR Z,Action_Take_0 | Jump to Action_Take_0 if A is equal to 89. | ||
Print "it.".
|
||||
62081 | LD HL,48939 | HL=Messaging_It. | ||
62084 | JP PrintStringAndNewline_Alias | Jump to PrintStringAndNewline_Alias. | ||
Print "them.".
|
||||
Action_Take_0 | 62087 | LD HL,48943 | HL=Messaging_Them. | |
62090 | JP PrintStringAndNewline_Alias | Jump to PrintStringAndNewline_Alias. | ||
Action_Take_1 | 62093 | LD A,(48280) | Compare *Count_InventoryItems with 5... | |
62096 | CP 5 | |||
62098 | LD B,E | B=E. | ||
62099 | RET NZ | Return if *Count_InventoryItems is not equal to 5. | ||
62100 | POP HL | Restore HL from the stack. | ||
Print "You can't carry any more.".
|
||||
62101 | LD HL,48949 | HL=Messaging_YouCantCarryAnyMore. | ||
62104 | JP PrintStringAndNewline_Alias | Jump to PrintStringAndNewline_Alias. | ||
Table: All the items in the game which are plural.
Which is ... the jewels.
|
||||
Table_ItemsWhichArePlural | 62107 | DEFB 29 | Item 29: "The Jewels of Babylon". | |
The player can take the item.
|
||||
TakeItem | 62108 | LD C,1 | Load C with 1 which indicates the item will be in the players inventory. | |
62110 | CALL Handler_UpdateObjectLocation | Call Handler_UpdateObjectLocation. | ||
62113 | LD HL,48280 | Increment *Count_InventoryItems by one. | ||
62116 | INC (HL) | |||
62117 | JP Response_OK_Duplicate | Jump to Response_OK_Duplicate. | ||
Was the player trying to take the bottle of rum?
|
||||
Validate_Take_BottleOfRum | 62120 | LD HL,59879 | Call MatchPhraseTokens with PhraseTokens_BottleOfRum. | |
62123 | CALL MatchPhraseTokens | |||
62126 | JR NZ,Validate_Take_Fish | Jump to Validate_Take_Fish if the token isn't for the bottle of rum. | ||
62128 | LD HL,59514 | Call CheckActiveScenicEvents with Data_ItemGroup_Bottle_1. | ||
62131 | CALL CheckActiveScenicEvents | |||
62134 | CALL Take_IsPlayerHoldingItem | Call Take_IsPlayerHoldingItem. | ||
62137 | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the fish?
|
||||
Validate_Take_Fish | 62140 | LD HL,59852 | Call MatchPhraseTokens with PhraseTokens_Fish. | |
62143 | CALL MatchPhraseTokens | |||
62146 | JR NZ,Validate_Take_Watch | Jump to Validate_Take_Watch if the token isn't for the fish. | ||
62148 | LD HL,59541 | Call CheckActiveScenicEvents with Data_ItemGroup_Fish. | ||
62151 | CALL CheckActiveScenicEvents | |||
62154 | CALL Take_IsPlayerHoldingItem | Call Take_IsPlayerHoldingItem. | ||
62157 | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the watch?
|
||||
Validate_Take_Watch | 62160 | LD HL,59857 | Call MatchPhraseTokens with PhraseTokens_Watch. | |
62163 | CALL MatchPhraseTokens | |||
62166 | JR NZ,Validate_Take_Shoe | Jump to Validate_Take_Shoe if the token isn't for the watch. | ||
62168 | LD A,25 | Call ValidateItemPresent with "The distracted natives". | ||
62170 | CALL ValidateItemPresent | |||
62173 | 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.".
|
||||
62175 | LD HL,56159 | HL=56159. | ||
62178 | JP PrintStringAndNewline_Alias | Jump to PrintStringAndNewline_Alias. | ||
Action_Take_2 | 62181 | LD A,23 | Call Take_IsPlayerHoldingItem with "A watch". | |
62183 | CALL Take_IsPlayerHoldingItem | |||
62186 | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the shoe?
|
||||
Validate_Take_Shoe | 62189 | LD HL,59859 | Call MatchPhraseTokens with PhraseTokens_Shoe. | |
62192 | CALL MatchPhraseTokens | |||
62195 | JR NZ,Validate_Take_Fruit | Jump to Validate_Take_Fruit if the token isn't for the shoe. | ||
62197 | LD A,21 | Call Take_IsPlayerHoldingItem with "A shoe". | ||
62199 | CALL Take_IsPlayerHoldingItem | |||
62202 | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the fruit?
|
||||
Validate_Take_Fruit | 62205 | LD HL,59863 | Call MatchPhraseTokens with PhraseTokens_Fruit. | |
62208 | CALL MatchPhraseTokens | |||
62211 | JR NZ,Validate_Take_Rod | Jump to Validate_Take_Rod if the token isn't for the fruit. | ||
62213 | LD A,14 | Call Take_IsPlayerHoldingItem with "Some fruit". | ||
62215 | CALL Take_IsPlayerHoldingItem | |||
62218 | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the rod?
|
||||
Validate_Take_Rod | 62221 | LD HL,59861 | Call MatchPhraseTokens with PhraseTokens_Rod. | |
62224 | CALL MatchPhraseTokens | |||
62227 | JR NZ,Validate_Take_Jewels | Jump to Validate_Take_Jewels if the token isn't for the rod. | ||
62229 | LD A,8 | Call Take_IsPlayerHoldingItem with "A rod". | ||
62231 | CALL Take_IsPlayerHoldingItem | |||
62234 | LD A,B | A=B. | ||
62235 | CALL ValidateItemPresent | Call ValidateItemPresent. | ||
62238 | LD B,8 | B=8. | ||
62240 | JP Z,TakeItem | Jump to TakeItem if *HL is equal to 8. | ||
62243 | LD BC,2569 | Call TransformItem to transform item 10 ("A hole with a rod inserted to the side of the door") into item 9 ("A small round hole to the side of the door"). | ||
62246 | CALL TransformItem | |||
62249 | LD BC,12594 | Call TransformItem to transform item 49 ("The door is open") into item 50 ("The door is closed"). | ||
62252 | CALL TransformItem | |||
62255 | LD BC,13077 | Call Handler_UpdateObjectLocation using item "A slab of rock" to create it in The Narrow Path. | ||
62258 | CALL Handler_UpdateObjectLocation | |||
62261 | XOR A | Write 0 to *60304 to remove access to The Mighty Rock Door from The Narrow Path. | ||
62262 | LD (60304),A | |||
62265 | LD (60813),A | Write 0 to *60813 to remove access to The Narrow Path from The Mighty Rock Door. | ||
62268 | LD B,8 | B=8. | ||
62270 | CALL TakeItem | Call TakeItem. | ||
Print "The door rolls shut.".
|
||||
62273 | LD HL,56188 | HL=56188. | ||
62276 | JP PrintStringAndNewline_Alias | Jump to PrintStringAndNewline_Alias. | ||
Was the player trying to take the jewels?
|
||||
Validate_Take_Jewels | 62279 | LD HL,59867 | Call MatchPhraseTokens with PhraseTokens_Jewels. | |
62282 | CALL MatchPhraseTokens | |||
62285 | JR NZ,Validate_Take_Match | Jump to Validate_Take_Match if the token isn't for the jewels. | ||
62287 | LD A,29 | Call Take_IsPlayerHoldingItem with "The Jewels of Babylon". | ||
62289 | CALL Take_IsPlayerHoldingItem | |||
62292 | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the match?
|
||||
Validate_Take_Match | 62295 | LD HL,59873 | Call MatchPhraseTokens with PhraseTokens_Match. | |
62298 | CALL MatchPhraseTokens | |||
62301 | JR NZ,Validate_Take_Plank | Jump to Validate_Take_Plank if the token isn't for the match. | ||
62303 | LD HL,59502 | Call CheckActiveScenicEvents with Data_ItemGroup_Match. | ||
62306 | CALL CheckActiveScenicEvents | |||
62309 | CALL Take_IsPlayerHoldingItem | Call Take_IsPlayerHoldingItem. | ||
62312 | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the plank?
|
||||
Validate_Take_Plank | 62315 | LD HL,59875 | Call MatchPhraseTokens with PhraseTokens_Plank. | |
62318 | CALL MatchPhraseTokens | |||
62321 | JR NZ,Validate_Take_Coconut | Jump to Validate_Take_Coconut if the token isn't for the plank. | ||
62323 | LD HL,59505 | Call CheckActiveScenicEvents with Data_ItemGroup_Plank. | ||
62326 | CALL CheckActiveScenicEvents | |||
62329 | CALL Take_IsPlayerHoldingItem | Call Take_IsPlayerHoldingItem. | ||
62332 | LD A,B | A=B. | ||
62333 | CP 4 | Jump to TakeItem if A is equal to 4. | ||
62335 | JP Z,TakeItem | |||
62338 | LD A,5 | A=5 (event ID: 5). | ||
62340 | CALL Handler_DestroyItemEvent | Call Handler_DestroyItemEvent. | ||
62343 | LD A,6 | A=6 (event ID: 6). | ||
62345 | CALL Handler_DestroyItemEvent | Call Handler_DestroyItemEvent. | ||
62348 | LD B,4 | B=4. | ||
62350 | XOR A | Write 0 to: | ||
62351 | LD (60789),A | |||
62354 | LD (60800),A | |||
62357 | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the coconut?
|
||||
Validate_Take_Coconut | 62360 | LD HL,59877 | Call MatchPhraseTokens with PhraseTokens_Coconut. | |
62363 | CALL MatchPhraseTokens | |||
62366 | JR NZ,Validate_Take_Gun | Jump to Validate_Take_Gun if the token isn't for the coconut. | ||
62368 | LD A,7 | Call Take_IsPlayerHoldingItem with "A coconut". | ||
62370 | CALL Take_IsPlayerHoldingItem | |||
62373 | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the gun?
|
||||
Validate_Take_Gun | 62376 | LD HL,59887 | Call MatchPhraseTokens with PhraseTokens_Gun. | |
62379 | CALL MatchPhraseTokens | |||
62382 | JR NZ,Validate_Take_Eyepatch | Jump to Validate_Take_Eyepatch if the token isn't for the gun. | ||
62384 | LD A,15 | Call Take_IsPlayerHoldingItem with "A gun". | ||
62386 | CALL Take_IsPlayerHoldingItem | |||
62389 | LD A,39 | Call ValidateItemPresent with "A parrot (alive)". | ||
62391 | CALL ValidateItemPresent | |||
62394 | JR Z,Action_Take_3 | Jump to Action_Take_3 if "A parrot (alive)" is present in the current room. | ||
62396 | LD A,34 | A=34 (event ID: 34). | ||
62398 | CALL Handler_DestroyItemEvent | Call Handler_DestroyItemEvent. | ||
62401 | LD A,136 | A=136. | ||
62403 | CALL ScenicEventTriggered | Call ScenicEventTriggered. | ||
62406 | LD B,15 | B=15. | ||
62408 | JP TakeItem | Jump to TakeItem. | ||
Bad luck!
|
||||
Action_Take_3 | 62411 | LD HL,60887 | Switch GameOver onto the stack so the next return actions a "game over". | |
62414 | EX (SP),HL | |||
Print "As you start to move,
the parrot squawks...
The pirate wakes
and quickly shoots you.".
|
||||
62415 | LD HL,56268 | HL=56268. | ||
62418 | JP PrintStringAndNewline_Alias | Jump to PrintStringAndNewline_Alias. | ||
Was the player trying to take the eyepatch?
|
||||
Validate_Take_Eyepatch | 62421 | LD HL,59889 | Call MatchPhraseTokens with PhraseTokens_Eyepatch. | |
62424 | CALL MatchPhraseTokens | |||
62427 | JR NZ,Validate_Take_KegOfGunpowder | Jump to Validate_Take_KegOfGunpowder if the token isn't for the eyepatch. | ||
62429 | LD HL,59525 | Call CheckActiveScenicEvents with Data_ItemGroup_Eyepatch. | ||
62432 | CALL CheckActiveScenicEvents | |||
62435 | CALL Take_IsPlayerHoldingItem | Call Take_IsPlayerHoldingItem. | ||
62438 | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the keg of gunpowder?
|
||||
Validate_Take_KegOfGunpowder | 62441 | LD HL,59891 | Call MatchPhraseTokens with PhraseTokens_KegGunPowder. | |
62444 | CALL MatchPhraseTokens | |||
62447 | JR NZ,Validate_Take_Sextant | Jump to Validate_Take_Sextant if the token isn't for the keg of gunpowder. | ||
62449 | LD HL,59528 | Call CheckActiveScenicEvents with Data_ItemGroup_CrocodileWithKeg_1. | ||
62452 | CALL CheckActiveScenicEvents | |||
62455 | CALL Take_IsPlayerHoldingItem | Call Take_IsPlayerHoldingItem. | ||
62458 | LD A,B | A=B. | ||
62459 | CP 18 | Compare A with 18. | ||
62461 | JP Z,TakeItem | Jump to TakeItem if A is equal to 18. | ||
62464 | JP Response_YouCant_Duplicate | Jump to Response_YouCant_Duplicate. | ||
Was the player trying to take the sextant?
|
||||
Validate_Take_Sextant | 62467 | LD HL,59899 | Call MatchPhraseTokens with PhraseTokens_Sextant. | |
62470 | CALL MatchPhraseTokens | |||
62473 | JR NZ,Validate_Take_Crowbar | Jump to Validate_Take_Crowbar if the token isn't for the sextant. | ||
62475 | LD A,22 | Call Take_IsPlayerHoldingItem with "A sextant". | ||
62477 | CALL Take_IsPlayerHoldingItem | |||
62480 | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the crowbar?
|
||||
Validate_Take_Crowbar | 62483 | LD HL,59901 | Call MatchPhraseTokens with PhraseTokens_Crowbar. | |
62486 | CALL MatchPhraseTokens | |||
62489 | JR NZ,Validate_Take_Key | Jump to Validate_Take_Key if the token isn't for the crowbar. | ||
62491 | LD A,30 | Call Take_IsPlayerHoldingItem with "A crowbar". | ||
62493 | CALL Take_IsPlayerHoldingItem | |||
62496 | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the key?
|
||||
Validate_Take_Key | 62499 | LD HL,59903 | Call MatchPhraseTokens with PhraseTokens_Key. | |
62502 | CALL MatchPhraseTokens | |||
62505 | JR NZ,Validate_Take_Skull | Jump to Validate_Take_Skull if the token isn't for the key. | ||
62507 | LD A,31 | Call Take_IsPlayerHoldingItem with "A key". | ||
62509 | CALL Take_IsPlayerHoldingItem | |||
62512 | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the skull?
|
||||
Validate_Take_Skull | 62515 | LD HL,59905 | Call MatchPhraseTokens with PhraseTokens_Skull. | |
62518 | CALL MatchPhraseTokens | |||
62521 | JR NZ,Validate_Take_Spear | Jump to Validate_Take_Spear if the token isn't for the skull. | ||
62523 | LD A,32 | Call Take_IsPlayerHoldingItem with "A human skull". | ||
62525 | CALL Take_IsPlayerHoldingItem | |||
62528 | JP TakeItem | Jump to TakeItem. | ||
Was the player trying to take the spear?
|
||||
Validate_Take_Spear | 62531 | LD HL,59910 | Call MatchPhraseTokens with PhraseTokens_Spear. | |
62534 | CALL MatchPhraseTokens | |||
62537 | JR NZ,Validate_Take_Parrot | Jump to Validate_Take_Parrot if the token isn't for the spear. | ||
62539 | LD HL,59552 | Call CheckActiveScenicEvents with Data_ItemGroup_CannibalsWithSpear. | ||
62542 | CALL CheckActiveScenicEvents | |||
62545 | CALL Take_IsPlayerHoldingItem | Call Take_IsPlayerHoldingItem. | ||
62548 | LD A,B | A=B. | ||
62549 | CP 26 | Compare A with 26. | ||
62551 | JP Z,TakeItem | Jump to TakeItem if A is equal to 26. | ||
62554 | JP Response_YouCant_Duplicate | Jump to Response_YouCant_Duplicate. | ||
Was the player trying to take the parrot?
|
||||
Validate_Take_Parrot | 62557 | LD HL,59912 | Call MatchPhraseTokens with PhraseTokens_Parrot. | |
62560 | CALL MatchPhraseTokens | |||
62563 | JR NZ,Take_Invalid | Jump to Take_Invalid if the token isn't for the parrot. | ||
62565 | LD HL,59580 | Call CheckActiveScenicEvents with Data_ItemGroup_Parrot. | ||
62568 | CALL CheckActiveScenicEvents | |||
62571 | CALL Take_IsPlayerHoldingItem | Call Take_IsPlayerHoldingItem. | ||
62574 | LD A,B | A=B. | ||
62575 | CP 40 | Compare A with 40. | ||
62577 | JP Z,TakeItem | Jump to TakeItem if A is equal to 40. | ||
Bad luck!
|
||||
62580 | LD HL,60887 | Switch GameOver onto the stack so the next return actions a "game over". | ||
62583 | EX (SP),HL | |||
Print "As you start to move,
the parrot squawks...
The pirate wakes
and quickly shoots you.".
|
||||
62584 | LD HL,56268 | HL=56268. | ||
62587 | JP PrintStringAndNewline_Alias | Jump to PrintStringAndNewline_Alias. | ||
Nothing else is valid.
|
||||
Take_Invalid | 62590 | JP Response_YouCant_Duplicate | Jump to Response_YouCant_Duplicate. |
Prev: 62022 | Up: Map | Next: 62593 |