Skip to content

Commit 16d77d4

Browse files
AexxieDebugOk
authored andcommitted
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 <[email protected]> * Update Content.Shared/Explosion/Components/ActiveTimerTriggerComponent.cs Co-authored-by: DrSmugleaf <[email protected]> * Update Content.Shared/Explosion/Components/OnUseTimerTriggerComponent.cs Co-authored-by: DrSmugleaf <[email protected]> * Update Content.Shared/Explosion/Components/OnUseTimerTriggerComponent.cs Co-authored-by: DrSmugleaf <[email protected]> * Update Content.Shared/Explosion/EntitySystems/SharedTriggerSystem.cs Co-authored-by: DrSmugleaf <[email protected]> * Update Content.Shared/Explosion/EntitySystems/SharedSmokeOnTriggerSystem.cs Co-authored-by: DrSmugleaf <[email protected]> * 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 <[email protected]> Co-authored-by: metalgearsloth <[email protected]> (cherry picked from commit 467e983)
1 parent a08f6f4 commit 16d77d4

40 files changed

+125
-86
lines changed

.run/Content Server+Client.run.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<component name="ProjectRunConfigurationManager">
1+
<component name="ProjectRunConfigurationManager">
22
<configuration default="false" name="Content Server+Client" type="CompoundRunConfigurationType">
33
<toRun name="Content.Client" type="DotNetProject" />
44
<toRun name="Content.Server" type="DotNetProject" />

Content.Client/Explosion/ClusterGrenadeVisualizerSystem.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Content.Shared.Explosion;
2+
using Content.Shared.Explosion.Components;
23
using Robust.Client.GameObjects;
34

45
namespace Content.Client.Explosion;

Content.Client/Explosion/ExplosionOverlay.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using System.Numerics;
2-
using Content.Shared.Explosion;
2+
using Content.Shared.Explosion.Components;
33
using JetBrains.Annotations;
44
using Robust.Client.Graphics;
55
using Robust.Shared.Enums;

Content.Client/Explosion/ExplosionOverlaySystem.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Content.Shared.Explosion;
2+
using Content.Shared.Explosion.Components;
23
using Robust.Client.Graphics;
34
using Robust.Client.ResourceManagement;
45
using Robust.Shared.GameStates;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
using Content.Shared.Explosion.EntitySystems;
2+
3+
namespace Content.Client.Explosion;
4+
5+
public sealed class SmokeOnTriggerSystem : SharedSmokeOnTriggerSystem
6+
{
7+
}

Content.Client/Explosion/TriggerOnProximityComponent.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Content.Shared.Explosion;
2+
using Content.Shared.Explosion.Components;
23

34
namespace Content.Client.Explosion;
45

Content.IntegrationTests/Tests/Payload/ModularGrenadeTests.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Content.IntegrationTests.Tests.Interaction;
22
using Content.Server.Explosion.Components;
3+
using Content.Shared.Explosion.Components;
34
using Robust.Shared.Containers;
45
using Robust.Shared.GameObjects;
56

Content.Server/Defusable/Systems/DefusableSystem.cs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
using Content.Shared.Database;
99
using Content.Shared.Defusable;
1010
using Content.Shared.Examine;
11+
using Content.Shared.Explosion.Components;
12+
using Content.Shared.Explosion.Components.OnTrigger;
1113
using Content.Shared.Popups;
1214
using Content.Shared.Verbs;
1315
using Content.Shared.Wires;

Content.Server/Explosion/Components/ActiveTimerTriggerComponent.cs

-25
This file was deleted.

Content.Server/Explosion/Components/TriggerOnProximityComponent.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Content.Server.Explosion.EntitySystems;
22
using Content.Shared.Explosion;
3+
using Content.Shared.Explosion.Components;
34
using Content.Shared.Physics;
45
using Robust.Shared.Physics.Collision.Shapes;
56
using Robust.Shared.Physics.Components;

Content.Server/Explosion/EntitySystems/ClusterGrenadeSystem.cs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
using Robust.Shared.Random;
99
using Content.Server.Weapons.Ranged.Systems;
1010
using System.Numerics;
11+
using Content.Shared.Explosion.Components;
12+
using Content.Shared.Flash.Components;
1113
using Robust.Server.Containers;
1214
using Robust.Server.GameObjects;
1315

Content.Server/Explosion/EntitySystems/ExplosionSystem.GridMap.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System.Numerics;
22
using Content.Shared.Atmos;
33
using Content.Shared.Explosion;
4+
using Content.Shared.Explosion.Components;
45
using Robust.Shared.Map;
56
using Robust.Shared.Map.Components;
67

Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using Content.Shared.CCVar;
44
using Content.Shared.Damage;
55
using Content.Shared.Explosion;
6+
using Content.Shared.Explosion.Components;
67
using Content.Shared.Maps;
78
using Content.Shared.Physics;
89
using Content.Shared.Projectiles;

Content.Server/Explosion/EntitySystems/ExplosionSystem.TileFill.cs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Numerics;
33
using Content.Shared.Administration;
44
using Content.Shared.Explosion;
5+
using Content.Shared.Explosion.Components;
56
using Robust.Shared.Map;
67
using Robust.Shared.Physics.Components;
78
using Robust.Shared.Timing;

Content.Server/Explosion/EntitySystems/ExplosionSystem.Visuals.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Content.Shared.Explosion;
2+
using Content.Shared.Explosion.Components;
23
using Robust.Server.GameObjects;
34
using Robust.Shared.GameStates;
45
using Robust.Shared.Map;

Content.Server/Explosion/EntitySystems/SmokeOnTriggerSystem.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
using Content.Server.Explosion.Components;
1+
using Content.Shared.Explosion.Components;
22
using Content.Server.Fluids.EntitySystems;
33
using Content.Shared.Chemistry.Components;
44
using Content.Shared.Coordinates.Helpers;
5+
using Content.Shared.Explosion.Components.OnTrigger;
6+
using Content.Shared.Explosion.EntitySystems;
57
using Content.Shared.Maps;
68
using Robust.Shared.Map;
79

@@ -10,7 +12,7 @@ namespace Content.Server.Explosion.EntitySystems;
1012
/// <summary>
1113
/// Handles creating smoke when <see cref="SmokeOnTriggerComponent"/> is triggered.
1214
/// </summary>
13-
public sealed class SmokeOnTriggerSystem : EntitySystem
15+
public sealed class SmokeOnTriggerSystem : SharedSmokeOnTriggerSystem
1416
{
1517
[Dependency] private readonly IMapManager _mapMan = default!;
1618
[Dependency] private readonly SmokeSystem _smoke = default!;

Content.Server/Explosion/EntitySystems/TriggerSystem.Mobstate.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Content.Server.Explosion.Components;
2+
using Content.Shared.Explosion.Components;
23
using Content.Shared.Implants;
34
using Content.Shared.Interaction.Events;
45
using Content.Shared.Mobs;

Content.Server/Explosion/EntitySystems/TriggerSystem.OnUse.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Content.Server.Explosion.Components;
22
using Content.Server.Sticky.Events;
33
using Content.Shared.Examine;
4+
using Content.Shared.Explosion.Components;
45
using Content.Shared.Interaction.Events;
56
using Content.Shared.Popups;
67
using Content.Shared.Verbs;

Content.Server/Explosion/EntitySystems/TriggerSystem.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
using Content.Server.Chemistry.Containers.EntitySystems;
44
using Content.Server.Explosion.Components;
55
using Content.Server.Flash;
6-
using Content.Server.Flash.Components;
6+
using Content.Shared.Flash.Components;
77
using Content.Server.Radio.EntitySystems;
88
using Content.Shared.Chemistry.Components;
99
using Content.Shared.Chemistry.Components.SolutionManager;
1010
using Content.Shared.Database;
11+
using Content.Shared.Explosion.Components;
12+
using Content.Shared.Explosion.Components.OnTrigger;
1113
using Content.Shared.Implants.Components;
1214
using Content.Shared.Interaction;
1315
using Content.Shared.Mobs;

Content.Server/Flash/Components/FlashOnTriggerComponent.cs

-12
This file was deleted.

Content.Server/Flash/FlashSystem.cs

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using Content.Shared.Charges.Systems;
88
using Content.Shared.Eye.Blinding.Components;
99
using Content.Shared.Flash;
10+
using Content.Shared.Flash.Components;
1011
using Content.Shared.IdentityManagement;
1112
using Content.Shared.Interaction;
1213
using Content.Shared.Interaction.Events;

Content.Server/Nutrition/EntitySystems/CreamPieSystem.cs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Content.Server.Nutrition.Components;
66
using Content.Server.Popups;
77
using Content.Shared.Containers.ItemSlots;
8+
using Content.Shared.Explosion.Components;
89
using Content.Shared.Interaction;
910
using Content.Shared.Nutrition.Components;
1011
using Content.Shared.Nutrition.EntitySystems;

Content.Shared/Administration/SpawnExplosionEuiMsg.cs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Robust.Shared.Serialization;
33
using Robust.Shared.Map;
44
using Content.Shared.Explosion;
5+
using Content.Shared.Explosion.Components;
56

67
namespace Content.Shared.Administration;
78

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using Robust.Shared.Audio;
2+
using Robust.Shared.GameStates;
3+
4+
namespace Content.Shared.Explosion.Components;
5+
6+
/// <summary>
7+
/// Component for tracking active trigger timers. A timers can activated by some other component, e.g. <see cref="OnUseTimerTriggerComponent"/>.
8+
/// </summary>
9+
[RegisterComponent, NetworkedComponent]
10+
public sealed partial class ActiveTimerTriggerComponent : Component
11+
{
12+
[DataField] public float TimeRemaining;
13+
14+
[DataField] public EntityUid? User;
15+
16+
[DataField] public float BeepInterval;
17+
18+
[DataField] public float TimeUntilBeep;
19+
20+
[DataField] public SoundSpecifier? BeepSound;
21+
}

Content.Shared/Explosion/ExplosionVisualsComponent.cs Content.Shared/Explosion/Components/ExplosionVisualsComponent.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using Robust.Shared.Map;
33
using Robust.Shared.Serialization;
44

5-
namespace Content.Shared.Explosion;
5+
namespace Content.Shared.Explosion.Components;
66

77
/// <summary>
88
/// Component that is used to send explosion overlay/visual data to an abstract explosion entity.
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
namespace Content.Server.Explosion.Components;
1+
using Robust.Shared.GameStates;
2+
3+
namespace Content.Shared.Explosion.Components.OnTrigger;
24

35
/// <summary>
46
/// Explode using the entity's <see cref="ExplosiveComponent"/> if Triggered.
57
/// </summary>
6-
[RegisterComponent]
8+
[RegisterComponent, NetworkedComponent]
79
public sealed partial class ExplodeOnTriggerComponent : Component
810
{
911
}

Content.Server/Explosion/Components/OnTrigger/SmokeOnTriggerComponent.cs Content.Shared/Explosion/Components/OnTrigger/SmokeOnTriggerComponent.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
using Content.Server.Explosion.EntitySystems;
21
using Content.Shared.Chemistry.Components;
2+
using Content.Shared.Explosion.EntitySystems;
3+
using Robust.Shared.GameStates;
34
using Robust.Shared.Prototypes;
45

5-
namespace Content.Server.Explosion.Components;
6+
namespace Content.Shared.Explosion.Components.OnTrigger;
67

78
/// <summary>
89
/// Creates a smoke cloud when triggered, with an optional solution to include in it.
910
/// No sound is played incase a grenade is stealthy, use <see cref="SoundOnTriggerComponent"/> if you want a sound.
1011
/// </summary>
11-
[RegisterComponent, Access(typeof(SmokeOnTriggerSystem))]
12+
[RegisterComponent, NetworkedComponent, Access(typeof(SharedSmokeOnTriggerSystem))]
1213
public sealed partial class SmokeOnTriggerComponent : Component
1314
{
1415
/// <summary>
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,49 @@
11
using Robust.Shared.Audio;
2+
using Robust.Shared.GameStates;
23

3-
namespace Content.Server.Explosion.Components
4+
namespace Content.Shared.Explosion.Components
45
{
5-
[RegisterComponent]
6+
[RegisterComponent, NetworkedComponent]
67
public sealed partial class OnUseTimerTriggerComponent : Component
78
{
8-
[DataField("delay")]
9-
public float Delay = 1f;
9+
[DataField] public float Delay = 1f;
1010

1111
/// <summary>
1212
/// If not null, a user can use verbs to configure the delay to one of these options.
1313
/// </summary>
14-
[DataField("delayOptions")]
15-
public List<float>? DelayOptions = null;
14+
[DataField] public List<float>? DelayOptions = null;
1615

1716
/// <summary>
1817
/// If not null, this timer will periodically play this sound while active.
1918
/// </summary>
20-
[DataField("beepSound")]
21-
public SoundSpecifier? BeepSound;
19+
[DataField] public SoundSpecifier? BeepSound;
2220

2321
/// <summary>
2422
/// Time before beeping starts. Defaults to a single beep interval. If set to zero, will emit a beep immediately after use.
2523
/// </summary>
26-
[DataField("initialBeepDelay")]
27-
public float? InitialBeepDelay;
24+
[DataField] public float? InitialBeepDelay;
2825

29-
[DataField("beepInterval")]
30-
public float BeepInterval = 1;
26+
[DataField] public float BeepInterval = 1;
3127

3228
/// <summary>
3329
/// Whether the timer should instead be activated through a verb in the right-click menu
3430
/// </summary>
35-
[DataField("useVerbInstead")]
36-
public bool UseVerbInstead = false;
31+
[DataField] public bool UseVerbInstead = false;
3732

3833
/// <summary>
3934
/// Should timer be started when it was stuck to another entity.
4035
/// Used for C4 charges and similar behaviour.
4136
/// </summary>
42-
[DataField("startOnStick")]
43-
public bool StartOnStick;
37+
[DataField] public bool StartOnStick;
4438

4539
/// <summary>
4640
/// Allows changing the start-on-stick quality.
4741
/// </summary>
48-
[DataField("canToggleStartOnStick")]
49-
public bool AllowToggleStartOnStick;
42+
[DataField("canToggleStartOnStick")] public bool AllowToggleStartOnStick;
5043

5144
/// <summary>
5245
/// Whether you can examine the item to see its timer or not.
5346
/// </summary>
54-
[DataField("examinable")]
55-
public bool Examinable = true;
47+
[DataField] public bool Examinable = true;
5648
}
5749
}

Content.Shared/Explosion/SharedClusterGrenadeComponent.cs Content.Shared/Explosion/Components/SharedClusterGrenadeComponent.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Robust.Shared.Serialization;
22

3-
namespace Content.Shared.Explosion
3+
namespace Content.Shared.Explosion.Components
44
{
55
[Serializable, NetSerializable]
66
public enum ClusterGrenadeVisuals : byte

Content.Shared/Explosion/SharedTriggerOnProximityComponent.cs Content.Shared/Explosion/Components/SharedTriggerOnProximityComponent.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Robust.Shared.GameStates;
22

3-
namespace Content.Shared.Explosion;
3+
namespace Content.Shared.Explosion.Components;
44

55
[NetworkedComponent]
66
public abstract partial class SharedTriggerOnProximityComponent : Component
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace Content.Shared.Explosion.EntitySystems;
2+
3+
public abstract class SharedSmokeOnTriggerSystem : EntitySystem
4+
{
5+
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace Content.Shared.Explosion.EntitySystems;
2+
3+
public abstract class SharedTriggerSystem : EntitySystem
4+
{
5+
6+
}

Content.Server/Flash/Components/FlashComponent.cs Content.Shared/Flash/Components/FlashComponent.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
using Content.Shared.Flash;
12
using Robust.Shared.Audio;
3+
using Robust.Shared.GameStates;
24

3-
namespace Content.Server.Flash.Components
5+
namespace Content.Shared.Flash.Components
46
{
5-
[RegisterComponent, Access(typeof(FlashSystem))]
7+
[RegisterComponent, NetworkedComponent, Access(typeof(SharedFlashSystem))]
68
public sealed partial class FlashComponent : Component
79
{
810

0 commit comments

Comments
 (0)