Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 6 additions & 37 deletions Content.Client/Eye/EyeLerpingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ public override void Initialize()
UpdatesAfter.Add(typeof(TransformSystem));
UpdatesAfter.Add(typeof(Robust.Client.Physics.PhysicsSystem));
UpdatesBefore.Add(typeof(SharedEyeSystem));
// ES START
UpdatesBefore.Add(typeof(EyeSystem));
// ES END
UpdatesOutsidePrediction = true;
}

Expand Down Expand Up @@ -71,11 +68,6 @@ public void AddEye(EntityUid uid, EyeComponent? component = null, bool automatic
{
_eye.SetRotation(uid, lerpInfo.TargetRotation, component);
_eye.SetZoom(uid, lerpInfo.TargetZoom, component);

// Starlight begin - fix ES Screenshake triggering on spawn
if (TryComp<ContentEyeComponent>(uid, out var contentEye))
contentEye.BaseRotation = lerpInfo.TargetRotation;
// Starlight end
}
}

Expand Down Expand Up @@ -183,15 +175,9 @@ public override void FrameUpdate(float frameTime)
{
var tickFraction = (float) _gameTiming.TickFraction / ushort.MaxValue;
const double lerpMinimum = 0.00001;
// ES START
// add contenteye bc we only want to modify the fuckin base rotation
var query = AllEntityQuery<LerpingEyeComponent, EyeComponent, ContentEyeComponent, TransformComponent>();
// ES END

// ES START
// contenteye
while (query.MoveNext(out var entity, out var lerpInfo, out var eye, out var contentEye, out var xform))
// ES END
var query = AllEntityQuery<LerpingEyeComponent, EyeComponent, TransformComponent>();

while (query.MoveNext(out var entity, out var lerpInfo, out var eye, out var xform))
{
// Handle zoom
var zoomDiff = Vector2.Lerp(lerpInfo.LastZoom, lerpInfo.TargetZoom, tickFraction);
Expand All @@ -205,14 +191,6 @@ public override void FrameUpdate(float frameTime)
_eye.SetZoom(entity, zoomDiff, eye);
}

// ES START
// UHHHHHHHHHHHh
// shit is fucked idk
// we need to alter baserotation not regular eye rotation and also i added baserotation because uhh
// there was no good way to separate 'how the eye should be oriented because of the grid/turning/etc' and 'the eye rotating on top of that'
// had to add it
// ES END

// Handle Rotation
TryComp<InputMoverComponent>(entity, out var mover);

Expand All @@ -221,28 +199,19 @@ public override void FrameUpdate(float frameTime)

if (!NeedsLerp(mover))
{
// ES START
// contenteye
contentEye.BaseRotation = lerpInfo.TargetRotation;
// ES END
_eye.SetRotation(entity, lerpInfo.TargetRotation, eye);
continue;
}

var shortest = Angle.ShortestDistance(lerpInfo.LastRotation, lerpInfo.TargetRotation);

if (Math.Abs(shortest.Theta) < lerpMinimum)
{
// ES START
// contenteye
contentEye.BaseRotation = lerpInfo.TargetRotation;
// ES END
_eye.SetRotation(entity, lerpInfo.TargetRotation, eye);
continue;
}

// ES START
// contenteye
contentEye.BaseRotation = shortest * tickFraction + lerpInfo.LastRotation;
// ES END
_eye.SetRotation(entity, shortest * tickFraction + lerpInfo.LastRotation, eye);
}
}
}
6 changes: 0 additions & 6 deletions Content.Client/Movement/Systems/ContentEyeSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ public override void FrameUpdate(float frameTime)
while (eyeEntities.MoveNext(out var entity, out ContentEyeComponent? contentComponent, out EyeComponent? eyeComponent))
{
UpdateEyeOffset((entity, eyeComponent));
// ES START
UpdateEyeRotation((entity, eyeComponent));
// ES END
}
}

Expand All @@ -74,9 +71,6 @@ public override void Update(float frameTime)
while (eyeEntities.MoveNext(out var entity, out ContentEyeComponent? contentComponent, out EyeComponent? eyeComponent))
{
UpdateEyeOffset((entity, eyeComponent));
// ES START
UpdateEyeRotation((entity, eyeComponent));
// ES END
}
}
}
1 change: 0 additions & 1 deletion Content.Client/Options/UI/Tabs/AccessibilityTab.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<Label Text="{Loc 'ui-options-accessability-header-visuals'}"
StyleClasses="LabelKeyText"/>
<CheckBox Name="ReducedMotionCheckBox" Text="{Loc 'ui-options-reduced-motion'}" />
<CheckBox Name="DisableScreenshakeCheckBox" Text="{Loc 'ui-options-es-screen-shake-toggle'}" /> <!-- DeltaV - ES Screenshake Port -->
<CheckBox Name="EnableColorNameCheckBox" Text="{Loc 'ui-options-enable-color-name'}" />
<CheckBox Name="ColorblindFriendlyCheckBox" Text="{Loc 'ui-options-colorblind-friendly'}" />
<ui:OptionSlider Name="ScreenShakeIntensitySlider" Title="{Loc 'ui-options-screen-shake-intensity'}" />
Expand Down
2 changes: 0 additions & 2 deletions Content.Client/Options/UI/Tabs/AccessibilityTab.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Content.Shared._DV.CCVars; // DeltaV - ES Screenshake Port
using Content.Shared.CCVar;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
Expand All @@ -16,7 +15,6 @@ public AccessibilityTab()
Control.AddOptionCheckBox(CCVars.ChatEnableColorName, EnableColorNameCheckBox);
Control.AddOptionCheckBox(CCVars.AccessibilityColorblindFriendly, ColorblindFriendlyCheckBox);
Control.AddOptionCheckBox(CCVars.ReducedMotion, ReducedMotionCheckBox);
Control.AddOptionCheckBox(DCCVars.EsScreenshakeDisabled, DisableScreenshakeCheckBox); // DeltaV - ES Screenshake Port
Control.AddOptionPercentSlider(CCVars.ScreenShakeIntensity, ScreenShakeIntensitySlider);
Control.AddOptionPercentSlider(CCVars.ChatWindowOpacity, ChatWindowOpacitySlider);
Control.AddOptionPercentSlider(CCVars.SpeechBubbleTextOpacity, SpeechBubbleTextOpacitySlider);
Expand Down
5 changes: 1 addition & 4 deletions Content.Client/Weapons/Ranged/Systems/GunSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,7 @@ private void Recoil(EntityUid? user, Vector2 recoil, float recoilScalar)
if (!Timing.IsFirstTimePredicted || user == null || recoil == Vector2.Zero || recoilScalar == 0)
return;

// ES START
// reduce recoil even further
_recoil.KickCamera(user.Value, recoil.Normalized() * 0.13f * recoilScalar);
// ES END
_recoil.KickCamera(user.Value, recoil.Normalized() * 0.5f * recoilScalar);
}

protected override void Popup(string message, EntityUid? uid, EntityUid? user)
Expand Down
99 changes: 0 additions & 99 deletions Content.Client/_ES/ESScreenshakeSystem.cs

This file was deleted.

11 changes: 1 addition & 10 deletions Content.Server/Damage/Systems/DamageOtherOnHitSystem.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Content.Server.Administration.Logs;
using Content.Server.Weapons.Ranged.Systems;
using Content.Shared._ES.Camera; // ES - Screenshake
using Content.Shared.Camera;
using Content.Shared.Damage;
using Content.Shared.Damage.Components;
Expand All @@ -16,9 +15,6 @@ namespace Content.Server.Damage.Systems;

public sealed class DamageOtherOnHitSystem : SharedDamageOtherOnHitSystem
{
// ES START
[Dependency] private readonly SharedESScreenshakeSystem _shake = default!;
// ES END
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly GunSystem _guns = default!;
[Dependency] private readonly Shared.Damage.Systems.DamageableSystem _damageable = default!;
Expand Down Expand Up @@ -52,12 +48,7 @@ private void OnDoHit(EntityUid uid, DamageOtherOnHitComponent component, ThrowDo
if (TryComp<PhysicsComponent>(uid, out var body) && body.LinearVelocity.LengthSquared() > 0f)
{
var direction = body.LinearVelocity.Normalized();
// ES START
// lower recoil + shake
_sharedCameraRecoil.KickCamera(args.Target, direction * 0.1f);
var otherHitShake = new ESScreenshakeParameters() { Trauma = 0.35f, DecayRate = 1.4f, Frequency = 0.014f };
_shake.Screenshake(args.Target, otherHitShake, null);
// ES END
_sharedCameraRecoil.KickCamera(args.Target, direction);
}
}
}
16 changes: 1 addition & 15 deletions Content.Server/Explosion/EntitySystems/ExplosionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using Content.Server.NodeContainer.EntitySystems;
using Content.Server.NPC.Pathfinding;
using Content.Server.Station.Systems; // DeltaV - Admin QOL
using Content.Shared._ES.Camera; // ES - Screenshake
using Content.Shared.Atmos.Components;
using Content.Shared.Camera;
using Content.Shared.CCVar;
Expand Down Expand Up @@ -36,10 +35,6 @@ namespace Content.Server.Explosion.EntitySystems;

public sealed partial class ExplosionSystem : SharedExplosionSystem
{
// ES START
[Dependency] private readonly SharedESScreenshakeSystem _shake = default!;
// ES END

[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IRobustRandom _robustRandom = default!;
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!;
Expand Down Expand Up @@ -383,9 +378,7 @@ public void QueueExplosion(MapCoordinates epicenter,
var visualEnt = CreateExplosionVisualEntity(pos, queued.Proto.ID, spaceMatrix, spaceData, gridData.Values, iterationIntensity);

// camera shake
// ES START
// CameraShake(iterationIntensity.Count * 4f, pos, queued.TotalIntensity);
// ES END
CameraShake(iterationIntensity.Count * 4f, pos, queued.TotalIntensity);

//For whatever bloody reason, sound system requires ENTITY coordinates.
var mapEntityCoords = _transformSystem.ToCoordinates(_map.GetMap(pos.MapId), pos);
Expand Down Expand Up @@ -416,13 +409,6 @@ public void QueueExplosion(MapCoordinates epicenter,
? queued.Proto.SmallSoundFar
: queued.Proto.SoundFar;

// ES START
var farTranslationShake = iterationIntensity.Count < queued.Proto.SmallSoundIterationThreshold
? new ESScreenshakeParameters() { Trauma = 0.4f, DecayRate = 0.2f, Frequency = 0.014f }
: new ESScreenshakeParameters() { Trauma = 0.6f, DecayRate = 0.05f, Frequency = 0.014f };
_shake.Screenshake(filter, farTranslationShake, null);
// ES END

_audio.PlayGlobal(farSound, farFilter, true, farSound.Params);

return new Explosion(this,
Expand Down
11 changes: 1 addition & 10 deletions Content.Server/Projectiles/ProjectileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Content.Server.Destructible;
using Content.Server.Effects;
using Content.Server.Weapons.Ranged.Systems;
using Content.Shared._ES.Camera; // ES - Screenshake
using Content.Shared.Camera;
using Content.Shared.Damage;
using Content.Shared.Damage.Components;
Expand All @@ -18,9 +17,6 @@ namespace Content.Server.Projectiles;

public sealed class ProjectileSystem : SharedProjectileSystem
{
// ES START
[Dependency] private readonly SharedESScreenshakeSystem _shake = default!;
// ES END
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly ColorFlashEffectSystem _color = default!;
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
Expand Down Expand Up @@ -85,13 +81,8 @@ private void OnStartCollide(EntityUid uid, ProjectileComponent component, ref St
{
_guns.PlayImpactSound(target, damage, component.SoundHit, component.ForceSound);

// ES START
// shake + lower recoil
var otherShakeTranslation = new ESScreenshakeParameters() { Trauma = 0.45f, DecayRate = 1.1f, Frequency = 0.04f };
if (!args.OurBody.LinearVelocity.IsLengthZero())
_sharedCameraRecoil.KickCamera(target, args.OurBody.LinearVelocity.Normalized() * 0.08f);
_shake.Screenshake(target, otherShakeTranslation, null);
// ES END
_sharedCameraRecoil.KickCamera(target, args.OurBody.LinearVelocity.Normalized());
}

if (component.DeleteOnCollide && component.ProjectileSpent)
Expand Down
24 changes: 0 additions & 24 deletions Content.Shared/Gravity/SharedGravitySystem.Shake.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
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;

Expand Down Expand Up @@ -47,20 +37,6 @@ public void StartGridShake(EntityUid uid, GravityComponent? gravity = null)
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);
Expand Down
Loading
Loading