Table of Contents

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
object
RandomChanceCondition

Methods

Evaluate(EvaluationContext)

Evaluates this condition against the provided context.

public override bool Evaluate(EvaluationContext ctx)

Parameters

ctx EvaluationContext

Contextual data available to the condition (holder, performer, payload).

Returns

bool

true if the condition is satisfied; otherwise false.