Files
tbd-station-14/Content.Shared/Flash/SharedFlashableComponent.cs
Vera Aguilera Puerto 77fe21eb0d Refactors flashes to ECS, sunglasses protect you from being flashed. (#4579)
* Refactors flashes to ECS, sunglasses protect you from being flashed.

* VV ReadWrite for FlashImmunity Enabled.

* Use cached IEntityLookup.

* Consistent formatting.

* Fix flashbang duration.
Flash duration is a mess.

* Small area flash code cleanup.

* Flashable state is only sent to attached player.
2021-09-10 00:20:41 +10:00

31 lines
794 B
C#

using System;
using Robust.Shared.Analyzers;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Flash
{
[NetworkedComponent, Friend(typeof(SharedFlashSystem))]
public abstract class SharedFlashableComponent : Component
{
public override string Name => "Flashable";
public float Duration { get; set; }
public TimeSpan LastFlash { get; set; }
}
[Serializable, NetSerializable]
public class FlashableComponentState : ComponentState
{
public float Duration { get; }
public TimeSpan Time { get; }
public FlashableComponentState(float duration, TimeSpan time)
{
Duration = duration;
Time = time;
}
}
}