+++ /dev/null
-using Content.Server.Fluids.EntitySystems;
-using Robust.Shared.Prototypes;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
-
-namespace Content.Server.Chemistry.Components;
-
-
-/// <summary>
-/// When a <see cref="SmokeComponent"/> despawns this will spawn another entity in its place.
-/// </summary>
-[RegisterComponent, Access(typeof(SmokeSystem))]
-public sealed partial class SmokeDissipateSpawnComponent : Component
-{
- [DataField("prototype", required: true, customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
- public string Prototype = string.Empty;
-}
SubscribeLocalEvent<SmokeComponent, EntityUnpausedEvent>(OnSmokeUnpaused);
SubscribeLocalEvent<SmokeComponent, ReactionAttemptEvent>(OnReactionAttempt);
SubscribeLocalEvent<SmokeComponent, SpreadNeighborsEvent>(OnSmokeSpread);
- SubscribeLocalEvent<SmokeDissipateSpawnComponent, TimedDespawnEvent>(OnSmokeDissipate);
- }
-
- private void OnSmokeDissipate(EntityUid uid, SmokeDissipateSpawnComponent component, ref TimedDespawnEvent args)
- {
- if (!TryComp<TransformComponent>(uid, out var xform))
- {
- return;
- }
-
- Spawn(component.Prototype, xform.Coordinates);
}
private void OnSmokeSpread(EntityUid uid, SmokeComponent component, ref SpreadNeighborsEvent args)
--- /dev/null
+using Content.Server.Spawners.EntitySystems;
+using Robust.Shared.Prototypes;
+using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
+
+namespace Content.Server.Spawners.Components;
+
+/// <summary>
+/// When a <c>TimedDespawnComponent"</c> despawns, another one will be spawned in its place.
+/// </summary>
+[RegisterComponent, Access(typeof(SpawnOnDespawnSystem))]
+public sealed partial class SpawnOnDespawnComponent : Component
+{
+ /// <summary>
+ /// Entity prototype to spawn.
+ /// </summary>
+ [DataField(required: true)]
+ public EntProtoId Prototype = string.Empty;
+}
--- /dev/null
+using Content.Server.Spawners.Components;
+using Robust.Shared.Spawners;
+
+namespace Content.Server.Spawners.EntitySystems;
+
+public sealed class SpawnOnDespawnSystem : EntitySystem
+{
+ public override void Initialize()
+ {
+ base.Initialize();
+
+ SubscribeLocalEvent<SpawnOnDespawnComponent, TimedDespawnEvent>(OnDespawn);
+ }
+
+ private void OnDespawn(EntityUid uid, SpawnOnDespawnComponent comp, ref TimedDespawnEvent args)
+ {
+ if (!TryComp<TransformComponent>(uid, out var xform))
+ return;
+
+ Spawn(comp.Prototype, xform.Coordinates);
+ }
+}
animationTime: 0.6
animationState: mfoam-dissolve
- type: Smoke
- - type: SmokeDissipateSpawn
+ - type: SpawnOnDespawn
prototype: FoamedIronMetal
- type: entity
animationTime: 0.6
animationState: mfoam-dissolve
- type: Smoke
- - type: SmokeDissipateSpawn
+ - type: SpawnOnDespawn
prototype: FoamedAluminiumMetal
- type: entity