Class StatThresholdCondition
- Namespace
- ElectricDrill.AstraRpgFramework.Conditions
- Assembly
- com.electricdrill.astra-rpg-framework.Runtime.dll
Condition that checks a stat on the resolved target entity against a threshold.
When Absolute, the stat's final value is compared directly against
ElectricDrill.AstraRpgFramework.Conditions.StatThresholdCondition._thresholdAbsolute.
When Percentage, the stat's position within its defined range
[MinValue, MaxValue] is expressed as a percentage (0–100) and compared against
ElectricDrill.AstraRpgFramework.Conditions.StatThresholdCondition._thresholdPercentage. Requires the stat to have HasMaxValue = true; returns
false otherwise. When HasMinValue = false, 0 is used as the implicit minimum.
Returns false if the effective range (MaxValue − MinValue) is zero to avoid
division by zero.
Negative MinValue is fully supported: a stat with MinValue = −100 and MaxValue = 100
at value 0 evaluates to 50 %.
[Serializable]
[TypeSelectableMenu("Leaf/Attr. & Stat")]
public class StatThresholdCondition : Condition
- Inheritance
-
objectStatThresholdCondition
Methods
Evaluate(EvaluationContext)
Evaluates this condition against the provided context.
public override bool Evaluate(EvaluationContext ctx)
Parameters
ctxEvaluationContextContextual data available to the condition (holder, performer, payload).
Returns
- bool
trueif the condition is satisfied; otherwisefalse.