mr:buffs
Machine-readable reference page for Buff system in Remixed Dungeon.
Java Implementation
Base Class:
Key Properties:
target: Char - The character affected by this buff
buffLevel: int - The level/strength of the buff (default: 1)
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:
Factory Methods:
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, BuffClass.class).level(value);
```
Prolong (Extend existing duration):
```java
Buff.prolong(target, BuffClass.class, duration);
```
Attach (Direct attachment):
```java
buff.attachTo(target);
```
Detach (Remove buff):
```java
buff.detach();
```
Buff string resources follow this naming convention:
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, “Poison”):level(damage)
– Prolong buff duration
Buff.prolong(target, “Haste”, duration)
– Check if character has buff
if target:hasBuff(“Invisibility”) then
- Handle invisible target
end
```
Buff Icons
Buff icons are stored in: RemixedDungeon/src/main/assets/assets/buffs.png
Individual buff icons for wiki: wiki-data/media/rpd/images/{buff_name}_buff.png
Related Pages
Machine-readable references:
Wiki documentation:
-
Баффы - Russian wiki overview
-
Code References