CatStation/Content.Server/NPC/Systems/NPCCombatSystem.cs
TemporalOroboros 84b2f07157
The IMapManager is dead (#44002)
* Axes the easy IMapManager references

* Axes the references to unported (obsolete) IMapManager methods

* Converts salvageruler command to a LocalizedEntityCommand so it can use SharedMapSystem

* Removes IMapManager from GameTicker
This required axing the map nuke during restart, but that should be fine?
Maps are entities so EntityManager.FlushEntities should delete them all and that's the preceding line

* submodule update(?)

---------

Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
2026-07-01 20:44:54 -07:00

46 lines
1.4 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 IGameTiming _timing = default!;
[Dependency] private IRobustRandom _random = default!;
[Dependency] private GunSystem _gun = default!;
[Dependency] private InteractionSystem _interaction = default!;
[Dependency] private SharedAudioSystem _audio = default!;
[Dependency] private NPCSteeringSystem _steering = default!;
[Dependency] private SharedMapSystem _map = default!;
[Dependency] private SharedMeleeWeaponSystem _melee = default!;
[Dependency] private 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);
}
}