Class Ability
A Being has one or more abilities (strength, dexterity, intelligence, etc.) that are referenced when calculating the success of a GameAction.
Inheritance
Inherited Members
Namespace: osrlib.Core
Assembly: osrlib.Core.dll
Syntax
public class Ability
Properties
| Improve this Doc View SourceBaseValue
Gets or sets the base value of this Ability. This is raw "rolled" value set with RollAbilityScore(), without any modifiers.
Declaration
public int BaseValue { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
ScoreModifiers
Gets or sets the collection of Modifiers that adjust the score of this Ability.
Declaration
public List<Modifier> ScoreModifiers { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<Modifier> |
Remarks
These are the modifiers that grant a bonus or a impose a penalty on the modifier value. For example, enhancements from potions or penalties from curse-type spells.
Type
Gets or sets the type (strength, dexterity, intelligence, etc.) of this Ability.
Declaration
public AbilityType Type { get; set; }
Property Value
Type | Description |
---|---|
AbilityType |
Value
Gets the total value of the Ability, the sum of its BaseValue and ScoreModifiers, if any.
Declaration
public int Value { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceGetModifier()
Gets the bonus granted or penalty imposed by the Ability.
Declaration
public int GetModifier()
Returns
Type | Description |
---|---|
System.Int32 | The bonus or penalty value of the Ability. |
Remarks
This value is based on the Ability's Value, which is the sum of its BaseValue and ScoreModifiers, if any. For example, for an Ability score of 18, this method returns 3 (that is, a +3). Use this method when adjusting dice rolls typically affected by ability scores, for example attack and damage rolls.
RollAbilityScore()
Rolls and sets the BaseValue of the Ability.
Declaration
public int RollAbilityScore()
Returns
Type | Description |
---|---|
System.Int32 | The rolled score. |
ToString()
Gets a string representation of the Ability. For example, Strength: 18 (17 + 1)
.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | Single-line text representation of the Ability. |