@@ -1,6 +1,8 @@
|
||||
using Content.Server.Mind;
|
||||
using Content.Shared.Species.Components;
|
||||
using Content.Shared.Body.Events;
|
||||
using Content.Shared.Zombies;
|
||||
using Content.Server.Zombies;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
@@ -11,6 +13,7 @@ public sealed partial class NymphSystem : EntitySystem
|
||||
[Dependency] private readonly IPrototypeManager _protoManager= default!;
|
||||
[Dependency] private readonly MindSystem _mindSystem = default!;
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
[Dependency] private readonly ZombieSystem _zombie = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -30,12 +33,18 @@ public sealed partial class NymphSystem : EntitySystem
|
||||
if (!_protoManager.TryIndex<EntityPrototype>(comp.EntityPrototype, out var entityProto))
|
||||
return;
|
||||
|
||||
// Get the organs' position & spawn a nymph there
|
||||
var coords = Transform(uid).Coordinates;
|
||||
var nymph = EntityManager.SpawnAtPosition(entityProto.ID, coords);
|
||||
|
||||
if (HasComp<ZombieComponent>(args.OldBody)) // Zombify the new nymph if old one is a zombie
|
||||
_zombie.ZombifyEntity(nymph);
|
||||
|
||||
// Move the mind if there is one and it's supposed to be transferred
|
||||
if (comp.TransferMind == true && _mindSystem.TryGetMind(args.OldBody, out var mindId, out var mind))
|
||||
_mindSystem.TransferTo(mindId, nymph, mind: mind);
|
||||
|
||||
// Delete the old organ
|
||||
QueueDel(uid);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user