mr:poison_trap
Differences
This shows you the differences between two versions of the page.
| mr:poison_trap [2026/04/01 00:43] – Improve wiki pages: ice_elemental_mob and poison_trap Qwen Assistant | mr:poison_trap [2026/04/01 00:46] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Poison Trap - Machine Readable Data ====== | ||
| + | This page contains machine-readable reference data for the Poison Trap entity in Remixed Dungeon. | ||
| + | |||
| + | ===== Entity Information ===== | ||
| + | * **Entity Name:** PoisonTrap | ||
| + | * **Entity Type:** Trap (Level Object) | ||
| + | * **Namespace: | ||
| + | * **Implementation Language:** Java | ||
| + | * **Package: | ||
| + | |||
| + | ===== Java Class Implementation ===== | ||
| + | |||
| + | **File:** ``RemixedDungeon/ | ||
| + | |||
| + | **Full Class Content:** | ||
| + | <code java> | ||
| + | package com.watabou.pixeldungeon.levels.traps; | ||
| + | |||
| + | import com.nyrds.pixeldungeon.levels.objects.ITrigger; | ||
| + | import com.watabou.pixeldungeon.Dungeon; | ||
| + | import com.watabou.pixeldungeon.actors.Actor; | ||
| + | import com.watabou.pixeldungeon.actors.Char; | ||
| + | import com.watabou.pixeldungeon.actors.buffs.Buff; | ||
| + | import com.watabou.pixeldungeon.actors.buffs.Poison; | ||
| + | import com.watabou.pixeldungeon.effects.CellEmitter; | ||
| + | import com.watabou.pixeldungeon.effects.particles.PoisonParticle; | ||
| + | |||
| + | import org.jetbrains.annotations.Nullable; | ||
| + | |||
| + | public class PoisonTrap implements ITrigger { | ||
| + | |||
| + | // 0xBB66EE | ||
| + | |||
| + | public static void trigger( int pos, @Nullable Char ch ) { | ||
| + | if (ch == null){ | ||
| + | ch = Actor.findChar(pos); | ||
| + | } | ||
| + | if (ch != null) { | ||
| + | Buff.affect( ch, Poison.class, | ||
| + | } | ||
| + | CellEmitter.center( pos ).burst( PoisonParticle.SPLASH, | ||
| + | } | ||
| + | |||
| + | @Override | ||
| + | public void doTrigger(int cell, Char ch) { | ||
| + | trigger(cell, | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ===== Key Methods ===== | ||
| + | |||
| + | **trigger(int pos, Char ch)** | ||
| + | * Static method that triggers the poison trap effect | ||
| + | * Parameters: | ||
| + | - ``int pos``: Cell position where trap is triggered | ||
| + | - ``Char ch``: Character triggering the trap (can be null) | ||
| + | * Behavior: | ||
| + | - If character is null, attempts to find character at position using ``Actor.findChar(pos)`` | ||
| + | - If character exists, applies Poison buff with duration: ``Poison.durationFactor(ch) * (4 + Dungeon.depth / 2)`` | ||
| + | - Emits poison particle splash effect at trap position (3 particles) | ||
| + | * Color comment: ``// 0xBB66EE`` (purple color reference) | ||
| + | |||
| + | **doTrigger(int cell, Char ch)** | ||
| + | * Implementation of ITrigger interface method | ||
| + | * Delegates to static ``trigger(cell, | ||
| + | |||
| + | ===== Dependencies ===== | ||
| + | |||
| + | **Interfaces: | ||
| + | * ``com.nyrds.pixeldungeon.levels.objects.ITrigger`` - Trap trigger interface | ||
| + | |||
| + | **Classes Used:** | ||
| + | * ``com.watabou.pixeldungeon.Dungeon`` - Dungeon state access | ||
| + | * ``com.watabou.pixeldungeon.actors.Actor`` - Actor system for finding characters | ||
| + | * ``com.watabou.pixeldungeon.actors.Char`` - Character class | ||
| + | * ``com.watabou.pixeldungeon.actors.buffs.Buff`` - Buff application system | ||
| + | * ``com.watabou.pixeldungeon.actors.buffs.Poison`` - Poison buff class | ||
| + | * ``com.watabou.pixeldungeon.effects.CellEmitter`` - Cell-based particle emitter | ||
| + | * ``com.watabou.pixeldungeon.effects.particles.PoisonParticle`` - Poison particle effects | ||
| + | * ``org.jetbrains.annotations.Nullable`` - Nullability annotation | ||
| + | |||
| + | ===== JSON Configuration ===== | ||
| + | * **Tile Definition: | ||
| + | |||
| + | ===== String Resources ===== | ||
| + | * **English Name:** [[https:// | ||
| + | * **Russian Name:** [[https:// | ||
| + | |||
| + | ===== Related Entities ===== | ||
| + | * **Poison Buff:** ``com.watabou.pixeldungeon.actors.buffs.Poison`` - The poison effect applied by this trap | ||
| + | * **Trap System:** ``com.watabou.pixeldungeon.levels.objects.Trap`` - Base trap system | ||
| + | * **ITrigger Interface: | ||
| + | |||
| + | ===== Lua Scripts ===== | ||
| + | This entity is implemented entirely in Java. No Lua script exists for PoisonTrap. | ||
| + | |||
| + | ===== GitHub Links ===== | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | |||
| + | {{tag> mr traps poison java code_reference}} | ||
mr/poison_trap.txt · Last modified: (external edit)
