2021-12-30 22:56:10 +01:00
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Content.Server.Clothing.Components;
|
2021-12-27 18:15:16 +11:00
|
|
|
using Content.Server.Light.EntitySystems;
|
2022-02-15 17:06:52 +13:00
|
|
|
using Content.Shared.ActionBlocker;
|
2021-12-30 22:56:10 +01:00
|
|
|
using Content.Shared.Examine;
|
|
|
|
|
using Content.Shared.Interaction;
|
2021-06-09 22:19:39 +02:00
|
|
|
using Content.Shared.Light.Component;
|
2021-12-30 22:56:10 +01:00
|
|
|
using Content.Shared.Popups;
|
|
|
|
|
using Content.Shared.Rounding;
|
2021-07-10 17:35:33 +02:00
|
|
|
using Content.Shared.Sound;
|
2020-12-13 14:28:20 -08:00
|
|
|
using JetBrains.Annotations;
|
2021-12-30 22:56:10 +01:00
|
|
|
using Robust.Server.GameObjects;
|
2021-12-27 18:15:16 +11:00
|
|
|
using Robust.Shared.Analyzers;
|
2021-12-30 22:56:10 +01:00
|
|
|
using Robust.Shared.Audio;
|
2019-04-15 21:11:38 -06:00
|
|
|
using Robust.Shared.GameObjects;
|
2021-12-03 11:11:52 +01:00
|
|
|
using Robust.Shared.IoC;
|
2021-12-30 22:56:10 +01:00
|
|
|
using Robust.Shared.Localization;
|
|
|
|
|
using Robust.Shared.Maths;
|
|
|
|
|
using Robust.Shared.Player;
|
2021-03-05 01:08:38 +01:00
|
|
|
using Robust.Shared.Serialization.Manager.Attributes;
|
2021-12-30 22:56:10 +01:00
|
|
|
using Robust.Shared.Utility;
|
2019-04-15 21:11:38 -06:00
|
|
|
using Robust.Shared.ViewVariables;
|
2018-08-28 08:39:20 -07:00
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.Light.Components
|
2018-08-28 08:39:20 -07:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
2020-10-29 20:17:03 +02:00
|
|
|
/// Component that represents a powered handheld light source which can be toggled on and off.
|
2018-08-28 08:39:20 -07:00
|
|
|
/// </summary>
|
2019-07-31 15:02:36 +02:00
|
|
|
[RegisterComponent]
|
2021-12-27 18:15:16 +11:00
|
|
|
[Friend(typeof(HandheldLightSystem))]
|
|
|
|
|
public sealed class HandheldLightComponent : SharedHandheldLightComponent
|
2018-08-28 08:39:20 -07:00
|
|
|
{
|
2021-03-05 01:08:38 +01:00
|
|
|
[ViewVariables(VVAccess.ReadWrite)] [DataField("wattage")] public float Wattage { get; set; } = 3f;
|
2018-08-28 08:39:20 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
2018-11-21 20:58:11 +01:00
|
|
|
/// Status of light, whether or not it is emitting light.
|
2018-08-28 08:39:20 -07:00
|
|
|
/// </summary>
|
2018-09-09 15:34:43 +02:00
|
|
|
[ViewVariables]
|
2021-12-27 18:15:16 +11:00
|
|
|
public bool Activated { get; set; }
|
2018-08-28 08:39:20 -07:00
|
|
|
|
2021-09-09 18:31:54 -07:00
|
|
|
[ViewVariables(VVAccess.ReadWrite)] [DataField("turnOnSound")] public SoundSpecifier TurnOnSound = new SoundPathSpecifier("/Audio/Items/flashlight_on.ogg");
|
2021-07-10 17:35:33 +02:00
|
|
|
[ViewVariables(VVAccess.ReadWrite)] [DataField("turnOnFailSound")] public SoundSpecifier TurnOnFailSound = new SoundPathSpecifier("/Audio/Machines/button.ogg");
|
2021-09-20 11:53:34 -07:00
|
|
|
[ViewVariables(VVAccess.ReadWrite)] [DataField("turnOffSound")] public SoundSpecifier TurnOffSound = new SoundPathSpecifier("/Audio/Items/flashlight_off.ogg");
|
2018-11-21 20:58:11 +01:00
|
|
|
|
2020-11-01 07:56:46 +11:00
|
|
|
/// <summary>
|
|
|
|
|
/// Client-side ItemStatus level
|
|
|
|
|
/// </summary>
|
2021-12-27 18:15:16 +11:00
|
|
|
public byte? LastLevel;
|
2018-08-28 08:39:20 -07:00
|
|
|
}
|
|
|
|
|
}
|