mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* Add TriggerOnRot Component, and related systems and events * Move around components and events to proper namespaces * Improve TriggerOnRotComponent Comment * fix a bunch of imports * Change BeginRottingEvent to a ByRefEvent record --------- Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
19 lines
532 B
C#
19 lines
532 B
C#
using Content.Shared.Atmos.Rotting;
|
|
using Content.Shared.Trigger.Components.Triggers;
|
|
|
|
namespace Content.Shared.Trigger.Systems;
|
|
|
|
public sealed partial class TriggerOnRotSystem : TriggerOnXSystem
|
|
{
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<TriggerOnRotComponent, BeginRottingEvent>(OnRot);
|
|
}
|
|
|
|
private void OnRot(Entity<TriggerOnRotComponent> ent, ref BeginRottingEvent args)
|
|
{
|
|
Trigger.Trigger(ent.Owner, null, ent.Comp.KeyOut, predicted: false);
|
|
}
|
|
}
|