mr:food_item
Table of Contents
Food Item - Code References
Java Classes
- Food.java - Base abstract class for all food items
- ChargrilledMeat.java - Chargrilled meat food item
- MysteryMeat.java - Mystery meat food item
- RottenMeat.java - Rotten meat food item
- Pasty.java - Pasty food item
- PseudoPasty.java - Pseudo-pasty food item
- Ration.java - Food ration item
- SmallRation.java - Small food ration item
- Fruit.java - Fruit food item
- Berry.java - Berry food item
JSON Configuration
Food items are primarily implemented in Java. Some food-related configurations may exist in:
- Dungeon.json - Dungeon configuration with food spawn rates
- Bestiary.json - Mob drop tables that may include food items
String Resources
<!-- Base Food --> <string name="Food_Message">That food tasted delicious.</string> <!-- Chargrilled Meat --> <string name="ChargrilledMeat_Name">chargrilled meat</string> <string name="ChargrilledMeat_Info">It looks like a decent steak.</string> <!-- Mystery Meat --> <string name="MysteryMeat_Name">mystery meat</string> <string name="MysteryMeat_Info">It's mystery meat.</string> <!-- Rotten Meat --> <string name="RottenMeat_Name">rotten meat</string> <string name="RottenMeat_Info">A piece of rotten meat</string> <!-- Pasty --> <string name="Pasty_Name">pasty</string> <string name="Pasty_Info">This is an authentic Cornish pasty with traditional filling of beef and potato.</string> <!-- Food Ration --> <string name="Ration_Name">food ration</string> <string name="Ration_Info">It's a large cube of dried meat.</string> <!-- Small Ration --> <string name="SmallRation_Name">small ration</string> <string name="SmallRation_Info">Tastes like dried meat.</string> <!-- Fruit --> <string name="Fruit_Name">fruit</string> <string name="Fruit_Info">It's a juicy fruit.</string> <!-- Berry --> <string name="Berry_Name">berry</string> <string name="Berry_Info">It's a small berry.</string>
Lua Scripts
Food items are primarily implemented in Java. No specific Lua scripts exist for basic food items.
Implementation Details
- Base Class: `com.watabou.pixeldungeon.items.food.Food`
- Entity Kind: Varies by subclass (e.g., “Food”, “ChargrilledMeat”, “MysteryMeat”, “RottenMeat”, “Pasty”, “Ration”)
- Sprite: Defined in ItemSpriteSheet
- Default Action: `CommonActions.AC_EAT`
- Time to Eat: 3 turns (TIME_TO_EAT constant)
- Stackable: Yes (stackable = true)
- Identified: Yes (isIdentified() returns true)
- Upgradable: No (isUpgradable() returns false)
Food Mechanics
- Energy: Each food item provides energy value (varies by type)
- Satiation: Food restores hunger/satiation meter
- Eating Time: Takes 3 turns to consume any food item
- Message: Custom message displayed when eating (defined in each food subclass)
Related mr Entities
mr/food_item.txt · Last modified: by 127.0.0.1
