Class GameAction
The GameAction represents an act initiated by one entity on another, such as a melee attack from one Being on another, or a lockpick attempt from a Being on a locked treasure chest.
Inheritance
Inherited Members
Namespace: osrlib.Core
Assembly: osrlib.Core.dll
Syntax
public class GameAction
Constructors
| Improve this Doc View SourceGameAction(Being, Being)
Creates a new instance of the GameAction with the specified attacker and defender.
Declaration
public GameAction(Being source, Being target)
Parameters
Type | Name | Description |
---|---|---|
Being | source | The Being performing the action. |
Being | target | The Being that is the target of the action. |
Properties
| Improve this Doc View SourceActionSource
Gets or sets the Being performing the action.
Declaration
public Being ActionSource { get; set; }
Property Value
Type | Description |
---|---|
Being |
ActionTarget
Gets or sets the target Being.
Declaration
public Being ActionTarget { get; set; }
Property Value
Type | Description |
---|---|
Being |
AttackRoll
Gets the attack roll result of the GameAction.
Declaration
public DiceRoll AttackRoll { get; }
Property Value
Type | Description |
---|---|
DiceRoll | The attack roll associated with the GameAction's attack operation. |
DamageRoll
Gets the damage roll result of the GameAction.
Declaration
public DiceRoll DamageRoll { get; }
Property Value
Type | Description |
---|---|
DiceRoll | The damage roll associated with the GameAction's damage operation. |
Victor
Gets the victor of the GameAction.
Declaration
public Being Victor { get; }
Property Value
Type | Description |
---|---|
Being |
Methods
| Improve this Doc View SourcePerformAction()
Performs the GameAction by applying the attacker's attack roll to the defender's defense value, and applying damage to the defender if the attack roll succeeded.
Declaration
public Being PerformAction()
Returns
Type | Description |
---|---|
Being | The victor in the GameAction. |
Remarks
The victor in the GameAction can be the defending GamePiece.