mr:rotten_food_item
Table of Contents
Rotten Food Item - Code References
RottenFood is the base class for all spoiled food items in Remixed Dungeon. Rotten food has negative effects when consumed but can be purified into edible food.
Entity Type
Item Base Class (Food Category)
Java Classes
RottenFood Base Class: RottenFood.java
- Package: `com.watabou.pixeldungeon.items.food`
- Extends: `Food` → `Item`
- Key Methods:
- `purify()` - Returns purified food variant (to be implemented by subclasses)
- `execute(Hero hero)` - Consumption effects (negative)
Subclasses:
- RottenRation.java → purifies to `Ration`
- RottenMeat.java → purifies to `ChargrilledMeat`
- RottenPasty.java → purifies to `Pasty`
- RottenPumpkinPie.java → purifies to `PumpkinPie`
- RottenFish.java → purifies to `RawFish`
Item Factory: ItemFactory.java
- Line 261: `registerItemClass(RottenPasty.class)`
- Line 262: `registerItemClass(RottenRation.class)`
- Line 263: `registerItemClass(RottenMeat.class)`
- Line 264: `registerItemClass(RottenPumpkinPie.class)`
- Line 265: `registerItemClass(RottenFish.class)`
Food Base Class: Food.java
- `purify()` - Abstract method for purification
- `execute(Hero hero)` - Consumption logic
- `quantity()` - Stack size
Moistening Mechanics: Potion.java (moistenRottenFood)
- Line 345: `moistenRottenFood1)`
- Water/potion interaction restores rotten food partially
JSON Configuration
Implemented in Java, no JSON configuration for base class. Subclasses registered in ItemFactory.
String Resources
English (values/strings_all.xml):
<!-- RottenRation --> <string name="RottenRation_Name">rotten ration</string> <string name="RottenRation_Info">it might once have been a ration, now it\'s just disgusting</string> <!-- RottenMeat --> <string name="RottenMeat_Name">rotten meat</string> <string name="RottenMeat_Info">this meat has gone bad, but fire could make it edible again</string> <!-- RottenPasty --> <string name="RottenPasty_Name">rotten pasty</string> <string name="RottenPasty_Info">it might once have been a pasty, now it\'s just disgusting</string> <!-- RottenPumpkinPie --> <string name="RottenPumpkinPie_Name">rotten pumpkin pie</string> <string name="RottenPumpkinPie_Info">this pie looks revolting, but can be restored</string> <!-- RottenFish --> <string name="RottenFish_Name">rotten fish</string> <string name="RottenFish_Info">this fish smells terrible, but cooking might help</string>
Russian (values-ru/strings_all.xml):
<string name="RottenRation_Name">испорченный пайок</string> <string name="RottenRation_Info">когда-то это был пайок, теперь это просто отвратительно</string> <string name="RottenMeat_Name">испорченное мясо</string> <string name="RottenMeat_Info">мясо испортилось, но огонь может сделать его съедобным снова</string> <string name="RottenPasty_Name">тухлый пирог</string> <string name="RottenPasty_Info">выглядит мерзко</string> <string name="RottenPumpkinPie_Name">испорченный тыквенный пирог</string> <string name="RottenPumpkinPie_Info">этот пирог выглядит отвратительно, но его можно восстановить</string> <string name="RottenFish_Name">испорченная рыба</string> <string name="RottenFish_Info">эта рыба пахнет ужасно, но приготовление может помочь</string>
Lua Scripts
- BlackCat AI: `scripts/ai/BlackCat.lua` - Disgusting food detection
- Line 23: `RottenRation`, `RottenPasty`, `RottenPumpkinPie`, `RottenFish` marked as “disgusting”
Related mr Entities
- Food Item - Base food class
- Ration Item - Purified form of RottenRation
- Rotten Ration Item - Rotten variant
- Rotten Meat Item - Rotten variant
- Rotten Pasty Item - Rotten variant
- Rotten Pumpkin Pie Item - Rotten variant
- Rotten Fish Item - Rotten variant
- Chargrilled Meat Item - Purified form
- Pasty Item - Purified form of RottenPasty
- Pumpkin Pie Item - Purified form
- Raw Fish Item - Purified form
- Moisten Mechanic - Restoration via water
- Black Cat NPC - Avoids rotten food
Game Mechanics
- Consumption Effects:
- Hunger restoration (reduced vs fresh food)
- Chance of negative effects: Poison, Nausea, Paralysis
- Black Cat NPC refuses rotten food
- Purification:
- Each rotten food has `purify()` method returning fresh variant
- Triggered by: Cooking, Alchemy, certain scrolls/spells
- Pasty.purify() → RottenPasty (reverse!)
- Moistening:
- Water/potions can partially restore rotten food
- `Potion.moistenRottenFood()` method
- Alchemy:
- Rotten foods used in recipes
- Carcass of mob + rotten food = various results
- Drop Sources:
- Mimic Pie drops RottenPasty
- Mimic drops various rotten foods
- Chests/containers in deeper levels
- Rare enemy drops
Code Fragments
RottenFood base class:
package com.watabou.pixeldungeon.items.food; public class RottenFood extends Food { // Base class for all rotten foods // Implements negative consumption effects // Subclasses must implement purify() }
RottenPasty implementation:
public class RottenPasty extends RottenFood { public RottenPasty() { image = ItemSpriteSheet.ROTTEN_PASTY; } @Override public Food purify() { return new Pasty(); // Returns fresh pasty } }
ItemFactory registration:
// ItemFactory.java line 261-265 registerItemClass(RottenPasty.class); registerItemClass(RottenRation.class); registerItemClass(RottenMeat.class); registerItemClass(RottenPumpkinPie.class); registerItemClass(RottenFish.class);
Moistening interaction:
// Potion.java line 345-348 if(item instanceof RottenFood) { moistenRottenFood((RottenFood) item, item.getOwner()); }
Lua “disgusting” food list:
local disgusting = { RottenRation = true, RottenPasty = true, RottenPumpkinPie = true, RottenFish = true } -- Black Cat AI refuses these
Subclass Purification Mapping
| Rotten Variant | Purifies To | Sprite |
| — | — | — |
| RottenRation | Ration | RATION |
| RottenMeat | ChargrilledMeat | CHARGRILLED_MEAT |
| RottenPasty | Pasty | PASTY |
| RottenPumpkinPie | PumpkinPie | PUMPKIN_PIE |
| RottenFish | RawFish | RAW_FISH |
1)
RottenFood) item, item.getOwner(
mr/rotten_food_item.txt · Last modified: by 127.0.0.1
