Skip to main content

EffectDefinitionApplication

A class in Root.Township, Alta.Alchemy.

An effect with a strength multiplier and optional duration, as carried by liquids, food and potions. Applies at once or spread over time.

Constructors​

MemberWhat it is
EffectDefinitionApplication(EffectDefinition effectToModify, float strengthMultiplier, int durationInSeconds = 0)Creates an EffectDefinitionApplication with default values.
EffectDefinitionApplication()Creates an EffectDefinitionApplication with default values.

Fields​

3 private and internal fields
MemberWhat it is
private int durationInSecondsSeconds to spread the effect over. 0 applies it at once. Not included in Serialize, so it is not synced.
private EffectDefinition effectToModifyBacking field for EffectToModify, the effect this entry applies.
private float strengthMultiplierBacking field for StrengthMultiplier. Multiplies the strength passed to the effect. 1 by default.

Properties​

MemberWhat it is
EffectDefinition EffectToModify { get; }The effect definition this applies.
float StrengthMultiplier { get; set; }Multiplier on the strength passed in. Settable.

Methods​

MemberWhat it is
virtual void CheckApply(EffectHandler target, float strength)Applies the effect now, or over its duration in seconds when that is above 0.
EffectDefinitionApplication Copy()Returns a copy.
override bool Equals(object obj)True when effect, multiplier and duration all match.
override int GetHashCode()Hash from effect, multiplier and duration.
void Serialize(Stream stream)Writes or reads the effect and multiplier. The duration is not sent.
protected void Apply(EffectHandler target, float strength)Applies the effect to a handler at the given strength times the multiplier.

Used in​

Members of other types that take, return or hold a EffectDefinitionApplication: