mist weather
This commit is contained in:
@@ -60,7 +60,7 @@ public sealed partial class StencilOverlay
|
||||
|
||||
// Draw the rain
|
||||
worldHandle.UseShader(_protoManager.Index<ShaderPrototype>("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);
|
||||
|
||||
@@ -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<CP14WorldEdgeComponent>(mapUid, out var worldEdge))
|
||||
{
|
||||
DrawWorldEdge(args, worldEdge, invMatrix);
|
||||
}
|
||||
//CP14 Overlays end
|
||||
|
||||
if (_entManager.TryGetComponent<WeatherComponent>(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<CP14WorldEdgeComponent>(mapUid, out var worldEdge))
|
||||
{
|
||||
DrawWorldEdge(args, worldEdge, invMatrix);
|
||||
}
|
||||
//CP14 Overlays end
|
||||
|
||||
//CP14 Overlays
|
||||
if (_entManager.TryGetComponent<CP14CloudShadowsComponent>(mapUid, out var shadows))
|
||||
{
|
||||
|
||||
@@ -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<CP14WeatherControllerComponent, RoundStartingEvent>(OnRoundStart);
|
||||
SubscribeLocalEvent<CP14WeatherControllerComponent, MapInitEvent>(OnMapInit);
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
@@ -45,7 +42,7 @@ public sealed class CP14WeatherControllerSystem : EntitySystem
|
||||
}
|
||||
}
|
||||
|
||||
private void OnRoundStart(Entity<CP14WeatherControllerComponent> ent, ref RoundStartingEvent args)
|
||||
private void OnMapInit(Entity<CP14WeatherControllerComponent> ent, ref MapInitEvent args)
|
||||
{
|
||||
ent.Comp.NextWeatherTime = _timing.CurTime + TimeSpan.FromSeconds(ent.Comp.ClearDuration.Next(_random));
|
||||
}
|
||||
|
||||
@@ -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
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("sound")]
|
||||
public SoundSpecifier? Sound;
|
||||
|
||||
/// <summary>
|
||||
/// CP14 offset speed
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public Vector2 OffsetSpeed = Vector2.Zero;
|
||||
|
||||
/// <summary>
|
||||
/// CP14 alpha
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public float Alpha = 1f;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
14
Resources/Textures/_CP14/Effects/parallax.rsi/meta.json
Normal file
14
Resources/Textures/_CP14/Effects/parallax.rsi/meta.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"version": 1,
|
||||
"copyright": "Generated",
|
||||
"license": "CC-BY-SA-3.0",
|
||||
"size": {
|
||||
"x": 1000,
|
||||
"y": 1000
|
||||
},
|
||||
"states": [
|
||||
{
|
||||
"name": "noise"
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
Resources/Textures/_CP14/Effects/parallax.rsi/noise.png
Normal file
BIN
Resources/Textures/_CP14/Effects/parallax.rsi/noise.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 643 KiB |
Reference in New Issue
Block a user