NPC refactor (#10122)
Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
This commit is contained in:
47
Content.Server/NPC/Components/NPCMeleeCombatComponent.cs
Normal file
47
Content.Server/NPC/Components/NPCMeleeCombatComponent.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
namespace Content.Server.NPC.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Added to NPCs whenever they're in melee combat so they can be handled by the dedicated system.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class NPCMeleeCombatComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Weapon we're using to attack the target. Can also be ourselves.
|
||||
/// </summary>
|
||||
[ViewVariables] public EntityUid Weapon;
|
||||
|
||||
[ViewVariables]
|
||||
public EntityUid Target;
|
||||
|
||||
[ViewVariables]
|
||||
public CombatStatus Status = CombatStatus.Normal;
|
||||
}
|
||||
|
||||
public enum CombatStatus : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// The target isn't in LOS anymore.
|
||||
/// </summary>
|
||||
NotInSight,
|
||||
|
||||
/// <summary>
|
||||
/// Due to some generic reason we are unable to attack the target.
|
||||
/// </summary>
|
||||
Unspecified,
|
||||
|
||||
/// <summary>
|
||||
/// Set if we can't reach the target for whatever reason.
|
||||
/// </summary>
|
||||
TargetUnreachable,
|
||||
|
||||
/// <summary>
|
||||
/// Set if the weapon we were assigned is no longer valid.
|
||||
/// </summary>
|
||||
NoWeapon,
|
||||
|
||||
/// <summary>
|
||||
/// No dramas.
|
||||
/// </summary>
|
||||
Normal,
|
||||
}
|
||||
Reference in New Issue
Block a user