diff --git a/Content.Client/Overlays/ScreechShockWaveOverlay.cs b/Content.Client/Overlays/ScreechShockWaveOverlay.cs index affb7ce8bc..21b80c6e4b 100644 --- a/Content.Client/Overlays/ScreechShockWaveOverlay.cs +++ b/Content.Client/Overlays/ScreechShockWaveOverlay.cs @@ -119,6 +119,7 @@ public sealed partial class ScreechShockWaveOverlay : Overlay _shader.SetParameter("times", _times); _shader.SetParameter("count", _currentCount); _shader.SetParameter("SCREEN_TEXTURE", ScreenTexture); + _shader?.SetParameter("renderScale", args.Viewport.RenderScale * args.Viewport.Eye.Scale); // finally do the rendering var worldHandle = args.WorldHandle; diff --git a/Content.Client/Suicide/SuicideSystem.cs b/Content.Client/Suicide/SuicideSystem.cs new file mode 100644 index 0000000000..517180b651 --- /dev/null +++ b/Content.Client/Suicide/SuicideSystem.cs @@ -0,0 +1,5 @@ +using Content.Shared.Suicide; + +namespace Content.Client.Suicide; + +public sealed class SuicideSystem : SharedSuicideSystem; diff --git a/Content.Server/Chat/Commands/SuicideCommand.cs b/Content.Server/Chat/Commands/SuicideCommand.cs index 87557cb754..813fbf5b2e 100644 --- a/Content.Server/Chat/Commands/SuicideCommand.cs +++ b/Content.Server/Chat/Commands/SuicideCommand.cs @@ -1,7 +1,6 @@ -using Content.Server.GameTicking; using Content.Server.Popups; +using Content.Server.Suicide; using Content.Shared.Administration; -using Content.Shared.Chat; using Content.Shared.Mind; using Robust.Shared.Console; using Robust.Shared.Enums; diff --git a/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs b/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs index e2a16b2ebf..dd39f63716 100644 --- a/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs +++ b/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs @@ -1,45 +1,42 @@ +using System.Linq; using Content.Server.Administration.Logs; using Content.Server.Construction; -using Content.Server.Explosion.EntitySystems; +using Content.Server.Construction.Components; using Content.Server.DeviceLinking.Systems; +using Content.Server.Explosion.EntitySystems; using Content.Server.Hands.Systems; using Content.Server.Kitchen.Components; +using Content.Server.Lightning; using Content.Server.Power.Components; using Content.Server.Power.EntitySystems; using Content.Server.Temperature.Systems; -using Content.Shared.Chemistry.Components.SolutionManager; using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Chemistry.Reaction; using Content.Shared.Construction.EntitySystems; +using Content.Shared.Damage.Components; using Content.Shared.Database; -using Content.Shared.DeviceLinking.Events; using Content.Shared.Destructible; +using Content.Shared.DeviceLinking.Events; using Content.Shared.FixedPoint; +using Content.Shared.IdentityManagement; using Content.Shared.Interaction; using Content.Shared.Interaction.Events; -using Robust.Shared.Random; -using Robust.Shared.Audio; -using Content.Server.Lightning; using Content.Shared.Item; using Content.Shared.Kitchen; using Content.Shared.Kitchen.Components; using Content.Shared.Popups; using Content.Shared.Power; +using Content.Shared.Power.EntitySystems; +using Content.Shared.Stacks; +using Content.Shared.Suicide; using Content.Shared.Tag; using Robust.Server.GameObjects; +using Robust.Shared.Audio; using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; -using Robust.Shared.Player; -using System.Linq; using Robust.Shared.Prototypes; +using Robust.Shared.Random; using Robust.Shared.Timing; -using Content.Shared.Stacks; -using Content.Server.Construction.Components; -using Content.Shared.Chat; -using Content.Shared.Damage.Components; -using Content.Shared.Power.EntitySystems; -using Content.Shared.Temperature.Components; -using Content.Shared.IdentityManagement; namespace Content.Server.Kitchen.EntitySystems { diff --git a/Content.Server/Chat/SuicideSystem.cs b/Content.Server/Suicide/SuicideSystem.cs similarity index 95% rename from Content.Server/Chat/SuicideSystem.cs rename to Content.Server/Suicide/SuicideSystem.cs index b4f27b945f..936fa6ae89 100644 --- a/Content.Server/Chat/SuicideSystem.cs +++ b/Content.Server/Suicide/SuicideSystem.cs @@ -1,7 +1,6 @@ using Content.Server.Ghost; using Content.Server.Hands.Systems; using Content.Shared.Administration.Logs; -using Content.Shared.Chat; using Content.Shared.Damage.Components; using Content.Shared.Database; using Content.Shared.IdentityManagement; @@ -12,13 +11,14 @@ using Content.Shared.Mind.Components; using Content.Shared.Mobs.Components; using Content.Shared.Mobs.Systems; using Content.Shared.Popups; +using Content.Shared.Suicide; using Content.Shared.Tag; using Robust.Shared.Player; using Robust.Shared.Prototypes; -namespace Content.Server.Chat; +namespace Content.Server.Suicide; -public sealed partial class SuicideSystem : EntitySystem +public sealed partial class SuicideSystem : SharedSuicideSystem { [Dependency] private EntityLookupSystem _entityLookupSystem = default!; [Dependency] private ISharedAdminLogManager _adminLogger = default!; @@ -27,7 +27,6 @@ public sealed partial class SuicideSystem : EntitySystem [Dependency] private MobStateSystem _mobState = default!; [Dependency] private SharedPopupSystem _popup = default!; [Dependency] private GhostSystem _ghostSystem = default!; - [Dependency] private SharedSuicideSystem _suicide = default!; [Dependency] private EntityQuery _itemQuery = default!; private static readonly ProtoId CannotSuicideTag = "CannotSuicide"; @@ -83,6 +82,7 @@ public sealed partial class SuicideSystem : EntitySystem { _adminLogger.Add(LogType.Mind, $"{ToPrettyString(victim):player} suicided."); } + return true; } @@ -162,13 +162,13 @@ public sealed partial class SuicideSystem : EntitySystem if (args.DamageSpecifier != null) { - _suicide.ApplyLethalDamage(victim, args.DamageSpecifier); + ApplyLethalDamage(victim, args.DamageSpecifier); args.Handled = true; return; } args.DamageType ??= "Bloodloss"; - _suicide.ApplyLethalDamage(victim, args.DamageType); + ApplyLethalDamage(victim, args.DamageType); args.Handled = true; } } diff --git a/Content.Shared/Execution/SharedExecutionSystem.cs b/Content.Shared/Execution/SharedExecutionSystem.cs index 17c44cf430..e1ca1a0268 100644 --- a/Content.Shared/Execution/SharedExecutionSystem.cs +++ b/Content.Shared/Execution/SharedExecutionSystem.cs @@ -1,17 +1,17 @@ using Content.Shared.ActionBlocker; -using Content.Shared.Chat; using Content.Shared.CombatMode; using Content.Shared.Damage.Components; using Content.Shared.Database; using Content.Shared.DoAfter; using Content.Shared.IdentityManagement; +using Content.Shared.Interaction.Events; using Content.Shared.Mobs.Components; using Content.Shared.Mobs.Systems; using Content.Shared.Popups; +using Content.Shared.Suicide; using Content.Shared.Verbs; using Content.Shared.Weapons.Melee; using Content.Shared.Weapons.Melee.Events; -using Content.Shared.Interaction.Events; using Robust.Shared.Audio.Systems; namespace Content.Shared.Execution; diff --git a/Content.Shared/Chat/SharedSuicideSystem.cs b/Content.Shared/Suicide/SharedSuicideSystem.cs similarity index 97% rename from Content.Shared/Chat/SharedSuicideSystem.cs rename to Content.Shared/Suicide/SharedSuicideSystem.cs index 01f88d9276..c7e7206f0d 100644 --- a/Content.Shared/Chat/SharedSuicideSystem.cs +++ b/Content.Shared/Suicide/SharedSuicideSystem.cs @@ -6,9 +6,9 @@ using Content.Shared.Damage.Systems; using Content.Shared.Mobs.Components; using Robust.Shared.Prototypes; -namespace Content.Shared.Chat; +namespace Content.Shared.Suicide; -public sealed partial class SharedSuicideSystem : EntitySystem +public abstract partial class SharedSuicideSystem : EntitySystem { private static readonly ProtoId FallbackDamageType = "Blunt"; diff --git a/Resources/Textures/Shaders/screech_shock_wave.swsl b/Resources/Textures/Shaders/screech_shock_wave.swsl index 086f78d3e7..2447fb779a 100644 --- a/Resources/Textures/Shaders/screech_shock_wave.swsl +++ b/Resources/Textures/Shaders/screech_shock_wave.swsl @@ -5,9 +5,11 @@ uniform highp float[10] waveSpeeds; uniform highp float[10] downScales; uniform highp float[10] fades; uniform highp float[10] times; + // variables that are the same for everyone uniform lowp int count; uniform sampler2D SCREEN_TEXTURE; +uniform highp vec2 renderScale; void fragment() { @@ -24,8 +26,8 @@ void fragment() WaveCentre.y *= ratio; // calculate the distortion itself - highp float dist = distance(vec2(st.x, st.y * ratio), WaveCentre) * downScales[i]; - highp vec2 delta = vec2(st.x, st.y * ratio) - WaveCentre; + highp float dist = distance(vec2(st.x, st.y * ratio) / renderScale, WaveCentre / renderScale) * downScales[i]; + highp vec2 delta = (vec2(st.x, st.y * ratio) - WaveCentre) / renderScale; highp float angle = atan(delta.y/delta.x); highp float sinf = sin(angle*60.0)/80.0; diff --git a/Resources/Textures/Shaders/singularity.swsl b/Resources/Textures/Shaders/singularity.swsl index 609a4b3b10..7ea9501859 100644 --- a/Resources/Textures/Shaders/singularity.swsl +++ b/Resources/Textures/Shaders/singularity.swsl @@ -8,7 +8,7 @@ uniform lowp int count; uniform highp float[5] falloffPower; uniform highp float[5] intensity; uniform highp vec2[5] position; -// the `5`s in the array lengths correspond to the upper limit on the simultaneous distortion sources that can be present on screen at a time. +// the `5`s in the array lengths correspond to the upper limit on the simultaneous distortion sources that can be present on screen at a time. // If you want to change this, make sure to change all of them here, in the for loop, and, in whatever overlay assigns the uniforms // (apparently #define is an unknown preprocessor directive) @@ -18,28 +18,28 @@ void fragment() { highp vec2 delta; highp float distance; highp float deformation; - + for (int i = 0; i < 5 && i < count; i++) { - + delta = FRAGCOORD.xy - position[i]; distance = length(delta / renderScale); deformation = intensity[i] / pow(distance, falloffPower[i]); - + // ensure deformation goes to zero at max distance // avoids long-range single-pixel shifts that are noticeable when leaving PVS. - + if (distance >= maxDistance) { deformation = 0.0; } else { deformation *= (1.0 - pow(distance/maxDistance, 4.0)); } - + if(deformation > 0.8) deformation = pow(deformation, 0.3); finalCoords -= deformation * delta; } - + COLOR = zTextureSpec(SCREEN_TEXTURE, finalCoords*SCREEN_PIXEL_SIZE ); }