mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
27 lines
952 B
C#
27 lines
952 B
C#
using Content.Shared.StepTrigger.Systems;
|
|
using Content.Shared.EntityEffects;
|
|
|
|
namespace Content.Server.Tiles;
|
|
|
|
public sealed partial class TileEntityEffectSystem : EntitySystem
|
|
{
|
|
[Dependency] private SharedEntityEffectsSystem _entityEffects = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
SubscribeLocalEvent<TileEntityEffectComponent, StepTriggeredOffEvent>(OnTileStepTriggered);
|
|
SubscribeLocalEvent<TileEntityEffectComponent, StepTriggerAttemptEvent>(OnTileStepTriggerAttempt);
|
|
}
|
|
private void OnTileStepTriggerAttempt(Entity<TileEntityEffectComponent> ent, ref StepTriggerAttemptEvent args)
|
|
{
|
|
args.Continue = true;
|
|
}
|
|
|
|
private void OnTileStepTriggered(Entity<TileEntityEffectComponent> ent, ref StepTriggeredOffEvent args)
|
|
{
|
|
var otherUid = args.Tripper;
|
|
|
|
_entityEffects.ApplyEffects(otherUid, ent.Comp.Effects.ToArray(), user: otherUid);
|
|
}
|
|
}
|