2023-07-24 14:07:35 +12:00
|
|
|
using Content.Shared.DeviceLinking;
|
2025-08-12 07:06:28 +10:00
|
|
|
using Content.Shared.Light.EntitySystems;
|
2022-07-29 14:13:12 +12:00
|
|
|
using Robust.Shared.Audio;
|
2022-11-16 20:22:11 +01:00
|
|
|
using Robust.Shared.Containers;
|
2025-08-12 07:06:28 +10:00
|
|
|
using Robust.Shared.GameStates;
|
2022-11-16 20:22:11 +01:00
|
|
|
using Robust.Shared.Prototypes;
|
2018-05-27 16:44:50 +02:00
|
|
|
|
2025-08-12 07:06:28 +10:00
|
|
|
namespace Content.Shared.Light.Components
|
2018-05-27 16:44:50 +02:00
|
|
|
{
|
2019-03-22 23:59:13 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Component that represents a wall light. It has a light bulb that can be replaced when broken.
|
|
|
|
|
/// </summary>
|
2025-08-12 07:06:28 +10:00
|
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause, Access(typeof(SharedPoweredLightSystem))]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class PoweredLightComponent : Component
|
2018-05-27 16:44:50 +02:00
|
|
|
{
|
2025-08-12 07:06:28 +10:00
|
|
|
/*
|
|
|
|
|
* Stop adding more fields, use components or I will shed you.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
[DataField]
|
2021-10-27 04:24:22 +03:00
|
|
|
public SoundSpecifier BurnHandSound = new SoundPathSpecifier("/Audio/Effects/lightburn.ogg");
|
2021-07-10 17:35:33 +02:00
|
|
|
|
2025-08-12 07:06:28 +10:00
|
|
|
[DataField]
|
2021-10-27 04:24:22 +03:00
|
|
|
public SoundSpecifier TurnOnSound = new SoundPathSpecifier("/Audio/Machines/light_tube_on.ogg");
|
2021-07-10 17:35:33 +02:00
|
|
|
|
2025-08-12 07:06:28 +10:00
|
|
|
// Should be using containerfill?
|
|
|
|
|
[DataField]
|
|
|
|
|
public EntProtoId? HasLampOnSpawn = null;
|
2020-02-22 17:39:00 -06:00
|
|
|
|
2021-10-27 04:24:22 +03:00
|
|
|
[DataField("bulb")]
|
|
|
|
|
public LightBulbType BulbType;
|
2021-03-05 01:08:38 +01:00
|
|
|
|
2025-08-12 07:06:28 +10:00
|
|
|
[DataField, AutoNetworkedField]
|
2021-10-27 04:24:22 +03:00
|
|
|
public bool On = true;
|
2021-03-05 01:08:38 +01:00
|
|
|
|
2025-08-12 07:06:28 +10:00
|
|
|
[DataField]
|
2021-08-31 11:33:55 +03:00
|
|
|
public bool IgnoreGhostsBoo;
|
|
|
|
|
|
2025-08-12 07:06:28 +10:00
|
|
|
[DataField]
|
2021-08-31 11:33:55 +03:00
|
|
|
public TimeSpan GhostBlinkingTime = TimeSpan.FromSeconds(10);
|
|
|
|
|
|
2025-08-12 07:06:28 +10:00
|
|
|
[DataField]
|
2021-08-31 11:33:55 +03:00
|
|
|
public TimeSpan GhostBlinkingCooldown = TimeSpan.FromSeconds(60);
|
|
|
|
|
|
2019-03-22 23:59:13 +01:00
|
|
|
[ViewVariables]
|
2021-10-27 04:24:22 +03:00
|
|
|
public ContainerSlot LightBulbContainer = default!;
|
2025-08-12 07:06:28 +10:00
|
|
|
|
|
|
|
|
[AutoNetworkedField]
|
2021-10-27 04:24:22 +03:00
|
|
|
public bool CurrentLit;
|
2025-08-12 07:06:28 +10:00
|
|
|
|
|
|
|
|
[DataField, AutoNetworkedField]
|
2021-10-27 04:24:22 +03:00
|
|
|
public bool IsBlinking;
|
2025-08-12 07:06:28 +10:00
|
|
|
|
|
|
|
|
[DataField, AutoNetworkedField, AutoPausedField]
|
2021-10-27 04:24:22 +03:00
|
|
|
public TimeSpan LastThunk;
|
2025-08-12 07:06:28 +10:00
|
|
|
|
|
|
|
|
[DataField, AutoPausedField]
|
2021-10-27 04:24:22 +03:00
|
|
|
public TimeSpan? LastGhostBlink;
|
2022-05-12 20:46:20 +12:00
|
|
|
|
2025-08-12 07:06:28 +10:00
|
|
|
[DataField]
|
|
|
|
|
public ProtoId<SinkPortPrototype> OnPort = "On";
|
2022-05-12 20:46:20 +12:00
|
|
|
|
2025-08-12 07:06:28 +10:00
|
|
|
[DataField]
|
|
|
|
|
public ProtoId<SinkPortPrototype> OffPort = "Off";
|
2022-05-12 20:46:20 +12:00
|
|
|
|
2025-08-12 07:06:28 +10:00
|
|
|
[DataField]
|
|
|
|
|
public ProtoId<SinkPortPrototype> TogglePort = "Toggle";
|
2022-06-21 20:55:06 -04:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// How long it takes to eject a bulb from this
|
|
|
|
|
/// </summary>
|
2025-08-12 07:06:28 +10:00
|
|
|
[DataField]
|
2022-06-21 20:55:06 -04:00
|
|
|
public float EjectBulbDelay = 2;
|
2023-07-27 07:37:09 +00:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Shock damage done to a mob that hits the light with an unarmed attack
|
|
|
|
|
/// </summary>
|
2025-08-12 07:06:28 +10:00
|
|
|
[DataField]
|
2023-07-27 07:37:09 +00:00
|
|
|
public int UnarmedHitShock = 20;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Stun duration applied to a mob that hits the light with an unarmed attack
|
|
|
|
|
/// </summary>
|
2025-08-12 07:06:28 +10:00
|
|
|
[DataField]
|
2023-07-27 07:37:09 +00:00
|
|
|
public TimeSpan UnarmedHitStun = TimeSpan.FromSeconds(5);
|
2018-05-27 16:44:50 +02:00
|
|
|
}
|
|
|
|
|
}
|