Files
tbd-station-14/Content.Server/NPC/Components/NPCMeleeCombatComponent.cs
metalgearsloth c31c848afd Shooting NPCs and more (#18042)
* Add pirate shooting

* Shooting working

* Basics working

* Refactor time

* More conversion

* Update primitives

* Update yml

* weh

* Building again

* Draft

* weh

* b

* Start shutdown

* Starting to take form

* Code side done

* is it worky

* Fix prototypes

* stuff

* Shitty working

* Juke events working

* Even more cleanup

* RTX

* Fix interaction combat mode and compquery

* GetAmmoCount relays

* Fix rotation speed

* Juke fixes

* fixes

* weh

* The collision avoidance never ends

* Fixes

* Pause support

* framework

* lazy

* Fix idling

* Fix drip

* goobed

* Fix takeover shutdown bug

* Merge fixes

* shitter

* Fix carpos
2023-08-01 19:48:56 -05:00

54 lines
1.2 KiB
C#

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>
/// If the target is moving what is the chance for this NPC to miss.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public float MissChance;
[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>
/// If the target is outside of our melee range.
/// </summary>
TargetOutOfRange,
/// <summary>
/// Set if the weapon we were assigned is no longer valid.
/// </summary>
NoWeapon,
/// <summary>
/// No dramas.
/// </summary>
Normal,
}