add igniter (#20962)

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2023-10-14 08:11:50 +01:00
committed by GitHub
parent 4fb8fa3f22
commit 33e5dfb9a8
12 changed files with 150 additions and 4 deletions

View File

@@ -0,0 +1,30 @@
using Robust.Shared.Audio;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Server.IgnitionSource;
/// <summary>
/// Ignites for a certain length of time when triggered.
/// Requires <see cref="IgnitionSourceComponent"/> along with triggering components.
/// </summary>
[RegisterComponent, Access(typeof(IgniteOnTriggerSystem))]
public sealed partial class IgniteOnTriggerComponent : Component
{
/// <summary>
/// Once ignited, the time it will unignite at.
/// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
public TimeSpan IgnitedUntil = TimeSpan.Zero;
/// <summary>
/// How long the ignition source is active for after triggering.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public TimeSpan IgnitedTime = TimeSpan.FromSeconds(0.5);
/// <summary>
/// Sound to play when igniting.
/// </summary>
[DataField]
public SoundSpecifier IgniteSound = new SoundCollectionSpecifier("WelderOn");
}