![]()  | 
Routines | 
| Prev: FBD5 | Up: Map | Next: FC61 | 
| 
 | 
||||
| Action_Light | FC24 | CALL Parser_ValidateDirectObject | Call Parser_ValidateDirectObject. | |
| FC27 | RET C | Return if the direct object is malformed. | ||
| FC28 | CP $02 | Jump to Response_PleaseRephraseThat_Duplicate if A is greater than 02. | ||
| FC2A | JP NC,Response_PleaseRephraseThat_Duplicate | |||
| 
 
Was the player trying to light ... the match?
 
 | 
||||
| FC2D | LD HL,$E9E1 | Call MatchPhraseTokens with PhraseTokens_Match. | ||
| FC30 | CALL MatchPhraseTokens | |||
| 
 
The match is the only item which is light/ strikable.
 
 | 
||||
| FC33 | JR NZ,LightStrike_Invalid | Jump to LightStrike_Invalid if the token isn't for the match. | ||
| 
 
The player definitely wants to light the match ... but is it already lit?
 
 | 
||||
| FC35 | LD A,$03 | Call ValidateItemPresent using item: "A lighted match". | ||
| FC37 | CALL ValidateItemPresent | |||
| FC3A | JP Z,Response_YouveDoneThatAlready | Jump to Response_YouveDoneThatAlready if the lit match is already in the players possession. | ||
| 
 
The match isn't already lit, but is it either in the room, or in the players inventory?
 
 | 
||||
| FC3D | LD A,$02 | Call CheckObjectInInventory using item 02: "A match". | ||
| FC3F | CALL CheckObjectInInventory | |||
| FC42 | JP NZ,Response_YoureNotCarryingIt | Jump to Response_YoureNotCarryingIt if the player is not holding the (unlit) match. | ||
| 
 
The player can light the match- so go ahead and do this.
 
 | 
||||
| FC45 | LD BC,$0203 | Call TransformItem to transform item 02 ("A match") into item 03 ("A lighted match"). | ||
| FC48 | CALL TransformItem | |||
| FC4B | LD HL,$BC66 | Set bit 6 of *Flag_TurnBasedEventState which activates lighting the match. | ||
| FC4E | SET 6,(HL) | |||
| 
 
The event is turn-based, the player only has the lit match for 06 turns.
 
 | 
||||
| FC50 | LD A,$06 | Write 06 to *Counter_Match. | ||
| FC52 | LD ($BC6D),A | |||
| FC55 | CALL Response_OK_Duplicate | Call Response_OK_Duplicate. | ||
| 
 
Print "The match flares into life.
Hurry it will go out soon.".
 
 | 
||||
| FC58 | LD HL,$E4D1 | HL=Messaging_TheMatchFlaresIntoLife. | ||
| FC5B | JP PrintStringAndNewline_Alias | Jump to PrintStringAndNewline_Alias. | ||
| 
 
Nothing else is valid.
 
 | 
||||
| LightStrike_Invalid | FC5E | JP Response_YouCant_Duplicate | Jump to Response_YouCant_Duplicate. | |
| Prev: FBD5 | Up: Map | Next: FC61 |