
Deep dive into the core architecture for creating buffs, debuffs, and attribute modifications.
The Modifier System allows you to create temporary or permanent changes to attributes with full conditional logic support. It integrates with the Base tier's three-value architecture:
Modifiers write to modifierBonus, keeping them separate from base stats and formula calculations. This prevents feedback loops and allows clean removal.
The main container class for a modifier. Each group can contain multiple AttributeModifications and defines the modifier's identity, timing, and behavior.
| Property | Type | Description |
|---|---|---|
| name | string | Display name for the modifier |
| description | string | Human-readable description |
| tag | string | Category tag for grouping (e.g., "buff", "curse", "equipment") |
| id | string | Unique GUID assigned at runtime |
| Property | Type | Description |
|---|---|---|
| duration | float | Duration in seconds. 0 or negative = permanent |
| priority | int | Application order. Higher = applied later |
| stackable | bool | Can multiple instances stack? |
| maxStacks | int | Maximum stack count (if stackable) |
| timeRemaining | float | Runtime: remaining duration |
| currentStacks | int | Runtime: current stack count |
| Property | Type | Description |
|---|---|---|
| isDebuff | bool | Marks as negative effect (for UI/dispel logic) |
| isHidden | bool | Hide from player-facing UI |
| canBeDispelled | bool | Can be removed by cleanse/dispel effects |
| persistsThroughDeath | bool | Survives character death/respawn |
| refreshOnReapply | bool | Resets duration when reapplied |
| Property | Type | Description |
|---|---|---|
| requiredLevel | int | Minimum character level to apply (0 = no requirement) |
| category | string | Category string (offensive, defensive, utility, passive) |
| incompatibleModifiers | List<string> | Modifier names that block this one |
| requiredModifiers | List<string> | Modifier names required for this one to apply |
| Event | Type | Description |
|---|---|---|
| onApply | UnityEvent | Fired when modifier is applied |
| onRemove | UnityEvent | Fired when modifier is removed |
| onExpire | UnityEvent | Fired when modifier expires (duration ends) |
| onTick | UnityEvent<float> | Fired on each tick for DoT/HoT effects |
Represents a single attribute change within a modifier group. Each modification targets one attribute with a specific change type and value.
| Property | Type | Description |
|---|---|---|
| targetAttribute | string | Attribute name to modify |
| type | ModifierType | How to apply the value (Flat, Percentage, Multiply) |
| value | float | The modification amount |
Add/subtract a fixed value.+50 Health, -10 Stamina
Add/subtract a percentage of base.+25% Health, -15% Speed
Multiply the total value.x1.5 Damage, x0.5 Defense
| Property | Type | Description |
|---|---|---|
| modifyBaseValue | bool | Affects base stat (standard behavior) |
| modifyCurrentValue | bool | Affects current value (healing/damage) |
| modifyMinValue | bool | Affects minimum boundary |
| modifyMaxValue | bool | Affects maximum boundary |
modifyBaseValue = true. Use modifyCurrentValue for instant damage/healing effects. Use modifyMaxValue to change maximum health/mana caps.
| Property | Type | Description |
|---|---|---|
| isPermanent | bool | Survives scene changes |
| applyOverTime | bool | Apply effect over time (DoT/HoT) |
| tickInterval | float | Seconds between ticks for DoT/HoT |
| removeWhenConditionsMet | bool | Auto-remove when conditions become false |
| Property | Type | Description |
|---|---|---|
| enableConditions | bool | Enable condition checking |
| conditions | List<AttributeCondition> | Attribute-based conditions |
| modifierConditions | List<ModifierCondition> | Modifier presence conditions |
See Conditions System for detailed documentation on AttributeCondition and ModifierCondition.
SimpleAttributeModifierGroup includes built-in support for modifying regeneration rates and delays - essential for ARPG status effects.
| Property | Type | Description |
|---|---|---|
| modifyRegenRate | bool | Enable regen rate modification |
| regenRateType | ModifierType | Flat, Percentage, or Multiply |
| regenRateValue | float | Value for regen rate modification |
| modifyRegenDelay | bool | Enable regen delay modification |
| regenDelayType | ModifierType | Flat, Percentage, or Multiply |
| regenDelayValue | float | Value for regen delay modification |
| disableRegeneration | bool | Completely disable regeneration |
See Regen Modifiers for detailed documentation and stacking behavior.
Static utility class for tracking and querying active modifiers across all targets. Essential for ModifierCondition evaluation and modifier management.
ApplyTo() and RemoveFrom() are called. You don't need to manually register modifiers.
Group related modifiers with tags: "buff", "debuff", "curse", "equipment", "consumable". Makes bulk operations easy.
Use priority to control application order. Equipment (100) -> Buffs (200) -> Debuffs (300) -> Ultimate abilities (400).
requiredModifiers for combo effects, incompatibleModifiers to prevent stacking similar buffs.
isDebuff for dispel targeting, canBeDispelled for cleanseable effects, persistsThroughDeath for permanent curses.