• Home
  • API reference
  • Source code
Show / Hide Table of Contents
  • osrlib.Controllers
    • GameManager
  • osrlib.Core
    • Ability
    • AbilityType
    • Adventure
    • Alignment
    • Being
    • BeingTargetingEventArgs
    • BeingTargetingEventHandler
    • CharacterClass
    • Dungeon
    • Encounter
    • GameAction
    • GameActionEventArgs
    • GameActionEventHandler
    • GamePosition
    • Modifier
    • Party
    • Quest
    • User
    • Weapon
    • WeaponType
  • osrlib.Dice
    • DiceHand
    • DiceRoll
    • DiceRolledEventArgs
    • DiceRolledEventHandler
    • Die
  • osrlib.SaveLoad
    • SaveLoadLocal
    • SaveType
  • osrlib.Tests
    • CoreRulesTests
    • DiceTests
    • PartyGenerator
    • ReadMeTests
    • SaveLoadTests
    • SteppedBattleTests
  • osrlib.Utility
    • Randomizer

Class Ability

A Being has one or more abilities (strength, dexterity, intelligence, etc.) that are referenced when calculating the success of a GameAction.

Inheritance
System.Object
Ability
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: osrlib.Core
Assembly: osrlib.Core.dll
Syntax
public class Ability

Properties

| Improve this Doc View Source

BaseValue

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
| Improve this Doc View Source

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.

| Improve this Doc View Source

Type

Gets or sets the type (strength, dexterity, intelligence, etc.) of this Ability.

Declaration
public AbilityType Type { get; set; }
Property Value
Type Description
AbilityType
| Improve this Doc View Source

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 Source

GetModifier()

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.

| Improve this Doc View Source

RollAbilityScore()

Rolls and sets the BaseValue of the Ability.

Declaration
public int RollAbilityScore()
Returns
Type Description
System.Int32

The rolled score.

| Improve this Doc View Source

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.

Overrides
System.Object.ToString()
  • Improve this Doc
  • View Source
Back to top Generated by DocFX