Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Jabak
2024-06-18 22:37:29 +03:00
40 changed files with 553 additions and 137 deletions

View File

@@ -1,5 +1,6 @@
using System.Diagnostics.CodeAnalysis;
using System.Numerics;
using Content.Shared._White.Events;
using Content.Shared._White.WeaponModules;
using Content.Shared.ActionBlocker;
using Content.Shared.Actions;
@@ -353,6 +354,7 @@ public abstract partial class SharedGunSystem : EntitySystem
return;
}
RaiseLocalEvent(user, new EnergyDomeClothesTurnOffEvent()); // WD
// Shoot confirmed - sounds also played here in case it's invalid (e.g. cartridge already spent).
Shoot(gunUid, gun, ev.Ammo, fromCoordinates, toCoordinates.Value, out var userImpulse, user, throwItems: attemptEv.ThrowItems);
var shotEv = new GunShotEvent(user, ev.Ammo);

View File

@@ -0,0 +1,8 @@
namespace Content.Shared._White.Knockdown;
[RegisterComponent]
public sealed partial class KnockdownOnCollideComponent : Component
{
[DataField]
public float BlurTime = 20f;
}

View File

@@ -0,0 +1,30 @@
using Content.Shared.Eye.Blinding.Components;
using Content.Shared.Projectiles;
using Content.Shared.Standing.Systems;
using Content.Shared.StatusEffect;
namespace Content.Shared._White.Knockdown;
public sealed class KnockdownOnCollideSystem : EntitySystem
{
[Dependency] private readonly SharedStandingStateSystem _standing = default!;
[Dependency] private readonly StatusEffectsSystem _statusEffects = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<KnockdownOnCollideComponent, ProjectileHitEvent>(OnProjectileHit);
}
private void OnProjectileHit(Entity<KnockdownOnCollideComponent> ent, ref ProjectileHitEvent args)
{
_standing.TryLieDown(args.Target, null, true);
if (ent.Comp.BlurTime <= 0f)
return;
_statusEffects.TryAddStatusEffect<BlurryVisionComponent>(args.Target, "BlurryVision",
TimeSpan.FromSeconds(ent.Comp.BlurTime), true);
}
}

View File

@@ -178,4 +178,10 @@ public sealed partial class TeleportSpellEvent : InstantActionEvent, ISpeakSpell
public string? Speech { get; private set; }
}
public sealed partial class MindswapSpellEvent : EntityTargetActionEvent, ISpeakSpell
{
[DataField("speech")]
public string? Speech { get; private set; }
}
#endregion