Files
crystall-punk-14/Content.Shared/Light/Components/SunShadowCycleComponent.cs
Ed 1867903c46 Planetarization (#1040)
* tiers to level demiplanes

* Update demiplane_keys.yml

* demiplane on planets

* migrate to wizden dayCycle + planetarize Comoss

* Update comoss_d.yml

* Update audio_music.yml

* Update dev_map.yml

* add shadows to demiplanes

* remove outdated systems

* fix silvas

* silva fix

* Update factoria.yml

* Update island.yml
2025-03-19 12:52:37 +03:00

36 lines
1.2 KiB
C#

using System.Linq;
using System.Numerics;
using Robust.Shared.GameStates;
namespace Content.Shared.Light.Components;
/// <summary>
/// Applies <see cref="SunShadowComponent"/> direction vectors based on a time-offset. Will track <see cref="LightCycleComponent"/> on on MapInit
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class SunShadowCycleComponent : Component
{
/// <summary>
/// How long an entire cycle lasts
/// </summary>
[DataField, AutoNetworkedField]
public TimeSpan Duration = TimeSpan.FromMinutes(30);
[DataField, AutoNetworkedField]
public TimeSpan Offset;
// Originally had this as ratios but it was slightly annoying to use.
/// <summary>
/// Time to have each direction applied. Will lerp from the current value to the next one.
/// </summary>
[AutoNetworkedField] //CP14 Remove DataField
public List<(float Ratio, Vector2 Direction, float Alpha)> Directions = new()
{
(0f, new Vector2(0f, 3f), 0f),
(0.25f, new Vector2(-3f, -0.1f), 0.5f),
(0.5f, new Vector2(0f, -3f), 0.8f),
(0.75f, new Vector2(3f, -0.1f), 0.5f),
};
}