diff --git a/Content.Server/Explosion/EntitySystems/TriggerSystem.cs b/Content.Server/Explosion/EntitySystems/TriggerSystem.cs index b8d7389533..cc2baa47b3 100644 --- a/Content.Server/Explosion/EntitySystems/TriggerSystem.cs +++ b/Content.Server/Explosion/EntitySystems/TriggerSystem.cs @@ -153,7 +153,7 @@ namespace Content.Server.Explosion.EntitySystems private void HandleFlashTrigger(EntityUid uid, FlashOnTriggerComponent component, TriggerEvent args) { // TODO Make flash durations sane ffs. - _flashSystem.FlashArea(uid, args.User, component.Range, component.Duration * 1000f, probability: component.Probability, forceStun: component.ForceStun); // WD edit + _flashSystem.FlashArea(uid, args.User, component.Range, component.Duration * 1000f, probability: component.Probability, stunTime: component.StunTime, knockdownTime: component.KnockdownTime); // WD edit args.Handled = true; } diff --git a/Content.Server/Flash/FlashSystem.cs b/Content.Server/Flash/FlashSystem.cs index 13dfaca6bf..5d9d5ac0eb 100644 --- a/Content.Server/Flash/FlashSystem.cs +++ b/Content.Server/Flash/FlashSystem.cs @@ -158,7 +158,7 @@ namespace Content.Server.Flash } // WD edit - public void FlashArea(Entity source, EntityUid? user, float range, float duration, float slowTo = 0.8f, bool displayPopup = false, float probability = 1f, SoundSpecifier? sound = null, bool forceStun = false) + public void FlashArea(Entity source, EntityUid? user, float range, float duration, float slowTo = 0.8f, bool displayPopup = false, float probability = 1f, SoundSpecifier? sound = null, float stunTime = 0f, float knockdownTime = 0f) { var transform = Transform(source); var mapPosition = _transform.GetMapCoordinates(transform); @@ -202,8 +202,8 @@ namespace Content.Server.Flash var distance = (mapPosition.Position - _transform.GetMapCoordinates(entity).Position).Length(); - if (forceStun) // WD - _flashSoundSuppressionSystem.Stun(entity, duration, distance, range); + if (stunTime > 0f || knockdownTime > 0f) // WD + _flashSoundSuppressionSystem.Stun(entity, stunTime, knockdownTime, distance, range); } _audio.PlayPvs(sound, source, AudioParams.Default.WithVolume(1f).WithMaxDistance(3f)); diff --git a/Content.Shared/Alert/AlertType.cs b/Content.Shared/Alert/AlertType.cs index 51c038d136..c163efb405 100644 --- a/Content.Shared/Alert/AlertType.cs +++ b/Content.Shared/Alert/AlertType.cs @@ -38,8 +38,9 @@ namespace Content.Shared.Alert VeryGood, VeryVeryGood, MoodDead, - //WD end CultBuffed, + Knockdown, + //WD end PilotingShuttle, Peckish, Starving, diff --git a/Content.Shared/Changeling/SharedTentacleGun.cs b/Content.Shared/Changeling/SharedTentacleGun.cs index 98324a59ad..113bd3abdc 100644 --- a/Content.Shared/Changeling/SharedTentacleGun.cs +++ b/Content.Shared/Changeling/SharedTentacleGun.cs @@ -4,6 +4,7 @@ using Content.Shared.Humanoid; using Content.Shared.Mobs.Components; using Content.Shared.Physics; using Content.Shared.Projectiles; +using Content.Shared.Standing; using Content.Shared.Standing.Systems; using Content.Shared.Stunnable; using Content.Shared.Throwing; @@ -30,6 +31,7 @@ public abstract class SharedTentacleGun : EntitySystem [Dependency] private readonly ITimerManager _timerManager = default!; [Dependency] private readonly SharedStandingStateSystem _standing = default!; [Dependency] private readonly SharedHandsSystem _handsSystem = default!; + [Dependency] private readonly SharedStunSystem _stun = default!; public override void Initialize() { @@ -111,7 +113,7 @@ public abstract class SharedTentacleGun : EntitySystem return; } - if (!HasComp(args.Embedded)) + if (!TryComp(args.Embedded, out var standing) || !standing.CanLieDown) { DeleteProjectile(uid); return; @@ -156,6 +158,7 @@ public abstract class SharedTentacleGun : EntitySystem private bool PullMob(ProjectileEmbedEvent args) { _standing.TryLieDown(args.Embedded); + _stun.TryKnockdown(args.Embedded, TimeSpan.FromSeconds(4), true); _throwingSystem.TryThrow(args.Embedded, Transform(args.Shooter!.Value).Coordinates, 5f); diff --git a/Content.Shared/Flash/Components/FlashOnTriggerComponent.cs b/Content.Shared/Flash/Components/FlashOnTriggerComponent.cs index 3f174db29d..bef8d2c3ea 100644 --- a/Content.Shared/Flash/Components/FlashOnTriggerComponent.cs +++ b/Content.Shared/Flash/Components/FlashOnTriggerComponent.cs @@ -10,5 +10,6 @@ public sealed partial class FlashOnTriggerComponent : Component [DataField] public float Range = 1.0f; [DataField] public float Duration = 8.0f; [DataField] public float Probability = 1.0f; - [DataField] public bool ForceStun; // WD + [DataField] public float StunTime; // WD + [DataField] public float KnockdownTime; // WD } diff --git a/Content.Shared/Standing/Systems/SharedStandingStateSystem.cs b/Content.Shared/Standing/Systems/SharedStandingStateSystem.cs index de8b9f0cca..17cb0bdb5a 100644 --- a/Content.Shared/Standing/Systems/SharedStandingStateSystem.cs +++ b/Content.Shared/Standing/Systems/SharedStandingStateSystem.cs @@ -11,6 +11,7 @@ using Content.Shared._White.Wizard.Timestop; using Content.Shared.Buckle; using Content.Shared.Buckle.Components; using Content.Shared.Mobs; +using Content.Shared.Movement.Events; using Robust.Shared.Audio.Systems; using Robust.Shared.Input.Binding; using Robust.Shared.Physics; @@ -52,6 +53,7 @@ public abstract partial class SharedStandingStateSystem : EntitySystem SubscribeLocalEvent(OnStandingUpDoAfter); SubscribeLocalEvent(OnRefreshMovementSpeed); + SubscribeLocalEvent(OnTileFriction); SubscribeLocalEvent(OnSlipAttempt); InitializeColliding(); @@ -98,12 +100,9 @@ public abstract partial class SharedStandingStateSystem : EntitySystem private void OnStandingUpDoAfter(EntityUid uid, StandingStateComponent component, StandingUpDoAfterEvent args) { - if (args.Handled || _stun.IsParalyzed(uid)) // WD EDIT - { + if (args.Handled || args.Cancelled || HasComp(uid) || + _mobState.IsIncapacitated(uid) || !Stand(uid)) // WD EDIT component.CurrentState = StandingState.Lying; - return; - } - Stand(uid); } private void OnRefreshMovementSpeed(EntityUid uid, StandingStateComponent component, @@ -115,6 +114,12 @@ public abstract partial class SharedStandingStateSystem : EntitySystem args.ModifySpeed(1f, 1f); } + private void OnTileFriction(Entity ent, ref TileFrictionEvent args) + { + if (IsDown(ent)) + args.Modifier *= SharedStunSystem.KnockDownModifier; + } + private void OnSlipAttempt(EntityUid uid, StandingStateComponent component, SlipAttemptEvent args) { if (IsDown(uid)) @@ -217,6 +222,9 @@ public abstract partial class SharedStandingStateSystem : EntitySystem if (TryComp(uid, out BuckleComponent? buckle) && buckle.Buckled && !_buckle.TryUnbuckle(uid, uid, buckleComp: buckle)) // WD EDIT return false; + if (standingState.CurrentState is StandingState.Lying or StandingState.GettingUp) + return true; + // This is just to avoid most callers doing this manually saving boilerplate // 99% of the time you'll want to drop items but in some scenarios (e.g. buckling) you don't want to. // We do this BEFORE downing because something like buckle may be blocking downing but we want to drop hand items anyway @@ -226,9 +234,6 @@ public abstract partial class SharedStandingStateSystem : EntitySystem RaiseLocalEvent(uid, new DropHandItemsEvent()); } - if (standingState.CurrentState is StandingState.Lying or StandingState.GettingUp) - return true; - var msg = new DownAttemptEvent(); RaiseLocalEvent(uid, msg); diff --git a/Content.Shared/Stunnable/SharedStunSystem.cs b/Content.Shared/Stunnable/SharedStunSystem.cs index 56d2b796e2..4f4df8bc61 100644 --- a/Content.Shared/Stunnable/SharedStunSystem.cs +++ b/Content.Shared/Stunnable/SharedStunSystem.cs @@ -52,7 +52,7 @@ public abstract class SharedStunSystem : EntitySystem SubscribeLocalEvent(OnInteractHand); SubscribeLocalEvent(OnRefreshMovespeed); - SubscribeLocalEvent(OnKnockedTileFriction); + //SubscribeLocalEvent(OnKnockedTileFriction); // Attempt event subscriptions. SubscribeLocalEvent(OnAttempt); @@ -260,10 +260,10 @@ public abstract class SharedStunSystem : EntitySystem args.Handled = true; } - private void OnKnockedTileFriction(EntityUid uid, KnockedDownComponent component, ref TileFrictionEvent args) + /*private void OnKnockedTileFriction(EntityUid uid, KnockedDownComponent component, ref TileFrictionEvent args) { args.Modifier *= KnockDownModifier; - } + }*/ //WD EDIT START public bool IsParalyzed(EntityUid uid) diff --git a/Content.Shared/_White/BuffedFlashGrenade/FlashSoundSuppressionSystem.cs b/Content.Shared/_White/BuffedFlashGrenade/FlashSoundSuppressionSystem.cs index 354c7b3352..a60cde55be 100644 --- a/Content.Shared/_White/BuffedFlashGrenade/FlashSoundSuppressionSystem.cs +++ b/Content.Shared/_White/BuffedFlashGrenade/FlashSoundSuppressionSystem.cs @@ -21,7 +21,7 @@ public sealed class FlashSoundSuppressionSystem : EntitySystem args.Args.MaxRange = MathF.Min(args.Args.MaxRange, ent.Comp.MaxRange); } - public void Stun(EntityUid target, float duration, float distance, float range) + public void Stun(EntityUid target, float stunDuration, float knockdownDuration, float distance, float range) { if (TryComp(target, out var suppression)) range = MathF.Min(range, suppression.MaxRange); @@ -38,11 +38,13 @@ public sealed class FlashSoundSuppressionSystem : EntitySystem if (distance > range) return; - var stunTime = float.Lerp(duration, 0f, distance / range); - if (stunTime <= 0f) - return; + var knockdownTime = float.Lerp(knockdownDuration, 0f, distance / range); + if (knockdownTime > 0f) + _stunSystem.TryKnockdown(target, TimeSpan.FromSeconds(knockdownTime), true); - _stunSystem.TryParalyze(target, TimeSpan.FromSeconds(stunTime / 1000f), true); + var stunTime = float.Lerp(stunDuration, 0f, distance / range); + if (stunTime > 0f) + _stunSystem.TryStun(target, TimeSpan.FromSeconds(stunTime), true); } } diff --git a/Resources/Locale/ru-RU/_white/white-shit.ftl b/Resources/Locale/ru-RU/_white/white-shit.ftl index bde173579e..2ff64f81d9 100644 --- a/Resources/Locale/ru-RU/_white/white-shit.ftl +++ b/Resources/Locale/ru-RU/_white/white-shit.ftl @@ -14,3 +14,6 @@ action-name-insert-other = Засунуть внутрь. action-start-insert-self = Вы начинаете залазить в {$storage}. action-start-insert-other = {$user} начинает засовывать вас в {$storage}. carry-start = { $carrier } пытается взять вас на руки! + +alerts-knockdown-name = Лежу +alerts-knockdown-desc = Не могу встать. diff --git a/Resources/Prototypes/Alerts/alerts.yml b/Resources/Prototypes/Alerts/alerts.yml index c52fd3a78c..85789a002f 100644 --- a/Resources/Prototypes/Alerts/alerts.yml +++ b/Resources/Prototypes/Alerts/alerts.yml @@ -19,6 +19,7 @@ - category: Piloting - alertType: Corporeal - alertType: Stun + - alertType: Knockdown - category: Breathing # Vox gang not calling this oxygen - category: Pressure - alertType: Bleed @@ -479,12 +480,20 @@ name: Debug6 description: Debug +# WD-EDIT - type: alert id: CultBuffed icons: [ /Textures/Interface/Alerts/buff.png ] name: alerts-cult-buff-name description: alerts-cult-buff-desc +# WD-EDIT +- type: alert + id: Knockdown + icons: [ /Textures/White/Interface/Alerts/knockdown.png ] + name: alerts-knockdown-name + description: alerts-knockdown-desc + # WD-EDIT - type: alert id: Bleeding diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml index f79e9222fe..7af6f1c865 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml @@ -756,7 +756,8 @@ - state: grenade - type: FlashOnTrigger range: 7 - forceStun: true # WD EDIT + stunTime: 2 # WD + knockdownTime: 20 # WD - type: SpawnOnTrigger proto: GrenadeFlashEffect - type: ActiveTimerTrigger diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml index 325ee3f8d5..2823152405 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml @@ -67,7 +67,8 @@ sprite: Objects/Weapons/Grenades/flashbang.rsi - type: FlashOnTrigger range: 7 - forceStun: true # WD + stunTime: 2 # WD + knockdownTime: 20 # WD - type: SoundOnTrigger sound: path: "/Audio/Effects/flash_bang.ogg" diff --git a/Resources/Prototypes/_White/Entities/Objects/Weapons/Guns/Projectiles/shinanogrenades.yml b/Resources/Prototypes/_White/Entities/Objects/Weapons/Guns/Projectiles/shinanogrenades.yml index 613c588ab3..0cda7a6807 100644 --- a/Resources/Prototypes/_White/Entities/Objects/Weapons/Guns/Projectiles/shinanogrenades.yml +++ b/Resources/Prototypes/_White/Entities/Objects/Weapons/Guns/Projectiles/shinanogrenades.yml @@ -40,7 +40,8 @@ - state: grenade - type: FlashOnTrigger range: 5 - forceStun: true + stunTime: 2 # WD + knockdownTime: 20 # WD - type: SpawnOnTrigger proto: GrenadeFlashEffect - type: DeleteOnTrigger diff --git a/Resources/Prototypes/status_effects.yml b/Resources/Prototypes/status_effects.yml index 7249cef390..710c82a69d 100644 --- a/Resources/Prototypes/status_effects.yml +++ b/Resources/Prototypes/status_effects.yml @@ -7,7 +7,7 @@ - type: statusEffect id: KnockedDown - alert: Stun + alert: Knockdown - type: statusEffect id: SlowedDown diff --git a/Resources/Textures/White/Interface/Alerts/knockdown.png b/Resources/Textures/White/Interface/Alerts/knockdown.png new file mode 100644 index 0000000000..dcefa1f58d Binary files /dev/null and b/Resources/Textures/White/Interface/Alerts/knockdown.png differ