User Tools

Site Tools


en:rpd:doom_interface

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:rpd:doom_interface [2026/07/10 04:33] – Fix dokuwiki linting issues and missing image reference Qwen Assistanten:rpd:doom_interface [2026/07/10 04:37] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== Doom Interface ======
  
 +{{ rpd:images:stone_walking_buff.png|Stone Walking Buff (Doom Implementation) }}
 +
 +**Doom Interface** is a marker interface in Remixed Dungeon that identifies "doom-type" buffs - buffs that trigger special effects when the hero dies while affected by them.
 +
 +==== Description ====
 +The Doom interface extends [[en:rpd:named_entity_kind|NamedEntityKind]] and defines a single method `onHeroDeath()` that is called when the hero dies while the buff is active. This allows buffs to implement custom death effects, such as special game over messages, badge validation, or unique death reasons.
 +
 +==== Interface Definition ====
 +```java
 +public interface Doom extends NamedEntityKind {
 +    void onHeroDeath();
 +}
 +```
 +
 +==== Implementations ====
 +Classes implementing Doom must:
 +  * Extend [[en:rpd:buff_mechanics|Buff]] (or a subclass like [[en:rpd:artifact_buff|ArtifactBuff]])
 +  * Implement the `onHeroDeath()` method to define custom death behavior
 +  * Implement `getEntityKind()` from NamedEntityKind for entity identification
 +
 +==== Known Implementations ====
 +  * [[en:rpd:stone_walking_buff|Stone Walking Buff]] - Implements Doom via ArtifactBuff
 +    * On death: Validates "Death in Stone" badge, shows "You have been immured in stone. Forever." message, uses IMMURED death reason
 +  * Other doom-type buffs may exist
 +
 +==== Code References ====
 +  * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/hero/Doom.java|Doom.java]]
 +  * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/nyrds/pixeldungeon/mechanics/NamedEntityKind.java|NamedEntityKind.java]] (parent interface)
 +  * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/items/rings/ArtifactBuff.java|ArtifactBuff.java]] (common parent for doom buffs)
 +  * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/hero/Hero.java|Hero.java]] (handles doom buff death logic)
 +
 +==== Usage in Game Logic ====
 +When the hero dies, the game checks all active buffs for Doom implementations:
 +```java
 +for (Buff buff : hero.buffs()) {
 +    if (buff instanceof Doom) {
 +        ((Doom) buff).onHeroDeath();
 +    }
 +}
 +```
 +
 +==== Related Pages ====
 +  * [[en:rpd:artifact_buff|Artifact Buff]] - Base class for artifact buffs (often implements Doom)
 +  * [[en:rpd:stone_walking_buff|Stone Walking Buff]] - Example doom buff implementation
 +  * [[en:rpd:buff_mechanics|Buff Mechanics]] - General buff system
 +  * [[en:rpd:badges|Badges]] - Achievement system (often validated in onHeroDeath)
 +
 +{{tag> rpd mechanics interfaces buffs doom }}
en/rpd/doom_interface.txt · Last modified: by 127.0.0.1