2024-01-27 15:19:52 +03:00
|
|
|
|
using Content.Shared.Mobs;
|
|
|
|
|
|
|
2024-01-28 18:18:54 +07:00
|
|
|
|
namespace Content.Server._White.BecomeDustOnDeathSystem;
|
2024-01-27 15:19:52 +03:00
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|