Turn ReagentEffects into generic EntityEffects (#28168)
* Oh the possibilities * Merge fixes * Forgot to remote LavaSystem oops * Changed EntityEffectArgs to EntityEffectBaseArgs and EntityEffectReagentArgs * Throw exception for unimplemented effectargs * Remove Json and overrideable datafields * Fix test issues * Actually fix the compiling issue * Fix comments and remove EntityEffectArgs (no longer used, replaced with EntityEffectBaseArgs)
This commit is contained in:
32
Content.Server/Tiles/TileEntityEffectSystem.cs
Normal file
32
Content.Server/Tiles/TileEntityEffectSystem.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using Content.Server.Atmos.Components;
|
||||
using Content.Server.Atmos.EntitySystems;
|
||||
using Content.Shared.StepTrigger.Systems;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.EntityEffects;
|
||||
|
||||
namespace Content.Server.Tiles;
|
||||
|
||||
public sealed class TileEntityEffectSystem : EntitySystem
|
||||
{
|
||||
|
||||
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;
|
||||
|
||||
foreach (var effect in ent.Comp.Effects)
|
||||
{
|
||||
effect.Effect(new EntityEffectBaseArgs(otherUid, EntityManager));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user