mr:chests
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| mr:chests [2025/12/24 17:09] – Add new mr namespace pages for chasm_level, chests, curses and debuffs mike | mr:chests [2026/03/23 01:58] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Chests - Code References ====== | ||
| + | ==== Java Classes ==== | ||
| + | * **Heap Types**: [[https:// | ||
| + | * **Open Chest Action**: [[https:// | ||
| + | * **Level Treasure**: [[https:// | ||
| + | * **Room Painters**: Various painters place chests: | ||
| + | - [[https:// | ||
| + | - [[https:// | ||
| + | - [[https:// | ||
| + | - [[https:// | ||
| + | - [[https:// | ||
| + | |||
| + | ==== Java Class Content ==== | ||
| + | <code java> | ||
| + | // Heap.java - Chest type definitions | ||
| + | public enum Type { | ||
| + | // ... | ||
| + | CHEST, | ||
| + | LOCKED_CHEST, | ||
| + | CRYSTAL_CHEST, | ||
| + | // ... | ||
| + | } | ||
| + | |||
| + | // Heap.java - Chest spawn weights | ||
| + | static { | ||
| + | regularHeaps.put(Type.CHEST, | ||
| + | sageHeaps.put(Type.CHEST, | ||
| + | } | ||
| + | |||
| + | // OpenChest.java - Chest opening logic | ||
| + | public class OpenChest extends CharAction { | ||
| + | public OpenChest(int dst) { | ||
| + | // ... | ||
| + | if (heap != null && (heap.type == Heap.Type.CHEST | ||
| + | || heap.type == Heap.Type.TOMB | ||
| + | || heap.type == Heap.Type.SKELETON | ||
| + | || heap.type == Heap.Type.LOCKED_CHEST | ||
| + | || heap.type == Heap.Type.CRYSTAL_CHEST | ||
| + | || heap.type == Heap.Type.MIMIC)) { | ||
| + | // Handle chest opening | ||
| + | if (heap.type == Heap.Type.LOCKED_CHEST | ||
| + | || heap.type == Heap.Type.CRYSTAL_CHEST) { | ||
| + | // Requires key | ||
| + | if (!hasKey) { | ||
| + | GLog.w(StringsManager.getVar(R.string.Hero_LockedChest)); | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Key Properties from Code ==== | ||
| + | * **Chest Types**: | ||
| + | - `CHEST` - Regular chest, can be opened freely | ||
| + | - `LOCKED_CHEST` - Requires skeleton key to open | ||
| + | - `CRYSTAL_CHEST` - Requires crystal key to open | ||
| + | - `MIMIC` - May appear instead of CHEST (hostile monster) | ||
| + | * **Spawn Weights**: CHEST has weight of 4f in regular and sage heap distributions | ||
| + | * **Key Requirement**: | ||
| + | * **Mimic Chance**: Some chest spawns may be replaced by Mimics | ||
| + | |||
| + | ==== JSON Configuration ==== | ||
| + | * Level configurations that may include treasure: [[https:// | ||
| + | * Chest contents are generated dynamically by the Generator class | ||
| + | |||
| + | ==== String Resources ==== | ||
| + | <code xml> | ||
| + | <!-- English strings --> | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | </ | ||
| + | |||
| + | ==== Lua Scripts ==== | ||
| + | This entity is implemented in Java, no Lua script exists | ||
| + | |||
| + | ==== Sprite References ==== | ||
| + | * **Chest Level Objects**: | ||
| + | - {{rpd: | ||
| + | - {{rpd: | ||
| + | - {{rpd: | ||
| + | |||
| + | ==== Related Entities ==== | ||
| + | * **Mimic**: [[mr: | ||
| + | * **Skeleton Key**: [[mr: | ||
| + | * **Crystal Key**: [[mr: | ||
| + | * **English Page**: [[en: | ||
| + | * **Russian Page**: [[ru: | ||
| + | |||
| + | {{tag> rpd items chests containers loot dungeon_objects}} | ||
