mr:doom_interface
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| mr:doom_interface [2026/03/28 11:42] – Wiki maintenance: Fix broken links and add missing mr: namespace pages Qwen Assistant | mr:doom_interface [2026/03/28 11:46] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Doom Interface - Code References ====== | ||
| + | |||
| + | The **Doom** interface marks buffs that trigger special effects when the hero dies. It is used for curse-type effects and doom-related mechanics that activate upon character death. | ||
| + | |||
| + | ===== Java Classes ===== | ||
| + | |||
| + | **Interface Definition: | ||
| + | * `com/ | ||
| + | * Extends: `com.nyrds.pixeldungeon.mechanics.NamedEntityKind` | ||
| + | * Package: `com.watabou.pixeldungeon.actors.hero` | ||
| + | |||
| + | **Key Method:** | ||
| + | <code java> | ||
| + | // In Doom.java | ||
| + | public interface Doom extends NamedEntityKind { | ||
| + | void onHeroDeath(); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | **Implementation Requirements: | ||
| + | * Any class implementing `Doom` must implement the `onHeroDeath()` method | ||
| + | * The `onHeroDeath()` method is called when the hero dies while affected by the buff | ||
| + | * This allows for special death conditions, badges, and game-over scenarios | ||
| + | |||
| + | **Example Implementation (StoneWalking): | ||
| + | <code java> | ||
| + | // In RingOfStoneWalking.java | ||
| + | public static class StoneWalking extends ArtifactBuff implements Doom { | ||
| + | @Override | ||
| + | public int icon() { | ||
| + | return BuffIndicator.STONEBLOOD; | ||
| + | } | ||
| + | |||
| + | @Override | ||
| + | public String name() { | ||
| + | return StringsManager.getVar(R.string.StoneBloodBuff_Name); | ||
| + | } | ||
| + | |||
| + | @Override | ||
| + | public String desc() { | ||
| + | return StringsManager.getVar(R.string.StoneBloodBuff_Info); | ||
| + | } | ||
| + | |||
| + | @Override | ||
| + | public void onHeroDeath() { | ||
| + | Badges.validateDeathInStone(); | ||
| + | Dungeon.fail(Utils.format(ResultDescriptions.getDescription(ResultDescriptions.Reason.IMMURED), | ||
| + | GLog.n(StringsManager.getVar(R.string.RingOfStoneWalking_ImmuredInStone)); | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ===== JSON Configuration ===== | ||
| + | |||
| + | The Doom interface does not have JSON configuration. It is: | ||
| + | * A Java interface implemented by specific buff classes | ||
| + | * Registered through the buff factory system | ||
| + | * Associated with artifacts or other buff sources | ||
| + | |||
| + | ===== String Resources ===== | ||
| + | |||
| + | Doom-type buffs use standard string resources for their display names and descriptions. The death messages may be customized per implementation. | ||
| + | |||
| + | **Example String Resources (English): | ||
| + | <code xml> | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | </ | ||
| + | |||
| + | **Example String Resources (Russian): | ||
| + | <code xml> | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | </ | ||
| + | |||
| + | ===== Lua Scripts ===== | ||
| + | |||
| + | The Doom interface is implemented entirely in Java. No Lua scripts are used. | ||
| + | |||
| + | ===== Related Entities ===== | ||
| + | |||
| + | **Base Interfaces: | ||
| + | * [[mr: | ||
| + | * [[https:// | ||
| + | |||
| + | **Related Classes:** | ||
| + | * [[mr: | ||
| + | * [[mr: | ||
| + | * [[https:// | ||
| + | |||
| + | **Example Doom Buffs:** | ||
| + | * [[mr: | ||
| + | * [[en: | ||
| + | |||
| + | **Related Systems:** | ||
| + | * `Badges` - Unlocks badges on special deaths | ||
| + | * `Dungeon.fail()` - Triggers game over with custom reason | ||
| + | * `ResultDescriptions` - Provides death reason descriptions | ||
| + | |||
| + | ===== Code References ===== | ||
| + | * Java: [[https:// | ||
| + | * Java: [[https:// | ||
| + | * Java: [[https:// | ||
| + | |||
| + | {{tag> mr code reference buff doom interface}} | ||
