![]()  | 
Routines | 
| Prev: 62843 | Up: Map | Next: 62955 | 
| 
 | 
||||
| 
 
The players wants to place the sword on the stone slab, check which version of the sword is in the current room or the players inventory.
 
 | 
||||
| Process_PlaceSwordOnSlab | 62904 | LD HL,58258 | Call CheckItemGroupPresent with Data_ItemGroup_Sword. | |
| 62907 | CALL CheckItemGroupPresent | |||
| 
 
Print "You've done that already." if the version of the sword in the current room is the one where it's on the stone slab.
 
 | 
||||
| 62910 | CP 89 | Jump to Response_YouveDoneThatAlready if the version of the sword in the current room is "A shimmering stone slab with a sword laying upon it". | ||
| 62912 | JP Z,Response_YouveDoneThatAlready | |||
| 
 
Print "I don't see the point." if the version of the sword in the current room is item 57 instead of item 56.
 
 | 
||||
| 62915 | CP 57 | Jump to Response_IDontSeeThePoint if the version of the sword in the current room is "A sword". | ||
| 62917 | JP Z,Response_IDontSeeThePoint | |||
| 
 
Ensure the player is carrying the sword.
 
 | 
||||
| 62920 | CALL IsPlayerCarryingItem | Call IsPlayerCarryingItem with the item ID of the originally requsted item. | ||
| 62923 | LD A,E | |||
| 
 
The sword item itself is destroyed, it's the stone slab item which changes to the version where it has a sword laying on it.
 
 | 
||||
| 62924 | CALL Handler_DestroyItemEvent | Call Handler_DestroyItemEvent. | ||
| 
 
Change the stone slab state!
 
 | 
||||
| 62927 | LD BC,22617 | Call TransformItem to transform item 88 ("A stone slab") into item 89 ("A shimmering stone slab with a sword laying upon it"). | ||
| 62930 | CALL TransformItem | |||
| 
 
The sword has been used so handle the inventory count.
 
 | 
||||
| 62933 | LD HL,42896 | Decrease *Count_InventoryItems by one. | ||
| 62936 | DEC (HL) | |||
| 
 
Is this the first time the player has placed the sword on the stone slab?
 
 | 
||||
| 62937 | LD HL,42861 | Jump to Response_OK_Duplicate if bit 4 of *Flag_GameStates_02 is set, which relates to placing the sword on the stone slab. | ||
| 62940 | BIT 4,(HL) | |||
| 62942 | JP NZ,Response_OK_Duplicate | |||
| 62945 | SET 4,(HL) | Set bit 4 of *Flag_GameStates_02 to signify that the sword has been placed on the stone slab. This is to prevent the points from being awarded more than one time. | ||
| 62947 | LD A,4 | Call AddToScore to add 4 points to the score. | ||
| 62949 | CALL AddToScore | |||
| 62952 | JP Response_OK_Duplicate | Jump to Response_OK_Duplicate. | ||
| Prev: 62843 | Up: Map | Next: 62955 |