![]()  | 
Routines | 
| Prev: F500 | Up: Map | Next: F52E | 
  | 
||||||||
| Process_EatFood | F518 | LD A,$22 | Call IsPlayerCarryingItem with item 22: "Some food". | |||||
| F51A | CALL IsPlayerCarryingItem | |||||||
| 
 
The player has the food in their inventory, so eat it!
 
 | 
||||||||
| F51D | LD A,E | Call Handler_DestroyItemEvent with the item ID of the originally requsted item. | ||||||
| F51E | CALL Handler_DestroyItemEvent | |||||||
| 
 
The food has been consumed so handle the inventory count.
 
 | 
||||||||
| F521 | LD HL,$A790 | Decrease *Count_InventoryItems by one. | ||||||
| F524 | DEC (HL) | |||||||
| 
 
Print "O.K.".
 
 | 
||||||||
| F525 | CALL Response_OK_Duplicate | Call Response_OK_Duplicate. | ||||||
| 
 
Print "You are filled with renewed
energy.".
 
 | 
||||||||
| F528 | LD HL,$DC1D | HL=Messaging_FilledWithRenewedEnergy. | ||||||
| F52B | JP PrintStringAndNewline_Duplicate | Jump to PrintStringAndNewline_Duplicate. | ||||||
| Prev: F500 | Up: Map | Next: F52E |