Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -204,7 +204,7 @@ namespace Content.Shared.Ghost
|
||||
/// Contains players, and locations a ghost can warp to
|
||||
/// </summary>
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class GhostWarpsResponseEvent : EntityEventArgs
|
||||
public sealed class GhostWarpsResponseEvent : EntityEventArgs // WD edit
|
||||
{
|
||||
public GhostWarpsResponseEvent(List<GhostWarpPlayer> players, List<GhostWarpPlace> places, List<GhostWarpGlobalAntagonist> antagonists)
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace Content.Shared.Roles
|
||||
public bool JoinNotifyCrew { get; private set; } = false;
|
||||
|
||||
[DataField]
|
||||
public string? AnnouncementPrototype;
|
||||
public string? ArrivalNotificationPrototype;
|
||||
|
||||
[DataField]
|
||||
public bool RequireAdminNotify { get; private set; } = false;
|
||||
|
||||
@@ -61,15 +61,15 @@ public abstract class SharedJobSystem : EntitySystem
|
||||
{
|
||||
// Not that many departments so we can just eat the cost instead of storing the inverse lookup.
|
||||
var departmentProtos = _protoManager.EnumeratePrototypes<DepartmentPrototype>().ToList();
|
||||
departmentProtos.Sort((x, y) => string.Compare(x.ID, y.ID, StringComparison.Ordinal));
|
||||
departmentProtos = departmentProtos.OrderByDescending(d => d.Weight).ToList();
|
||||
|
||||
foreach (var department in departmentProtos)
|
||||
{
|
||||
if (department.Roles.Contains(jobProto))
|
||||
{
|
||||
departmentPrototype = department;
|
||||
return true;
|
||||
}
|
||||
if (!department.Roles.Contains(jobProto))
|
||||
continue;
|
||||
|
||||
departmentPrototype = department;
|
||||
return true;
|
||||
}
|
||||
|
||||
departmentPrototype = null;
|
||||
|
||||
@@ -5,4 +5,7 @@ public sealed partial class KnockdownOnCollideComponent : Component
|
||||
{
|
||||
[DataField]
|
||||
public float BlurTime = 20f;
|
||||
|
||||
[DataField]
|
||||
public bool UseBlur;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ using Content.Shared.Eye.Blinding.Components;
|
||||
using Content.Shared.Projectiles;
|
||||
using Content.Shared.Standing.Systems;
|
||||
using Content.Shared.StatusEffect;
|
||||
using Content.Shared.Throwing;
|
||||
|
||||
namespace Content.Shared._White.Knockdown;
|
||||
|
||||
@@ -15,16 +16,24 @@ public sealed class KnockdownOnCollideSystem : EntitySystem
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<KnockdownOnCollideComponent, ProjectileHitEvent>(OnProjectileHit);
|
||||
SubscribeLocalEvent<KnockdownOnCollideComponent, ThrowDoHitEvent>(OnEntityHit);
|
||||
}
|
||||
|
||||
private void OnEntityHit(Entity<KnockdownOnCollideComponent> ent, ref ThrowDoHitEvent args)
|
||||
{
|
||||
ApplyEffects(args.Target, ent.Comp);
|
||||
}
|
||||
|
||||
private void OnProjectileHit(Entity<KnockdownOnCollideComponent> ent, ref ProjectileHitEvent args)
|
||||
{
|
||||
_standing.TryLieDown(args.Target, null, SharedStandingStateSystem.DropHeldItemsBehavior.AlwaysDrop);
|
||||
ApplyEffects(args.Target, ent.Comp);
|
||||
}
|
||||
|
||||
if (ent.Comp.BlurTime <= 0f)
|
||||
return;
|
||||
private void ApplyEffects(EntityUid target, KnockdownOnCollideComponent component)
|
||||
{
|
||||
_standing.TryLieDown(target, null, SharedStandingStateSystem.DropHeldItemsBehavior.AlwaysDrop);
|
||||
|
||||
_statusEffects.TryAddStatusEffect<BlurryVisionComponent>(args.Target, "BlurryVision",
|
||||
TimeSpan.FromSeconds(ent.Comp.BlurTime), true);
|
||||
if (component.UseBlur)
|
||||
_statusEffects.TryAddStatusEffect<BlurryVisionComponent>(target, "BlurryVision", TimeSpan.FromSeconds(component.BlurTime), true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user