![]()  | 
Routines | 
| Prev: F643 | Up: Map | Next: F6E1 | 
| 
 
Used by the routine at Process_KillWarrior.
 
 | 
||||
| 
 
The player wants to kill the Fomorian, check which version of the Fomorian is is in the current room.
 
 | 
||||
| Process_KillFomorian | F69F | LD HL,$E348 | Call CheckItemGroupPresent with Data_ItemGroup_Fomorian. | |
| F6A2 | CALL CheckItemGroupPresent | |||
| 
 
Is the Fomorian already dead?
 
 | 
||||
| F6A5 | LD HL,$FC8A | HL=Data_DeadFomorian. | ||
| F6A8 | LD BC,$0003 | Set a counter in BC of the length of the table 0003. | ||
| F6AB | CPIR | Search for the version of the Fomorian found in the table of dead Fomorian item IDs. | ||
| 
 
Print "You've done that already." if the Fomorian is already dead...
 
 | 
||||
| F6AD | JP Z,Response_YouveDoneThatAlready | Jump to Response_YouveDoneThatAlready if the Fomorian is dead. | ||
| 
 
The Fomorian is alive (for now).
 
 | 
||||
| F6B0 | LD ($A773),A | Temporarily stash the version of the Fomorian in *TemporaryStorage_SingleByte. | ||
| 
 
Make sure the player is even carrying a sword.
 
 | 
||||
| F6B3 | CALL IsPlayerCarryingSword | Call IsPlayerCarryingSword. | ||
| F6B6 | LD A,($A773) | Restore the version of the Fomorian from *TemporaryStorage_SingleByte. | ||
| 
 
So uhhhh... is the player trying to kill one Fomorian or an entire tribe?
 
 | 
||||
| F6B9 | CP $0F | Jump to KillFomorian if the version of the Fomorian is not "The Fomorian tribe". | ||
| F6BB | JR NZ,KillFomorian | |||
| 
 
The player is overly ambitious, and is attempting to take on an entire tribe of Fomorians.
 
Bad luck!
 
 | 
||||
| F6BD | LD HL,$E9B2 | Switch GameOver onto the stack so the next return actions a "game over". | ||
| F6C0 | EX (SP),HL | |||
| 
 
Print "You attack in vain.They quickly
overwhelm you.".
 
 | 
||||
| F6C1 | LD HL,$DD86 | HL=Messaging_AttackInVain. | ||
| F6C4 | JP PrintStringAndNewline_Duplicate | Jump to PrintStringAndNewline_Duplicate. | ||
| 
 
There's a single Fomorian present, but does the player have a sword?
 
 | 
||||
| KillFomorian | F6C7 | LD A,$39 | Call ValidateItemPresent with item 39: "A sword". | |
| F6C9 | CALL ValidateItemPresent | |||
| F6CC | JR Z,KillFomorianWithSword | Jump to KillFomorianWithSword if "A sword" is either in the current room or in the players inventory. | ||
| 
 
Print "The Fomorian is unaffected by
your blows.".
 
 | 
||||
| F6CE | LD HL,$DDB5 | HL=Messaging_FomorianUnaffected. | ||
| F6D1 | JP PrintStringAndNewline_Duplicate | Jump to PrintStringAndNewline_Duplicate. | ||
| 
 
The player is able to kill the Fomorian with a sword.
 
 | 
||||
| KillFomorianWithSword | F6D4 | LD A,($A773) | Set the "from" item ID in B, restored from *TemporaryStorage_SingleByte. | |
| F6D7 | LD B,A | |||
| F6D8 | ADD A,$09 | Set the "destination" item ID in C which is the source ID+09. | ||
| F6DA | LD C,A | |||
| 
 
Change the Fomorian state!
 
 | 
||||
| F6DB | CALL TransformItem | Call TransformItem to transform item ID of the version of the Fomorian to one 09 higher (e.g. N/A to "The body of a Fomorian"). | ||
| F6DE | JP Response_KilledRoman | Jump to Response_KilledRoman. | ||
| Prev: F643 | Up: Map | Next: F6E1 |