- add: TelefragSystem. (#333)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Content.Shared._White.BetrayalDagger;
|
||||
using Content.Shared.Actions;
|
||||
using Content.Shared.Charges.Components;
|
||||
using Content.Shared.Charges.Systems;
|
||||
@@ -24,6 +25,7 @@ public sealed class DashAbilitySystem : EntitySystem
|
||||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
[Dependency] private readonly ActionContainerSystem _actionContainer = default!;
|
||||
[Dependency] private readonly TelefragSystem _telefrag = default!; // WD
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -90,6 +92,7 @@ public sealed class DashAbilitySystem : EntitySystem
|
||||
return;
|
||||
}
|
||||
|
||||
_telefrag.Telefrag(args.Target, user);
|
||||
_transform.SetCoordinates(user, args.Target);
|
||||
_transform.AttachToGridOrMap(user);
|
||||
_audio.PlayPredicted(comp.BlinkSound, user, user);
|
||||
|
||||
24
Content.Shared/_White/BetrayalDagger/TelefragSystem.cs
Normal file
24
Content.Shared/_White/BetrayalDagger/TelefragSystem.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Linq;
|
||||
using Content.Shared.Standing;
|
||||
using Content.Shared.Standing.Systems;
|
||||
using Content.Shared.StatusEffect;
|
||||
using Robust.Shared.Map;
|
||||
|
||||
namespace Content.Shared._White.BetrayalDagger;
|
||||
|
||||
public sealed class TelefragSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly EntityLookupSystem _lookup = default!;
|
||||
[Dependency] private readonly SharedStandingStateSystem _standingState = default!;
|
||||
|
||||
public void Telefrag(EntityCoordinates coords, EntityUid user, float range = 0.2f)
|
||||
{
|
||||
var ents = new HashSet<Entity<StandingStateComponent>>();
|
||||
_lookup.GetEntitiesInRange(coords, range, ents);
|
||||
|
||||
foreach (var ent in ents.Where(ent => ent.Owner != user))
|
||||
{
|
||||
_standingState.TryLieDown(ent, ent, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user