Interface ICombatant
Interface for all creatures that can participate in combat.
Inherited Members
Namespace: Fibula.Mechanics.Contracts.Abstractions
Assembly: Fibula.Mechanics.Contracts.dll
Syntax
public interface ICombatant : ICreatureWithSkills, ICreatureThatSensesOthers, ICreature, IThing, IContainedThing, IEquatable<IThing>, ICloneableThing<IThing>, IThingContainer, ILocatable, IEquatable<ICreature>
Properties
| Improve this Doc View SourceAttackedBy
Gets the collection of combatants currently attacking this combatant.
Declaration
IEnumerable<ICombatant> AttackedBy { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ICombatant> |
AttackSpeed
Gets a metric of how fast a combatant can earn an attack credit per combat round.
Declaration
decimal AttackSpeed { get; }
Property Value
Type | Description |
---|---|
System.Decimal |
AutoAttackRange
Gets the range that the auto attack has.
Declaration
byte AutoAttackRange { get; }
Property Value
Type | Description |
---|---|
System.Byte |
AutoAttackTarget
Gets the current target combatant, if any.
Declaration
ICombatant AutoAttackTarget { get; }
Property Value
Type | Description |
---|---|
ICombatant |
ChaseMode
Gets or sets the chase mode selected by this combatant.
Declaration
ChaseMode ChaseMode { get; set; }
Property Value
Type | Description |
---|---|
ChaseMode |
ChaseTarget
Gets the current target being chased, if any.
Declaration
ICreature ChaseTarget { get; }
Property Value
Type | Description |
---|---|
ICreature |
DamageTakenInSession
Gets the distribution of damage taken by any combatant that has attacked this combatant while the current combat is active.
Declaration
IEnumerable<(uint CombatantId, uint Damage)> DamageTakenInSession { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.ValueTuple<System.UInt32, System.UInt32>> |
DefenseSpeed
Gets a metric of how fast a combatant can earn a defense credit per combat round.
Declaration
decimal DefenseSpeed { get; }
Property Value
Type | Description |
---|---|
System.Decimal |
FightMode
Gets or sets the fight mode selected by this combatant.
Declaration
FightMode FightMode { get; set; }
Property Value
Type | Description |
---|---|
FightMode |
Methods
| Improve this Doc View SourceAddExperience(Int64)
Adds a value of experience to the combatant, which can be positive or negative.
Declaration
void AddExperience(long expToGiveOrTake)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | expToGiveOrTake | The experience value to give or take. |
AddToCombatList(ICombatant)
Adds a combatant to the combat list of this one.
Declaration
void AddToCombatList(ICombatant otherCombatant)
Parameters
Type | Name | Description |
---|---|---|
ICombatant | otherCombatant | The combatant to add to the list. |
ApplyDamage(DamageInfo, UInt32)
Applies damage to the combatant, which is expected to apply reductions and protections.
Declaration
DamageInfo ApplyDamage(DamageInfo damageInfo, uint fromCombatantId = 0U)
Parameters
Type | Name | Description |
---|---|---|
DamageInfo | damageInfo | The information of the damage to make, without reductions. |
System.UInt32 | fromCombatantId | The combatant from which to track the damage, if any. |
Returns
Type | Description |
---|---|
DamageInfo | The information about the damage actually done. |
DecreaseAttackSpeed(Decimal)
Decreases the attack speed of this combatant.
Declaration
void DecreaseAttackSpeed(decimal decreaseAmount)
Parameters
Type | Name | Description |
---|---|---|
System.Decimal | decreaseAmount | The amount by which to decrease. |
DecreaseDefenseSpeed(Decimal)
Decreases the defense speed of this combatant.
Declaration
void DecreaseDefenseSpeed(decimal decreaseAmount)
Parameters
Type | Name | Description |
---|---|---|
System.Decimal | decreaseAmount | The amount by which to decrease. |
IncreaseAttackSpeed(Decimal)
Increases the attack speed of this combatant.
Declaration
void IncreaseAttackSpeed(decimal increaseAmount)
Parameters
Type | Name | Description |
---|---|---|
System.Decimal | increaseAmount | The amount by which to increase. |
IncreaseDefenseSpeed(Decimal)
Increases the defense speed of this combatant.
Declaration
void IncreaseDefenseSpeed(decimal increaseAmount)
Parameters
Type | Name | Description |
---|---|---|
System.Decimal | increaseAmount | The amount by which to increase. |
RemoveFromCombatList(ICombatant)
Removes a combatant from the combat list of this one.
Declaration
void RemoveFromCombatList(ICombatant otherCombatant)
Parameters
Type | Name | Description |
---|---|---|
ICombatant | otherCombatant | The combatant to remove from the list. |
SetAttackedBy(ICombatant)
Sets this combatant as being attacked by another.
Declaration
void SetAttackedBy(ICombatant combatant)
Parameters
Type | Name | Description |
---|---|---|
ICombatant | combatant | The combatant attacking this one, if any. |
SetAttackTarget(ICombatant)
Sets the attack target of this combatant.
Declaration
bool SetAttackTarget(ICombatant otherCombatant)
Parameters
Type | Name | Description |
---|---|---|
ICombatant | otherCombatant | The other target combatant, if any. |
Returns
Type | Description |
---|---|
System.Boolean | True if the target was actually changed, false otherwise. |
SetFollowTarget(ICreature)
Sets the chasing target of this combatant.
Declaration
bool SetFollowTarget(ICreature target)
Parameters
Type | Name | Description |
---|---|---|
ICreature | target | The target to chase, if any. |
Returns
Type | Description |
---|---|
System.Boolean | True if the target was actually changed, false otherwise. |
UnsetAttackedBy(ICombatant)
Unsets this combatant as being attacked by another.
Declaration
void UnsetAttackedBy(ICombatant combatant)
Parameters
Type | Name | Description |
---|---|---|
ICombatant | combatant | The combatant no longer attacking this one, if any. |
Events
| Improve this Doc View SourceAttackTargetChanged
Event to call when the attack target changes.
Declaration
event OnAttackTargetChanged AttackTargetChanged
Event Type
Type | Description |
---|---|
OnAttackTargetChanged |
Death
Event to call when the combatant dies.
Declaration
event OnDeath Death
Event Type
Type | Description |
---|---|
OnDeath |
FollowTargetChanged
Event to call when the chase target changes.
Declaration
event OnFollowTargetChanged FollowTargetChanged
Event Type
Type | Description |
---|---|
OnFollowTargetChanged |