Glowsticks, flares and lighting behaviours (#1886)

* Assets

* LightingBehaviours, flares, and such.

* More changes

* More changes, more flare work.

* More work on flares + light behaviours

* another refactor

* missed

* Light behaviours refactor, added sfx, improved graphics, improved lighting effects for glowstick and flare.

* remove unneeded value

* nullables

* remove old code

* nullable

* one last push

* net id

* more work

* more colors for glowsticks

* Adjust flare so it fades in

* fix name

* sprite fix
This commit is contained in:
nuke
2020-09-03 16:02:40 -04:00
committed by GitHub
parent 7991a97ec2
commit c3630b7301
30 changed files with 1682 additions and 0 deletions

View File

@@ -0,0 +1,39 @@

using Content.Shared.GameObjects.Components;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using System;
namespace Content.Client.GameObjects.Components
{
[UsedImplicitly]
public class ExpendableLightVisualizer : AppearanceVisualizer
{
public override void OnChangeData(AppearanceComponent component)
{
base.OnChangeData(component);
if (component.Deleted)
{
return;
}
if (component.TryGetData(ExpendableLightVisuals.State, out string lightBehaviourID))
{
if (component.Owner.TryGetComponent<LightBehaviourComponent>(out var lightBehaviour))
{
lightBehaviour.StopLightBehaviour();
if (lightBehaviourID != string.Empty)
{
lightBehaviour.StartLightBehaviour(lightBehaviourID);
}
else if (component.Owner.TryGetComponent<PointLightComponent>(out var light))
{
light.Enabled = false;
}
}
}
}
}
}