Supermatter grenades (#13747)

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
AlexMorgan3817
2023-08-10 21:29:47 +07:00
committed by GitHub
parent 163ba7a470
commit 62ccbdaeae
26 changed files with 370 additions and 25 deletions

View File

@@ -1,12 +0,0 @@
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
{
}
}

View File

@@ -1,10 +0,0 @@
namespace Content.Server.Explosion.Components
{
/// <summary>
/// Explode using the entity's <see cref="ExplosiveComponent"/> if Triggered.
/// </summary>
[RegisterComponent]
public sealed class ExplodeOnTriggerComponent : Component
{
}
}

View File

@@ -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;
}

View File

@@ -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
{
}

View File

@@ -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
{
}

View File

@@ -1,4 +1,4 @@
namespace Content.Server.Explosion.Components;
namespace Content.Server.Explosion.Components;
/// <summary>
/// Gibs on trigger, self explanatory.

View File

@@ -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");
}

View File

@@ -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;
}