main cult
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server.White.BecomeDustOnDeathSystem;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed partial class BecomeDustOnDeathComponent : Component
|
||||
{
|
||||
[DataField("sprite", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
||||
public string SpawnOnDeathPrototype = "Ectoplasm";
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using Content.Shared.Mobs;
|
||||
|
||||
namespace Content.Server.White.BecomeDustOnDeathSystem;
|
||||
|
||||
public sealed class BecomeDustOnDeathSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<BecomeDustOnDeathComponent, MobStateChangedEvent>(OnMobStateChanged);
|
||||
}
|
||||
|
||||
private void OnMobStateChanged(EntityUid uid, BecomeDustOnDeathComponent component, MobStateChangedEvent args)
|
||||
{
|
||||
var xform = Transform(uid);
|
||||
Spawn(component.SpawnOnDeathPrototype, xform.Coordinates);
|
||||
|
||||
QueueDel(uid);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user