Supermatter grenades (#13747)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
using Content.Server.Explosion.EntitySystems;
|
||||
|
||||
namespace Content.Server.Explosion.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Will anchor the attached entity upon a <see cref="TriggerEvent"/>.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class AnchorOnTriggerComponent : Component
|
||||
{
|
||||
[DataField("removeOnTrigger")]
|
||||
public bool RemoveOnTrigger = true;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using Content.Server.Explosion.EntitySystems;
|
||||
|
||||
namespace Content.Server.Explosion.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Will delete the attached entity upon a <see cref="TriggerEvent"/>.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class DeleteOnTriggerComponent : Component
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Content.Server.Explosion.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Explode using the entity's <see cref="ExplosiveComponent"/> if Triggered.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class ExplodeOnTriggerComponent : Component
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
namespace Content.Server.Explosion.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Gibs on trigger, self explanatory.
|
||||
/// Also in case of an implant using this, gibs the implant user instead.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class GibOnTriggerComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Should gibbing also delete the owners items?
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("deleteItems")]
|
||||
public bool DeleteItems = false;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using Content.Server.Explosion.EntitySystems;
|
||||
using Robust.Shared.Audio;
|
||||
|
||||
namespace Content.Server.Explosion.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Will play sound from the attached entity upon a <see cref="TriggerEvent"/>.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class SoundOnTriggerComponent : Component
|
||||
{
|
||||
[DataField("removeOnTrigger")]
|
||||
public bool RemoveOnTrigger = true;
|
||||
|
||||
[DataField("sound")]
|
||||
public SoundSpecifier? Sound = new SoundPathSpecifier("/Audio/Effects/Grenades/supermatter_start.ogg");
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||
|
||||
namespace Content.Server.Explosion.Components.OnTrigger;
|
||||
|
||||
/// <summary>
|
||||
/// After being triggered applies the specified components and runs triggers again.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class TwoStageTriggerComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// How long it takes for the second stage to be triggered.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("triggerDelay")]
|
||||
public TimeSpan TriggerDelay = TimeSpan.FromSeconds(10);
|
||||
|
||||
/// <summary>
|
||||
/// This list of components that will be added for the second trigger.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadOnly)]
|
||||
[DataField("components", required: true)]
|
||||
public ComponentRegistry SecondStageComponents = new();
|
||||
|
||||
[DataField("nextTriggerTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
public TimeSpan? NextTriggerTime;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("triggered")] public bool Triggered = false;
|
||||
}
|
||||
Reference in New Issue
Block a user