feat: Fancy Screenshake from Ephemeral Space (#5503)

* cherry-pick: Screenshake (EphemeralSpace/ephemeral-space#627)

* commit your shit at some point maybe

* y

* who knows

* rename?

* debugging  + shit api

* i hope no one fucks my ass

* erm

* p

* replace with shit that makes way more sense

* stuff

* pretty sure this is just fine

* actual fix noise shit

* uhhh hmaybe if i feel like it wrong then later

* explosion shake

* grav shake

* gun shake

* idk

* projectile melee

Co-authored-by: DisposableCrewmember42 <disposablecrewmember42@proton.me>

* tweak: tune recoil on weapons

* docs: add _ES license info to LEGAL.md

* fix: screenshake on spawn fix from ss14Starlight/space-station-14#3664

Co-authored-by: neomoth <69372252+neomoth@users.noreply.github.com>

* feat: add client cvar to disable screenshake

* feat: add screenshake toggle to accessibility settings

* fix: upmerge compatibility

* docs: properly document cvar

* docs: add missing import comments

---------

Co-authored-by: mirrorcult <mirrorcult@pm.me>
Co-authored-by: neomoth <69372252+neomoth@users.noreply.github.com>
This commit is contained in:
DisposableCrewmember42
2026-05-15 23:32:40 +02:00
committed by GitHub
co-authored by neomoth mirrorcult
parent 3a05ef885c
commit 9146c59ecf
27 changed files with 569 additions and 11 deletions
@@ -1,7 +1,17 @@
using Content.Shared._ES.Camera; // ES
using Content.Shared.GameTicking; // ES
using Robust.Shared.Player; // ES
using Robust.Shared.Timing; // ES
namespace Content.Shared.Gravity;
public abstract partial class SharedGravitySystem
{
// ES START
[Dependency] private readonly SharedGameTicker _ticker = default!;
[Dependency] private readonly SharedESScreenshakeSystem _shake = default!;
// ES END
protected const float GravityKick = 100.0f;
protected const float ShakeCooldown = 0.2f;
@@ -37,6 +47,20 @@ public abstract partial class SharedGravitySystem
if (!Resolve(uid, ref gravity, false))
return;
// ES START
// do not shake grid if the round just started
// i did not want to have to think this logic through more. this is the simplest solution i could think of
if (Timing.CurTime - _ticker.RoundStartTimeSpan < TimeSpan.FromSeconds(30))
return;
// ES SCREENSHAKE LOGIC
// instead of poopass camera kick
var translation = new ESScreenshakeParameters() { Trauma = 0.8f, DecayRate = 0.04f, Frequency = 0.015f };
var filter = Filter.BroadcastGrid(uid);
_shake.Screenshake(filter, translation, null);
return;
// ES END
if (!TryComp<GravityShakeComponent>(uid, out var shake))
{
shake = AddComp<GravityShakeComponent>(uid);