![]()  | 
Routines | 
| Prev: F239 | Up: Map | Next: F259 | 
| 
 | 
||||
| 
 
The player wants to throw the food to the bear, check which version of the bear is in the current room.
 
 | 
||||
| Process_ThrowFoodToBear | F23E | LD A,$45 | Call ValidateItemPresent with item 45: "A dead bear". | |
| F240 | CALL ValidateItemPresent | |||
| 
 
Just to cover all angles, print "Don't be ridiculous." if the player is trying to throw the food to the dead bear...
 
 | 
||||
| F243 | JP Z,Response_DontBeRidiculous | Jump to Response_DontBeRidiculous if the version of the bear is "A dead bear". | ||
| 
 
The bear is alive, but is the player even carrying the food?
 
 | 
||||
| F246 | LD A,$22 | Call IsPlayerCarryingItem with item 22: "Some food". | ||
| F248 | CALL IsPlayerCarryingItem | |||
| 
 
The player is carrying the food, so destroy the item.
 
 | 
||||
| F24B | LD A,E | Call Handler_DestroyItemEvent with the item ID originally passed to the routine. | ||
| F24C | CALL Handler_DestroyItemEvent | |||
| 
 
The bear has eaten an item so handle the inventory count.
 
 | 
||||
| F24F | LD HL,$A790 | Decrease *Count_InventoryItems by one. | ||
| F252 | DEC (HL) | |||
| 
 
Print "The bear eats the food.".
 
 | 
||||
| F253 | LD HL,$D717 | HL=Messaging_BearEatsFood. | ||
| F256 | JP PrintStringAndNewline_Duplicate | Jump to PrintStringAndNewline_Duplicate. | ||
| Prev: F239 | Up: Map | Next: F259 |