| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- 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 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);
- }
- }
|