48 lines
1.5 KiB
C#
48 lines
1.5 KiB
C#
using Content.Server.Interaction;
|
|
using Content.Server.Weapons.Ranged.Systems;
|
|
using Content.Shared.Weapons.Melee;
|
|
using Robust.Shared.Audio;
|
|
using Robust.Shared.Audio.Systems;
|
|
using Robust.Shared.Map;
|
|
using Robust.Shared.Physics.Systems;
|
|
using Robust.Shared.Random;
|
|
using Robust.Shared.Timing;
|
|
|
|
namespace Content.Server.NPC.Systems;
|
|
|
|
/// <summary>
|
|
/// Handles combat for NPCs.
|
|
/// </summary>
|
|
public sealed partial class NPCCombatSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly IGameTiming _timing = default!;
|
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
|
[Dependency] private readonly IRobustRandom _random = default!;
|
|
[Dependency] private readonly GunSystem _gun = default!;
|
|
[Dependency] private readonly InteractionSystem _interaction = default!;
|
|
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
|
[Dependency] private readonly NPCSteeringSystem _steering = default!;
|
|
[Dependency] private readonly SharedMapSystem _map = default!;
|
|
[Dependency] private readonly SharedMeleeWeaponSystem _melee = default!;
|
|
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
|
|
|
/// <summary>
|
|
/// If disabled we'll move into range but not attack.
|
|
/// </summary>
|
|
public bool Enabled = true;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
InitializeMelee();
|
|
InitializeRanged();
|
|
}
|
|
|
|
public override void Update(float frameTime)
|
|
{
|
|
base.Update(frameTime);
|
|
UpdateMelee(frameTime);
|
|
UpdateRanged(frameTime);
|
|
}
|
|
}
|