Add Modular grenades (chemnades). (#7138)

This commit is contained in:
Leon Friedrich
2022-03-25 17:17:29 +13:00
committed by GitHub
parent 414c03978d
commit 1b0e7ae0f5
51 changed files with 994 additions and 96 deletions

View File

@@ -0,0 +1,29 @@
using Content.Shared.Sound;
using Robust.Shared.Audio;
namespace Content.Server.Explosion.Components;
/// <summary>
/// Component for tracking active trigger timers. A timers can activated by some other component, e.g. <see cref="OnUseTimerTriggerComponent"/>.
/// </summary>
[RegisterComponent]
public sealed class ActiveTimerTriggerComponent : Component
{
[DataField("timeRemaining")]
public float TimeRemaining;
[DataField("user")]
public EntityUid? User;
[DataField("beepInterval")]
public float BeepInterval;
[DataField("timeUntilBeep")]
public float TimeUntilBeep;
[DataField("beepSound")]
public SoundSpecifier? BeepSound;
[DataField("beepParams")]
public AudioParams BeepParams = AudioParams.Default;
}

View File

@@ -1,11 +1,36 @@
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
using Content.Shared.Sound;
using Robust.Shared.Audio;
namespace Content.Server.Explosion.Components
{
[RegisterComponent]
public sealed class OnUseTimerTriggerComponent : Component
{
[DataField("delay")] public float Delay = 0f;
[DataField("delay")]
public float Delay = 1f;
/// <summary>
/// If not null, a user can use verbs to configure the delay to one of these options.
/// </summary>
[DataField("delayOptions")]
public List<float>? DelayOptions = null;
/// <summary>
/// If not null, this timer will periodically play this sound wile active.
/// </summary>
[DataField("beepSound")]
public SoundSpecifier? BeepSound;
/// <summary>
/// Time before beeping starts. Defaults to a single beep interval. If set to zero, will emit a beep immediately after use.
/// </summary>
[DataField("initialBeepDelay")]
public float? InitialBeepDelay;
[DataField("beepInterval")]
public float BeepInterval = 1;
[DataField("beepParams")]
public AudioParams BeepParams = AudioParams.Default.WithVolume(-2f);
}
}

View File

@@ -1,19 +0,0 @@
using Content.Server.Explosion.EntitySystems;
using Content.Shared.Sound;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
namespace Content.Server.Explosion.Components
{
/// <summary>
/// Whenever a <see cref="TriggerEvent"/> is run play a sound in PVS range.
/// </summary>
[RegisterComponent]
public sealed class SoundOnTriggerComponent : Component
{
[ViewVariables(VVAccess.ReadWrite)]
[DataField("sound")]
public SoundSpecifier? Sound { get; set; }
}
}