* - tweak: Rev tweaks.

* - tweak: Item drop and lying tweaks.

* - tweak: No ebow stamina damage.

* - tweak: Fun tweaks.
This commit is contained in:
Aviu00
2024-06-29 20:03:28 +00:00
committed by GitHub
parent 8922181b84
commit 93943aaf95
16 changed files with 54 additions and 39 deletions

View File

@@ -1,5 +1,4 @@
using Content.Shared.DoAfter;
using Content.Shared.Gravity;
using Content.Shared.Hands.Components;
using Content.Shared.Input;
using Content.Shared.Mobs.Systems;
@@ -146,17 +145,27 @@ public abstract partial class SharedStandingStateSystem : EntitySystem
return true;
}
public bool TryLieDown(EntityUid uid, StandingStateComponent? standingState = null, bool dropHeldItems = false)
public enum DropHeldItemsBehavior
{
if (!Resolve(uid, ref standingState, false) || !standingState.CanLieDown)
return false;
NoDrop,
DropIfStanding,
AlwaysDrop
}
if (standingState.CurrentState is not StandingState.Standing)
public bool TryLieDown(EntityUid uid,
StandingStateComponent? standingState = null,
DropHeldItemsBehavior behavior = DropHeldItemsBehavior.NoDrop)
{
if (!Resolve(uid, ref standingState, false) || !standingState.CanLieDown ||
standingState.CurrentState is not StandingState.Standing)
{
if (behavior == DropHeldItemsBehavior.AlwaysDrop)
RaiseLocalEvent(uid, new DropHandItemsEvent());
return false;
}
Down(uid, true, dropHeldItems, standingState);
Down(uid, true, behavior != DropHeldItemsBehavior.NoDrop, standingState);
return true;
}
// WD EDIT END

View File

@@ -1,7 +1,6 @@
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;
@@ -11,14 +10,14 @@ 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)
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, true);
_standingState.TryLieDown(ent, ent, SharedStandingStateSystem.DropHeldItemsBehavior.DropIfStanding);
}
}
}

View File

@@ -19,7 +19,7 @@ public sealed class KnockdownOnCollideSystem : EntitySystem
private void OnProjectileHit(Entity<KnockdownOnCollideComponent> ent, ref ProjectileHitEvent args)
{
_standing.TryLieDown(args.Target, null, true);
_standing.TryLieDown(args.Target, null, SharedStandingStateSystem.DropHeldItemsBehavior.AlwaysDrop);
if (ent.Comp.BlurTime <= 0f)
return;