mr:rotten_food_item
Differences
This shows you the differences between two versions of the page.
| mr:rotten_food_item [2026/07/09 13:42] – wiki: Add missing mr: namespace pages for mob system, pet mechanic, rotten food, and sewers level Qwen Assistant | mr:rotten_food_item [2026/07/09 13:43] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== 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**: [[https:// | ||
| + | * 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**: | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | |||
| + | **Item Factory**: [[https:// | ||
| + | * 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**: [[https:// | ||
| + | * `purify()` - Abstract method for purification | ||
| + | * `execute(Hero hero)` - Consumption logic | ||
| + | * `quantity()` - Stack size | ||
| + | |||
| + | **Moistening Mechanics**: | ||
| + | * Line 345: `moistenRottenFood((RottenFood) item, item.getOwner())` | ||
| + | * Water/ | ||
| + | |||
| + | ===== JSON Configuration ===== | ||
| + | Implemented in Java, no JSON configuration for base class. Subclasses registered in ItemFactory. | ||
| + | |||
| + | ===== String Resources ===== | ||
| + | English (values/ | ||
| + | <code xml> | ||
| + | <!-- RottenRation --> | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | |||
| + | <!-- RottenMeat --> | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | |||
| + | <!-- RottenPasty --> | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | |||
| + | <!-- RottenPumpkinPie --> | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | |||
| + | <!-- RottenFish --> | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | </ | ||
| + | |||
| + | Russian (values-ru/ | ||
| + | <code xml> | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | </ | ||
| + | |||
| + | ===== Lua Scripts ===== | ||
| + | * **BlackCat AI**: `scripts/ | ||
| + | * Line 23: `RottenRation`, | ||
| + | |||
| + | ===== Related mr Entities ===== | ||
| + | * [[mr: | ||
| + | * [[mr: | ||
| + | * [[mr: | ||
| + | * [[mr: | ||
| + | * [[mr: | ||
| + | * [[mr: | ||
| + | * [[mr: | ||
| + | * [[mr: | ||
| + | * [[mr: | ||
| + | * [[mr: | ||
| + | * [[mr: | ||
| + | * [[mr: | ||
| + | * [[mr: | ||
| + | |||
| + | ===== 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/ | ||
| + | * Pasty.purify() → RottenPasty (reverse!) | ||
| + | * **Moistening**: | ||
| + | * Water/ | ||
| + | * `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/ | ||
| + | * Rare enemy drops | ||
| + | |||
| + | ===== Code Fragments ===== | ||
| + | RottenFood base class: | ||
| + | <code java> | ||
| + | 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: | ||
| + | <code java> | ||
| + | public class RottenPasty extends RottenFood { | ||
| + | public RottenPasty() { | ||
| + | image = ItemSpriteSheet.ROTTEN_PASTY; | ||
| + | } | ||
| + | |||
| + | @Override | ||
| + | public Food purify() { | ||
| + | return new Pasty(); // Returns fresh pasty | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ItemFactory registration: | ||
| + | <code java> | ||
| + | // ItemFactory.java line 261-265 | ||
| + | registerItemClass(RottenPasty.class); | ||
| + | registerItemClass(RottenRation.class); | ||
| + | registerItemClass(RottenMeat.class); | ||
| + | registerItemClass(RottenPumpkinPie.class); | ||
| + | registerItemClass(RottenFish.class); | ||
| + | </ | ||
| + | |||
| + | Moistening interaction: | ||
| + | <code java> | ||
| + | // Potion.java line 345-348 | ||
| + | if(item instanceof RottenFood) { | ||
| + | moistenRottenFood((RottenFood) item, item.getOwner()); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | Lua " | ||
| + | <code lua> | ||
| + | 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 | | ||
| + | |||
| + | {{tag> rpd items food rotten baseclass}} | ||
mr/rotten_food_item.txt · Last modified: by 127.0.0.1
