]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Welding tweaks (#27959)
authorVerm <32827189+Vermidia@users.noreply.github.com>
Mon, 3 Jun 2024 03:28:53 +0000 (22:28 -0500)
committerGitHub <noreply@github.com>
Mon, 3 Jun 2024 03:28:53 +0000 (23:28 -0400)
33 files changed:
Content.Server/Configurable/ConfigurationSystem.cs
Content.Server/Damage/Components/DamageOnToolInteractComponent.cs
Content.Server/Damage/Systems/DamageOnToolInteractSystem.cs
Content.Server/Mech/Systems/MechAssemblySystem.cs
Content.Server/Mech/Systems/MechSystem.cs
Content.Server/PneumaticCannon/PneumaticCannonSystem.cs
Content.Server/Weapons/Melee/EnergySword/EnergySwordSystem.cs
Content.Server/Xenoarchaeology/XenoArtifacts/Triggers/Systems/ArtifactElectricityTriggerSystem.cs
Content.Shared/Construction/EntitySystems/AnchorableSystem.cs
Content.Shared/Radio/EntitySystems/EncryptionKeySystem.cs
Content.Shared/Tools/Components/ToolComponent.cs
Content.Shared/Tools/Components/ToolRefinableComponent.cs [moved from Content.Server/Construction/Components/WelderRefinableComponent.cs with 74% similarity]
Content.Shared/Tools/Systems/SharedToolSystem.Welder.cs
Content.Shared/Tools/Systems/SharedToolSystem.cs
Content.Shared/Tools/Systems/ToolRefinableSystem.cs [moved from Content.Server/Construction/RefiningSystem.cs with 59% similarity]
Resources/Prototypes/Entities/Mobs/NPCs/animals.yml
Resources/Prototypes/Entities/Mobs/NPCs/xeno.yml
Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_bottles.yml
Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_cans.yml
Resources/Prototypes/Entities/Objects/Materials/shards.yml
Resources/Prototypes/Entities/Objects/Misc/broken_bottle.yml
Resources/Prototypes/Entities/Objects/Misc/fire_extinguisher.yml
Resources/Prototypes/Entities/Objects/Power/lights.yml
Resources/Prototypes/Entities/Objects/Specific/Medical/surgery.yml
Resources/Prototypes/Entities/Objects/Tools/cowtools.yml
Resources/Prototypes/Entities/Objects/Tools/gas_tanks.yml
Resources/Prototypes/Entities/Objects/Tools/jaws_of_life.yml
Resources/Prototypes/Entities/Objects/Tools/tools.yml
Resources/Prototypes/Entities/Objects/Tools/welders.yml
Resources/Prototypes/Entities/Objects/Weapons/Melee/baseball_bat.yml
Resources/Prototypes/Entities/Structures/Storage/Tanks/tanks.yml
Resources/Prototypes/Entities/Structures/Wallmounts/walldispenser.yml
Resources/Prototypes/XenoArch/Effects/utility_effects.yml

index 5f5f1ef7d16605f7a9961e0822a0a9d690385753..bf89c3f7ed13ab9474a69d7169b3d54f2907cdda 100644 (file)
@@ -1,6 +1,7 @@
 using Content.Shared.Configurable;
 using Content.Shared.Interaction;
 using Content.Shared.Tools.Components;
+using Content.Shared.Tools.Systems;
 using Robust.Server.GameObjects;
 using Robust.Shared.Containers;
 using Robust.Shared.Player;
@@ -11,6 +12,7 @@ namespace Content.Server.Configurable;
 public sealed class ConfigurationSystem : EntitySystem
 {
     [Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
+    [Dependency] private readonly SharedToolSystem _toolSystem = default!;
 
     public override void Initialize()
     {
@@ -28,7 +30,7 @@ public sealed class ConfigurationSystem : EntitySystem
         if (args.Handled)
             return;
 
-        if (!TryComp(args.Used, out ToolComponent? tool) || !tool.Qualities.Contains(component.QualityNeeded))
+        if (!_toolSystem.HasQuality(args.Used, component.QualityNeeded))
             return;
 
         args.Handled = _uiSystem.TryOpenUi(uid, ConfigurationUiKey.Key, args.User);
@@ -68,7 +70,7 @@ public sealed class ConfigurationSystem : EntitySystem
 
     private void OnInsert(EntityUid uid, ConfigurationComponent component, ContainerIsInsertingAttemptEvent args)
     {
-        if (!TryComp(args.EntityUid, out ToolComponent? tool) || !tool.Qualities.Contains(component.QualityNeeded))
+        if (!_toolSystem.HasQuality(args.EntityUid, component.QualityNeeded))
             return;
 
         args.Cancel();
index e54090cdbbfbba9c11e5f153415bf5eb4aed30ed..547c29a202d2cfb30712a1947da7e45e47799a6c 100644 (file)
@@ -1,22 +1,19 @@
 using Content.Shared.Damage;
 using Content.Shared.Tools;
-using Robust.Shared.Utility;
+using Robust.Shared.Prototypes;
 
-namespace Content.Server.Damage.Components
+namespace Content.Server.Damage.Components;
+
+[RegisterComponent]
+public sealed partial class DamageOnToolInteractComponent : Component
 {
-    [RegisterComponent]
-    public sealed partial class DamageOnToolInteractComponent : Component
-    {
-        [DataField("tools")]
-        public PrototypeFlags<ToolQualityPrototype> Tools { get; private set; } = new ();
+    [DataField]
+    public ProtoId<ToolQualityPrototype> Tools { get; private set; }
 
-        // TODO: Remove this snowflake stuff, make damage per-tool quality perhaps?
-        [DataField("weldingDamage")]
-        [ViewVariables(VVAccess.ReadWrite)]
-        public DamageSpecifier? WeldingDamage { get; private set; }
+    // TODO: Remove this snowflake stuff, make damage per-tool quality perhaps?
+    [DataField]
+    public DamageSpecifier? WeldingDamage { get; private set; }
 
-        [DataField("defaultDamage")]
-        [ViewVariables(VVAccess.ReadWrite)]
-        public DamageSpecifier? DefaultDamage { get; private set; }
-    }
+    [DataField]
+    public DamageSpecifier? DefaultDamage { get; private set; }
 }
index 42676c1891cd96a688159100e3743e532cab3a0a..5980455e49c1fcdf0559b1b4348f1c624f35b0ef 100644 (file)
@@ -4,6 +4,7 @@ using Content.Shared.Damage;
 using Content.Shared.Database;
 using Content.Shared.Interaction;
 using Content.Shared.Tools.Components;
+using Content.Shared.Tools.Systems;
 using ItemToggleComponent = Content.Shared.Item.ItemToggle.Components.ItemToggleComponent;
 
 namespace Content.Server.Damage.Systems
@@ -12,6 +13,7 @@ namespace Content.Server.Damage.Systems
     {
         [Dependency] private readonly DamageableSystem _damageableSystem = default!;
         [Dependency] private readonly IAdminLogManager _adminLogger = default!;
+        [Dependency] private readonly SharedToolSystem _toolSystem = default!;
 
         public override void Initialize()
         {
@@ -42,8 +44,7 @@ namespace Content.Server.Damage.Systems
                 args.Handled = true;
             }
             else if (component.DefaultDamage is {} damage
-                && EntityManager.TryGetComponent(args.Used, out ToolComponent? tool)
-                && tool.Qualities.ContainsAny(component.Tools))
+                && _toolSystem.HasQuality(args.Used, component.Tools))
             {
                 var dmg = _damageableSystem.TryChangeDamage(args.Target, damage, origin: args.User);
 
index c1fff819b4c9f573f607e964b8de65fe6a820aea..4b408343b7a37561248ef871bc1df1496dd6d577 100644 (file)
@@ -2,6 +2,7 @@
 using Content.Shared.Interaction;
 using Content.Shared.Tag;
 using Content.Shared.Tools.Components;
+using Content.Shared.Tools.Systems;
 using Robust.Server.Containers;
 using Robust.Shared.Containers;
 
@@ -15,6 +16,7 @@ public sealed class MechAssemblySystem : EntitySystem
 {
     [Dependency] private readonly ContainerSystem _container = default!;
     [Dependency] private readonly TagSystem _tag = default!;
+    [Dependency] private readonly SharedToolSystem _toolSystem = default!;
 
     /// <inheritdoc/>
     public override void Initialize()
@@ -30,7 +32,7 @@ public sealed class MechAssemblySystem : EntitySystem
 
     private void OnInteractUsing(EntityUid uid, MechAssemblyComponent component, InteractUsingEvent args)
     {
-        if (TryComp<ToolComponent>(args.Used, out var toolComp) && toolComp.Qualities.Contains(component.QualityNeeded))
+        if (_toolSystem.HasQuality(args.Used, component.QualityNeeded))
         {
             foreach (var tag in component.RequiredParts.Keys)
             {
index 53c6c62cdb8193aabed8fae0f05e721a8732045d..68b973f5887791c0eafd5acebe58409856814250 100644 (file)
@@ -17,6 +17,7 @@ using Content.Shared.Tools.Components;
 using Content.Shared.Verbs;
 using Content.Shared.Wires;
 using Content.Server.Body.Systems;
+using Content.Shared.Tools.Systems;
 using Robust.Server.Containers;
 using Robust.Server.GameObjects;
 using Robust.Shared.Containers;
@@ -35,6 +36,7 @@ public sealed partial class MechSystem : SharedMechSystem
     [Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
     [Dependency] private readonly SharedPopupSystem _popup = default!;
     [Dependency] private readonly UserInterfaceSystem _ui = default!;
+    [Dependency] private readonly SharedToolSystem _toolSystem = default!;
 
     /// <inheritdoc/>
     public override void Initialize()
@@ -87,7 +89,7 @@ public sealed partial class MechSystem : SharedMechSystem
             return;
         }
 
-        if (TryComp<ToolComponent>(args.Used, out var tool) && tool.Qualities.Contains("Prying") && component.BatterySlot.ContainedEntity != null)
+        if (_toolSystem.HasQuality(args.Used, "Prying") && component.BatterySlot.ContainedEntity != null)
         {
             var doAfterEventArgs = new DoAfterArgs(EntityManager, args.User, component.BatteryRemovalDelay,
                 new RemoveBatteryEvent(), uid, target: uid, used: args.Target)
index 6e0e0c503a9ef8a40ba80f8dbe2909b4faa97dd6..7882522d30ba27d3217d2c35c41aac2a61efb112 100644 (file)
@@ -7,7 +7,7 @@ using Content.Shared.Containers.ItemSlots;
 using Content.Shared.Interaction;
 using Content.Shared.PneumaticCannon;
 using Content.Shared.StatusEffect;
-using Content.Shared.Tools.Components;
+using Content.Shared.Tools.Systems;
 using Content.Shared.Weapons.Ranged.Components;
 using Content.Shared.Weapons.Ranged.Events;
 using Content.Shared.Weapons.Ranged.Systems;
@@ -22,6 +22,7 @@ public sealed class PneumaticCannonSystem : SharedPneumaticCannonSystem
     [Dependency] private readonly GunSystem _gun = default!;
     [Dependency] private readonly StunSystem _stun = default!;
     [Dependency] private readonly ItemSlotsSystem _slots = default!;
+    [Dependency] private readonly SharedToolSystem _toolSystem = default!;
 
     public override void Initialize()
     {
@@ -38,10 +39,7 @@ public sealed class PneumaticCannonSystem : SharedPneumaticCannonSystem
         if (args.Handled)
             return;
 
-        if (!TryComp<ToolComponent>(args.Used, out var tool))
-            return;
-
-        if (!tool.Qualities.Contains(component.ToolModifyPower))
+        if (!_toolSystem.HasQuality(args.Used, component.ToolModifyPower))
             return;
 
         var val = (int) component.Power;
index e8897781f5e7d4452d25afe9ebd8acfb17a5d197..5970e16319615a1749bbc18d12f700260e6bf8d7 100644 (file)
@@ -2,8 +2,7 @@ using Content.Shared.Interaction;
 using Content.Shared.Light;
 using Content.Shared.Light.Components;
 using Content.Shared.Toggleable;
-using Content.Shared.Tools.Components;
-using Content.Shared.Item;
+using Content.Shared.Tools.Systems;
 using Robust.Shared.Random;
 
 namespace Content.Server.Weapons.Melee.EnergySword;
@@ -13,6 +12,7 @@ public sealed class EnergySwordSystem : EntitySystem
     [Dependency] private readonly SharedRgbLightControllerSystem _rgbSystem = default!;
     [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
     [Dependency] private readonly IRobustRandom _random = default!;
+    [Dependency] private readonly SharedToolSystem _toolSystem = default!;
 
     public override void Initialize()
     {
@@ -38,7 +38,7 @@ public sealed class EnergySwordSystem : EntitySystem
         if (args.Handled)
             return;
 
-        if (!TryComp(args.Used, out ToolComponent? tool) || !tool.Qualities.ContainsAny("Pulsing"))
+        if (!_toolSystem.HasQuality(args.Used, "Pulsing"))
             return;
 
         args.Handled = true;
index aa2a16aa1b2ee02df9aac319f3ce23cbef312f5d..019e09bbbbc01822fcf4f92ef0f4bf7427c43d13 100644 (file)
@@ -3,12 +3,14 @@ using Content.Server.Power.Events;
 using Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Components;
 using Content.Shared.Interaction;
 using Content.Shared.Tools.Components;
+using Content.Shared.Tools.Systems;
 
 namespace Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Systems;
 
 public sealed class ArtifactElectricityTriggerSystem : EntitySystem
 {
     [Dependency] private readonly ArtifactSystem _artifactSystem = default!;
+    [Dependency] private readonly SharedToolSystem _toolSystem = default!;
 
     public override void Initialize()
     {
@@ -42,7 +44,7 @@ public sealed class ArtifactElectricityTriggerSystem : EntitySystem
         if (args.Handled)
             return;
 
-        if (!TryComp(args.Used, out ToolComponent? tool) || !tool.Qualities.ContainsAny("Pulsing"))
+        if (!_toolSystem.HasQuality(args.Used, "Pulsing"))
             return;
 
         args.Handled = _artifactSystem.TryActivateArtifact(uid, args.User);
index e9ef053f629fd6fb856062581bb65df3bd4c9a06..efb5dfd024820375bddf73764f90ee595d755fb8 100644 (file)
@@ -79,7 +79,7 @@ public sealed partial class AnchorableSystem : EntitySystem
             return;
 
         // If the used entity doesn't have a tool, return early.
-        if (!TryComp(args.Used, out ToolComponent? usedTool) || !usedTool.Qualities.Contains(anchorable.Tool))
+        if (!TryComp(args.Used, out ToolComponent? usedTool) || !_tool.HasQuality(args.Used, anchorable.Tool, usedTool))
             return;
 
         args.Handled = true;
index 746147eb5b4de0ba108fd889571c505001fd8c84..ea07b5f8a5ce96ad906135ce9673b805d7ba3187 100644 (file)
@@ -6,10 +6,8 @@ using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Interaction;
 using Content.Shared.Popups;
 using Content.Shared.Radio.Components;
-using Content.Shared.Tools;
 using Content.Shared.Tools.Components;
 using Content.Shared.Wires;
-using Robust.Shared.Audio;
 using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Network;
@@ -106,7 +104,7 @@ public sealed partial class EncryptionKeySystem : EntitySystem
             TryInsertKey(uid, component, args);
         }
         else if (TryComp<ToolComponent>(args.Used, out var tool)
-                 && tool.Qualities.Contains(component.KeysExtractionMethod)
+                 && _tool.HasQuality(args.Used, component.KeysExtractionMethod, tool)
                  && component.KeyContainer.ContainedEntities.Count > 0) // dont block deconstruction
         {
             args.Handled = true;
index 92857ab9054d81cfa797b0ec133ca8657341955e..a7210c6fa07bbd69a282cb8640574e9b7c6d0f0e 100644 (file)
@@ -1,52 +1,43 @@
+using Content.Shared.Tools.Systems;
 using Robust.Shared.Audio;
 using Robust.Shared.GameStates;
 using Robust.Shared.Utility;
 
-namespace Content.Shared.Tools.Components
-{
-    [RegisterComponent, NetworkedComponent] // TODO move tool system to shared, and make it a friend.
-    public sealed partial class ToolComponent : Component
-    {
-        [DataField("qualities")]
-        public PrototypeFlags<ToolQualityPrototype> Qualities { get; set; } = new();
-
-        /// <summary>
-        ///     For tool interactions that have a delay before action this will modify the rate, time to wait is divided by this value
-        /// </summary>
-        [ViewVariables(VVAccess.ReadWrite)]
-        [DataField("speed")]
-        public float SpeedModifier { get; set; } = 1;
+namespace Content.Shared.Tools.Components;
 
-        [DataField("useSound")]
-        public SoundSpecifier? UseSound { get; set; }
-    }
+[RegisterComponent, NetworkedComponent]
+[Access(typeof(SharedToolSystem))]
+public sealed partial class ToolComponent : Component
+{
+    [DataField]
+    public PrototypeFlags<ToolQualityPrototype> Qualities  = [];
 
     /// <summary>
-    /// Attempt event called *before* any do afters to see if the tool usage should succeed or not.
-    /// Raised on both the tool and then target.
+    ///     For tool interactions that have a delay before action this will modify the rate, time to wait is divided by this value
     /// </summary>
-    public sealed class ToolUseAttemptEvent : CancellableEntityEventArgs
-    {
-        public EntityUid User { get; }
+    [DataField]
+    public float SpeedModifier  = 1;
 
-        public ToolUseAttemptEvent(EntityUid user)
-        {
-            User = user;
-        }
-    }
+    [DataField]
+    public SoundSpecifier? UseSound;
+}
 
-    /// <summary>
-    /// Event raised on the user of a tool to see if they can actually use it.
-    /// </summary>
-    [ByRefEvent]
-    public struct ToolUserAttemptUseEvent
-    {
-        public EntityUid? Target;
-        public bool Cancelled = false;
+/// <summary>
+/// Attempt event called *before* any do afters to see if the tool usage should succeed or not.
+/// Raised on both the tool and then target.
+/// </summary>
+public sealed class ToolUseAttemptEvent(EntityUid user, float fuel) : CancellableEntityEventArgs
+{
+    public EntityUid User { get; } = user;
+    public float Fuel = fuel;
+}
 
-        public ToolUserAttemptUseEvent(EntityUid? target)
-        {
-            Target = target;
-        }
-    }
+/// <summary>
+/// Event raised on the user of a tool to see if they can actually use it.
+/// </summary>
+[ByRefEvent]
+public struct ToolUserAttemptUseEvent(EntityUid? target)
+{
+    public EntityUid? Target = target;
+    public bool Cancelled = false;
 }
similarity index 74%
rename from Content.Server/Construction/Components/WelderRefinableComponent.cs
rename to Content.Shared/Tools/Components/ToolRefinableComponent.cs
index 2fe88f2670c1008882a4e30e8e6c2459d7554392..5a311cdda8e3c51afbd8c639e9771989959099ba 100644 (file)
@@ -1,15 +1,16 @@
 using Content.Shared.Storage;
-using Content.Shared.Tools;
+using Robust.Shared.GameStates;
 using Robust.Shared.Prototypes;
+using Content.Shared.Tools.Systems;
 
-namespace Content.Server.Construction.Components;
+namespace Content.Shared.Tools.Components;
 
 /// <summary>
 /// Used for something that can be refined by welder.
 /// For example, glass shard can be refined to glass sheet.
 /// </summary>
-[RegisterComponent, Access(typeof(RefiningSystem))]
-public sealed partial class WelderRefinableComponent : Component
+[RegisterComponent, NetworkedComponent, Access(typeof(ToolRefinablSystem))]
+public sealed partial class ToolRefinableComponent : Component
 {
     /// <summary>
     /// The items created when the item is refined.
@@ -27,7 +28,7 @@ public sealed partial class WelderRefinableComponent : Component
     /// The amount of fuel it takes to refine a given item.
     /// </summary>
     [DataField]
-    public float RefineFuel;
+    public float RefineFuel = 3f;
 
     /// <summary>
     /// The tool type needed in order to refine this item.
index e790b59cd121ee86d325921081e60e283fbbf0e2..60eafce47429a3d931c55141b20c5dae1b5c353b 100644 (file)
@@ -16,8 +16,15 @@ public abstract partial class SharedToolSystem
     {
         SubscribeLocalEvent<WelderComponent, ExaminedEvent>(OnWelderExamine);
         SubscribeLocalEvent<WelderComponent, AfterInteractEvent>(OnWelderAfterInteract);
-        SubscribeLocalEvent<WelderComponent, DoAfterAttemptEvent<ToolDoAfterEvent>>(OnWelderToolUseAttempt);
+
+        SubscribeLocalEvent<WelderComponent, ToolUseAttemptEvent>((uid, comp, ev) => {
+            CanCancelWelderUse((uid, comp), ev.User, ev.Fuel, ev);
+        });
+        SubscribeLocalEvent<WelderComponent, DoAfterAttemptEvent<ToolDoAfterEvent>>((uid, comp, ev) => {
+            CanCancelWelderUse((uid, comp), ev.Event.User, ev.Event.Fuel, ev);
+        });
         SubscribeLocalEvent<WelderComponent, ToolDoAfterEvent>(OnWelderDoAfter);
+
         SubscribeLocalEvent<WelderComponent, ItemToggledEvent>(OnToggle);
         SubscribeLocalEvent<WelderComponent, ItemToggleActivateAttemptEvent>(OnActivateAttempt);
     }
@@ -120,23 +127,20 @@ public abstract partial class SharedToolSystem
         }
     }
 
-    private void OnWelderToolUseAttempt(Entity<WelderComponent> entity, ref DoAfterAttemptEvent<ToolDoAfterEvent> args)
+    private void CanCancelWelderUse(Entity<WelderComponent> entity, EntityUid user, float requiredFuel, CancellableEntityEventArgs ev)
     {
-        var user = args.DoAfter.Args.User;
-
         if (!ItemToggle.IsActivated(entity.Owner))
         {
             _popup.PopupClient(Loc.GetString("welder-component-welder-not-lit-message"), entity, user);
-            args.Cancel();
-            return;
+            ev.Cancel();
         }
 
-        var (fuel, _) = GetWelderFuelAndCapacity(entity);
+        var (currentFuel, _) = GetWelderFuelAndCapacity(entity);
 
-        if (args.Event.Fuel > fuel)
+        if (requiredFuel > currentFuel)
         {
             _popup.PopupClient(Loc.GetString("welder-component-cannot-weld-message"), entity, user);
-            args.Cancel();
+            ev.Cancel();
         }
     }
 
index 9edae9b78fd058ecddcb357be2808c7c29208e60..72e984fd82a12e194d1d49aef5907d81644da9a6 100644 (file)
@@ -217,7 +217,7 @@ public abstract partial class SharedToolSystem : EntitySystem
             return false;
 
         // check if the tool allows being used
-        var beforeAttempt = new ToolUseAttemptEvent(user);
+        var beforeAttempt = new ToolUseAttemptEvent(user, fuel);
         RaiseLocalEvent(tool, beforeAttempt);
         if (beforeAttempt.Cancelled)
             return false;
@@ -296,4 +296,3 @@ public abstract partial class SharedToolSystem : EntitySystem
 public sealed partial class CableCuttingFinishedEvent : SimpleDoAfterEvent;
 
 #endregion
-
similarity index 59%
rename from Content.Server/Construction/RefiningSystem.cs
rename to Content.Shared/Tools/Systems/ToolRefinableSystem.cs
index ce7eb49ef1d7c7c8151309fe25f167bdd5f2ee2e..e8ac4d492d7787a3946f63492957e75779d58256 100644 (file)
@@ -1,25 +1,26 @@
-using Content.Server.Construction.Components;
 using Content.Shared.Construction;
 using Content.Shared.Interaction;
 using Content.Shared.Storage;
-using Content.Shared.Tools.Systems;
+using Content.Shared.Tools.Components;
+using Robust.Shared.Network;
 using Robust.Shared.Random;
 
-namespace Content.Server.Construction;
+namespace Content.Shared.Tools.Systems;
 
-public sealed class RefiningSystem : EntitySystem
+public sealed class ToolRefinablSystem : EntitySystem
 {
+    [Dependency] private readonly INetManager _net = default!;
     [Dependency] private readonly IRobustRandom _random = default!;
     [Dependency] private readonly SharedToolSystem _toolSystem = default!;
 
     public override void Initialize()
     {
         base.Initialize();
-        SubscribeLocalEvent<WelderRefinableComponent, InteractUsingEvent>(OnInteractUsing);
-        SubscribeLocalEvent<WelderRefinableComponent, WelderRefineDoAfterEvent>(OnDoAfter);
+        SubscribeLocalEvent<ToolRefinableComponent, InteractUsingEvent>(OnInteractUsing);
+        SubscribeLocalEvent<ToolRefinableComponent, WelderRefineDoAfterEvent>(OnDoAfter);
     }
 
-    private void OnInteractUsing(EntityUid uid, WelderRefinableComponent component, InteractUsingEvent args)
+    private void OnInteractUsing(EntityUid uid, ToolRefinableComponent component, InteractUsingEvent args)
     {
         if (args.Handled)
             return;
@@ -34,11 +35,14 @@ public sealed class RefiningSystem : EntitySystem
             fuel: component.RefineFuel);
     }
 
-    private void OnDoAfter(EntityUid uid, WelderRefinableComponent component, WelderRefineDoAfterEvent args)
+    private void OnDoAfter(EntityUid uid, ToolRefinableComponent component, WelderRefineDoAfterEvent args)
     {
         if (args.Cancelled)
             return;
 
+        if (_net.IsClient)
+            return;
+
         var xform = Transform(uid);
         var spawns = EntitySpawnCollection.GetSpawns(component.RefineResult, _random);
         foreach (var spawn in spawns)
index b5f69e6f56b61e1c0de8dfb8c78ba5e655328e79..51647f69852428289c568ead565741f3ed820628 100644 (file)
     - DoorBumpOpener
     - FootstepSound
   - type: Tool # Open door from xeno.yml.
-    speed: 1.5
+    speedModifier: 1.5
     qualities:
       - Prying
     useSound:
index a3d4eafacbbca729b34b12a7478c851a5f439beb..8c262d23da65cdd562f40dc5e4316cc059ef562a 100644 (file)
@@ -22,7 +22,7 @@
       NavSmash: !type:Bool
         true
   - type: Tool
-    speed: 1.5
+    speedModifier: 1.5
     qualities:
       - Prying
   - type: Prying
index 35ad43586bf4578b0151b5f000ff45372b6cb9eb..7287119019e835e04025c481c16dd3b256467b6c 100644 (file)
@@ -80,7 +80,7 @@
   - type: Tool
     qualities:
     - Rolling
-    speed: 0.75 # not as good as a rolling pin but does the job
+    speedModifier: 0.75 # not as good as a rolling pin but does the job
   - type: PhysicalComposition
     materialComposition:
       Glass: 100
index 5d092673edfa8410da076af45ff7163a9521e774..f5cb260e03bdc720322b3047477f935fa8a04e5c 100644 (file)
@@ -56,7 +56,7 @@
   - type: Tool
     qualities:
     - Rolling
-    speed: 0.25 # its small so takes longer to roll the entire dough flat
+    speedModifier: 0.25 # its small so takes longer to roll the entire dough flat
   - type: SpaceGarbage
   - type: TrashOnSolutionEmpty
     solution: drink
index 561140a46a44de942da24eba6dbc7aa64d39a75b..fa6937dac341f599faae18ccd32bf49fe35f2a05 100644 (file)
@@ -85,7 +85,7 @@
   components:
   - type: Sprite
     color: "#bbeeff"
-  - type: WelderRefinable
+  - type: ToolRefinable
     refineResult:
     - id: SheetGlass1
   - type: DamageUserOnTrigger
     damage:
       types:
         Slash: 4.5
-  - type: WelderRefinable
+  - type: ToolRefinable
     refineResult:
     - id: SheetGlass1
     - id: PartRodMetal1
     damage:
       types:
         Slash: 5.5
-  - type: WelderRefinable
+  - type: ToolRefinable
     refineResult:
     - id: SheetGlass1
     - id: SheetPlasma1
       types:
         Slash: 4.5
         Radiation: 2
-  - type: WelderRefinable
+  - type: ToolRefinable
     refineResult:
     - id: SheetGlass1
     - id: SheetUranium1
   components:
   - type: Sprite
     color: "#e0aa36"
-  - type: WelderRefinable
+  - type: ToolRefinable
     refineResult:
     - id: SheetGlass1
     - id: SheetBrass1
index 32222d0036cd1fdd474f564a83a24b0c9bd3d9bf..9d3ef6c42427cee2a01c73c537ea4960b8223bed 100644 (file)
@@ -26,6 +26,6 @@
     materialComposition:
       Glass: 50
   - type: SpaceGarbage
-  - type: WelderRefinable
+  - type: ToolRefinable
     refineResult:
     - id: SheetGlass1
index 112ce99710d39be525bdf3a88904818a4bec4c10..71629919ae4ea961a036996c58f19b3d1e5a20dc 100644 (file)
@@ -46,7 +46,7 @@
   - type: Tool
     qualities:
     - Rolling
-    speed: 0.5 # its very big, akward to use
+    speedModifier: 0.5 # its very big, akward to use
   - type: Appearance
   - type: GenericVisualizer
     visuals:
index bccf10bee53578f91407771c7e7845cd9f0219c8..3f7da1efab3556ae5c31740a27f7d5a2934099d8 100644 (file)
@@ -66,7 +66,7 @@
     materialComposition:
       Glass: 25
   - type: SpaceGarbage
-  - type: WelderRefinable
+  - type: ToolRefinable
     refineResult:
     - id: SheetGlass1
 
   - type: Construction
     graph: CyanLight
     node: icon
-  - type: WelderRefinable
+  - type: ToolRefinable
     refineResult:
     - id: SheetGlass1
     - id: ShardCrystalCyan
   - type: Construction
     graph: BlueLight
     node: icon
-  - type: WelderRefinable
+  - type: ToolRefinable
     refineResult:
     - id: SheetGlass1
     - id: ShardCrystalBlue
   - type: Construction
     graph: PinkLight
     node: icon
-  - type: WelderRefinable
+  - type: ToolRefinable
     refineResult:
     - id: SheetGlass1
     - id: ShardCrystalPink
   - type: Construction
     graph: OrangeLight
     node: icon
-  - type: WelderRefinable
+  - type: ToolRefinable
     refineResult:
     - id: SheetGlass1
     - id: ShardCrystalOrange
   - type: Construction
     graph: RedLight
     node: icon
-  - type: WelderRefinable
+  - type: ToolRefinable
     refineResult:
     - id: SheetGlass1
     - id: ShardCrystalRed
   - type: Construction
     graph: GreenLight
     node: icon
-  - type: WelderRefinable
+  - type: ToolRefinable
     refineResult:
     - id: SheetGlass1
     - id: ShardCrystalGreen
index aa0cf46187210f930b7babb93e86c8a123ebc53e..c4f7798154e346eb62a7bf22cb6db12c0b7f19fc 100644 (file)
   - type: Tool
     qualities:
       - Sawing
-    speed: 1.0
+    speedModifier: 1.0
 # No melee for regular saw because have you ever seen someone use a band saw as a weapon? It's dumb.
 
 - type: entity
   - type: Tool
     qualities:
       - Sawing
-    speed: 0.5
+    speedModifier: 0.5
 
 - type: entity
   name: circular saw
   - type: Tool
     qualities:
       - Sawing
-    speed: 1.5
+    speedModifier: 1.5
 
 - type: entity
   name: advanced circular saw
   - type: Tool
     qualities:
       - Sawing
-    speed: 2.0
+    speedModifier: 2.0
index 87959ebef3dbf4f7931a378978cc008ab388504f..c9b37b8b1aed704dabe4c176cdb10fa0d2bc110e 100644 (file)
@@ -21,7 +21,7 @@
     - Cutting
     useSound:
       path: /Audio/Items/wirecutter.ogg
-    speed: 0.05
+    speedModifier: 0.05
   - type: Item
     sprite: Objects/Tools/Cowtools/haycutters.rsi
 
@@ -46,7 +46,7 @@
     - Screwing
     useSound:
       collection: Screwdriver
-    speed: 0.05
+    speedModifier: 0.05
 
 - type: entity
   name: wronch
@@ -69,7 +69,7 @@
     - Anchoring
     useSound:
       path: /Audio/Items/ratchet.ogg
-    speed: 0.05
+    speedModifier: 0.05
 
 - type: entity
   name: cowbar
@@ -93,7 +93,7 @@
     - Prying
     useSound:
       path: /Audio/Items/crowbar.ogg
-    speed: 0.05
+    speedModifier: 0.05
   - type: ToolTileCompatible
   - type: Prying
 
     size: Small
     sprite: Objects/Tools/Cowtools/cowelder.rsi
   - type: Tool
-    speed: 0.05
+    speedModifier: 0.05
 
 - type: entity
   name: milkalyzer
index 7bdd32f45795b21e1cb07acc361b61bb2e39f933..53423e84a4fea90457e7042ff3d4fe32a2605981 100644 (file)
@@ -51,7 +51,7 @@
   - type: Tool
     qualities:
     - Rolling
-    speed: 0.6 # fairly unwieldly but nice round surface
+    speedModifier: 0.6 # fairly unwieldly but nice round surface
 
 - type: entity
   parent: GasTankRoundBase
index 8e2b7597970d1b22ca2591458f483258267d811e..c80e53870e583dbf9084dcb48f7d46d4bd495f29 100644 (file)
@@ -21,7 +21,7 @@
   - type: Tool
     qualities:
       - Prying
-    speed: 1.5
+    speedModifier: 1.5
     useSound: /Audio/Items/jaws_pry.ogg
   - type: Prying
     pryPowered: true
@@ -69,7 +69,7 @@
   - type: Tool
     qualities:
       - Prying
-    speed: 3.0
+    speedModifier: 3.0
   - type: MultipleTool
     entries:
       - behavior: Prying
index 452a905329e25df6c473d8491b3acbbad2c10831..7930482960ffdd1636b659fc584d3bd2db4c8132 100644 (file)
   - type: Tool
     qualities:
       - Screwing
-    speed: 1.5
+    speedModifier: 1.5
     useSound: /Audio/Items/drill_use.ogg
   - type: MultipleTool
     statusShowBehavior: true
   - type: Tool
     qualities:
       - Screwing
-    speed: 1.2 # Kept for future adjustments. Currently 1.2x for balance
+    speedModifier: 1.2 # Kept for future adjustments. Currently 1.2x for balance
     useSound: /Audio/Items/drill_use.ogg
   - type: ToolTileCompatible
   - type: MultipleTool
index 9bf3f2e2cb9d0b34b9b586f94f81d1d41dfab96d..9db30edb52ed57cf929a7b0205220c8ed104660f 100644 (file)
           Quantity: 250
         maxVol: 250
   - type: Tool
-    speed: 1.3
+    speedModifier: 1.3
 
 - type: entity
   name: experimental welding tool
           Quantity: 50
         maxVol: 50
   - type: Tool
-    speed: 0.7
+    speedModifier: 0.7
   - type: PointLight
     enabled: false
     radius: 1.0
index 5347096bf10e23f6b0e1d4b3f9be09666b3d07d6..818c4bd67685d93af9f67500d89a6f315e21dfe7 100644 (file)
@@ -26,7 +26,7 @@
   - type: Tool
     qualities:
     - Rolling
-    speed: 0.75 # a bit unwieldly but does the job
+    speedModifier: 0.75 # a bit unwieldly but does the job
   - type: Clothing
     quickEquip: false
     slots:
index 934298b62076294b3fd0693b2de1adfbacb9191e..df19550cdbdebf2d2590047e6b1f9a9d93a471a9 100644 (file)
@@ -25,8 +25,7 @@
   - type: ReagentTank
     tankType: Fuel
   - type: DamageOnToolInteract
-    tools:
-    - Welding
+    tools: Welding
     weldingDamage:
       types:
         Heat: 10
       fillBaseName: watertank-2-
     - type: ExaminableSolution
       solution: tank
-
index 72ea308af087722c5477356554a78dcf2c4b0fce..3570264a57ac0e6c2e7d9d22bd693e8354b89f95 100644 (file)
@@ -82,8 +82,7 @@
   - type: ReagentTank
     tankType: Fuel
   - type: DamageOnToolInteract
-    tools:
-    - Welding
+    tools: Welding
     weldingDamage:
       types:
         Heat: 20
index 84df09af33d7feeb8cc82d47326e4c5f03807e4a..a89670805799a3529f6ef213d970a1de611ce94c 100644 (file)
   - type: Tool
     qualities:
     - Screwing
-    speed: 2 # Very powerful multitool to balance out the desire to sell or scrap for points
+    speedModifier: 2 # Very powerful multitool to balance out the desire to sell or scrap for points
     useSound: /Audio/Items/drill_use.ogg
   - type: Tag
     tags: