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:
Aexxie
2024-02-01 07:29:01 -06:00
committed by GitHub
parent 4520ac8c9b
commit 467e983ba9
40 changed files with 125 additions and 86 deletions

View File

@@ -1,4 +1,4 @@
<component name="ProjectRunConfigurationManager"> <component name="ProjectRunConfigurationManager">
<configuration default="false" name="Content Server+Client" type="CompoundRunConfigurationType"> <configuration default="false" name="Content Server+Client" type="CompoundRunConfigurationType">
<toRun name="Content.Client" type="DotNetProject" /> <toRun name="Content.Client" type="DotNetProject" />
<toRun name="Content.Server" type="DotNetProject" /> <toRun name="Content.Server" type="DotNetProject" />

View File

@@ -1,4 +1,5 @@
using Content.Shared.Explosion; using Content.Shared.Explosion;
using Content.Shared.Explosion.Components;
using Robust.Client.GameObjects; using Robust.Client.GameObjects;
namespace Content.Client.Explosion; namespace Content.Client.Explosion;

View File

@@ -1,5 +1,5 @@
using System.Numerics; using System.Numerics;
using Content.Shared.Explosion; using Content.Shared.Explosion.Components;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Client.Graphics; using Robust.Client.Graphics;
using Robust.Shared.Enums; using Robust.Shared.Enums;

View File

@@ -1,4 +1,5 @@
using Content.Shared.Explosion; using Content.Shared.Explosion;
using Content.Shared.Explosion.Components;
using Robust.Client.Graphics; using Robust.Client.Graphics;
using Robust.Client.ResourceManagement; using Robust.Client.ResourceManagement;
using Robust.Shared.GameStates; using Robust.Shared.GameStates;

View File

@@ -0,0 +1,7 @@
using Content.Shared.Explosion.EntitySystems;
namespace Content.Client.Explosion;
public sealed class SmokeOnTriggerSystem : SharedSmokeOnTriggerSystem
{
}

View File

@@ -1,4 +1,5 @@
using Content.Shared.Explosion; using Content.Shared.Explosion;
using Content.Shared.Explosion.Components;
namespace Content.Client.Explosion; namespace Content.Client.Explosion;

View File

@@ -1,5 +1,6 @@
using Content.IntegrationTests.Tests.Interaction; using Content.IntegrationTests.Tests.Interaction;
using Content.Server.Explosion.Components; using Content.Server.Explosion.Components;
using Content.Shared.Explosion.Components;
using Robust.Shared.Containers; using Robust.Shared.Containers;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;

View File

@@ -8,6 +8,8 @@ using Content.Shared.Construction.Components;
using Content.Shared.Database; using Content.Shared.Database;
using Content.Shared.Defusable; using Content.Shared.Defusable;
using Content.Shared.Examine; using Content.Shared.Examine;
using Content.Shared.Explosion.Components;
using Content.Shared.Explosion.Components.OnTrigger;
using Content.Shared.Popups; using Content.Shared.Popups;
using Content.Shared.Verbs; using Content.Shared.Verbs;
using Content.Shared.Wires; using Content.Shared.Wires;

View File

@@ -1,25 +0,0 @@
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 partial 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;
}

View File

@@ -1,5 +1,6 @@
using Content.Server.Explosion.EntitySystems; using Content.Server.Explosion.EntitySystems;
using Content.Shared.Explosion; using Content.Shared.Explosion;
using Content.Shared.Explosion.Components;
using Content.Shared.Physics; using Content.Shared.Physics;
using Robust.Shared.Physics.Collision.Shapes; using Robust.Shared.Physics.Collision.Shapes;
using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Components;

View File

@@ -8,6 +8,8 @@ using Robust.Shared.Containers;
using Robust.Shared.Random; using Robust.Shared.Random;
using Content.Server.Weapons.Ranged.Systems; using Content.Server.Weapons.Ranged.Systems;
using System.Numerics; using System.Numerics;
using Content.Shared.Explosion.Components;
using Content.Shared.Flash.Components;
using Robust.Server.Containers; using Robust.Server.Containers;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;

View File

@@ -1,6 +1,7 @@
using System.Numerics; using System.Numerics;
using Content.Shared.Atmos; using Content.Shared.Atmos;
using Content.Shared.Explosion; using Content.Shared.Explosion;
using Content.Shared.Explosion.Components;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Map.Components; using Robust.Shared.Map.Components;

View File

@@ -3,6 +3,7 @@ using System.Numerics;
using Content.Shared.CCVar; using Content.Shared.CCVar;
using Content.Shared.Damage; using Content.Shared.Damage;
using Content.Shared.Explosion; using Content.Shared.Explosion;
using Content.Shared.Explosion.Components;
using Content.Shared.Maps; using Content.Shared.Maps;
using Content.Shared.Physics; using Content.Shared.Physics;
using Content.Shared.Projectiles; using Content.Shared.Projectiles;

View File

@@ -2,6 +2,7 @@ using System.Linq;
using System.Numerics; using System.Numerics;
using Content.Shared.Administration; using Content.Shared.Administration;
using Content.Shared.Explosion; using Content.Shared.Explosion;
using Content.Shared.Explosion.Components;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Components;
using Robust.Shared.Timing; using Robust.Shared.Timing;

View File

@@ -1,4 +1,5 @@
using Content.Shared.Explosion; using Content.Shared.Explosion;
using Content.Shared.Explosion.Components;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
using Robust.Shared.Map; using Robust.Shared.Map;

View File

@@ -1,7 +1,9 @@
using Content.Server.Explosion.Components; using Content.Shared.Explosion.Components;
using Content.Server.Fluids.EntitySystems; using Content.Server.Fluids.EntitySystems;
using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.Components;
using Content.Shared.Coordinates.Helpers; using Content.Shared.Coordinates.Helpers;
using Content.Shared.Explosion.Components.OnTrigger;
using Content.Shared.Explosion.EntitySystems;
using Content.Shared.Maps; using Content.Shared.Maps;
using Robust.Shared.Map; using Robust.Shared.Map;
@@ -10,7 +12,7 @@ namespace Content.Server.Explosion.EntitySystems;
/// <summary> /// <summary>
/// Handles creating smoke when <see cref="SmokeOnTriggerComponent"/> is triggered. /// Handles creating smoke when <see cref="SmokeOnTriggerComponent"/> is triggered.
/// </summary> /// </summary>
public sealed class SmokeOnTriggerSystem : EntitySystem public sealed class SmokeOnTriggerSystem : SharedSmokeOnTriggerSystem
{ {
[Dependency] private readonly IMapManager _mapMan = default!; [Dependency] private readonly IMapManager _mapMan = default!;
[Dependency] private readonly SmokeSystem _smoke = default!; [Dependency] private readonly SmokeSystem _smoke = default!;

View File

@@ -1,4 +1,5 @@
using Content.Server.Explosion.Components; using Content.Server.Explosion.Components;
using Content.Shared.Explosion.Components;
using Content.Shared.Implants; using Content.Shared.Implants;
using Content.Shared.Interaction.Events; using Content.Shared.Interaction.Events;
using Content.Shared.Mobs; using Content.Shared.Mobs;

View File

@@ -1,6 +1,7 @@
using Content.Server.Explosion.Components; using Content.Server.Explosion.Components;
using Content.Server.Sticky.Events; using Content.Server.Sticky.Events;
using Content.Shared.Examine; using Content.Shared.Examine;
using Content.Shared.Explosion.Components;
using Content.Shared.Interaction.Events; using Content.Shared.Interaction.Events;
using Content.Shared.Popups; using Content.Shared.Popups;
using Content.Shared.Verbs; using Content.Shared.Verbs;

View File

@@ -3,11 +3,13 @@ using Content.Server.Body.Systems;
using Content.Server.Chemistry.Containers.EntitySystems; using Content.Server.Chemistry.Containers.EntitySystems;
using Content.Server.Explosion.Components; using Content.Server.Explosion.Components;
using Content.Server.Flash; using Content.Server.Flash;
using Content.Server.Flash.Components; using Content.Shared.Flash.Components;
using Content.Server.Radio.EntitySystems; using Content.Server.Radio.EntitySystems;
using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Components.SolutionManager; using Content.Shared.Chemistry.Components.SolutionManager;
using Content.Shared.Database; using Content.Shared.Database;
using Content.Shared.Explosion.Components;
using Content.Shared.Explosion.Components.OnTrigger;
using Content.Shared.Implants.Components; using Content.Shared.Implants.Components;
using Content.Shared.Interaction; using Content.Shared.Interaction;
using Content.Shared.Mobs; using Content.Shared.Mobs;

View File

@@ -1,12 +0,0 @@
namespace Content.Server.Flash.Components
{
/// <summary>
/// Upon being triggered will flash in an area around it.
/// </summary>
[RegisterComponent]
internal sealed partial class FlashOnTriggerComponent : Component
{
[DataField("range")] internal float Range = 1.0f;
[DataField("duration")] internal float Duration = 8.0f;
}
}

View File

@@ -7,6 +7,7 @@ using Content.Shared.Charges.Components;
using Content.Shared.Charges.Systems; using Content.Shared.Charges.Systems;
using Content.Shared.Eye.Blinding.Components; using Content.Shared.Eye.Blinding.Components;
using Content.Shared.Flash; using Content.Shared.Flash;
using Content.Shared.Flash.Components;
using Content.Shared.IdentityManagement; using Content.Shared.IdentityManagement;
using Content.Shared.Interaction; using Content.Shared.Interaction;
using Content.Shared.Interaction.Events; using Content.Shared.Interaction.Events;

View File

@@ -5,6 +5,7 @@ using Content.Server.Fluids.EntitySystems;
using Content.Server.Nutrition.Components; using Content.Server.Nutrition.Components;
using Content.Server.Popups; using Content.Server.Popups;
using Content.Shared.Containers.ItemSlots; using Content.Shared.Containers.ItemSlots;
using Content.Shared.Explosion.Components;
using Content.Shared.Interaction; using Content.Shared.Interaction;
using Content.Shared.Nutrition.Components; using Content.Shared.Nutrition.Components;
using Content.Shared.Nutrition.EntitySystems; using Content.Shared.Nutrition.EntitySystems;

View File

@@ -2,6 +2,7 @@ using Content.Shared.Eui;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.Map; using Robust.Shared.Map;
using Content.Shared.Explosion; using Content.Shared.Explosion;
using Content.Shared.Explosion.Components;
namespace Content.Shared.Administration; namespace Content.Shared.Administration;

View File

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

View File

@@ -2,7 +2,7 @@ using Robust.Shared.GameStates;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
namespace Content.Shared.Explosion; namespace Content.Shared.Explosion.Components;
/// <summary> /// <summary>
/// Component that is used to send explosion overlay/visual data to an abstract explosion entity. /// Component that is used to send explosion overlay/visual data to an abstract explosion entity.

View File

@@ -1,9 +1,11 @@
namespace Content.Server.Explosion.Components; using Robust.Shared.GameStates;
namespace Content.Shared.Explosion.Components.OnTrigger;
/// <summary> /// <summary>
/// Explode using the entity's <see cref="ExplosiveComponent"/> if Triggered. /// Explode using the entity's <see cref="ExplosiveComponent"/> if Triggered.
/// </summary> /// </summary>
[RegisterComponent] [RegisterComponent, NetworkedComponent]
public sealed partial class ExplodeOnTriggerComponent : Component public sealed partial class ExplodeOnTriggerComponent : Component
{ {
} }

View File

@@ -1,14 +1,15 @@
using Content.Server.Explosion.EntitySystems;
using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.Components;
using Content.Shared.Explosion.EntitySystems;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
namespace Content.Server.Explosion.Components; namespace Content.Shared.Explosion.Components.OnTrigger;
/// <summary> /// <summary>
/// Creates a smoke cloud when triggered, with an optional solution to include in it. /// 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. /// No sound is played incase a grenade is stealthy, use <see cref="SoundOnTriggerComponent"/> if you want a sound.
/// </summary> /// </summary>
[RegisterComponent, Access(typeof(SmokeOnTriggerSystem))] [RegisterComponent, NetworkedComponent, Access(typeof(SharedSmokeOnTriggerSystem))]
public sealed partial class SmokeOnTriggerComponent : Component public sealed partial class SmokeOnTriggerComponent : Component
{ {
/// <summary> /// <summary>

View File

@@ -1,57 +1,49 @@
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.GameStates;
namespace Content.Server.Explosion.Components namespace Content.Shared.Explosion.Components
{ {
[RegisterComponent] [RegisterComponent, NetworkedComponent]
public sealed partial class OnUseTimerTriggerComponent : Component public sealed partial class OnUseTimerTriggerComponent : Component
{ {
[DataField("delay")] [DataField] public float Delay = 1f;
public float Delay = 1f;
/// <summary> /// <summary>
/// If not null, a user can use verbs to configure the delay to one of these options. /// If not null, a user can use verbs to configure the delay to one of these options.
/// </summary> /// </summary>
[DataField("delayOptions")] [DataField] public List<float>? DelayOptions = null;
public List<float>? DelayOptions = null;
/// <summary> /// <summary>
/// If not null, this timer will periodically play this sound while active. /// If not null, this timer will periodically play this sound while active.
/// </summary> /// </summary>
[DataField("beepSound")] [DataField] public SoundSpecifier? BeepSound;
public SoundSpecifier? BeepSound;
/// <summary> /// <summary>
/// Time before beeping starts. Defaults to a single beep interval. If set to zero, will emit a beep immediately after use. /// Time before beeping starts. Defaults to a single beep interval. If set to zero, will emit a beep immediately after use.
/// </summary> /// </summary>
[DataField("initialBeepDelay")] [DataField] public float? InitialBeepDelay;
public float? InitialBeepDelay;
[DataField("beepInterval")] [DataField] public float BeepInterval = 1;
public float BeepInterval = 1;
/// <summary> /// <summary>
/// Whether the timer should instead be activated through a verb in the right-click menu /// Whether the timer should instead be activated through a verb in the right-click menu
/// </summary> /// </summary>
[DataField("useVerbInstead")] [DataField] public bool UseVerbInstead = false;
public bool UseVerbInstead = false;
/// <summary> /// <summary>
/// Should timer be started when it was stuck to another entity. /// Should timer be started when it was stuck to another entity.
/// Used for C4 charges and similar behaviour. /// Used for C4 charges and similar behaviour.
/// </summary> /// </summary>
[DataField("startOnStick")] [DataField] public bool StartOnStick;
public bool StartOnStick;
/// <summary> /// <summary>
/// Allows changing the start-on-stick quality. /// Allows changing the start-on-stick quality.
/// </summary> /// </summary>
[DataField("canToggleStartOnStick")] [DataField("canToggleStartOnStick")] public bool AllowToggleStartOnStick;
public bool AllowToggleStartOnStick;
/// <summary> /// <summary>
/// Whether you can examine the item to see its timer or not. /// Whether you can examine the item to see its timer or not.
/// </summary> /// </summary>
[DataField("examinable")] [DataField] public bool Examinable = true;
public bool Examinable = true;
} }
} }

View File

@@ -1,6 +1,6 @@
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
namespace Content.Shared.Explosion namespace Content.Shared.Explosion.Components
{ {
[Serializable, NetSerializable] [Serializable, NetSerializable]
public enum ClusterGrenadeVisuals : byte public enum ClusterGrenadeVisuals : byte

View File

@@ -1,6 +1,6 @@
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
namespace Content.Shared.Explosion; namespace Content.Shared.Explosion.Components;
[NetworkedComponent] [NetworkedComponent]
public abstract partial class SharedTriggerOnProximityComponent : Component public abstract partial class SharedTriggerOnProximityComponent : Component

View File

@@ -0,0 +1,6 @@
namespace Content.Shared.Explosion.EntitySystems;
public abstract class SharedSmokeOnTriggerSystem : EntitySystem
{
}

View File

@@ -0,0 +1,6 @@
namespace Content.Shared.Explosion.EntitySystems;
public abstract class SharedTriggerSystem : EntitySystem
{
}

View File

@@ -1,8 +1,10 @@
using Content.Shared.Flash;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.GameStates;
namespace Content.Server.Flash.Components namespace Content.Shared.Flash.Components
{ {
[RegisterComponent, Access(typeof(FlashSystem))] [RegisterComponent, NetworkedComponent, Access(typeof(SharedFlashSystem))]
public sealed partial class FlashComponent : Component public sealed partial class FlashComponent : Component
{ {

View File

@@ -0,0 +1,13 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Flash.Components;
/// <summary>
/// Upon being triggered will flash in an area around it.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class FlashOnTriggerComponent : Component
{
[DataField] public float Range = 1.0f;
[DataField] public float Duration = 8.0f;
}

View File

@@ -24,9 +24,10 @@
delay: 5 delay: 5
delayOptions: [3, 5, 10, 15, 30] delayOptions: [3, 5, 10, 15, 30]
initialBeepDelay: 0 initialBeepDelay: 0
beepSound: /Audio/Machines/Nuke/general_beep.ogg beepSound:
params: path: /Audio/Machines/Nuke/general_beep.ogg
volume: -2 params:
volume: -2
- type: StaticPrice - type: StaticPrice
price: 40 price: 40

View File

@@ -252,9 +252,10 @@
- type: OnUseTimerTrigger - type: OnUseTimerTrigger
delay: 7 delay: 7
initialBeepDelay: 0 initialBeepDelay: 0
beepSound: /Audio/Machines/Nuke/general_beep.ogg beepSound:
params: path: /Audio/Machines/Nuke/general_beep.ogg
volume: -2 params:
volume: -2
- type: ExplodeOnTrigger - type: ExplodeOnTrigger
- type: GibOnTrigger - type: GibOnTrigger
deleteItems: true deleteItems: true

View File

@@ -253,9 +253,10 @@
- type: OnUseTimerTrigger - type: OnUseTimerTrigger
useVerbInstead: true useVerbInstead: true
beepInterval: .25 beepInterval: .25
beepSound: /Audio/Items/Janitor/floor_sign_beep.ogg beepSound:
params: path: /Audio/Items/Janitor/floor_sign_beep.ogg
volume: 1 params:
volume: 1
examinable: false examinable: false
- type: Tag - type: Tag
tags: # ignore "WhitelistChameleon" tag tags: # ignore "WhitelistChameleon" tag

View File

@@ -24,9 +24,10 @@
Blunt: 5 Blunt: 5
- type: OnUseTimerTrigger - type: OnUseTimerTrigger
delay: 120 delay: 120
beepSound: /Audio/Machines/Nuke/general_beep.ogg beepSound:
params: path: /Audio/Machines/Nuke/general_beep.ogg
volume: -2 params:
volume: -2
- type: ExplodeOnTrigger - type: ExplodeOnTrigger
- type: Explosive - type: Explosive
explosionType: Default explosionType: Default

View File

@@ -22,7 +22,8 @@
initialBeepDelay: 0 initialBeepDelay: 0
beepSound: beepSound:
path: /Audio/Weapons/Guns/MagOut/pistol_magout.ogg path: /Audio/Weapons/Guns/MagOut/pistol_magout.ogg
volume: 1 params:
volume: 1
- type: RandomTimerTrigger - type: RandomTimerTrigger
min: 0 min: 0
max: 60 max: 60

View File

@@ -179,7 +179,6 @@
sound: sound:
path: /Audio/Weapons/flash.ogg path: /Audio/Weapons/flash.ogg
- type: FlashOnTrigger - type: FlashOnTrigger
repeating: true
range: 3 range: 3
- type: TriggerOnProximity - type: TriggerOnProximity
enabled: true enabled: true