Namespace ElectricDrill.AstraRpgFramework.Conditions
Classes
- AllConditions
Composite condition that evaluates to
trueonly when ALL child conditions are satisfied (logical AND). An empty condition list evaluates totrue.
- AlwaysFalseCondition
Condition that always evaluates to
false. Useful to explicitly disable a condition slot during development or as a short-circuit placeholder.
- AlwaysTrueCondition
Condition that always evaluates to
true. Useful as a default or placeholder in condition chains.
- AnyCondition
Composite condition that evaluates to
truewhen ANY child condition is satisfied (logical OR). An empty condition list evaluates tofalse.
- AtLeastNCondition
Composite condition that evaluates to
truewhen at least ElectricDrill.AstraRpgFramework.Conditions.AtLeastNCondition._n child conditions are satisfied.With
N = 1this is equivalent to AnyCondition. WithN = 0it always evaluates totrue.
- AtMostNCondition
Composite condition that evaluates to
truewhen at most ElectricDrill.AstraRpgFramework.Conditions.AtMostNCondition._n child conditions are satisfied.With
N = 0this is equivalent to NoneCondition. An empty condition list always evaluates totrue.
- AttributeThresholdCondition
Condition that checks an attribute on the resolved target entity against a threshold.
When Absolute, the attribute's final value is compared directly against the configured absolute threshold.
When Percentage, the attribute's position within its defined range [MinValue,MaxValue] is expressed as a percentage (0–100) and compared against the configured percentage threshold. Requires the attribute to haveHasMaxValue = true; returnsfalseotherwise. WhenHasMinValue = false, 0 is used as the implicit minimum. Returnsfalseif the effective range (MaxValue − MinValue) is zero.Negative
MinValueis fully supported: an attribute with MinValue = −100 and MaxValue = 100 at value 0 evaluates to 50 %.
- ChangedAttributeCondition
Condition that checks whether the payload of an attribute change event refers to a specific attribute.
Returns
falsewhen EventPayload is not an AttributeChangeInfo, when the configured attribute is null, or when the payload attribute is null.
- ChangedStatCondition
Condition that checks whether the payload of a stat change event refers to a specific stat.
Returns
falsewhen EventPayload is not a StatChangeInfo, when the configured stat is null, or when the payload stat is null.
- Condition
Abstract base class for all conditions in the Astra RPG condition system. Conditions are pure predicates evaluated against an EvaluationContext. Subclass and implement Evaluate(EvaluationContext) to define custom logic.
Concrete subclasses must be decorated with
[Serializable]to participate in Unity's[SerializeReference]polymorphic serialization.
- ConditionCompatibility
Design-time utility that checks whether a Condition subclass is compatible with a given trigger payload type, based on ConditionPayloadAttribute metadata.
A condition with noConditionPayloadAttribute is payload-agnostic and compatible with every trigger. A condition with one or more attributes is compatible when the trigger's payload type is assignable to at least one declared accepted type.
- ConditionPayloadAttribute
Declares which event-payload type a Condition subclass can consume.
Apply one or more instances to a Condition subclass to declare the payload types it supports. A condition with no attribute is considered payload-agnostic (compatible with any trigger). A condition with one or more attributes is compatible with a trigger whose PayloadType is assignable to at least one of the declared AcceptedType values.
- EntityHasTagCondition
Condition that checks whether the resolved target entity has the required tags.
The entity is resolved from the configured ElectricDrill.AstraRpgFramework.Conditions.EntityHasTagCondition._target slot in the EvaluationContext. Returns
falseif the target isnullor does not implement ITaggable.
- EntityLevelCondition
Condition that checks the resolved target entity's current level against a fixed threshold.
The entity is resolved from the configured ElectricDrill.AstraRpgFramework.Conditions.EntityLevelCondition._target slot in the EvaluationContext. Returns
falseif the target cannot be resolved.
- EntityLevelThresholdTransitionCondition
Condition that checks whether an entity level comparison against a fixed threshold becomes satisfied or ceases to be satisfied across a level change payload.
Returns
falsewhen the payload does not implement IHasValueChange<T> for int.
- EntityReferenceCondition
Condition that compares two entity slots resolved from the current EvaluationContext.
SameEntity and DifferentEntity use reference identity over resolved EntityCore instances and do not treat two missing entities as equal. Use the explicit null-check modes when absence is the desired predicate.
- ExactlyNCondition
Composite condition that evaluates to
truewhen exactly ElectricDrill.AstraRpgFramework.Conditions.ExactlyNCondition._n child conditions are satisfied.With
N = 1this is equivalent to an exclusive-OR (XOR) across all children. An empty condition list withN = 0evaluates totrue.
- HasActiveModifierTagCondition
Condition that evaluates to
truewhen at least one active modifier on Holder carries all tags in ElectricDrill.AstraRpgFramework.Conditions.HasActiveModifierTagCondition._tags.Requires an IActiveModifierTagProvider component on the holder's
GameObject(typically provided by the Modifiers package). Returnsfalsewhen the holder isnullor lacks the component.
- HolderLevelCondition
Condition that checks the holder entity's current level against a fixed threshold.
- IntValueChangeDirectionCondition
Condition that checks the direction of an int value change projected from EventPayload.
Returns
falsewhen the payload does not implement IHasValueChange<T> for int.
- IntValueChangeModuloCondition
Condition that checks an int value projected from EventPayload against a modulo rule.
Returns
falsewhen the payload does not implement IHasValueChange<T> for int, or when ElectricDrill.AstraRpgFramework.Conditions.IntValueChangeModuloCondition._divisor is not positive. Both the projected value and the expected remainder are normalized into the range [0, divisor - 1] before comparison.
- IntValueChangeThresholdCondition
Condition that compares an int value projected from EventPayload against a fixed threshold.
Returns
falsewhen the payload does not implement IHasValueChange<T> for int, or when the requested projection cannot be represented safely.
- IntValueChangeThresholdTransitionCondition
Condition that checks whether an int comparison against a fixed threshold becomes satisfied or ceases to be satisfied across a value change payload.
Returns
falsewhen the payload does not implement IHasValueChange<T> for int.
- IsPerformerCondition
Condition that evaluates to
truewhen Performer is the same entity as Holder (i.e., the effect was self-applied). Returnsfalsewhen Performer isnull.
- LongValueChangeDirectionCondition
Condition that checks the direction of a long value change projected from EventPayload.
Returns
falsewhen the payload does not implement IHasValueChange<T> for long.
- LongValueChangeModuloCondition
Condition that checks a long value projected from EventPayload against a modulo rule.
Returns
falsewhen the payload does not implement IHasValueChange<T> for long, or when ElectricDrill.AstraRpgFramework.Conditions.LongValueChangeModuloCondition._divisor is not positive. Both the projected value and the expected remainder are normalized into the range [0, divisor - 1] before comparison.
- LongValueChangeThresholdCondition
Condition that compares a long value projected from EventPayload against a fixed threshold.
Returns
falsewhen the payload does not implement IHasValueChange<T> for long, or when the requested projection cannot be represented safely.
- LongValueChangeThresholdTransitionCondition
Condition that checks whether a long comparison against a fixed threshold becomes satisfied or ceases to be satisfied across a value change payload.
Returns
falsewhen the payload does not implement IHasValueChange<T> for long.
- NoneCondition
Composite condition that evaluates to
truewhen NO child condition is satisfied (logical NOR). An empty condition list evaluates totrue.
- NotCondition
Decorator condition that negates the result of its inner condition (logical NOT). Evaluates to
truewhen the inner condition isfalse, and vice-versa. When Inner isnull, evaluates totrue.
- RandomChanceCondition
Condition that evaluates to
truewith 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 returntrue.
- StatThresholdCondition
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 haveHasMaxValue = true; returnsfalseotherwise. WhenHasMinValue = false, 0 is used as the implicit minimum. Returnsfalseif the effective range (MaxValue − MinValue) is zero to avoid division by zero.Negative
MinValueis fully supported: a stat with MinValue = −100 and MaxValue = 100 at value 0 evaluates to 50 %.
Structs
- ConditionCompatibility.UnavailableTarget
Describes one configured ConditionTarget that is unavailable in a specific evaluation context.
- ConditionEvaluationAvailability
Design-time description of the payload and entity target slots available to a Condition.
- EvaluationContext
Lightweight value type passed to Evaluate(EvaluationContext) on every evaluation. Struct allocation keeps GC pressure at zero even under high tick frequency.
All fields are public for direct assignment via object-initializer syntax. Conditions must treat the context as read-only — mutations are silently discarded (pass-by-value semantics).
Enums
- ComparisonMode
Defines how a numeric value is compared against a threshold.
- ConditionTarget
Specifies which entity slot in an EvaluationContext a condition should target. Payload-derived slots resolve through contracts exposed by EventPayload and evaluate as
nullwhen the payload cannot supply the requested role.
- ConditionTargetAvailability
Describes which ConditionTarget slots are available in a condition evaluation context.
- EntityReferenceComparisonMode
Defines how two resolved entity slots should be compared.
- TagMatchMode
Controls how a tag set is matched against an entity's tags.
- ThresholdMode
Specifies whether a stat threshold is expressed as a raw absolute value or as a percentage of the stat's maximum value (0–100).
- ThresholdSatisfactionTransition
Describes how a threshold comparison should transition across a value change.
- ValueChangeComponent
Selects which numeric projection of an IHasValueChange<T> payload a condition should read.
- ValueChangeDirection
Describes the direction of a numeric change between a previous and a new value.