Show / Hide Table of Contents

    Class CombatantCreature

    Class that represents all creatures in the game.

    Inheritance
    System.Object
    Thing
    Creature
    CombatantCreature
    Monster
    Player
    Implements
    ICombatant
    ICreatureWithSkills
    ICreatureThatSensesOthers
    ICreature
    IThing
    IContainedThing
    System.IEquatable<IThing>
    IThingContainer
    ILocatable
    System.IEquatable<ICreature>
    Inherited Members
    Creature.StatChanged
    Creature.CreatureSensed
    Creature.CreatureSeen
    Creature.CreatureLost
    Creature.TypeId
    Creature.Id
    Creature.Article
    Creature.Name
    Creature.CorpseTypeId
    Creature.CarryLocation
    Creature.EmittedLightLevel
    Creature.EmittedLightColor
    Creature.Speed
    Creature.VariableSpeed
    Creature.Flags
    Creature.BloodType
    Creature.Inventory
    Creature.Outfit
    Creature.Direction
    Creature.LastMovementCostModifier
    Creature.WalkPlan
    Creature.TrackedCreatures
    Creature.IsDead
    Creature.CanWalk
    Creature.Stats
    Creature.StartSensingCreature(ICreature)
    Creature.StopSensingCreature(ICreature)
    Creature.CanSee(ICreature)
    Creature.CanSee(Location)
    Creature.AddContent(IThingFactory, IThing, Byte)
    Creature.RemoveContent(IThingFactory, IThing, Byte, Byte)
    Creature.ReplaceContent(IThingFactory, IThing, IThing, Byte, Byte)
    Creature.FindThingAtIndex(Byte)
    Creature.DescribeForLogger()
    Creature.Equals(ICreature)
    Creature.CalculateMovementSpeed()
    Creature.RaiseStatChange(CreatureStat, UInt32, Byte)
    Thing.LocationChanged
    Thing.UniqueId
    Thing.CanBeMoved
    Thing.ParentContainer
    Thing.Location
    Thing.TrackedEvents
    Thing.Conditions
    Thing.RaiseLocationChanged(Location)
    Thing.ToString()
    Thing.Equals(IThing)
    Thing.StartTrackingEvent(IEvent, String)
    Thing.StopTrackingEvent(IEvent, String)
    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: Fibula.Creatures
    Assembly: Fibula.Creatures.dll
    Syntax
    public abstract class CombatantCreature : Creature, ICombatant, ICreatureWithSkills, ICreatureThatSensesOthers, ICreature, IThing, IContainedThing, IEquatable<IThing>, IThingContainer, ILocatable, IEquatable<ICreature>

    Constructors

    | Improve this Doc View Source

    CombatantCreature(String, String, UInt16, UInt16, UInt16, Decimal, Decimal)

    Initializes a new instance of the CombatantCreature class.

    Declaration
    protected CombatantCreature(string name, string article, ushort maxHitpoints, ushort corpse, ushort hitpoints = 0, decimal baseAttackSpeed = 1.0M, decimal baseDefenseSpeed = 1.0M)
    Parameters
    Type Name Description
    System.String name

    The name of this creature.

    System.String article

    An article for the name of this creature.

    System.UInt16 maxHitpoints

    The maximum hitpoints of the creature.

    System.UInt16 corpse

    The corpse of the creature.

    System.UInt16 hitpoints

    The current hitpoints of the creature.

    System.Decimal baseAttackSpeed

    Optional. The base attack speed for this creature. Bounded between [MinimumCombatSpeed, MaximumCombatSpeed] inclusive. Defaults to DefaultAttackSpeed.

    System.Decimal baseDefenseSpeed

    Optional. The base defense speed for this creature. Bounded between [MinimumCombatSpeed, MaximumCombatSpeed] inclusive. Defaults to DefaultDefenseSpeed.

    Properties

    | Improve this Doc View Source

    AttackedBy

    Gets the collection of combatants currently attacking this combatant.

    Declaration
    public IEnumerable<ICombatant> AttackedBy { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<ICombatant>
    | Improve this Doc View Source

    AttackSpeed

    Gets a metric of how fast a combatant can earn an attack credit per combat round.

    Declaration
    public decimal AttackSpeed { get; }
    Property Value
    Type Description
    System.Decimal
    | Improve this Doc View Source

    AutoAttackRange

    Gets the range that the auto attack has.

    Declaration
    public abstract byte AutoAttackRange { get; }
    Property Value
    Type Description
    System.Byte
    | Improve this Doc View Source

    AutoAttackTarget

    Gets the current target combatant.

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

    ChaseMode

    Gets or sets the chase mode selected by this combatant.

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

    ChaseTarget

    Gets or sets the target being chased, if any.

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

    DamageTakenInSession

    Gets the distribution of damage taken by any combatant that has attacked this combatant while the current combat is active.

    Declaration
    public IEnumerable<(uint, uint)> DamageTakenInSession { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<System.ValueTuple<System.UInt32, System.UInt32>>
    | Improve this Doc View Source

    DefenseSpeed

    Gets a metric of how fast a combatant can earn a defense credit per combat round.

    Declaration
    public decimal DefenseSpeed { get; }
    Property Value
    Type Description
    System.Decimal
    | Improve this Doc View Source

    FightMode

    Gets or sets the fight mode selected by this combatant.

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

    Skills

    Gets the current skills information for the combatant.

    Declaration
    public IDictionary<SkillType, ISkill> Skills { get; }
    Property Value
    Type Description
    System.Collections.Generic.IDictionary<SkillType, ISkill>
    Remarks

    The key is a SkillType, and the value is a ISkill.

    Methods

    | Improve this Doc View Source

    AddToCombatList(ICombatant)

    Starts tracking another ICombatant.

    Declaration
    public abstract void AddToCombatList(ICombatant otherCombatant)
    Parameters
    Type Name Description
    ICombatant otherCombatant

    The other combatant, now in view.

    | Improve this Doc View Source

    ApplyDamage(DamageInfo, UInt32)

    Applies damage to the combatant, which is expected to apply reductions and protections.

    Declaration
    public 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.

    | Improve this Doc View Source

    ApplyDamageModifiers(ref DamageInfo)

    Applies damage modifiers to the damage information provided.

    Declaration
    protected abstract void ApplyDamageModifiers(ref DamageInfo damageInfo)
    Parameters
    Type Name Description
    DamageInfo damageInfo

    The damage information.

    | Improve this Doc View Source

    CalculateSkillPercent(SkillType)

    Calculates the current percentual value between current and target counts for the given skill.

    Declaration
    public byte CalculateSkillPercent(SkillType skillType)
    Parameters
    Type Name Description
    SkillType skillType

    The type of skill to calculate for.

    Returns
    Type Description
    System.Byte

    A value between [0, 100] representing the current percentual value.

    | Improve this Doc View Source

    DecreaseAttackSpeed(Decimal)

    Decreases the attack speed of this combatant.

    Declaration
    public void DecreaseAttackSpeed(decimal decreaseAmount)
    Parameters
    Type Name Description
    System.Decimal decreaseAmount

    The amount by which to decrease.

    | Improve this Doc View Source

    DecreaseDefenseSpeed(Decimal)

    Decreases the defense speed of this combatant.

    Declaration
    public void DecreaseDefenseSpeed(decimal decreaseAmount)
    Parameters
    Type Name Description
    System.Decimal decreaseAmount

    The amount by which to decrease.

    | Improve this Doc View Source

    IncreaseAttackSpeed(Decimal)

    Increases the attack speed of this combatant.

    Declaration
    public void IncreaseAttackSpeed(decimal increaseAmount)
    Parameters
    Type Name Description
    System.Decimal increaseAmount

    The amount by which to increase.

    | Improve this Doc View Source

    IncreaseDefenseSpeed(Decimal)

    Increases the defense speed of this combatant.

    Declaration
    public void IncreaseDefenseSpeed(decimal increaseAmount)
    Parameters
    Type Name Description
    System.Decimal increaseAmount

    The amount by which to increase.

    | Improve this Doc View Source

    RaiseSkillChange(SkillType, UInt32, Byte)

    Raises the SkillChanged event for this creature on the given skill.

    Declaration
    protected void RaiseSkillChange(SkillType forSkill, uint previousLevel, byte previousPercent)
    Parameters
    Type Name Description
    SkillType forSkill

    The skill to advance.

    System.UInt32 previousLevel

    The previous skill level.

    System.Byte previousPercent

    The previous percent of completion to next level.

    | Improve this Doc View Source

    RemoveFromCombatList(ICombatant)

    Stops tracking another ICombatant.

    Declaration
    public abstract void RemoveFromCombatList(ICombatant otherCombatant)
    Parameters
    Type Name Description
    ICombatant otherCombatant

    The other combatant, now in view.

    | Improve this Doc View Source

    SetAttackedBy(ICombatant)

    Sets this combatant as being attacked by another.

    Declaration
    public void SetAttackedBy(ICombatant combatant)
    Parameters
    Type Name Description
    ICombatant combatant

    The combatant attacking this one, if any.

    | Improve this Doc View Source

    SetAttackTarget(ICombatant)

    Sets the attack target of this combatant.

    Declaration
    public 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.

    | Improve this Doc View Source

    SetFollowTarget(ICreature)

    Sets the chasing target of this combatant.

    Declaration
    public 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.

    | Improve this Doc View Source

    UnsetAttackedBy(ICombatant)

    Unsets this combatant as being attacked by another.

    Declaration
    public void UnsetAttackedBy(ICombatant combatant)
    Parameters
    Type Name Description
    ICombatant combatant

    The combatant no longer attacking this one, if any.

    Events

    | Improve this Doc View Source

    AttackTargetChanged

    Event to call when the attack target changes.

    Declaration
    public event OnAttackTargetChanged AttackTargetChanged
    Event Type
    Type Description
    OnAttackTargetChanged
    | Improve this Doc View Source

    Death

    Event to call when the combatant dies.

    Declaration
    public event OnDeath Death
    Event Type
    Type Description
    OnDeath
    | Improve this Doc View Source

    FollowTargetChanged

    Event to call when the follow target changes.

    Declaration
    public event OnFollowTargetChanged FollowTargetChanged
    Event Type
    Type Description
    OnFollowTargetChanged
    | Improve this Doc View Source

    SkillChanged

    Event triggered when this a skill of this creature changes.

    Declaration
    public event OnCreatureSkillChanged SkillChanged
    Event Type
    Type Description
    OnCreatureSkillChanged

    Implements

    ICombatant
    ICreatureWithSkills
    ICreatureThatSensesOthers
    ICreature
    IThing
    IContainedThing
    System.IEquatable<T>
    IThingContainer
    ILocatable
    System.IEquatable<T>

    Extension Methods

    ObjectExtensions.YieldSingleItem<T>(T)
    ObjectExtensions.GetPropertyValue(Object, String)
    Validate.ThrowIfNull(Object, String)
    • Improve this Doc
    • View Source
    Back to top Copyright © 2018-2020 | The Fibula Project
    Generated using DocFX | Jose L. Nuñez de Caceres et al.