Class RandomChanceCondition
- Namespace
- ElectricDrill.AstraRpgFramework.Conditions
- Assembly
- com.electricdrill.astra-rpg-framework.Runtime.dll
Condition that evaluates to true with the given probability.
ElectricDrill.AstraRpgFramework.Conditions.RandomChanceCondition._chance is expressed as a percentage (0–100). A value of 25 means a 25 % chance.
Values ≤ 0 always return false; values ≥ 100 always return true.
[Serializable]
[TypeSelectableMenu("Leaf/Random")]
public class RandomChanceCondition : Condition
- Inheritance
-
objectRandomChanceCondition
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.