mr:buffs
Differences
This shows you the differences between two versions of the page.
| mr:buffs [2026/03/21 10:12] – Wiki maintenance: Fix 5 random pages for standards compliance Qwen Assistant | mr:buffs [2026/03/21 10:13] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== mr:buffs ====== | ||
| + | |||
| + | Machine-readable reference page for Buff system in Remixed Dungeon. | ||
| + | |||
| + | ==== Java Implementation ==== | ||
| + | |||
| + | **Base Class:** | ||
| + | * File: [[https:// | ||
| + | * Package: com.watabou.pixeldungeon.actors.buffs | ||
| + | * Extends: Actor | ||
| + | * Implements: NamedEntityKind, | ||
| + | |||
| + | **Key Properties: | ||
| + | * target: Char - The character affected by this buff | ||
| + | * buffLevel: int - The level/ | ||
| + | * source: int - The source of the buff (default: -1) | ||
| + | |||
| + | **Key Methods:** | ||
| + | * name() - Returns buff name from string resources ({entityKind}Buff_Name) | ||
| + | * desc() - Returns buff description from string resources ({entityKind}Buff_Info) | ||
| + | * textureSmall() - Returns buff icon texture path | ||
| + | * attach() - Attaches buff to a target character | ||
| + | * detach() - Removes buff from target | ||
| + | * tick() - Called each game tick to update buff state | ||
| + | * duration() - Returns remaining duration of the buff | ||
| + | |||
| + | ==== Buff Factory ==== | ||
| + | |||
| + | **Factory Class:** | ||
| + | * File: [[https:// | ||
| + | * Package: com.nyrds.pixeldungeon.mechanics.buffs | ||
| + | |||
| + | **Factory Methods:** | ||
| + | * createBuff(String entityKind) - Creates a buff by entity kind name | ||
| + | * registerBuff(Class<? | ||
| + | |||
| + | ==== Common Buff Classes ==== | ||
| + | |||
| + | **Positive Buffs (Buffs):** | ||
| + | * Invisibility - Makes target invisible to enemies | ||
| + | * Haste - Increases movement and attack speed | ||
| + | * Regeneration - Restores health over time | ||
| + | * Shield - Provides temporary damage absorption | ||
| + | * Levitation - Allows flying over traps and obstacles | ||
| + | * Barkskin - Provides temporary armor | ||
| + | * Blessing - Provides various beneficial effects | ||
| + | |||
| + | **Negative Buffs (Debuffs): | ||
| + | * Poison - Deals damage over time | ||
| + | * Bleeding - Deals damage over time, scales with damage taken | ||
| + | * Cripple - Reduces movement speed | ||
| + | * Weakness - Reduces attack damage | ||
| + | * Fragility - Increases damage taken | ||
| + | * Blindness - Reduces accuracy | ||
| + | * Charm - Prevents attacking the source | ||
| + | * Paralysis - Prevents all actions | ||
| + | * Burning - Deals fire damage over time | ||
| + | * Freezing - Immobilizes target | ||
| + | * Amok - Causes target to attack randomly | ||
| + | * Corruption - Converts target to ally | ||
| + | |||
| + | ==== Buff Application Patterns ==== | ||
| + | |||
| + | **Affect (Apply new or extend):** | ||
| + | ```java | ||
| + | Buff.affect(target, | ||
| + | ``` | ||
| + | |||
| + | **Prolong (Extend existing duration): | ||
| + | ```java | ||
| + | Buff.prolong(target, | ||
| + | ``` | ||
| + | |||
| + | **Attach (Direct attachment): | ||
| + | ```java | ||
| + | buff.attachTo(target); | ||
| + | ``` | ||
| + | |||
| + | **Detach (Remove buff):** | ||
| + | ```java | ||
| + | buff.detach(); | ||
| + | ``` | ||
| + | |||
| + | ==== String Resource Format ==== | ||
| + | |||
| + | Buff string resources follow this naming convention: | ||
| + | * Name: {entityKind}Buff_Name | ||
| + | * Description: | ||
| + | |||
| + | Example: | ||
| + | * InvisibilityBuff_Name | ||
| + | * InvisibilityBuff_Info | ||
| + | * PoisonBuff_Name | ||
| + | * PoisonBuff_Info | ||
| + | |||
| + | ==== Lua Integration ==== | ||
| + | |||
| + | Buffs can be created and manipulated from Lua scripts: | ||
| + | ```lua | ||
| + | -- Apply buff to character | ||
| + | Buff.affect(target, | ||
| + | |||
| + | -- Prolong buff duration | ||
| + | Buff.prolong(target, | ||
| + | |||
| + | -- Check if character has buff | ||
| + | if target: | ||
| + | -- Handle invisible target | ||
| + | end | ||
| + | ``` | ||
| + | |||
| + | ==== Buff Icons ==== | ||
| + | |||
| + | Buff icons are stored in: RemixedDungeon/ | ||
| + | Individual buff icons for wiki: wiki-data/ | ||
| + | |||
| + | ==== Related Pages ==== | ||
| + | |||
| + | **Machine-readable references: | ||
| + | * [[mr: | ||
| + | * [[mr: | ||
| + | * [[mr: | ||
| + | |||
| + | **Wiki documentation: | ||
| + | * [[en: | ||
| + | * [[ru: | ||
| + | * [[en: | ||
| + | |||
| + | ==== Code References ==== | ||
| + | |||
| + | * Base implementation: | ||
| + | * Buff factory: [[https:// | ||
| + | * All buff classes: [[https:// | ||
| + | * Lua buff scripts: [[https:// | ||
| + | |||
| + | {{tag> mr buffs reference machine-readable}} | ||
mr/buffs.txt · Last modified: by 127.0.0.1
