Class Skill
A skill is an ability that a PersonLike can have which influences their behavior in some way. Skill instances are created from their corresponding SkillType.
[DataContract]
public class Skill
- Inheritance
-
Skill
- Inherited Members
- Extension Methods
Constructors
Skill(SkillType, PersonLike)
Creates a new skill instance from the given SkillType.
public Skill(SkillType type, PersonLike person)
Parameters
type
SkillTypeThe type of skill to construct
person
PersonLike
Fields
Type
The underlying SkillType that this skill instance originates from
[DataMember]
public readonly SkillType Type
Field Value
Properties
Level
The current level of this skill. Note that this value never goes beyond GetMaxLevel(AgeGroup). To modify this value efficiently, use GainSkill(SkillType, float, ActionInfo, float).
[DataMember]
public int Level { get; set; }
Property Value
Person
public PersonLike Person { get; }
Property Value
PointPercentage
The percentage of PointsToNextLevel out of the RequiredPointsToNextLevel. This value is always between 0 and 1.
public float PointPercentage { get; }
Property Value
PointsToNextLevel
The amount of skill points that are required until the next Level is reached. To modify this value, use GainSkill(SkillType, float, ActionInfo, float).
[DataMember]
public float PointsToNextLevel { get; }
Property Value
RequiredPointsToNextLevel
Returns the amount of skill points that is required to reach the next level. This value is depenedent on the current Level, meaning higher skill levels are harder to reach.
public int RequiredPointsToNextLevel { get; }
Property Value
- int
The points required for the next level
TotalPercentage
The percentage of the Level, plus the PointPercentage, out of the total MaxLevel. Essentially, this value represents the total progress that this skill has, between 0 and 1.
public float TotalPercentage { get; }
Property Value
Methods
Gain(float)
public bool Gain(float amount)
Parameters
amount
float
Returns
Validate(PersonLike)
public void Validate(PersonLike person)
Parameters
person
PersonLike
Events
OnAdditionalEarnedActions
An event that is invoked when a notification for a skill level up is displayed for the given Skill. The list can have additional display strings added to based on a reached level to display additional actions or abilities that a person gains when reaching that level. This is an event version of AdditionalEarnedActions.
public static event Action<PersonLike, Skill, List<(int Level, string DisplayName)>> OnAdditionalEarnedActions
Event Type
- Action<PersonLike, Skill, List<(int Level, string DisplayName)>>