Code Reference‎ > ‎

HitEffect Struct

Defined in the namespace.

struct HitEffect

This struct is delivered OnHit and represents every possible effect from direct damage to area-effect spells to poison or anything else you can think of. It is up to the receiver to interpret this information and act accordingly. You can use the three generic parameters to describe the effect. They represent a name, amount and duration, and you can use all or just the name.

string name

The name of the effect. This is the primary data to compare against when deciding what action to take

float value

The value of the effect. This is typically used for damage, but can represent any value, such as a percentage for a movement speed modifier effect.

float duration

The duration of the effect. This is optional and many effects don't use duration at all, such as direct damage. Example effects that might use this are poisons, heat (fire), movement speed modifiers

string ToString()

returns a nicely formatted string that displayed the effects for use when debugging.