====== Ration Item - Code References ====== ===== Lua Implementation ===== * **Script**: `scripts/items/Ration.lua` * **File**: `RemixedDungeon/src/main/assets/scripts/items/Ration.lua` * **Note**: Formerly implemented in Java (`com.watabou.pixeldungeon.items.food.Ration`), migrated to Lua ===== Full Lua Script Content ===== --- --- Ration: bread and cheese, the standard food (was items/food/Ration.java). --- local food = require "scripts/lib/food" return food.init{ desc = function() return { image = 4, -- ItemSpriteSheet.RATION energy = 280, -- Hunger.HUNGRY price = 10, } end, poison = function(self, item, cell) return "RottenRation" end, } **Properties from code:** * **Image**: `4` (ItemSpriteSheet.RATION) * **Energy**: `280` (Hunger.HUNGRY constant - restores hunger to HUNGRY level) * **Price**: `10` gold per ration * **Poison behavior**: When poisoned, transforms to `RottenRation` ===== Java References ===== * **Food Base Class**: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/items/food/Food.java|Food.java]] - Base food class with `RATION = "Ration"` kind constant * **Item Factory**: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/nyrds/pixeldungeon/items/common/ItemFactory.java|ItemFactory.java]] - Registers `Ration` kind with `Food::new` * **Hunger System**: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/buffs/Hunger.java|Hunger.java]] - `HUNGRY = 280f` constant * **Sprite Sheet**: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/sprites/ItemSpriteSheet.java|ItemSpriteSheet.java]] - `RATION` sprite constant ===== JSON Configuration ===== * Starting items: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/assets/hero/initHeroes.json|initHeroes.json]] (Ration in starting items for most hero classes) * Treasury drops: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/assets/levelsDesc/Treasury.json|Treasury.json]] (Ration drop chance) * Spiders Treasury: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/assets/levelsDesc/SpidersTreasury.json|SpidersTreasury.json]] (Ration drop chance) ===== String Resources (All Languages) ===== * English: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values/strings_all.xml|Ration_Name, Ration_Info]] * Russian: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values-ru/strings_all.xml|Ration_Name, Ration_Info]] * Spanish: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values-es/strings_all.xml|Ration_Name, Ration_Info]] * Portuguese (Brazilian): [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values-pt-rBR/strings_all.xml|Ration_Name, Ration_Info]] * Chinese (Simplified): [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values-zh-rCN/strings_all.xml|Ration_Name, Ration_Info]] * Chinese (Traditional): [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values-zh-rTW/strings_all.xml|Ration_Name, Ration_Info]] * German: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values-de/strings_all.xml|Ration_Name, Ration_Info]] * French: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values-fr/strings_all.xml|Ration_Name, Ration_Info]] * Japanese: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values-ja/strings_all.xml|Ration_Name, Ration_Info]] * Korean: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values-ko/strings_all.xml|Ration_Name, Ration_Info]] * Italian: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values-it/strings_all.xml|Ration_Name, Ration_Info]] * Polish: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values-pl/strings_all.xml|Ration_Name, Ration_Info]] * Ukrainian: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values-uk/strings_all.xml|Ration_Name, Ration_Info]] * Hungarian: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values-hu/strings_all.xml|Ration_Name, Ration_Info]] * Turkish: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values-tr/strings_all.xml|Ration_Name, Ration_Info]] * Greek: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values-el/strings_all.xml|Ration_Name, Ration_Info]] * Indonesian: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values-in/strings_all.xml|Ration_Name, Ration_Info]] * Malay: [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values-ms/strings_all.xml|Ration_Name, Ration_Info]] ===== Related Files ===== * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/assets/scripts/items/RottenRation.lua|RottenRation.lua]] - Spoiled version (poisoned ration) * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/buffs/Hunger.java|Hunger.java]] - Hunger buff system