Class ClassSO
- Namespace
- ElectricDrill.AstraRpgFramework.Classes
- Assembly
- com.electricdrill.astra-rpg-framework.Runtime.dll
Represents a character class in the RPG system. It can be used to define how attributes and stats grow over levels.
[MovedFrom(true, "ElectricDrill.AstraRpgFramework.Classes", "com.electricdrill.astra-rpg-framework.Runtime", "Class")]
public class ClassSO : ScriptableObject, IHasStatSet, IHasAttributeSet, IEditorValidatable, ITaggable
- Inheritance
-
objectClassSO
- Implements
Fields
_attributeSet
The set of attributes associated with this class.
[SerializeField]
protected AttributeSetSO _attributeSet
Field Value
_maxHpGrowthFormula
The growth formula for the maximum HP. This is a baseline value that can be used to calculate the maximum HP of characters of this class at different levels.
[SerializeField]
protected GrowthFormulaSO _maxHpGrowthFormula
Field Value
_statSet
The set of stats associated with this class.
[SerializeField]
protected StatSetSO _statSet
Field Value
Properties
AttributeSet
Gets the AttributeSet for this class.
public virtual AttributeSetSO AttributeSet { get; }
Property Value
StatSet
Gets the StatSet for this class.
public virtual StatSetSO StatSet { get; }
Property Value
Tags
The tags associated with this object.
public GameTagSet Tags { get; }
Property Value
Methods
GetAttributeAt(AttributeSO, int)
Calculates the value of a specific attribute at a given level.
public virtual long GetAttributeAt(AttributeSO attribute, int level)
Parameters
attributeAttributeSOThe attribute to calculate.
levelintThe level to calculate the attribute value for.
Returns
- long
The value of the attribute at the specified level.
GetMaxHpAt(int)
Calculates the maximum HP for a given level.
public long GetMaxHpAt(int level)
Parameters
levelintThe level to calculate the max HP for.
Returns
- long
The maximum HP at the specified level.
GetStatAt(StatSO, int)
Calculates the value of a specific stat at a given level.
public virtual long GetStatAt(StatSO stat, int level)
Parameters
statStatSOThe stat to calculate.
levelintThe level to calculate the stat value for.
Returns
- long
The value of the stat at the specified level.
Exceptions
- ArgumentException
Thrown when the growth formula for the stat is not set.