Namespace ElectricDrill.AstraRpgFramework.Scaling
Classes
- ScalingComponent
Abstract base class for all scaling components. A scaling component calculates a value based on an entity's properties.
- ScalingFormula
Represents a formula to calculate a value based on values returned by several scaling components. The calculation of each scaling component can either be based on the "self" entity (the entity that owns the formula) or the "target" entity (the entity that will be targeted by the action). For example, a scaling formula for an attack that deals the more damage the higher the enemy's armor is, can use the "self" entity to calculate the damage based on the attacker's stats and the "target" entity to calculate additional damage based on the target's armor. The final damage will be the sum of the value returned by the two scaling components.
- ScalingFormulaInstance
A per-entity runtime wrapper around a shared ScalingFormula asset.
Because ScalingFormula is a
ScriptableObject, it is shared across all entities that reference it. Mutating temporary scaling components directly on the asset would therefore affect every entity that uses it. ScalingFormulaInstance solves this by keeping its own temporary component lists while delegating all computation to the underlying asset.Each entity that needs per-entity runtime modifications (e.g. a buff that adds an extra scaling term) should create its own ScalingFormulaInstance from the shared ScalingFormula asset.
- SoSetScalingComponentBase<SetType, KeyType>
Abstract base class for scaling components that work with ScriptableObject-based sets.
Interfaces
- IScalingFormula
Defines the contract for evaluating a scaling formula against one or two entities.
Implementations include:
- ScalingFormula – a shared
ScriptableObjectasset with no per-entity state. - ScalingFormulaInstance – a per-entity runtime wrapper that supports temporary scaling components without affecting other entities that reference the same ScalingFormula.
- ScalingFormula – a shared