# Modifiers

```csharp
using Databrain.Stats;

public class StatsModifier : DataObject{}
```

Modifiers can modify a StatsValue depending on the modifier type.

<div align="left"><figure><img src="https://2348672745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIoqF5QAgQsqxrjmTIKpE%2Fuploads%2FirU7ztp8iRnccGd4isoG%2FstatsModifier.png?alt=media&#x26;token=696e7909-2a2b-47e6-80bb-03ead1e0b762" alt=""><figcaption></figcaption></figure></div>

| Value              | The value of the modifier                                                                                                                                                                                                                                                        |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Type               | The type of the modifier                                                                                                                                                                                                                                                         |
| Type: Flat         | <p>Adds the modifier value to the base value: <br>Stats Value: 5</p><p>Modifier 1: 5</p><p>Modifier 2: 5</p><p>-------------</p><p>New Stats Value = 15</p>                                                                                                                      |
| Type: Percent Add  | <p>Adds all modifier values of type PercentAdd before multiplying the base stats value with the sum of it: </p><p>Stats Value: 10</p><p>Modifier 1: 0.5</p><p>Modifier 2: 0.5<br>---------------<br>New Stats Value = 20 (Rounded)<br>10 \* (0.5 + 0.5) = 10 -> 10 + 10 = 20</p> |
| Type: Percent Mult | <p>Multiplies the base value with the modifier value:<br>Stats Value: 10<br>Modifier1: 0.5<br>Modifier2: 0.5</p><p>---------------</p><p>New Value = 23 (Rounded) </p><p>10 \* 0.5 = 5 -> 5 + 10 = 15 -> 15 \* 0.5 = 7.5 -> 7.5 + 15 = 22.5</p>                                  |
| Stackable          | If enabled, multiple modifiers of this type can be added at the same time.                                                                                                                                                                                                       |
| Order              | Define in which order modifiers are being added to the stats value                                                                                                                                                                                                               |
| Has Duration       | If true, this modifier is active for a certain duration. After that, it gets removed from the stats value automatically.                                                                                                                                                         |
| Duration           | The duration a modifier stays active.                                                                                                                                                                                                                                            |

## Add a modifier

Please read the stat value section to know how to add a modifier to a stat value.

{% content-ref url="values" %}
[values](https://giantgrey.gitbook.io/databrain/add-ons/stats/values)
{% endcontent-ref %}
