diff --git a/Content.Client/Overlays/StencilOverlay.Weather.cs b/Content.Client/Overlays/StencilOverlay.Weather.cs index bc51454803..f709b06f04 100644 --- a/Content.Client/Overlays/StencilOverlay.Weather.cs +++ b/Content.Client/Overlays/StencilOverlay.Weather.cs @@ -60,7 +60,7 @@ public sealed partial class StencilOverlay // Draw the rain worldHandle.UseShader(_protoManager.Index("StencilDraw").Instance()); - _parallax.DrawParallax(worldHandle, worldAABB, sprite, curTime, position, Vector2.Zero, modulate: (weatherProto.Color ?? Color.White).WithAlpha(alpha)); + _parallax.DrawParallax(worldHandle, worldAABB, sprite, curTime, position, weatherProto.OffsetSpeed, modulate: (weatherProto.Color ?? Color.White).WithAlpha(alpha*weatherProto.Alpha)); //CP14 alpha and offset scrolling worldHandle.SetTransform(Matrix3x2.Identity); worldHandle.UseShader(null); diff --git a/Content.Client/Overlays/StencilOverlay.cs b/Content.Client/Overlays/StencilOverlay.cs index 672da437dd..0df7b42b2b 100644 --- a/Content.Client/Overlays/StencilOverlay.cs +++ b/Content.Client/Overlays/StencilOverlay.cs @@ -57,13 +57,6 @@ public sealed partial class StencilOverlay : Overlay _blep = _clyde.CreateRenderTarget(args.Viewport.Size, new RenderTargetFormatParameters(RenderTargetColorFormat.Rgba8Srgb), name: "weather-stencil"); } - //CP14 Overlays - if (_entManager.TryGetComponent(mapUid, out var worldEdge)) - { - DrawWorldEdge(args, worldEdge, invMatrix); - } - //CP14 Overlays end - if (_entManager.TryGetComponent(mapUid, out var comp)) { foreach (var (proto, weather) in comp.Weather) @@ -81,6 +74,14 @@ public sealed partial class StencilOverlay : Overlay DrawRestrictedRange(args, restrictedRangeComponent, invMatrix); } + + //CP14 Overlays + if (_entManager.TryGetComponent(mapUid, out var worldEdge)) + { + DrawWorldEdge(args, worldEdge, invMatrix); + } + //CP14 Overlays end + //CP14 Overlays if (_entManager.TryGetComponent(mapUid, out var shadows)) { diff --git a/Content.Server/_CP14/WeatherControl/CP14WeatherControllerSystem.cs b/Content.Server/_CP14/WeatherControl/CP14WeatherControllerSystem.cs index ac3c8cac98..67f2d1b8ed 100644 --- a/Content.Server/_CP14/WeatherControl/CP14WeatherControllerSystem.cs +++ b/Content.Server/_CP14/WeatherControl/CP14WeatherControllerSystem.cs @@ -1,5 +1,3 @@ -using Content.Server.GameTicking; -using Content.Server.GameTicking.Events; using Content.Server.Weather; using Robust.Shared.Prototypes; using Robust.Shared.Random; @@ -11,7 +9,6 @@ public sealed class CP14WeatherControllerSystem : EntitySystem { [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly IGameTiming _timing = default!; - [Dependency] private readonly GameTicker _gameTicker = default!; [Dependency] private readonly WeatherSystem _weather = default!; [Dependency] private readonly IPrototypeManager _proto = default!; @@ -19,7 +16,7 @@ public sealed class CP14WeatherControllerSystem : EntitySystem { base.Initialize(); - SubscribeLocalEvent(OnRoundStart); + SubscribeLocalEvent(OnMapInit); } public override void Update(float frameTime) @@ -45,7 +42,7 @@ public sealed class CP14WeatherControllerSystem : EntitySystem } } - private void OnRoundStart(Entity ent, ref RoundStartingEvent args) + private void OnMapInit(Entity ent, ref MapInitEvent args) { ent.Comp.NextWeatherTime = _timing.CurTime + TimeSpan.FromSeconds(ent.Comp.ClearDuration.Next(_random)); } diff --git a/Content.Shared/Weather/WeatherPrototype.cs b/Content.Shared/Weather/WeatherPrototype.cs index 3803c37d4c..c8e7983446 100644 --- a/Content.Shared/Weather/WeatherPrototype.cs +++ b/Content.Shared/Weather/WeatherPrototype.cs @@ -1,3 +1,4 @@ +using System.Numerics; using Robust.Shared.Audio; using Robust.Shared.Prototypes; using Robust.Shared.Utility; @@ -20,4 +21,16 @@ public sealed partial class WeatherPrototype : IPrototype /// [ViewVariables(VVAccess.ReadWrite), DataField("sound")] public SoundSpecifier? Sound; + + /// + /// CP14 offset speed + /// + [DataField] + public Vector2 OffsetSpeed = Vector2.Zero; + + /// + /// CP14 alpha + /// + [DataField] + public float Alpha = 1f; } diff --git a/Resources/Prototypes/_CP14/weather.yml b/Resources/Prototypes/_CP14/weather.yml index 72def46aef..73c35b8638 100644 --- a/Resources/Prototypes/_CP14/weather.yml +++ b/Resources/Prototypes/_CP14/weather.yml @@ -19,3 +19,12 @@ params: loop: true volume: -6 + +- type: weather + id: CP14Mist + offsetSpeed: 0.04, 0.06 + color: "#a9c4bf" + alpha: 0.5 + sprite: + sprite: /Textures/_CP14/Effects/parallax.rsi + state: noise diff --git a/Resources/Textures/_CP14/Effects/parallax.rsi/meta.json b/Resources/Textures/_CP14/Effects/parallax.rsi/meta.json new file mode 100644 index 0000000000..738a460676 --- /dev/null +++ b/Resources/Textures/_CP14/Effects/parallax.rsi/meta.json @@ -0,0 +1,14 @@ +{ + "version": 1, + "copyright": "Generated", + "license": "CC-BY-SA-3.0", + "size": { + "x": 1000, + "y": 1000 + }, + "states": [ + { + "name": "noise" + } + ] +} \ No newline at end of file diff --git a/Resources/Textures/_CP14/Effects/parallax.rsi/noise.png b/Resources/Textures/_CP14/Effects/parallax.rsi/noise.png new file mode 100644 index 0000000000..b6541886f2 Binary files /dev/null and b/Resources/Textures/_CP14/Effects/parallax.rsi/noise.png differ