using Content.Server.NPC.Systems;
using Robust.Shared.Audio;
namespace Content.Server.NPC.Components;
///
/// Added to an NPC doing ranged combat.
///
[RegisterComponent]
public sealed partial class NPCRangedCombatComponent : Component
{
[ViewVariables]
public EntityUid Target;
[ViewVariables]
public CombatStatus Status = CombatStatus.Normal;
// Most of the below is to deal with turrets.
///
/// If null it will instantly turn.
///
[ViewVariables(VVAccess.ReadWrite)] public Angle? RotationSpeed;
///
/// Maximum distance, between our rotation and the target's, to consider shooting it.
///
[ViewVariables(VVAccess.ReadWrite)]
public Angle AccuracyThreshold = Angle.FromDegrees(30);
///
/// How long until the last line of sight check.
///
[ViewVariables(VVAccess.ReadWrite)]
public float LOSAccumulator = 0f;
///
/// Is the target still considered in LOS since the last check.
///
[ViewVariables(VVAccess.ReadWrite)]
public bool TargetInLOS = false;
///
/// If true, only opaque objects will block line of sight.
///
[ViewVariables(VVAccess.ReadWrite)]
// ReSharper disable once InconsistentNaming
public bool UseOpaqueForLOSChecks = false;
///
/// Delay after target is in LOS before we start shooting.
///
[ViewVariables(VVAccess.ReadWrite)]
public float ShootDelay = 0.2f;
[ViewVariables(VVAccess.ReadWrite)]
public float ShootAccumulator;
///
/// Sound to play if the target enters line of sight.
///
[ViewVariables(VVAccess.ReadWrite)]
public SoundSpecifier? SoundTargetInLOS;
}