NPC refactor (#10122)
Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
This commit is contained in:
@@ -12,6 +12,7 @@ using System.Threading;
|
||||
using Content.Server.Chat.Systems;
|
||||
using Content.Server.GameTicking;
|
||||
using Content.Server.GameTicking.Rules;
|
||||
using Content.Server.NPC;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Dragon;
|
||||
using Content.Shared.Examine;
|
||||
@@ -20,6 +21,7 @@ using Content.Shared.Movement.Systems;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Random;
|
||||
using Content.Server.NPC.Systems;
|
||||
|
||||
namespace Content.Server.Dragon
|
||||
{
|
||||
@@ -36,6 +38,7 @@ namespace Content.Server.Dragon
|
||||
[Dependency] private readonly MovementSpeedModifierSystem _movement = default!;
|
||||
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audioSystem = default!;
|
||||
[Dependency] private readonly NPCSystem _npc = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Minimum distance between 2 rifts allowed.
|
||||
@@ -150,8 +153,8 @@ namespace Content.Server.Dragon
|
||||
if (comp.SpawnAccumulator > comp.SpawnCooldown)
|
||||
{
|
||||
comp.SpawnAccumulator -= comp.SpawnCooldown;
|
||||
Spawn(comp.SpawnPrototype, Transform(comp.Owner).MapPosition);
|
||||
// TODO: When NPC refactor make it guard the rift.
|
||||
var ent = Spawn(comp.SpawnPrototype, Transform(comp.Owner).MapPosition);
|
||||
_npc.SetBlackboard(ent, NPCBlackboard.FollowTarget, new EntityCoordinates(comp.Owner, Vector2.Zero));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user