====== Barrel Level Object - Code References ====== **Entity Kind**: `Barrel` **Entity Type**: Level Object (Pushable, Flammable) **Description**: The Barrel is a pushable level object found throughout the dungeon. It can be pushed by the hero or mobs, and when bumped or burned, it explodes and creates LiquidFlame blobs. During Halloween events, barrels are replaced with pumpkins that have the same behavior but different visuals and text. ===== Java Classes ===== * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/nyrds/pixeldungeon/levels/objects/Barrel.java|Barrel.java]] - Main barrel class implementation * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/nyrds/pixeldungeon/levels/objects/LevelObject.java|LevelObject.java]] - Parent level object class **Key Implementation Details**: public class Barrel extends LevelObject { private boolean burned = false; public Barrel(int pos) { super(pos); textureFile = "levelObjects/barrels.png"; } @Override public boolean pushable(Char hero) { return true; } @Override public void burn() { if (burned) return; burned = true; // Play burning animation Sample.INSTANCE.play(Assets.SND_EXPLOSION); LiquidFlame fire = Blob.seed(getPos(), 10, LiquidFlame.class); GameScene.add(fire); } @Override public void bump(Presser presser) { burn(); } @Override public boolean flammable() { return true; } } ===== Java Usage ===== * Used in [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/levels/RegularLevel.java|RegularLevel.java]] for placing barrels in levels * Registered in [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/nyrds/pixeldungeon/levels/objects/LevelObjectsFactory.java|LevelObjectsFactory.java]] * Used in [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/levels/painters/WarehousePainter.java|WarehousePainter.java]] for warehouse room decoration ===== JSON Configuration ===== * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/assets/spritesDesc/Barrel.json|Barrel.json]] - Sprite configuration ===== String Resources ===== **English** (`values/strings_all.xml`): barrel Looks like a simple wooden barrel. But as you get closer to it, you can smell a faint hint of oil. The barrel seems to be fairly light, you might be able to push it. pumpkin It is very strange and rather creepy to see a carved pumpkin lying on the dungeon floor. You clearly sense incoming danger from it. But you can always push it away, right? **Russian** (`values-ru/strings_all.xml`): бочка С виду обычная бочка. Но подходя ближе ты начинаешь чувствовать странный маслянистый запах. Похоже бочка довольно лёгкая, скорее всего ты сможешь её сдвинуть. тыква Весьма странно и довольно жутко видеть резную тыкву, лежащей на полу подземелья. Ты отчётливо чувствуешь исходящую от неё опасность. Но ты всегда можешь её оттолкнуть, верно? ===== Lua Scripts ===== * Referenced in [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/assets/scripts/userServices/autoTestAi.lua|autoTestAi.lua]] for AI interaction * Referenced in [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/assets/scripts/traps/Spawner.lua|Spawner.lua]] for trap spawning ===== Related mr Entities ===== * [[mr:level_object|Level Object]] * [[mr:pumpkin_level_object|Pumpkin Level Object]] - Halloween variant