mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-30 16:17:27 +00: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>
20 lines
532 B
C#
20 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);
|
|
}
|
|
}
|