// // Licensed under the MIT License. See LICENSE file in the project root for full license information. // namespace MUnique.OpenMU.GameLogic; using MUnique.OpenMU.AttributeSystem; /// /// Interface for an object which is attackable. /// public interface IAttackable : IIdentifiable, ILocateable { /// /// Occurs when this instance died. /// event EventHandler? Died; /// /// Gets the attributes. /// IAttributeSystem Attributes { get; } /// /// Gets the magic effect list which contains buffs and de-buffs. /// MagicEffectsList MagicEffectList { get; } /// /// Gets a value indicating whether this is alive. /// /// /// true if alive; otherwise, false. /// bool IsAlive { get; } /// /// Gets a value indicating whether this is currently teleporting and can't be directly targeted. /// It can still receive damage, if the teleport target coordinates are within an target skill area for area attacks. /// /// /// true if teleporting; otherwise, false. /// bool IsTeleporting { get; } /// /// Gets the information about the last death. /// DeathInformation? LastDeath { get; } /// /// Attacks this object by the attacker with the specified skill. /// /// The attacker. /// The skill. /// If set to true, the attacker did a combination of skills. /// The damage factor. /// /// Not null when it's a rage fighter multiple hit skill: /// true, if it's the final hit; /// false, for other hits. /// /// Returns information about the damage inflicted. ValueTask AttackByAsync(IAttacker attacker, SkillEntry? skill, bool isCombo, double damageFactor = 1.0, bool? isFinalStreakHit = null); /// /// Reflects the damage which was done previously with or even to the . /// /// The reflector. /// The damage. ValueTask ReflectDamageAsync(IAttacker reflector, uint damage); /// /// Applies the poison damage. /// /// The initial attacker. /// The damage. ValueTask ApplyPoisonDamageAsync(IAttacker initialAttacker, uint damage); /// /// Applies the bleeding damage. /// /// The initial attacker. /// The damage. ValueTask ApplyBleedingDamageAsync(IAttacker initialAttacker, uint damage); /// /// Kills the attackable instantly. /// ValueTask KillInstantlyAsync(); } /// /// Contains information about the last death of the object. /// /// The id of the killer. /// The name of the killer. /// The hit info of the final/lethal hit. /// The number of the used skill. // [System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1313:Parameter names should begin with lower-case letter", Justification = "The names are affecting the property names of the record. We want upper case there.")] public record DeathInformation(ushort KillerId, string KillerName, HitInfo FinalHit, short SkillNumber);