namespace Content.Server.NPC.Components; /// /// Added to NPCs whenever they're in melee combat so they can be handled by the dedicated system. /// [RegisterComponent] public sealed partial class NPCMeleeCombatComponent : Component { /// /// If the target is moving what is the chance for this NPC to miss. /// [ViewVariables(VVAccess.ReadWrite)] public float MissChance; [ViewVariables] public EntityUid Target; [ViewVariables] public CombatStatus Status = CombatStatus.Normal; /// /// Lava edit - how much seconds does it take for a mob to begin attacking once in range. /// This is to prevent instant attacks and give more time to dodge. /// // Lavaland Change Start [ViewVariables] public float ChargeupDelay = 1f; [ViewVariables] public float ChargeupTimer = 0f; // Lavaland Change end } public enum CombatStatus : byte { /// /// The target isn't in LOS anymore. /// NotInSight, /// /// Due to some generic reason we are unable to attack the target. /// Unspecified, /// /// Set if we can't reach the target for whatever reason. /// TargetUnreachable, /// /// If the target is outside of our melee range. /// TargetOutOfRange, /// /// Set if the weapon we were assigned is no longer valid. /// NoWeapon, /// /// No dramas. /// Normal, }