Move grenade components to shared (#22691)
* Moves FlashComponent.cs, FlashOnTriggerComponent.cs, and SmokeOnTriggerComponent.cs to Shared * Moves ExplodeOnTriggerComponent.cs, OnUseTimerTriggerComponent.cs, ActiveTimerTriggerComponent.cs, and SmokeOnTriggerComponent.cs to Shared * Delete .run/Content Server+Client.run.xml HOW DID THIS GET IN HERE ITS NOT AHHHH * Update Content.Client/Explosion/SmokeOnTriggerSystem.cs Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com> * Update Content.Shared/Explosion/Components/ActiveTimerTriggerComponent.cs Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com> * Update Content.Shared/Explosion/Components/OnUseTimerTriggerComponent.cs Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com> * Update Content.Shared/Explosion/Components/OnUseTimerTriggerComponent.cs Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com> * Update Content.Shared/Explosion/EntitySystems/SharedTriggerSystem.cs Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com> * Update Content.Shared/Explosion/EntitySystems/SharedSmokeOnTriggerSystem.cs Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com> * Update ExplodeOnTriggerComponent.cs * Revert "Delete .run/Content Server+Client.run.xml" This reverts commit 29ee05f57de60eab5c92158d8eba5e3acba483c2. * Fix? * cannot figure out how to get this to go back please forgive * Fixes a network issue * leftovers * Fixes --------- Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.Explosion.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Component for tracking active trigger timers. A timers can activated by some other component, e.g. <see cref="OnUseTimerTriggerComponent"/>.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class ActiveTimerTriggerComponent : Component
|
||||
{
|
||||
[DataField] public float TimeRemaining;
|
||||
|
||||
[DataField] public EntityUid? User;
|
||||
|
||||
[DataField] public float BeepInterval;
|
||||
|
||||
[DataField] public float TimeUntilBeep;
|
||||
|
||||
[DataField] public SoundSpecifier? BeepSound;
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Explosion.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Component that is used to send explosion overlay/visual data to an abstract explosion entity.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class ExplosionVisualsComponent : Component
|
||||
{
|
||||
public MapCoordinates Epicenter;
|
||||
public Dictionary<int, List<Vector2i>>? SpaceTiles;
|
||||
public Dictionary<EntityUid, Dictionary<int, List<Vector2i>>> Tiles = new();
|
||||
public List<float> Intensity = new();
|
||||
public string ExplosionType = string.Empty;
|
||||
public Matrix3 SpaceMatrix;
|
||||
public ushort SpaceTileSize;
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class ExplosionVisualsState : ComponentState
|
||||
{
|
||||
public MapCoordinates Epicenter;
|
||||
public Dictionary<int, List<Vector2i>>? SpaceTiles;
|
||||
public Dictionary<NetEntity, Dictionary<int, List<Vector2i>>> Tiles;
|
||||
public List<float> Intensity;
|
||||
public string ExplosionType = string.Empty;
|
||||
public Matrix3 SpaceMatrix;
|
||||
public ushort SpaceTileSize;
|
||||
|
||||
public ExplosionVisualsState(
|
||||
MapCoordinates epicenter,
|
||||
string typeID,
|
||||
List<float> intensity,
|
||||
Dictionary<int, List<Vector2i>>? spaceTiles,
|
||||
Dictionary<NetEntity, Dictionary<int, List<Vector2i>>> tiles,
|
||||
Matrix3 spaceMatrix,
|
||||
ushort spaceTileSize)
|
||||
{
|
||||
Epicenter = epicenter;
|
||||
SpaceTiles = spaceTiles;
|
||||
Tiles = tiles;
|
||||
Intensity = intensity;
|
||||
ExplosionType = typeID;
|
||||
SpaceMatrix = spaceMatrix;
|
||||
SpaceTileSize = spaceTileSize;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum ExplosionAppearanceData
|
||||
{
|
||||
Progress, // iteration index tracker for explosions that are still expanding outwards,
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.Explosion.Components.OnTrigger;
|
||||
|
||||
/// <summary>
|
||||
/// Explode using the entity's <see cref="ExplosiveComponent"/> if Triggered.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class ExplodeOnTriggerComponent : Component
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Explosion.EntitySystems;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Explosion.Components.OnTrigger;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a smoke cloud when triggered, with an optional solution to include in it.
|
||||
/// No sound is played incase a grenade is stealthy, use <see cref="SoundOnTriggerComponent"/> if you want a sound.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent, Access(typeof(SharedSmokeOnTriggerSystem))]
|
||||
public sealed partial class SmokeOnTriggerComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// How long the smoke stays for, after it has spread.
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public float Duration = 10;
|
||||
|
||||
/// <summary>
|
||||
/// How much the smoke will spread.
|
||||
/// </summary>
|
||||
[DataField(required: true), ViewVariables(VVAccess.ReadWrite)]
|
||||
public int SpreadAmount;
|
||||
|
||||
/// <summary>
|
||||
/// Smoke entity to spawn.
|
||||
/// Defaults to smoke but you can use foam if you want.
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public ProtoId<EntityPrototype> SmokePrototype = "Smoke";
|
||||
|
||||
/// <summary>
|
||||
/// Solution to add to each smoke cloud.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// When using repeating trigger this essentially gets multiplied so dont do anything crazy like omnizine or lexorin.
|
||||
/// </remarks>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public Solution Solution = new();
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.Explosion.Components
|
||||
{
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class OnUseTimerTriggerComponent : Component
|
||||
{
|
||||
[DataField] public float Delay = 1f;
|
||||
|
||||
/// <summary>
|
||||
/// If not null, a user can use verbs to configure the delay to one of these options.
|
||||
/// </summary>
|
||||
[DataField] public List<float>? DelayOptions = null;
|
||||
|
||||
/// <summary>
|
||||
/// If not null, this timer will periodically play this sound while active.
|
||||
/// </summary>
|
||||
[DataField] 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] public float? InitialBeepDelay;
|
||||
|
||||
[DataField] public float BeepInterval = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Whether the timer should instead be activated through a verb in the right-click menu
|
||||
/// </summary>
|
||||
[DataField] public bool UseVerbInstead = false;
|
||||
|
||||
/// <summary>
|
||||
/// Should timer be started when it was stuck to another entity.
|
||||
/// Used for C4 charges and similar behaviour.
|
||||
/// </summary>
|
||||
[DataField] public bool StartOnStick;
|
||||
|
||||
/// <summary>
|
||||
/// Allows changing the start-on-stick quality.
|
||||
/// </summary>
|
||||
[DataField("canToggleStartOnStick")] public bool AllowToggleStartOnStick;
|
||||
|
||||
/// <summary>
|
||||
/// Whether you can examine the item to see its timer or not.
|
||||
/// </summary>
|
||||
[DataField] public bool Examinable = true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Explosion.Components
|
||||
{
|
||||
[Serializable, NetSerializable]
|
||||
public enum ClusterGrenadeVisuals : byte
|
||||
{
|
||||
GrenadesCounter
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.Explosion.Components;
|
||||
|
||||
[NetworkedComponent]
|
||||
public abstract partial class SharedTriggerOnProximityComponent : Component
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user