Files
OldThink/Content.Shared/_White/BetrayalDagger/TelefragSystem.cs
Aviu00 93943aaf95 Tweaks (#394)
* - tweak: Rev tweaks.

* - tweak: Item drop and lying tweaks.

* - tweak: No ebow stamina damage.

* - tweak: Fun tweaks.
2024-06-29 23:03:28 +03:00

24 lines
801 B
C#

using System.Linq;
using Content.Shared.Standing;
using Content.Shared.Standing.Systems;
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.4f)
{
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, SharedStandingStateSystem.DropHeldItemsBehavior.DropIfStanding);
}
}
}