]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
UseDelay + ItemCooldown merge (#22502)
authorAJCM-git <60196617+AJCM-git@users.noreply.github.com>
Thu, 4 Jan 2024 01:33:09 +0000 (21:33 -0400)
committerGitHub <noreply@github.com>
Thu, 4 Jan 2024 01:33:09 +0000 (21:33 -0400)
80 files changed:
Content.Client/Inventory/ClientInventorySystem.cs
Content.Client/UserInterface/Systems/Hands/HandsUIController.cs
Content.Server/Atmos/EntitySystems/FlammableSystem.cs
Content.Server/Bible/BibleSystem.cs
Content.Server/Cargo/Systems/PriceGunSystem.cs
Content.Server/Chemistry/EntitySystems/ChemistrySystemHypospray.cs
Content.Server/Cooldown/ItemCooldownSystem.cs [deleted file]
Content.Server/DeviceLinking/Systems/LogicGateSystem.cs
Content.Server/DeviceLinking/Systems/PowerSensorSystem.cs
Content.Server/DeviceLinking/Systems/SignallerSystem.cs
Content.Server/Fluids/EntitySystems/AbsorbentSystem.cs
Content.Server/Fluids/EntitySystems/SpraySystem.cs
Content.Server/IgnitionSource/IgniteOnTriggerSystem.cs
Content.Server/Inventory/ServerInventorySystem.cs
Content.Server/Medical/DefibrillatorSystem.cs
Content.Server/NPC/HTN/PrimitiveTasks/Operators/Interactions/InteractWithOperator.cs
Content.Server/Ninja/Systems/NinjaSuitSystem.cs
Content.Server/Power/Generator/PowerSwitchableSystem.cs
Content.Server/Singularity/Components/RadiationCollectorComponent.cs
Content.Server/Singularity/EntitySystems/RadiationCollectorSystem.cs
Content.Server/Storage/EntitySystems/StorageSystem.cs
Content.Server/Xenoarchaeology/Equipment/Systems/NodeScannerSystem.cs
Content.Shared/Clothing/EntitySystems/ClothingSystem.cs
Content.Shared/Cooldown/Cooldowns.cs [deleted file]
Content.Shared/Cooldown/ItemCooldownComponent.cs [deleted file]
Content.Shared/Interaction/Events/UseInHandEvent.cs
Content.Shared/Interaction/SharedInteractionSystem.cs
Content.Shared/Inventory/InventorySystem.Equip.cs
Content.Shared/Mech/Equipment/Systems/MechSoundboardSystem.cs
Content.Shared/Ninja/Systems/SharedNinjaGlovesSystem.cs
Content.Shared/Ninja/Systems/SharedNinjaSuitSystem.cs
Content.Shared/Timing/UseDelayComponent.cs
Content.Shared/Timing/UseDelaySystem.cs
Content.Shared/Weapons/Misc/SharedGrapplingGunSystem.cs
Content.Shared/Weapons/Ranged/Systems/UseDelayOnShootSystem.cs
Content.Shared/Wieldable/WieldableSystem.cs
Resources/Maps/aspid.yml
Resources/Maps/cluster.yml
Resources/Maps/europa.yml
Resources/Maps/gemini.yml
Resources/Maps/marathon.yml
Resources/Maps/meta.yml
Resources/Maps/origin.yml
Resources/Maps/saltern.yml
Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_cans.yml
Resources/Prototypes/Entities/Objects/Consumable/Drinks/drinks_cups.yml
Resources/Prototypes/Entities/Objects/Devices/Syndicate_Gadgets/reinforcement_teleporter.yml
Resources/Prototypes/Entities/Objects/Devices/holoprojectors.yml
Resources/Prototypes/Entities/Objects/Fun/bike_horn.yml
Resources/Prototypes/Entities/Objects/Fun/darts.yml
Resources/Prototypes/Entities/Objects/Fun/dice.yml
Resources/Prototypes/Entities/Objects/Fun/skub.yml
Resources/Prototypes/Entities/Objects/Fun/toys.yml
Resources/Prototypes/Entities/Objects/Materials/crystal_shard.yml
Resources/Prototypes/Entities/Objects/Materials/shards.yml
Resources/Prototypes/Entities/Objects/Misc/broken_bottle.yml
Resources/Prototypes/Entities/Objects/Misc/desk_bell.yml
Resources/Prototypes/Entities/Objects/Misc/fire_extinguisher.yml
Resources/Prototypes/Entities/Objects/Misc/paper.yml
Resources/Prototypes/Entities/Objects/Specific/Chapel/bibles.yml
Resources/Prototypes/Entities/Objects/Specific/Hydroponics/sprays.yml
Resources/Prototypes/Entities/Objects/Specific/Hydroponics/tools.yml
Resources/Prototypes/Entities/Objects/Specific/Janitorial/janitor.yml
Resources/Prototypes/Entities/Objects/Specific/Janitorial/spray.yml
Resources/Prototypes/Entities/Objects/Specific/Medical/defib.yml
Resources/Prototypes/Entities/Objects/Specific/Medical/surgery.yml
Resources/Prototypes/Entities/Objects/Specific/Service/vending_machine_restock.yml
Resources/Prototypes/Entities/Objects/Tools/cowtools.yml
Resources/Prototypes/Entities/Objects/Tools/lighters.yml
Resources/Prototypes/Entities/Objects/Tools/toolbox.yml
Resources/Prototypes/Entities/Objects/Tools/tools.yml
Resources/Prototypes/Entities/Objects/Tools/welders.yml
Resources/Prototypes/Entities/Objects/Weapons/Melee/knife.yml
Resources/Prototypes/Entities/Objects/Weapons/Melee/pickaxe.yml
Resources/Prototypes/Entities/Objects/Weapons/Melee/spear.yml
Resources/Prototypes/Entities/Objects/Weapons/Melee/stunprod.yml
Resources/Prototypes/Entities/Objects/Weapons/security.yml
Resources/Prototypes/Entities/Structures/Power/Generation/Singularity/collector.yml
Resources/Prototypes/Entities/Structures/Specific/Anomaly/cores.yml
Resources/Prototypes/XenoArch/Effects/utility_effects.yml

index d4615210f2450abc84000e4c43f719e312499f87..7b98513a92950a84dba19f064c74b4da0d0a7f19 100644 (file)
@@ -1,9 +1,7 @@
 using Content.Client.Clothing;
 using Content.Client.Examine;
 using Content.Client.Verbs.UI;
-using Content.Shared.Clothing.Components;
 using Content.Shared.Interaction;
-using Content.Shared.Interaction.Events;
 using Content.Shared.Inventory;
 using Content.Shared.Inventory.Events;
 using Content.Shared.Storage;
@@ -48,8 +46,6 @@ namespace Content.Client.Inventory
                 _equipEventsQueue.Enqueue((comp, args)));
             SubscribeLocalEvent<InventorySlotsComponent, DidUnequipEvent>((_, comp, args) =>
                 _equipEventsQueue.Enqueue((comp, args)));
-
-            SubscribeLocalEvent<ClothingComponent, UseInHandEvent>(OnUseInHand);
         }
 
         public override void Update(float frameTime)
@@ -74,14 +70,6 @@ namespace Content.Client.Inventory
             }
         }
 
-        private void OnUseInHand(EntityUid uid, ClothingComponent component, UseInHandEvent args)
-        {
-            if (args.Handled || !component.QuickEquip)
-                return;
-
-            QuickEquip(uid, component, args);
-        }
-
         private void OnDidUnequip(InventorySlotsComponent component, DidUnequipEvent args)
         {
             UpdateSlot(args.Equipee, component, args.Slot);
index 09d6a080ef46556c7a1ade7deea1767c5c2dea52..a15f1cbb76219888fbc22b7cbdf07ae11ad7bd6b 100644 (file)
@@ -3,10 +3,9 @@ using Content.Client.Hands.Systems;
 using Content.Client.UserInterface.Controls;
 using Content.Client.UserInterface.Systems.Hands.Controls;
 using Content.Client.UserInterface.Systems.Hotbar.Widgets;
-using Content.Shared.Cooldown;
 using Content.Shared.Hands.Components;
 using Content.Shared.Input;
-using Robust.Client.GameObjects;
+using Content.Shared.Timing;
 using Robust.Client.Player;
 using Robust.Client.UserInterface;
 using Robust.Client.UserInterface.Controllers;
@@ -247,7 +246,7 @@ public sealed class HandsUIController : UIController, IOnStateEntered<GameplaySt
 
         if (HandsGui != null &&
             _playerHandsComponent != null &&
-            _player.LocalPlayer?.ControlledEntity is { } playerEntity &&
+            _player.LocalSession?.AttachedEntity is { } playerEntity &&
             _handsSystem.TryGetHand(playerEntity, handName, out var hand, _playerHandsComponent))
         {
             HandsGui.UpdatePanelEntity(hand.HeldEntity);
@@ -329,7 +328,6 @@ public sealed class HandsUIController : UIController, IOnStateEntered<GameplaySt
 
     private bool RemoveHand(string handName, out HandButton? handButton)
     {
-        handButton = null;
         if (!_handLookup.TryGetValue(handName, out handButton))
             return false;
         if (handButton.Parent is HandsContainer handContainer)
@@ -395,8 +393,9 @@ public sealed class HandsUIController : UIController, IOnStateEntered<GameplaySt
         {
             foreach (var hand in container.GetButtons())
             {
-                if (!_entities.TryGetComponent(hand.Entity, out ItemCooldownComponent? cooldown) ||
-                    cooldown is not { CooldownStart: { } start, CooldownEnd: { } end})
+
+                if (!_entities.TryGetComponent(hand.Entity, out UseDelayComponent? useDelay) ||
+                    useDelay is not { DelayStartTime: var start, DelayEndTime: var end })
                 {
                     hand.CooldownDisplay.Visible = false;
                     return;
index 069429481c4331cb2a58b93f82811f32202b5357..95273f6e7f255f68315555a88803d0fbb7baa8cc 100644 (file)
@@ -1,6 +1,5 @@
 using Content.Server.Administration.Logs;
 using Content.Server.Atmos.Components;
-using Content.Server.Explosion.EntitySystems;
 using Content.Server.IgnitionSource;
 using Content.Server.Stunnable;
 using Content.Server.Temperature.Components;
@@ -12,7 +11,6 @@ using Content.Shared.Atmos.Components;
 using Content.Shared.Damage;
 using Content.Shared.Database;
 using Content.Shared.Interaction;
-using Content.Shared.Interaction.Events;
 using Content.Shared.Physics;
 using Content.Shared.Popups;
 using Content.Shared.Rejuvenate;
@@ -22,7 +20,6 @@ using Content.Shared.Timing;
 using Content.Shared.Toggleable;
 using Content.Shared.Weapons.Melee.Events;
 using Robust.Server.Audio;
-using Robust.Server.GameObjects;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Physics.Events;
 using Robust.Shared.Physics.Systems;
@@ -39,9 +36,7 @@ namespace Content.Server.Atmos.EntitySystems
         [Dependency] private readonly IgnitionSourceSystem _ignitionSourceSystem = default!;
         [Dependency] private readonly DamageableSystem _damageableSystem = default!;
         [Dependency] private readonly AlertsSystem _alertsSystem = default!;
-        [Dependency] private readonly TransformSystem _transformSystem = default!;
         [Dependency] private readonly FixtureSystem _fixture = default!;
-        [Dependency] private readonly EntityLookupSystem _lookup = default!;
         [Dependency] private readonly IAdminLogManager _adminLogger = default!;
         [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
         [Dependency] private readonly SharedPopupSystem _popup = default!;
@@ -59,7 +54,6 @@ namespace Content.Server.Atmos.EntitySystems
         private float _timer;
 
         private readonly Dictionary<Entity<FlammableComponent>, float> _fireEvents = new();
-        private readonly List<EntityUid> _toRemove = new();
 
         public override void Initialize()
         {
@@ -157,10 +151,11 @@ namespace Content.Server.Atmos.EntitySystems
 
             args.Handled = true;
 
-            if (!_useDelay.BeginDelay(uid))
+            if (!TryComp(uid, out UseDelayComponent? useDelay) || !_useDelay.TryResetDelay((uid, useDelay), true))
                 return;
 
             _audio.PlayPvs(component.ExtinguishAttemptSound, uid);
+
             if (_random.Prob(component.Probability))
             {
                 AdjustFireStacks(uid, component.StackDelta, flammable);
@@ -170,6 +165,7 @@ namespace Content.Server.Atmos.EntitySystems
                 _popup.PopupEntity(Loc.GetString(component.ExtinguishFailed), uid);
             }
         }
+
         private void OnCollide(EntityUid uid, FlammableComponent flammable, ref StartCollideEvent args)
         {
             var otherUid = args.OtherEntity;
@@ -364,7 +360,7 @@ namespace Content.Server.Atmos.EntitySystems
 
             // TODO: This needs cleanup to take off the crust from TemperatureComponent and shit.
             var query = EntityQueryEnumerator<FlammableComponent, TransformComponent>();
-            while (query.MoveNext(out var uid, out var flammable, out var transform))
+            while (query.MoveNext(out var uid, out var flammable, out _))
             {
                 // Slowly dry ourselves off if wet.
                 if (flammable.FireStacks < 0)
@@ -394,7 +390,7 @@ namespace Content.Server.Atmos.EntitySystems
                     EnsureComp<IgnitionSourceComponent>(uid);
                     _ignitionSourceSystem.SetIgnited(uid);
 
-                    var damageScale = MathF.Min(flammable.FireStacks, 5);
+                    var damageScale = MathF.Min(  flammable.FireStacks, 5);
 
                     if (TryComp(uid, out TemperatureComponent? temp))
                         _temperatureSystem.ChangeHeat(uid, 12500 * damageScale, false, temp);
index 5c153bb46452485ee51452c68ee84382ac5c8ef2..c845b17230a4a756c18cb4a8a004fddb92cdf464 100644 (file)
@@ -32,6 +32,7 @@ namespace Content.Server.Bible
         [Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
         [Dependency] private readonly SharedAudioSystem _audio = default!;
         [Dependency] private readonly UseDelaySystem _delay = default!;
+        [Dependency] private readonly SharedTransformSystem _transform = default!;
 
         public override void Initialize()
         {
@@ -55,20 +56,20 @@ namespace Content.Server.Bible
         {
             base.Update(frameTime);
 
-            foreach(var entity in _addQueue)
+            foreach (var entity in _addQueue)
             {
                 EnsureComp<SummonableRespawningComponent>(entity);
             }
             _addQueue.Clear();
 
-            foreach(var entity in _remQueue)
+            foreach (var entity in _remQueue)
             {
                 RemComp<SummonableRespawningComponent>(entity);
             }
             _remQueue.Clear();
 
             var query = EntityQueryEnumerator<SummonableRespawningComponent, SummonableComponent>();
-            while (query.MoveNext(out var uid, out var respawning, out var summonableComp))
+            while (query.MoveNext(out var uid, out var _, out var summonableComp))
             {
                 summonableComp.Accumulator += frameTime;
                 if (summonableComp.Accumulator < summonableComp.RespawnTime)
@@ -82,8 +83,8 @@ namespace Content.Server.Bible
                     summonableComp.Summon = null;
                 }
                 summonableComp.AlreadySummoned = false;
-                _popupSystem.PopupEntity(Loc.GetString("bible-summon-respawn-ready", ("book", summonableComp.Owner)), summonableComp.Owner, PopupType.Medium);
-                _audio.PlayPvs("/Audio/Effects/radpulse9.ogg", summonableComp.Owner, AudioParams.Default.WithVolume(-4f));
+                _popupSystem.PopupEntity(Loc.GetString("bible-summon-respawn-ready", ("book", uid)), uid, PopupType.Medium);
+                _audio.PlayPvs("/Audio/Effects/radpulse9.ogg", uid, AudioParams.Default.WithVolume(-4f));
                 // Clean up the accumulator and respawn tracking component
                 summonableComp.Accumulator = 0;
                 _remQueue.Enqueue(uid);
@@ -95,9 +96,7 @@ namespace Content.Server.Bible
             if (!args.CanReach)
                 return;
 
-            UseDelayComponent? delay = null;
-
-            if (_delay.ActiveDelay(uid, delay))
+            if (!TryComp(uid, out UseDelayComponent? useDelay) || _delay.IsDelayed((uid, useDelay)))
                 return;
 
             if (args.Target == null || args.Target == args.User || !_mobStateSystem.IsAlive(args.Target.Value))
@@ -111,7 +110,7 @@ namespace Content.Server.Bible
 
                 _audio.PlayPvs(component.SizzleSoundPath, args.User);
                 _damageableSystem.TryChangeDamage(args.User, component.DamageOnUntrainedUse, true, origin: uid);
-                _delay.BeginDelay(uid, delay);
+                _delay.TryResetDelay((uid, useDelay));
 
                 return;
             }
@@ -121,15 +120,15 @@ namespace Content.Server.Bible
             {
                 if (_random.Prob(component.FailChance))
                 {
-                    var othersFailMessage = Loc.GetString(component.LocPrefix + "-heal-fail-others", ("user", Identity.Entity(args.User, EntityManager)),("target", Identity.Entity(args.Target.Value, EntityManager)),("bible", uid));
+                    var othersFailMessage = Loc.GetString(component.LocPrefix + "-heal-fail-others", ("user", Identity.Entity(args.User, EntityManager)), ("target", Identity.Entity(args.Target.Value, EntityManager)), ("bible", uid));
                     _popupSystem.PopupEntity(othersFailMessage, args.User, Filter.PvsExcept(args.User), true, PopupType.SmallCaution);
 
-                    var selfFailMessage = Loc.GetString(component.LocPrefix + "-heal-fail-self", ("target", Identity.Entity(args.Target.Value, EntityManager)),("bible", uid));
+                    var selfFailMessage = Loc.GetString(component.LocPrefix + "-heal-fail-self", ("target", Identity.Entity(args.Target.Value, EntityManager)), ("bible", uid));
                     _popupSystem.PopupEntity(selfFailMessage, args.User, args.User, PopupType.MediumCaution);
 
                     _audio.PlayPvs("/Audio/Effects/hit_kick.ogg", args.User);
                     _damageableSystem.TryChangeDamage(args.Target.Value, component.DamageOnFail, true, origin: uid);
-                    _delay.BeginDelay(uid, delay);
+                    _delay.TryResetDelay((uid, useDelay));
                     return;
                 }
             }
@@ -138,21 +137,21 @@ namespace Content.Server.Bible
 
             if (damage == null || damage.Empty)
             {
-                var othersMessage = Loc.GetString(component.LocPrefix + "-heal-success-none-others", ("user", Identity.Entity(args.User, EntityManager)),("target", Identity.Entity(args.Target.Value, EntityManager)),("bible", uid));
+                var othersMessage = Loc.GetString(component.LocPrefix + "-heal-success-none-others", ("user", Identity.Entity(args.User, EntityManager)), ("target", Identity.Entity(args.Target.Value, EntityManager)), ("bible", uid));
                 _popupSystem.PopupEntity(othersMessage, args.User, Filter.PvsExcept(args.User), true, PopupType.Medium);
 
-                var selfMessage = Loc.GetString(component.LocPrefix + "-heal-success-none-self", ("target", Identity.Entity(args.Target.Value, EntityManager)),("bible", uid));
+                var selfMessage = Loc.GetString(component.LocPrefix + "-heal-success-none-self", ("target", Identity.Entity(args.Target.Value, EntityManager)), ("bible", uid));
                 _popupSystem.PopupEntity(selfMessage, args.User, args.User, PopupType.Large);
             }
             else
             {
-                var othersMessage = Loc.GetString(component.LocPrefix + "-heal-success-others", ("user", Identity.Entity(args.User, EntityManager)),("target", Identity.Entity(args.Target.Value, EntityManager)),("bible", uid));
+                var othersMessage = Loc.GetString(component.LocPrefix + "-heal-success-others", ("user", Identity.Entity(args.User, EntityManager)), ("target", Identity.Entity(args.Target.Value, EntityManager)), ("bible", uid));
                 _popupSystem.PopupEntity(othersMessage, args.User, Filter.PvsExcept(args.User), true, PopupType.Medium);
 
-                var selfMessage = Loc.GetString(component.LocPrefix + "-heal-success-self", ("target", Identity.Entity(args.Target.Value, EntityManager)),("bible", uid));
+                var selfMessage = Loc.GetString(component.LocPrefix + "-heal-success-self", ("target", Identity.Entity(args.Target.Value, EntityManager)), ("bible", uid));
                 _popupSystem.PopupEntity(selfMessage, args.User, args.User, PopupType.Large);
                 _audio.PlayPvs(component.HealSoundPath, args.User);
-                _delay.BeginDelay(uid, delay);
+                _delay.TryResetDelay((uid, useDelay));
             }
         }
 
@@ -168,7 +167,8 @@ namespace Content.Server.Bible
             {
                 Act = () =>
                 {
-                    if (!TryComp<TransformComponent>(args.User, out var userXform)) return;
+                    if (!TryComp<TransformComponent>(args.User, out var userXform))
+                        return;
 
                     AttemptSummon((uid, component), args.User, userXform);
                 },
@@ -236,13 +236,13 @@ namespace Content.Server.Bible
 
             // Make this familiar the component's summon
             var familiar = EntityManager.SpawnEntity(component.SpecialItemPrototype, position.Coordinates);
-                            component.Summon = familiar;
+            component.Summon = familiar;
 
             // If this is going to use a ghost role mob spawner, attach it to the bible.
             if (HasComp<GhostRoleMobSpawnerComponent>(familiar))
             {
                 _popupSystem.PopupEntity(Loc.GetString("bible-summon-requested"), user, PopupType.Medium);
-                Transform(familiar).AttachParent(uid);
+                _transform.SetParent(familiar, uid);
             }
             component.AlreadySummoned = true;
             _actionsSystem.RemoveAction(user, component.SummonActionEntity);
index 23bded1d4263705f3fd5007e1485d9d321d199bf..d7d708821c9b2e440bd075c427f143480debf820 100644 (file)
@@ -4,7 +4,6 @@ using Content.Shared.IdentityManagement;
 using Content.Shared.Interaction;
 using Content.Shared.Timing;
 using Content.Shared.Verbs;
-using Robust.Shared.Player;
 
 namespace Content.Server.Cargo.Systems;
 
@@ -26,11 +25,10 @@ public sealed class PriceGunSystem : EntitySystem
 
     private void OnUtilityVerb(EntityUid uid, PriceGunComponent component, GetVerbsEvent<UtilityVerb> args)
     {
-
-        if (!args.CanAccess || !args.CanInteract)
+        if (!args.CanAccess || !args.CanInteract || args.Using == null)
             return;
 
-        if (TryComp(args.Using, out UseDelayComponent? useDelay) && useDelay.ActiveDelay)
+        if (!TryComp(uid, out UseDelayComponent? useDelay) || _useDelay.IsDelayed((uid, useDelay)))
             return;
 
         var price = _pricingSystem.GetPrice(args.Target);
@@ -40,7 +38,7 @@ public sealed class PriceGunSystem : EntitySystem
             Act = () =>
             {
                 _popupSystem.PopupEntity(Loc.GetString("price-gun-pricing-result", ("object", Identity.Entity(args.Target, EntityManager)), ("price", $"{price:F2}")), args.User, args.User);
-                _useDelay.BeginDelay(uid, useDelay);
+                _useDelay.TryResetDelay((uid, useDelay));
             },
             Text = Loc.GetString("price-gun-verb-text"),
             Message = Loc.GetString("price-gun-verb-message", ("object", Identity.Entity(args.Target, EntityManager)))
@@ -48,18 +46,19 @@ public sealed class PriceGunSystem : EntitySystem
 
         args.Verbs.Add(verb);
     }
+
     private void OnAfterInteract(EntityUid uid, PriceGunComponent component, AfterInteractEvent args)
     {
         if (!args.CanReach || args.Target == null || args.Handled)
             return;
 
-        if (TryComp(args.Used, out UseDelayComponent? useDelay) && useDelay.ActiveDelay)
+        if (!TryComp(uid, out UseDelayComponent? useDelay) || _useDelay.IsDelayed((uid, useDelay)))
             return;
 
         var price = _pricingSystem.GetPrice(args.Target.Value);
 
         _popupSystem.PopupEntity(Loc.GetString("price-gun-pricing-result", ("object", Identity.Entity(args.Target.Value, EntityManager)), ("price", $"{price:F2}")), args.User, args.User);
-        _useDelay.BeginDelay(uid, useDelay);
+        _useDelay.TryResetDelay((uid, useDelay));
         args.Handled = true;
     }
 }
index 9c1b5130a22d71ce051e677d88b7cc314884369e..be8faec9845063265104f2fe667134e37fbd501d 100644 (file)
@@ -79,8 +79,12 @@ namespace Content.Server.Chemistry.EntitySystems
             if (!EligibleEntity(target, _entMan, component))
                 return false;
 
-            if (TryComp(uid, out UseDelayComponent? delayComp) && _useDelay.ActiveDelay(uid, delayComp))
-                return false;
+            if (TryComp(uid, out UseDelayComponent? delayComp))
+            {
+                if (_useDelay.IsDelayed((uid, delayComp)))
+                    return false;
+            }
+
 
             string? msgFormat = null;
 
@@ -117,8 +121,8 @@ namespace Content.Server.Chemistry.EntitySystems
 
             // Medipens and such use this system and don't have a delay, requiring extra checks
             // BeginDelay function returns if item is already on delay
-            if (delayComp is not null)
-                _useDelay.BeginDelay(uid, delayComp);
+            if (delayComp != null)
+                _useDelay.TryResetDelay((uid, delayComp));
 
             // Get transfer amount. May be smaller than component.TransferAmount if not enough room
             var realTransferAmount = FixedPoint2.Min(component.TransferAmount, targetSolution.AvailableVolume);
diff --git a/Content.Server/Cooldown/ItemCooldownSystem.cs b/Content.Server/Cooldown/ItemCooldownSystem.cs
deleted file mode 100644 (file)
index 77d2dd1..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-using Content.Shared.Cooldown;
-
-namespace Content.Server.Cooldown
-{
-    public sealed class ItemCooldownSystem : EntitySystem
-    {
-        public override void Initialize()
-        {
-            base.Initialize();
-
-            SubscribeLocalEvent<ItemCooldownComponent, RefreshItemCooldownEvent>(OnItemCooldownRefreshed);
-        }
-
-        public void OnItemCooldownRefreshed(EntityUid uid, ItemCooldownComponent comp, RefreshItemCooldownEvent args)
-        {
-            comp.CooldownStart = args.LastAttackTime;
-            comp.CooldownEnd = args.CooldownEnd;
-        }
-    }
-
-    public sealed class RefreshItemCooldownEvent : EntityEventArgs
-    {
-        public TimeSpan LastAttackTime { get; }
-        public TimeSpan CooldownEnd { get;  }
-
-        public RefreshItemCooldownEvent(TimeSpan lastAttackTime, TimeSpan cooldownEnd)
-        {
-            LastAttackTime = lastAttackTime;
-            CooldownEnd = cooldownEnd;
-        }
-    }
-}
index 115285413f396af7b8556fef159aaa3624cad991..598d5a2725ef70691620709d3125082cb6d2e365 100644 (file)
@@ -5,9 +5,7 @@ using Content.Shared.Examine;
 using Content.Shared.Interaction;
 using Content.Shared.Popups;
 using Content.Shared.Timing;
-using Content.Shared.Tools;
 using Content.Shared.Tools.Systems;
-using Robust.Shared.Audio;
 using Robust.Shared.Audio.Systems;
 using SignalReceivedEvent = Content.Server.DeviceLinking.Events.SignalReceivedEvent;
 
@@ -74,7 +72,8 @@ public sealed class LogicGateSystem : EntitySystem
             return;
 
         // no sound spamming
-        if (TryComp<UseDelayComponent>(uid, out var useDelay) && _useDelay.ActiveDelay(uid, useDelay))
+        if (TryComp<UseDelayComponent>(uid, out var useDelay)
+            && !_useDelay.TryResetDelay((uid, useDelay), true))
             return;
 
         // cycle through possible gates
@@ -90,8 +89,6 @@ public sealed class LogicGateSystem : EntitySystem
         var msg = Loc.GetString("logic-gate-cycle", ("gate", comp.Gate.ToString().ToUpper()));
         _popup.PopupEntity(msg, uid, args.User);
         _appearance.SetData(uid, LogicGateVisuals.Gate, comp.Gate);
-
-        _useDelay.BeginDelay(uid, useDelay);
     }
 
     private void OnSignalReceived(EntityUid uid, LogicGateComponent comp, ref SignalReceivedEvent args)
index cabcabe1ae65a425577b705976ba880997a00cca..9975f04bbb38cdce17793103852b172b607141c1 100644 (file)
@@ -1,5 +1,4 @@
 using Content.Server.DeviceLinking.Components;
-using Content.Server.DeviceNetwork;
 using Content.Server.NodeContainer;
 using Content.Server.Power.EntitySystems;
 using Content.Server.Power.Nodes;
@@ -9,10 +8,9 @@ using Content.Shared.Interaction;
 using Content.Shared.Popups;
 using Content.Shared.Power.Generator;
 using Content.Shared.Timing;
-using Content.Shared.Tools;
 using Content.Shared.Tools.Systems;
 using Robust.Shared.Audio.Systems;
-using Robust.Shared.Map;
+using Robust.Shared.Map.Components;
 using Robust.Shared.Timing;
 
 namespace Content.Server.DeviceLinking.Systems;
@@ -21,7 +19,6 @@ public sealed class PowerSensorSystem : EntitySystem
 {
     [Dependency] private readonly DeviceLinkSystem _deviceLink = default!;
     [Dependency] private readonly IGameTiming _timing = default!;
-    [Dependency] private readonly IMapManager _mapManager = default!;
     [Dependency] private readonly PowerNetSystem _powerNet = default!;
     [Dependency] private readonly SharedAudioSystem _audio = default!;
     [Dependency] private readonly SharedPopupSystem _popup = default!;
@@ -76,7 +73,8 @@ public sealed class PowerSensorSystem : EntitySystem
             return;
 
         // no sound spamming
-        if (TryComp<UseDelayComponent>(uid, out var useDelay) && _useDelay.ActiveDelay(uid, useDelay))
+        if (TryComp<UseDelayComponent>(uid, out var useDelay)
+            && !_useDelay.TryResetDelay((uid, useDelay), true))
             return;
 
         // switch between input and output mode.
@@ -89,8 +87,6 @@ public sealed class PowerSensorSystem : EntitySystem
         _audio.PlayPvs(comp.SwitchSound, uid);
         var msg = Loc.GetString("power-sensor-switch", ("output", comp.Output));
         _popup.PopupEntity(msg, uid, args.User);
-
-        _useDelay.BeginDelay(uid, useDelay);
     }
 
     private void UpdateOutputs(EntityUid uid, PowerSensorComponent comp)
@@ -107,7 +103,9 @@ public sealed class PowerSensorSystem : EntitySystem
 
         // update state based on the power stats retrieved from the selected power network
         var xform = _xformQuery.GetComponent(uid);
-        _mapManager.TryGetGrid(xform.GridUid, out var grid);
+        if (!TryComp(xform.GridUid, out MapGridComponent? grid))
+            return;
+
         var cables = deviceNode.GetReachableNodes(xform, _nodeQuery, _xformQuery, grid, EntityManager);
         foreach (var node in cables)
         {
index 44a2385055246a6e672073cb5be9dc5201914f71..a5091508ed7c1e5ab5b516c440a47a1b9e61d383 100644 (file)
@@ -39,15 +39,12 @@ public sealed class SignallerSystem : EntitySystem
 
     private void OnTrigger(EntityUid uid, SignallerComponent component, TriggerEvent args)
     {
-        // if on cooldown, do nothing
-        var hasUseDelay = TryComp<UseDelayComponent>(uid, out var useDelay);
-        if (hasUseDelay && _useDelay.ActiveDelay(uid, useDelay))
+        if (!TryComp(uid, out UseDelayComponent? useDelay)
+            // if on cooldown, do nothing
+            // and set cooldown to prevent clocks
+            || !_useDelay.TryResetDelay((uid, useDelay), true))
             return;
 
-        // set cooldown to prevent clocks
-        if (hasUseDelay)
-            _useDelay.BeginDelay(uid, useDelay);
-
         _link.InvokePort(uid, component.Port);
         args.Handled = true;
     }
index 3fd2ca00e22ca42830e750d4cff8922e96a58afd..d88f46968abb77109b751b84c8a1821b2a24f294 100644 (file)
@@ -9,7 +9,8 @@ using Content.Shared.Interaction;
 using Content.Shared.Timing;
 using Content.Shared.Weapons.Melee;
 using Robust.Server.Audio;
-using Robust.Shared.Map;
+using Robust.Server.GameObjects;
+using Robust.Shared.Map.Components;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Utility;
 
@@ -18,7 +19,6 @@ namespace Content.Server.Fluids.EntitySystems;
 /// <inheritdoc/>
 public sealed class AbsorbentSystem : SharedAbsorbentSystem
 {
-    [Dependency] private readonly IMapManager _mapManager = default!;
     [Dependency] private readonly IPrototypeManager _prototype = default!;
     [Dependency] private readonly AudioSystem _audio = default!;
     [Dependency] private readonly PopupSystem _popups = default!;
@@ -27,6 +27,7 @@ public sealed class AbsorbentSystem : SharedAbsorbentSystem
     [Dependency] private readonly SharedTransformSystem _transform = default!;
     [Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
     [Dependency] private readonly UseDelaySystem _useDelay = default!;
+    [Dependency] private readonly MapSystem _mapSystem = default!;
 
     public override void Initialize()
     {
@@ -106,14 +107,15 @@ public sealed class AbsorbentSystem : SharedAbsorbentSystem
         if (!_solutionContainerSystem.TryGetSolution(used, AbsorbentComponent.SolutionName, out var absorberSoln))
             return;
 
-        if (_useDelay.ActiveDelay(used))
+        if (TryComp<UseDelayComponent>(used, out var useDelay)
+            && _useDelay.IsDelayed((used, useDelay)))
             return;
 
         // If it's a puddle try to grab from
-        if (!TryPuddleInteract(user, used, target, component, absorberSoln.Value))
+        if (!TryPuddleInteract(user, used, target, component, useDelay, absorberSoln.Value))
         {
             // If it's refillable try to transfer
-            if (!TryRefillableInteract(user, used, target, component, absorberSoln.Value))
+            if (!TryRefillableInteract(user, used, target, component, useDelay, absorberSoln.Value))
                 return;
         }
     }
@@ -121,7 +123,7 @@ public sealed class AbsorbentSystem : SharedAbsorbentSystem
     /// <summary>
     ///     Logic for an absorbing entity interacting with a refillable.
     /// </summary>
-    private bool TryRefillableInteract(EntityUid user, EntityUid used, EntityUid target, AbsorbentComponent component, Entity<SolutionComponent> absorbentSoln)
+    private bool TryRefillableInteract(EntityUid user, EntityUid used, EntityUid target, AbsorbentComponent component, UseDelayComponent? useDelay, Entity<SolutionComponent> absorbentSoln)
     {
         if (!TryComp(target, out RefillableSolutionComponent? refillable))
             return false;
@@ -143,7 +145,8 @@ public sealed class AbsorbentSystem : SharedAbsorbentSystem
         }
 
         _audio.PlayPvs(component.TransferSound, target);
-        _useDelay.BeginDelay(used);
+        if (useDelay != null)
+            _useDelay.TryResetDelay((used, useDelay));
         return true;
     }
 
@@ -264,7 +267,7 @@ public sealed class AbsorbentSystem : SharedAbsorbentSystem
     /// <summary>
     ///     Logic for an absorbing entity interacting with a puddle.
     /// </summary>
-    private bool TryPuddleInteract(EntityUid user, EntityUid used, EntityUid target, AbsorbentComponent absorber, Entity<SolutionComponent> absorberSoln)
+    private bool TryPuddleInteract(EntityUid user, EntityUid used, EntityUid target, AbsorbentComponent absorber, UseDelayComponent? useDelay, Entity<SolutionComponent> absorberSoln)
     {
         if (!TryComp(target, out PuddleComponent? puddle))
             return false;
@@ -297,17 +300,20 @@ public sealed class AbsorbentSystem : SharedAbsorbentSystem
         var absorberSplit = absorberSolution.SplitSolutionWithOnly(puddleSplit.Volume, PuddleSystem.EvaporationReagents);
 
         // Do tile reactions first
-        var coordinates = Transform(target).Coordinates;
-        if (_mapManager.TryGetGrid(coordinates.GetGridUid(EntityManager), out var mapGrid))
+        var transform = Transform(target);
+        var gridUid = transform.GridUid;
+        if (TryComp(gridUid, out MapGridComponent? mapGrid))
         {
-            _puddleSystem.DoTileReactions(mapGrid.GetTileRef(coordinates), absorberSplit);
+            var tileRef = _mapSystem.GetTileRef(gridUid.Value, mapGrid, transform.Coordinates);
+            _puddleSystem.DoTileReactions(tileRef, absorberSplit);
         }
 
         _solutionContainerSystem.AddSolution(puddle.Solution.Value, absorberSplit);
         _solutionContainerSystem.AddSolution(absorberSoln, puddleSplit);
 
         _audio.PlayPvs(absorber.PickupSound, target);
-        _useDelay.BeginDelay(used);
+        if (useDelay != null)
+            _useDelay.TryResetDelay((used, useDelay));
 
         var userXform = Transform(user);
         var targetPos = _transform.GetWorldPosition(target);
index 5acd2c91181a5918f84a1dfda617d2d27497816a..f7621aec62611e7b55c015bd286317247e676ac1 100644 (file)
@@ -1,36 +1,34 @@
 using Content.Server.Chemistry.Components;
 using Content.Server.Chemistry.Containers.EntitySystems;
 using Content.Server.Chemistry.EntitySystems;
-using Content.Server.Cooldown;
 using Content.Server.Extinguisher;
 using Content.Server.Fluids.Components;
 using Content.Server.Gravity;
 using Content.Server.Popups;
-using Content.Shared.Cooldown;
 using Content.Shared.FixedPoint;
 using Content.Shared.Interaction;
+using Content.Shared.Timing;
 using Content.Shared.Vapor;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio.Systems;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Prototypes;
-using Robust.Shared.Timing;
 using System.Numerics;
 
 namespace Content.Server.Fluids.EntitySystems;
 
 public sealed class SpraySystem : EntitySystem
 {
-    [Dependency] private readonly IGameTiming _gameTiming = default!;
     [Dependency] private readonly IPrototypeManager _proto = default!;
     [Dependency] private readonly GravitySystem _gravity = default!;
     [Dependency] private readonly PhysicsSystem _physics = default!;
+    [Dependency] private readonly UseDelaySystem _useDelay = default!;
     [Dependency] private readonly PopupSystem _popupSystem = default!;
     [Dependency] private readonly SharedAudioSystem _audio = default!;
     [Dependency] private readonly SolutionContainerSystem _solutionContainer = default!;
     [Dependency] private readonly VaporSystem _vapor = default!;
     [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
-    [Dependency] private readonly TransformSystem _transform = default!;
+    [Dependency] private readonly SharedTransformSystem _transform = default!;
 
     public override void Initialize()
     {
@@ -54,12 +52,9 @@ public sealed class SpraySystem : EntitySystem
         if (ev.Cancelled)
             return;
 
-        var curTime = _gameTiming.CurTime;
-        if (TryComp<ItemCooldownComponent>(entity, out var cooldown)
-            && curTime < cooldown.CooldownEnd)
-        {
+        if (!TryComp<UseDelayComponent>(entity, out var useDelay)
+            || _useDelay.IsDelayed((entity, useDelay)))
             return;
-        }
 
         if (solution.Volume <= 0)
         {
@@ -70,7 +65,7 @@ public sealed class SpraySystem : EntitySystem
         var xformQuery = GetEntityQuery<TransformComponent>();
         var userXform = xformQuery.GetComponent(args.User);
 
-        var userMapPos = userXform.MapPosition;
+        var userMapPos = _transform.GetMapCoordinates(userXform);
         var clickMapPos = args.ClickLocation.ToMap(EntityManager, _transform);
 
         var diffPos = clickMapPos.Position - userMapPos.Position;
@@ -149,7 +144,8 @@ public sealed class SpraySystem : EntitySystem
 
         _audio.PlayPvs(entity.Comp.SpraySound, entity, entity.Comp.SpraySound.Params.WithVariation(0.125f));
 
-        RaiseLocalEvent(entity, new RefreshItemCooldownEvent(curTime, curTime + TimeSpan.FromSeconds(cooldownTime)), true);
+        _useDelay.SetDelay((entity, useDelay), TimeSpan.FromSeconds(cooldownTime));
+        _useDelay.TryResetDelay((entity, useDelay));
     }
 }
 
index d80d7ecbfcfbb8e21581410351403ecc5c376a0a..a1c288e2259e08c8e8ee04f42f5f90571791b10b 100644 (file)
@@ -1,6 +1,5 @@
 using Content.Server.Explosion.EntitySystems;
 using Content.Shared.Timing;
-using Robust.Shared.Audio;
 using Robust.Shared.Audio.Systems;
 using Robust.Shared.Timing;
 
@@ -43,14 +42,13 @@ public sealed class IgniteOnTriggerSystem : EntitySystem
     private void OnTrigger(Entity<IgniteOnTriggerComponent> ent, ref TriggerEvent args)
     {
         // prevent spamming sound and ignition
-        TryComp<UseDelayComponent>(ent, out var delay);
-        if (_useDelay.ActiveDelay(ent, delay))
+        if (!TryComp(ent.Owner, out UseDelayComponent? useDelay) || _useDelay.IsDelayed((ent.Owner, useDelay)))
             return;
 
         _source.SetIgnited(ent.Owner);
         _audio.PlayPvs(ent.Comp.IgniteSound, ent);
 
-        _useDelay.BeginDelay(ent, delay);
+        _useDelay.TryResetDelay((ent.Owner, useDelay));
         ent.Comp.IgnitedUntil = _timing.CurTime + ent.Comp.IgnitedTime;
     }
 }
index 7e3d9b3c7d35d467dae3e659e5148b401c764a28..29d39f372348beadca28506f9189d63b68ac9ad7 100644 (file)
@@ -1,7 +1,5 @@
 using Content.Server.Storage.EntitySystems;
-using Content.Shared.Clothing.Components;
 using Content.Shared.Explosion;
-using Content.Shared.Interaction.Events;
 using Content.Shared.Inventory;
 using Content.Shared.Inventory.Events;
 using Content.Shared.Storage;
@@ -17,9 +15,6 @@ namespace Content.Server.Inventory
             base.Initialize();
 
             SubscribeLocalEvent<InventoryComponent, BeforeExplodeEvent>(OnExploded);
-
-            SubscribeLocalEvent<ClothingComponent, UseInHandEvent>(OnUseInHand);
-
             SubscribeNetworkEvent<OpenSlotStorageNetworkMessage>(OnOpenSlotStorage);
         }
 
@@ -34,14 +29,6 @@ namespace Content.Server.Inventory
             }
         }
 
-        private void OnUseInHand(EntityUid uid, ClothingComponent component, UseInHandEvent args)
-        {
-            if (args.Handled || !component.QuickEquip)
-                return;
-
-            QuickEquip(uid, component, args);
-        }
-
         private void OnOpenSlotStorage(OpenSlotStorageNetworkMessage ev, EntitySessionEventArgs args)
         {
             if (args.SenderSession.AttachedEntity is not { Valid: true } uid)
index d3374bd775508b795c7fae9590336858f61d175a..9b96cb7fcb7983684022b9494fee88b74cd852a5 100644 (file)
@@ -66,13 +66,14 @@ public sealed class DefibrillatorSystem : EntitySystem
 
     private void OnUseInHand(EntityUid uid, DefibrillatorComponent component, UseInHandEvent args)
     {
-        if (args.Handled || _useDelay.ActiveDelay(uid))
+        if (args.Handled || !TryComp(uid, out UseDelayComponent? useDelay) || _useDelay.IsDelayed((uid, useDelay)))
             return;
 
         if (!TryToggle(uid, component, args.User))
             return;
+
         args.Handled = true;
-        _useDelay.BeginDelay(uid);
+        _useDelay.TryResetDelay((uid, useDelay));
     }
 
     private void OnPowerCellSlotEmpty(EntityUid uid, DefibrillatorComponent component, ref PowerCellSlotEmptyEvent args)
index d3f4f2ea8dcdd3ef82bbbbb7f867c53d6ea4e046..a8abb5ac4ca5fdc36a3bcb38689cd361ac811a9b 100644 (file)
@@ -11,14 +11,15 @@ public sealed partial class InteractWithOperator : HTNOperator
     /// <summary>
     /// Key that contains the target entity.
     /// </summary>
-    [DataField("targetKey", required: true)]
+    [DataField(required: true)]
     public string TargetKey = default!;
 
     public override HTNOperatorStatus Update(NPCBlackboard blackboard, float frameTime)
     {
         var owner = blackboard.GetValue<EntityUid>(NPCBlackboard.Owner);
 
-        if (_entManager.System<UseDelaySystem>().ActiveDelay(owner) ||
+        if (!_entManager.TryGetComponent<UseDelayComponent>(owner, out var useDelay) ||
+            _entManager.System<UseDelaySystem>().IsDelayed((owner, useDelay)) ||
             !blackboard.TryGetValue<EntityUid>(TargetKey, out var moveTarget, _entManager) ||
             !_entManager.TryGetComponent<TransformComponent>(moveTarget, out var targetXform))
         {
index 61beed9481487944bde43d2ea65abdbec6f40d3e..2aa08e0492e092c34f2ecba7a516dfb375e91de0 100644 (file)
@@ -3,13 +3,12 @@ using Content.Server.Ninja.Events;
 using Content.Server.Popups;
 using Content.Server.Power.Components;
 using Content.Server.PowerCell;
-using Content.Shared.Actions;
 using Content.Shared.Clothing.EntitySystems;
 using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Ninja.Components;
 using Content.Shared.Ninja.Systems;
-using Content.Shared.Popups;
 using Content.Shared.PowerCell.Components;
+using Content.Shared.Timing;
 using Robust.Shared.Containers;
 
 namespace Content.Server.Ninja.Systems;
@@ -94,7 +93,8 @@ public sealed class NinjaSuitSystem : SharedNinjaSuitSystem
         // need 1 second of charge to turn on stealth
         var chargeNeeded = SuitWattage(uid, comp);
         // being attacked while cloaked gives no power message since it overloads the power supply or something
-        if (!_ninja.GetNinjaBattery(user, out var _, out var battery) || battery.CurrentCharge < chargeNeeded || UseDelay.ActiveDelay(user))
+        if (!_ninja.GetNinjaBattery(user, out var _, out var battery) || battery.CurrentCharge < chargeNeeded
+            || !TryComp(user, out UseDelayComponent? useDelay) || UseDelay.IsDelayed((user, useDelay)))
         {
             _popup.PopupEntity(Loc.GetString("ninja-no-power"), user, user);
             args.Cancel();
@@ -108,7 +108,8 @@ public sealed class NinjaSuitSystem : SharedNinjaSuitSystem
     {
         args.Handled = true;
         var user = args.Performer;
-        if (!_ninja.TryUseCharge(user, comp.ThrowingStarCharge) || UseDelay.ActiveDelay(user))
+        if (!_ninja.TryUseCharge(user, comp.ThrowingStarCharge)
+            || !TryComp(user, out UseDelayComponent? useDelay) || UseDelay.IsDelayed((user, useDelay)))
         {
             _popup.PopupEntity(Loc.GetString("ninja-no-power"), user, user);
             return;
@@ -130,7 +131,8 @@ public sealed class NinjaSuitSystem : SharedNinjaSuitSystem
         var coords = _transform.GetWorldPosition(katana);
         var distance = (_transform.GetWorldPosition(user) - coords).Length();
         var chargeNeeded = (float) distance * comp.RecallCharge;
-        if (!_ninja.TryUseCharge(user, chargeNeeded) || UseDelay.ActiveDelay(user))
+        if (!_ninja.TryUseCharge(user, chargeNeeded)
+            || !TryComp(user, out UseDelayComponent? useDelay) || UseDelay.IsDelayed((user, useDelay)))
         {
             _popup.PopupEntity(Loc.GetString("ninja-no-power"), user, user);
             return;
@@ -147,14 +149,15 @@ public sealed class NinjaSuitSystem : SharedNinjaSuitSystem
     {
         args.Handled = true;
         var user = args.Performer;
-        if (!_ninja.TryUseCharge(user, comp.EmpCharge) || UseDelay.ActiveDelay(user))
+        if (!_ninja.TryUseCharge(user, comp.EmpCharge)
+            || !TryComp(user, out UseDelayComponent? useDelay) || UseDelay.IsDelayed((user, useDelay)))
         {
             _popup.PopupEntity(Loc.GetString("ninja-no-power"), user, user);
             return;
         }
 
         // I don't think this affects the suit battery, but if it ever does in the future add a blacklist for it
-        var coords = Transform(user).MapPosition;
+        var coords = _transform.GetMapCoordinates(user);
         _emp.EmpPulse(coords, comp.EmpRange, comp.EmpConsumption, comp.EmpDuration);
     }
 }
index 7c377ef66ed4fc44abdbbc2b6b00c6c2b1a49045..61892f23f8683c54f5d2789f554a9f0d62849a72 100644 (file)
@@ -70,7 +70,7 @@ public sealed class PowerSwitchableSystem : SharedPowerSwitchableSystem
             return;
 
         // no sound spamming
-        if (TryComp<UseDelayComponent>(uid, out var useDelay) && _useDelay.ActiveDelay(uid))
+        if (!TryComp(uid, out UseDelayComponent? useDelay) || _useDelay.IsDelayed((uid, useDelay)))
             return;
 
         comp.ActiveIndex = NextIndex(uid, comp);
@@ -110,7 +110,7 @@ public sealed class PowerSwitchableSystem : SharedPowerSwitchableSystem
 
         _audio.PlayPvs(comp.SwitchSound, uid);
 
-        _useDelay.BeginDelay(uid, useDelay);
+        _useDelay.TryResetDelay((uid, useDelay));
     }
 }
 
index 649514ed4208c6e96196a4038eb7c68e9c3ac8af..30522c28f3a65f2fb89822d545d1fbee31f7ef91 100644 (file)
@@ -13,32 +13,21 @@ public sealed partial class RadiationCollectorComponent : Component
     /// <summary>
     ///     How much joules will collector generate for each rad.
     /// </summary>
-    [DataField("chargeModifier")]
+    [DataField]
     [ViewVariables(VVAccess.ReadWrite)]
     public float ChargeModifier = 30000f;
 
     /// <summary>
-    ///     Cooldown time between users interaction.
+    ///     Is the machine enabled.
     /// </summary>
-    [DataField("cooldown")]
-    [ViewVariables(VVAccess.ReadWrite)]
-    public TimeSpan Cooldown = TimeSpan.FromSeconds(0.81f);
-
-    /// <summary>
-    ///     Was machine activated by user?
-    /// </summary>
-    [ViewVariables(VVAccess.ReadOnly)]
+    [DataField]
+    [ViewVariables]
     public bool Enabled;
 
-    /// <summary>
-    ///     Timestamp when machine can be deactivated again.
-    /// </summary>
-    public TimeSpan CoolDownEnd;
-
     /// <summary>
     ///     List of gases that will react to the radiation passing through the collector
     /// </summary>
-    [DataField("radiationReactiveGases")]
+    [DataField]
     [ViewVariables(VVAccess.ReadWrite)]
     public List<RadiationReactiveGas>? RadiationReactiveGases;
 }
@@ -50,15 +39,15 @@ public sealed partial class RadiationCollectorComponent : Component
 public sealed partial class RadiationReactiveGas
 {
     /// <summary>
-    ///     The reactant gas 
+    ///     The reactant gas
     /// </summary>
-    [DataField("reactantPrototype", required: true)]
-    public Gas Reactant = Gas.Plasma;
+    [DataField(required: true)]
+    public Gas ReactantPrototype;
 
     /// <summary>
     ///     Multipier for the amount of power produced by the radiation collector when using this gas
     /// </summary>
-    [DataField("powerGenerationEfficiency")]
+    [DataField]
     public float PowerGenerationEfficiency = 1f;
 
     /// <summary>
@@ -67,7 +56,7 @@ public sealed partial class RadiationReactiveGas
     /// /// <remarks>
     ///     Set to zero if the reactant does not deplete
     /// </remarks>
-    [DataField("reactantBreakdownRate")]
+    [DataField]
     public float ReactantBreakdownRate = 1f;
 
     /// <summary>
@@ -76,12 +65,12 @@ public sealed partial class RadiationReactiveGas
     /// <remarks>
     ///     Leave null if the reactant no byproduct gas is to be formed
     /// </remarks>
-    [DataField("byproductPrototype")]
-    public Gas? Byproduct = null;
+    [DataField]
+    public Gas? Byproduct;
 
     /// <summary>
     ///     The molar ratio of the byproduct gas generated from the reactant gas
     /// </summary>
-    [DataField("molarRatio")]
+    [DataField]
     public float MolarRatio = 1f;
 }
index 27219bb1837c6f100b5414cc7cbd6839b09c0856..83666776a05d8aaf63e6794783da2e0a42ef9f1c 100644 (file)
@@ -1,16 +1,19 @@
-using Content.Server.Singularity.Components;
-using Content.Shared.Interaction;
-using Content.Shared.Singularity.Components;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+using Content.Server.Atmos;
+using Content.Server.Atmos.Components;
 using Content.Server.Popups;
 using Content.Server.Power.Components;
+using Content.Server.Power.EntitySystems;
+using Content.Server.Singularity.Components;
+using Content.Shared.Atmos;
+using Content.Shared.Examine;
+using Content.Shared.Interaction;
 using Content.Shared.Radiation.Events;
-using Robust.Shared.Timing;
+using Content.Shared.Singularity.Components;
+using Content.Shared.Timing;
 using Robust.Shared.Containers;
-using Content.Server.Atmos.Components;
-using Content.Shared.Examine;
-using Content.Server.Atmos;
-using System.Diagnostics.CodeAnalysis;
-using Content.Shared.Atmos;
+using Robust.Shared.Timing;
 
 namespace Content.Server.Singularity.EntitySystems;
 
@@ -20,6 +23,10 @@ public sealed class RadiationCollectorSystem : EntitySystem
     [Dependency] private readonly PopupSystem _popupSystem = default!;
     [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
     [Dependency] private readonly SharedContainerSystem _containerSystem = default!;
+    [Dependency] private readonly UseDelaySystem _useDelay = default!;
+    [Dependency] private readonly BatterySystem _batterySystem = default!;
+
+    private const string GasTankContainer = "gas_tank";
 
     public override void Initialize()
     {
@@ -36,12 +43,11 @@ public sealed class RadiationCollectorSystem : EntitySystem
     private bool TryGetLoadedGasTank(EntityUid uid, [NotNullWhen(true)] out GasTankComponent? gasTankComponent)
     {
         gasTankComponent = null;
-        var container = _containerSystem.EnsureContainer<ContainerSlot>(uid, "GasTank");
 
-        if (container.ContainedEntity == null)
+        if (!_containerSystem.TryGetContainer(uid, GasTankContainer, out var container) || container.ContainedEntities.Count == 0)
             return false;
 
-        if (!EntityManager.TryGetComponent(container.ContainedEntity, out gasTankComponent))
+        if (!EntityManager.TryGetComponent(container.ContainedEntities.First(), out gasTankComponent))
             return false;
 
         return true;
@@ -61,13 +67,10 @@ public sealed class RadiationCollectorSystem : EntitySystem
 
     private void OnInteractHand(EntityUid uid, RadiationCollectorComponent component, InteractHandEvent args)
     {
-        var curTime = _gameTiming.CurTime;
-
-        if (curTime < component.CoolDownEnd)
+        if (TryComp(uid, out UseDelayComponent? useDelay) && !_useDelay.TryResetDelay((uid, useDelay), true))
             return;
 
         ToggleCollector(uid, args.User, component);
-        component.CoolDownEnd = curTime + component.Cooldown;
     }
 
     private void OnRadiation(EntityUid uid, RadiationCollectorComponent component, OnIrradiatedEvent args)
@@ -82,7 +85,7 @@ public sealed class RadiationCollectorSystem : EntitySystem
 
         foreach (var gas in component.RadiationReactiveGases)
         {
-            float reactantMol = gasTankComponent.Air.GetMoles(gas.Reactant);
+            float reactantMol = gasTankComponent.Air.GetMoles(gas.ReactantPrototype);
             float delta = args.TotalRads * reactantMol * gas.ReactantBreakdownRate;
 
             // We need to offset the huge power gains possible when using very cold gases
@@ -95,7 +98,7 @@ public sealed class RadiationCollectorSystem : EntitySystem
 
             if (delta > 0)
             {
-                gasTankComponent.Air.AdjustMoles(gas.Reactant, -Math.Min(delta, reactantMol));
+                gasTankComponent.Air.AdjustMoles(gas.ReactantPrototype, -Math.Min(delta, reactantMol));
             }
 
             if (gas.Byproduct != null)
@@ -111,7 +114,7 @@ public sealed class RadiationCollectorSystem : EntitySystem
         // This still won't stop things being potentially hilariously unbalanced though.
         if (TryComp<BatteryComponent>(uid, out var batteryComponent))
         {
-            batteryComponent.CurrentCharge += charge;
+            _batterySystem.SetCharge(uid, charge, batteryComponent);
         }
 
         // Update appearance
index 3223cbf60c2e1cde3f8897ac40100569d3653e48..b1da3cf30e4d9702499843b76496c39507b4eaef 100644 (file)
@@ -12,6 +12,7 @@ using Content.Shared.Storage.EntitySystems;
 using Content.Shared.Timing;
 using Content.Shared.Verbs;
 using Robust.Server.GameObjects;
+using Robust.Shared.Audio.Systems;
 using Robust.Shared.Input.Binding;
 using Robust.Shared.Map;
 using Robust.Shared.Player;
@@ -26,6 +27,8 @@ public sealed partial class StorageSystem : SharedStorageSystem
     [Dependency] private readonly IPrototypeManager _prototype = default!;
     [Dependency] private readonly InventorySystem _inventory = default!;
     [Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
+    [Dependency] private readonly SharedAudioSystem _audio = default!;
+    [Dependency] private readonly UseDelaySystem _useDelay = default!;
 
     public override void Initialize()
     {
@@ -123,12 +126,12 @@ public sealed partial class StorageSystem : SharedStorageSystem
             return;
 
         // prevent spamming bag open / honkerton honk sound
-        silent |= TryComp<UseDelayComponent>(uid, out var useDelay) && UseDelay.ActiveDelay(uid, useDelay);
+        silent |= TryComp<UseDelayComponent>(uid, out var useDelay) && _useDelay.IsDelayed((uid, useDelay));
         if (!silent)
         {
-            Audio.PlayPvs(storageComp.StorageOpenSound, uid);
+            _audio.PlayPvs(storageComp.StorageOpenSound, uid);
             if (useDelay != null)
-                UseDelay.BeginDelay(uid, useDelay);
+                _useDelay.TryResetDelay((uid, useDelay));
         }
 
         Log.Debug($"Storage (UID {uid}) \"used\" by player session (UID {player.PlayerSession.AttachedEntity}).");
index 928de357114584670a4f1198fd4ca1c4c6fd6a50..fc9ab2894294f252f248c22121c015e1bd8dea97 100644 (file)
@@ -3,7 +3,6 @@ using Content.Server.Xenoarchaeology.Equipment.Components;
 using Content.Server.Xenoarchaeology.XenoArtifacts;
 using Content.Shared.Interaction;
 using Content.Shared.Timing;
-using Robust.Shared.Player;
 
 namespace Content.Server.Xenoarchaeology.Equipment.Systems;
 
@@ -31,7 +30,11 @@ public sealed class NodeScannerSystem : EntitySystem
         args.Handled = true;
 
         var target = args.Target.Value;
-        _useDelay.BeginDelay(uid);
+
+        if (TryComp(uid, out UseDelayComponent? useDelay)
+            && !_useDelay.TryResetDelay((uid, useDelay), true))
+            return;
+
         _popupSystem.PopupEntity(Loc.GetString("node-scan-popup",
             ("id", $"{artifact.CurrentNodeId}")), target);
     }
index 9aa01580886b3a6e844b45808dcb905417bc2dbf..da2a09313ab6571e4988eb0bcdf387dfb7031368 100644 (file)
@@ -1,9 +1,13 @@
 using Content.Shared.Clothing.Components;
+using Content.Shared.Hands.Components;
+using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Humanoid;
+using Content.Shared.Interaction.Events;
 using Content.Shared.Inventory;
 using Content.Shared.Inventory.Events;
 using Content.Shared.Item;
 using Content.Shared.Tag;
+using Content.Shared.Timing;
 using Robust.Shared.GameStates;
 
 namespace Content.Shared.Clothing.EntitySystems;
@@ -13,6 +17,8 @@ public abstract class ClothingSystem : EntitySystem
     [Dependency] private readonly SharedItemSystem _itemSys = default!;
     [Dependency] private readonly SharedHumanoidAppearanceSystem _humanoidSystem = default!;
     [Dependency] private readonly TagSystem _tagSystem = default!;
+    [Dependency] private readonly InventorySystem _invSystem = default!;
+    [Dependency] private readonly SharedHandsSystem _handsSystem = default!;
 
     [ValidatePrototypeId<TagPrototype>]
     private const string HairTag = "HidesHair";
@@ -21,12 +27,60 @@ public abstract class ClothingSystem : EntitySystem
     {
         base.Initialize();
 
+        SubscribeLocalEvent<ClothingComponent, UseInHandEvent>(OnUseInHand);
         SubscribeLocalEvent<ClothingComponent, ComponentGetState>(OnGetState);
         SubscribeLocalEvent<ClothingComponent, ComponentHandleState>(OnHandleState);
         SubscribeLocalEvent<ClothingComponent, GotEquippedEvent>(OnGotEquipped);
         SubscribeLocalEvent<ClothingComponent, GotUnequippedEvent>(OnGotUnequipped);
         SubscribeLocalEvent<ClothingComponent, ItemMaskToggledEvent>(OnMaskToggled);
     }
+    private void OnUseInHand(Entity<ClothingComponent> ent, ref UseInHandEvent args)
+    {
+        if (args.Handled || !ent.Comp.QuickEquip)
+            return;
+
+        var user = args.User;
+        if (!TryComp(user, out InventoryComponent? inv) ||
+            !TryComp(user, out HandsComponent? hands))
+            return;
+
+        QuickEquip(ent, (user, inv, hands));
+        args.Handled = true;
+        args.ApplyDelay = false;
+    }
+
+    private void QuickEquip(
+        Entity<ClothingComponent> toEquipEnt,
+        Entity<InventoryComponent, HandsComponent> userEnt)
+    {
+        foreach (var slotDef in userEnt.Comp1.Slots)
+        {
+            if (!_invSystem.CanEquip(userEnt, toEquipEnt, slotDef.Name, out _, slotDef, userEnt, toEquipEnt))
+                continue;
+
+            if (_invSystem.TryGetSlotEntity(userEnt, slotDef.Name, out var slotEntity, userEnt))
+            {
+                // Item in slot has to be quick equipable as well
+                if (TryComp(slotEntity, out ClothingComponent? item) && !item.QuickEquip)
+                    continue;
+
+                if (!_invSystem.TryUnequip(userEnt, slotDef.Name, true, inventory: userEnt, clothing: toEquipEnt))
+                    continue;
+
+                if (!_invSystem.TryEquip(userEnt, toEquipEnt, slotDef.Name, true, inventory: userEnt, clothing: toEquipEnt))
+                    continue;
+
+                _handsSystem.PickupOrDrop(userEnt, slotEntity.Value, handsComp: userEnt);
+            }
+            else
+            {
+                if (!_invSystem.TryEquip(userEnt, toEquipEnt, slotDef.Name, true, inventory: userEnt, clothing: toEquipEnt))
+                    continue;
+            }
+
+            break;
+        }
+    }
 
     protected virtual void OnGotEquipped(EntityUid uid, ClothingComponent component, GotEquippedEvent args)
     {
@@ -71,7 +125,7 @@ public abstract class ClothingSystem : EntitySystem
 
         clothing.EquippedPrefix = prefix;
         _itemSys.VisualsChanged(uid);
-        Dirty(clothing);
+        Dirty(uid, clothing);
     }
 
     public void SetSlots(EntityUid uid, SlotFlags slots, ClothingComponent? clothing = null)
@@ -80,7 +134,7 @@ public abstract class ClothingSystem : EntitySystem
             return;
 
         clothing.Slots = slots;
-        Dirty(clothing);
+        Dirty(uid, clothing);
     }
 
     /// <summary>
@@ -97,7 +151,7 @@ public abstract class ClothingSystem : EntitySystem
         clothing.FemaleMask = otherClothing.FemaleMask;
 
         _itemSys.VisualsChanged(uid);
-        Dirty(clothing);
+        Dirty(uid, clothing);
     }
 
     #endregion
diff --git a/Content.Shared/Cooldown/Cooldowns.cs b/Content.Shared/Cooldown/Cooldowns.cs
deleted file mode 100644 (file)
index f56c780..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-using Robust.Shared.Timing;
-
-namespace Content.Shared.Cooldown
-{
-    /// <summary>
-    /// Utilities for working with cooldowns.
-    /// </summary>
-    public static class Cooldowns
-    {
-        /// <param name="gameTiming">game timing to use, otherwise will resolve using IoCManager.</param>
-        /// <returns>a cooldown interval starting at GameTiming.Curtime and ending at (offset) from CurTime.
-        /// For example, passing TimeSpan.FromSeconds(5) will create an interval
-        /// from now to 5 seconds from now.</returns>
-        public static (TimeSpan start, TimeSpan end) FromNow(TimeSpan offset, IGameTiming? gameTiming = null)
-        {
-            var now = (gameTiming ?? IoCManager.Resolve<IGameTiming>()).CurTime;
-            return (now, now + offset);
-        }
-
-        /// <see cref="FromNow"/>
-        public static (TimeSpan start, TimeSpan end) SecondsFromNow(double seconds, IGameTiming? gameTiming = null)
-        {
-            return FromNow(TimeSpan.FromSeconds(seconds), gameTiming);
-        }
-    }
-}
diff --git a/Content.Shared/Cooldown/ItemCooldownComponent.cs b/Content.Shared/Cooldown/ItemCooldownComponent.cs
deleted file mode 100644 (file)
index 32560ec..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-using Robust.Shared.GameStates;
-using Robust.Shared.Serialization;
-
-namespace Content.Shared.Cooldown
-{
-    /// <summary>
-    ///     Stores a visual "cooldown" for items, that gets displayed in the hands GUI.
-    /// </summary>
-    [RegisterComponent, NetworkedComponent]
-    [AutoGenerateComponentState]
-    public sealed partial class ItemCooldownComponent : Component
-    {
-        // TODO: access and system setting and dirtying not this funny stuff
-        private TimeSpan? _cooldownEnd;
-        private TimeSpan? _cooldownStart;
-
-        /// <summary>
-        ///     The time when this cooldown ends.
-        /// </summary>
-        /// <remarks>
-        ///     If null, no cooldown is displayed.
-        /// </remarks>
-        [ViewVariables, AutoNetworkedField]
-        public TimeSpan? CooldownEnd
-        {
-            get => _cooldownEnd;
-            set
-            {
-                _cooldownEnd = value;
-                Dirty();
-            }
-        }
-
-        /// <summary>
-        ///     The time when this cooldown started.
-        /// </summary>
-        /// <remarks>
-        ///     If null, no cooldown is displayed.
-        /// </remarks>
-        [ViewVariables, AutoNetworkedField]
-        public TimeSpan? CooldownStart
-        {
-            get => _cooldownStart;
-            set
-            {
-                _cooldownStart = value;
-                Dirty();
-            }
-        }
-    }
-}
index 0a0b0406d5f5934251dd20dc2972abbfdb8e1dfa..24a841c2d83dda877ab95b8d0c8e538e7e5c8582 100644 (file)
@@ -1,3 +1,5 @@
+using Content.Shared.Clothing.EntitySystems;
+using Content.Shared.Timing;
 using JetBrains.Annotations;
 
 namespace Content.Shared.Interaction.Events;
@@ -11,7 +13,13 @@ public sealed class UseInHandEvent : HandledEntityEventArgs
     /// <summary>
     ///     Entity holding the item in their hand.
     /// </summary>
-    public EntityUid User { get; }
+    public EntityUid User;
+
+    /// <summary>
+    ///     Whether or not to apply a UseDelay when used.
+    ///     Mostly used by the <see cref="ClothingSystem"/> quick-equip to not apply the delay to entities that have the <see cref="UseDelayComponent"/>.
+    /// </summary>
+    public bool ApplyDelay = true;
 
     public UseInHandEvent(EntityUid user)
     {
index 44cf32556702195ef75b1d0dc53ff6d2bc93981e..75063c55503fcd51fddbd2171cffad0c6336dd1f 100644 (file)
@@ -6,7 +6,6 @@ using Content.Shared.Administration.Logs;
 using Content.Shared.Administration.Managers;
 using Content.Shared.CombatMode;
 using Content.Shared.Database;
-using Content.Shared.DragDrop;
 using Content.Shared.Hands;
 using Content.Shared.Hands.Components;
 using Content.Shared.Input;
@@ -21,7 +20,6 @@ using Content.Shared.Popups;
 using Content.Shared.Pulling;
 using Content.Shared.Pulling.Components;
 using Content.Shared.Tag;
-using Content.Shared.Throwing;
 using Content.Shared.Timing;
 using Content.Shared.Verbs;
 using Content.Shared.Wall;
@@ -67,8 +65,7 @@ namespace Content.Shared.Interaction
         [Dependency] private readonly IRobustRandom _random = default!;
         [Dependency] private readonly TagSystem _tagSystem = default!;
 
-        private const CollisionGroup InRangeUnobstructedMask
-            = CollisionGroup.Impassable | CollisionGroup.InteractImpassable;
+        private const CollisionGroup InRangeUnobstructedMask = CollisionGroup.Impassable | CollisionGroup.InteractImpassable;
 
         public const float InteractionRange = 1.5f;
         public const float InteractionRangeSquared = InteractionRange * InteractionRange;
@@ -170,7 +167,6 @@ namespace Content.Shared.Interaction
                 QueueDel(uid);
         }
 
-
         private bool HandleTryPullObject(ICommonSession? session, EntityCoordinates coords, EntityUid uid)
         {
             if (!ValidateClientInput(session, coords, uid, out var userEntity))
@@ -953,7 +949,7 @@ namespace Content.Shared.Interaction
             UseDelayComponent? delayComponent = null;
             if (checkUseDelay
                 && TryComp(used, out delayComponent)
-                && delayComponent.ActiveDelay)
+                && _useDelay.IsDelayed((used, delayComponent)))
                 return false;
 
             if (checkCanInteract && !_actionBlockerSystem.CanInteract(user, used))
@@ -977,7 +973,8 @@ namespace Content.Shared.Interaction
                 return false;
 
             DoContactInteraction(user, used, activateMsg);
-            _useDelay.BeginDelay(used, delayComponent);
+            if (delayComponent != null)
+                _useDelay.TryResetDelay((used, delayComponent));
             if (!activateMsg.WasLogged)
                 _adminLogger.Add(LogType.InteractActivate, LogImpact.Low, $"{ToPrettyString(user):user} activated {ToPrettyString(used):used}");
             return true;
@@ -1002,7 +999,7 @@ namespace Content.Shared.Interaction
 
             if (checkUseDelay
                 && TryComp(used, out delayComponent)
-                && delayComponent.ActiveDelay)
+                && _useDelay.IsDelayed((used, delayComponent)))
                 return true; // if the item is on cooldown, we consider this handled.
 
             if (checkCanInteract && !_actionBlockerSystem.CanInteract(user, used))
@@ -1016,7 +1013,8 @@ namespace Content.Shared.Interaction
             if (useMsg.Handled)
             {
                 DoContactInteraction(user, used, useMsg);
-                _useDelay.BeginDelay(used, delayComponent);
+                if (delayComponent != null && useMsg.ApplyDelay)
+                    _useDelay.TryResetDelay((used, delayComponent));
                 return true;
             }
 
index bad36098c0dc0949a2ac3ebd716a884e7b33f356..848c8c35584d0beb2b4da42ee3ce8bc7d592eb28 100644 (file)
@@ -4,18 +4,13 @@ using Content.Shared.Hands;
 using Content.Shared.Hands.Components;
 using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Interaction;
-using Content.Shared.Interaction.Events;
 using Content.Shared.Inventory.Events;
 using Content.Shared.Item;
 using Content.Shared.Movement.Systems;
 using Content.Shared.Popups;
 using Content.Shared.Strip.Components;
-using Robust.Shared.Audio;
 using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
-using Robust.Shared.Network;
-using Robust.Shared.Player;
-using Robust.Shared.Prototypes;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
 
@@ -31,7 +26,6 @@ public abstract partial class InventorySystem
     [Dependency] private readonly SharedContainerSystem _containerSystem = default!;
     [Dependency] private readonly SharedHandsSystem _handsSystem = default!;
     [Dependency] private readonly IGameTiming _gameTiming = default!;
-    [Dependency] private readonly INetManager _netMan = default!;
     [Dependency] private readonly SharedTransformSystem _transform = default!;
 
     [ValidatePrototypeId<ItemSizePrototype>]
@@ -46,41 +40,6 @@ public abstract partial class InventorySystem
         SubscribeAllEvent<UseSlotNetworkMessage>(OnUseSlot);
     }
 
-    protected void QuickEquip(EntityUid uid, ClothingComponent component, UseInHandEvent args)
-    {
-        if (!TryComp(args.User, out InventoryComponent? inv) || !HasComp<HandsComponent>(args.User))
-            return;
-
-        foreach (var slotDef in inv.Slots)
-        {
-            if (!CanEquip(args.User, uid, slotDef.Name, out _, slotDef, inv))
-                continue;
-
-            if (TryGetSlotEntity(args.User, slotDef.Name, out var slotEntity, inv))
-            {
-                // Item in slot has to be quick equipable as well
-                if (TryComp(slotEntity, out ClothingComponent? item) && !item.QuickEquip)
-                    continue;
-
-                if (!TryUnequip(args.User, slotDef.Name, true, inventory: inv))
-                    continue;
-
-                if (!TryEquip(args.User, uid, slotDef.Name, true, inventory: inv))
-                    continue;
-
-                _handsSystem.PickupOrDrop(args.User, slotEntity.Value);
-            }
-            else
-            {
-                if (!TryEquip(args.User, uid, slotDef.Name, true, inventory: inv))
-                    continue;
-            }
-
-            args.Handled = true;
-            break;
-        }
-    }
-
     private void OnEntRemoved(EntityUid uid, InventoryComponent component, EntRemovedFromContainerMessage args)
     {
         if(!TryGetSlot(uid, args.Container.ID, out var slotDef, inventory: component))
index 1440a6ef1f2c3d4c4c5bb193846a1802688139c5..a2a6a944880fbb5ad2742fb5cad06fbc2baf4543 100644 (file)
@@ -1,9 +1,6 @@
-using Content.Shared.Mech;
+using System.Linq;
 using Content.Shared.Mech.Equipment.Components;
-using Content.Shared.Mech.Equipment.Systems;
 using Content.Shared.Timing;
-using Robust.Shared.Audio;
-using System.Linq;
 using Robust.Shared.Audio.Systems;
 
 namespace Content.Shared.Mech.Equipment.Systems;
@@ -47,12 +44,11 @@ public sealed class MechSoundboardSystem : EntitySystem
         if (msg.Sound >= comp.Sounds.Count)
             return;
 
-        if (_useDelay.ActiveDelay(uid))
+        if (TryComp(uid, out UseDelayComponent? useDelay)
+            && !_useDelay.TryResetDelay((uid, useDelay), true))
             return;
 
         // honk!!!!!
-        var mech = equipment.EquipmentOwner.Value;
-        _useDelay.BeginDelay(uid);
         _audio.PlayPvs(comp.Sounds[msg.Sound], uid);
     }
 }
index 639d3f13467ca2e94c948d987319c98272bc650b..815464bf7a33dd473e6dbc102afef56b84f7d56a 100644 (file)
@@ -8,7 +8,6 @@ using Content.Shared.Inventory.Events;
 using Content.Shared.Ninja.Components;
 using Content.Shared.Popups;
 using Content.Shared.Research.Components;
-using Content.Shared.Timing;
 using Content.Shared.Toggleable;
 using Robust.Shared.Timing;
 
@@ -24,7 +23,6 @@ public abstract class SharedNinjaGlovesSystem : EntitySystem
     [Dependency] private readonly SharedCombatModeSystem _combatMode = default!;
     [Dependency] protected readonly SharedInteractionSystem Interaction = default!;
     [Dependency] protected readonly SharedPopupSystem Popup = default!;
-    [Dependency] private readonly UseDelaySystem _useDelay = default!;
     [Dependency] private readonly ActionContainerSystem _actionContainer = default!;
 
     public override void Initialize()
@@ -110,7 +108,6 @@ public abstract class SharedNinjaGlovesSystem : EntitySystem
         target = args.Target;
         return _timing.IsFirstTimePredicted
             && !_combatMode.IsInCombatMode(uid)
-            && !_useDelay.ActiveDelay(uid)
             && TryComp<HandsComponent>(uid, out var hands)
             && hands.ActiveHandEntity == null
             && Interaction.InRangeUnobstructed(uid, target);
index 224152a402befd5f9552a117c20479d17edcfda9..20d003a61b2e3664fd4103efc8a731dbbb4cc166 100644 (file)
@@ -15,7 +15,7 @@ public abstract class SharedNinjaSuitSystem : EntitySystem
 {
     [Dependency] private readonly SharedAudioSystem _audio = default!;
     [Dependency] private readonly SharedNinjaGlovesSystem _gloves = default!;
-    [Dependency] protected readonly SharedSpaceNinjaSystem _ninja = default!;
+    [Dependency] private readonly SharedSpaceNinjaSystem _ninja = default!;
     [Dependency] protected readonly StealthClothingSystem StealthClothing = default!;
     [Dependency] protected readonly UseDelaySystem UseDelay = default!;
     [Dependency] private readonly ActionContainerSystem _actionContainer = default!;
@@ -112,8 +112,8 @@ public abstract class SharedNinjaSuitSystem : EntitySystem
         _audio.PlayPredicted(comp.RevealSound, uid, user);
         // all abilities check for a usedelay on the ninja
         var useDelay = EnsureComp<UseDelayComponent>(user);
-        useDelay.Delay = comp.DisableTime;
-        UseDelay.BeginDelay(user, useDelay);
+        UseDelay.SetDelay((user, useDelay), comp.DisableTime);
+        UseDelay.TryResetDelay((user, useDelay));
     }
 
     // TODO: modify PowerCellDrain
index 4135bf26fe1799e08dbbd20ae99da2b5cbfa88cc..784fd6632f77268c83296647c0ab750e73acee47 100644 (file)
@@ -1,28 +1,36 @@
 using Robust.Shared.GameStates;
+using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
 
 namespace Content.Shared.Timing;
 
 /// <summary>
 /// Timer that creates a cooldown each time an object is activated/used
 /// </summary>
-[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)]
+/// <remarks>
+/// Currently it only supports a single delay per entity, this means that for things that have two delay interactions they will share one timer, so this can cause issues. For example, the bible has a delay when opening the storage UI and when applying it's interaction effect, and they share the same delay.
+/// </remarks>
+[RegisterComponent]
+[NetworkedComponent, AutoGenerateComponentState]
+[Access(typeof(UseDelaySystem))]
 public sealed partial class UseDelayComponent : Component
 {
-    [AutoNetworkedField]
-    public TimeSpan LastUseTime;
-
-    [AutoNetworkedField]
-    public TimeSpan? DelayEndTime;
+    /// <summary>
+    /// When the delay starts.
+    /// </summary>
+    [ViewVariables(VVAccess.ReadWrite), DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField]
+    public TimeSpan DelayStartTime;
 
-    [DataField, AutoNetworkedField]
-    [ViewVariables(VVAccess.ReadWrite)]
-    public TimeSpan Delay = TimeSpan.FromSeconds(1);
+    /// <summary>
+    /// When the delay ends.
+    /// </summary>
+    [ViewVariables(VVAccess.ReadWrite), DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField]
+    public TimeSpan DelayEndTime;
 
     /// <summary>
-    ///     Stores remaining delay pausing (and eventually, serialization).
+    /// Default delay time
     /// </summary>
     [DataField]
-    public TimeSpan? RemainingDelay;
-
-    public bool ActiveDelay => DelayEndTime != null;
+    [ViewVariables(VVAccess.ReadWrite)]
+    [AutoNetworkedField]
+    public TimeSpan Delay = TimeSpan.FromSeconds(1);
 }
index 17a806f09429d62b805100275f847d975ae12cde..a263778cef41d8720f4534d2f44b51a333b855ae 100644 (file)
-using Content.Shared.Cooldown;
 using Robust.Shared.Timing;
-using Robust.Shared.Utility;
 
 namespace Content.Shared.Timing;
 
 public sealed class UseDelaySystem : EntitySystem
 {
     [Dependency] private readonly IGameTiming _gameTiming = default!;
-
-    private HashSet<UseDelayComponent> _activeDelays = new();
+    [Dependency] private readonly MetaDataSystem _metadata = default!;
 
     public override void Initialize()
     {
-        base.Initialize();
-
-        SubscribeLocalEvent<UseDelayComponent, AfterAutoHandleStateEvent>(OnHandleState);
-
-        SubscribeLocalEvent<UseDelayComponent, EntityPausedEvent>(OnPaused);
         SubscribeLocalEvent<UseDelayComponent, EntityUnpausedEvent>(OnUnpaused);
     }
 
-    private void OnPaused(EntityUid uid, UseDelayComponent component, ref EntityPausedEvent args)
+    private void OnUnpaused(Entity<UseDelayComponent> ent, ref EntityUnpausedEvent args)
     {
-        // This entity just got paused, but wasn't before
-        if (component.DelayEndTime != null)
-            component.RemainingDelay = _gameTiming.CurTime - component.DelayEndTime;
-
-        _activeDelays.Remove(component);
-        Dirty(component);
+        // We got unpaused, resume the delay
+        ent.Comp.DelayStartTime += args.PausedTime;
+        ent.Comp.DelayEndTime += args.PausedTime;
+        Dirty(ent);
     }
 
-    private void OnUnpaused(EntityUid uid, UseDelayComponent component, ref EntityUnpausedEvent args)
+    public void SetDelay(Entity<UseDelayComponent> ent, TimeSpan delay)
     {
-        if (component.RemainingDelay == null)
+        if (ent.Comp.Delay == delay)
             return;
 
-        // We got unpaused, resume the delay/cooldown. Currently this takes for granted that ItemCooldownComponent
-        // handles the pausing on its own. I'm not even gonna check, because I CBF fixing it if it doesn't.
-        component.DelayEndTime = _gameTiming.CurTime + component.RemainingDelay;
-        Dirty(component);
-        _activeDelays.Add(component);
+        ent.Comp.Delay += delay;
+        Dirty(ent);
     }
 
-    private void OnHandleState(EntityUid uid, UseDelayComponent component, ref AfterAutoHandleStateEvent args)
+    /// <summary>
+    /// Returns true if the entity has a currently active UseDelay.
+    /// </summary>
+    public bool IsDelayed(Entity<UseDelayComponent> ent)
     {
-        if (component.DelayEndTime == null)
-            _activeDelays.Remove(component);
-        else
-            _activeDelays.Add(component);
+        return ent.Comp.DelayEndTime >= _gameTiming.CurTime;
     }
 
-    public override void Update(float frameTime)
+    /// <summary>
+    /// Cancels the current delay.
+    /// </summary>
+    public void CancelDelay(Entity<UseDelayComponent> ent)
     {
-        base.Update(frameTime);
-
-        var toRemove = new RemQueue<UseDelayComponent>();
-        var curTime = _gameTiming.CurTime;
-        var mQuery = EntityManager.GetEntityQuery<MetaDataComponent>();
-
-        // TODO refactor this to use active components
-        foreach (var delay in _activeDelays)
-        {
-            if (delay.DelayEndTime == null ||
-                curTime > delay.DelayEndTime ||
-                Deleted(delay.Owner, mQuery))
-            {
-                toRemove.Add(delay);
-            }
-        }
-
-        foreach (var delay in toRemove)
-        {
-            delay.DelayEndTime = null;
-            _activeDelays.Remove(delay);
-            Dirty(delay);
-        }
+        ent.Comp.DelayEndTime = _gameTiming.CurTime;
+        Dirty(ent);
     }
 
     /// <summary>
-    /// Attempts tp start a use-delay for some entity. Returns true unless there is already an active delay.
+    /// Resets the UseDelay entirely for this entity if possible.
     /// </summary>
-    /// <remarks>
-    /// Note that this will always return true if the entity does not have a use delay component, as in that case there
-    /// is no reason to block/prevent an interaction.
-    /// </remarks>
-    public bool BeginDelay(EntityUid uid, UseDelayComponent? component = null)
+    /// <param name="checkDelayed">Check if the entity has an ongoing delay, return false if it does, return true if it does not.</param>
+    public bool TryResetDelay(Entity<UseDelayComponent> ent, bool checkDelayed = false)
     {
-        if (!Resolve(uid, ref component, false))
-            return true;
-
-        if (component.ActiveDelay)
+        if (checkDelayed && IsDelayed(ent))
             return false;
 
-        DebugTools.Assert(!_activeDelays.Contains(component));
-        _activeDelays.Add(component);
-
-        var currentTime = _gameTiming.CurTime;
-        component.LastUseTime = currentTime;
-        component.DelayEndTime = currentTime + component.Delay;
-        Dirty(uid, component);
-
-        var cooldown = EnsureComp<ItemCooldownComponent>(uid);
-        cooldown.CooldownStart = currentTime;
-        cooldown.CooldownEnd = component.DelayEndTime;
+        var curTime = _gameTiming.CurTime;
+        ent.Comp.DelayStartTime = curTime;
+        ent.Comp.DelayEndTime = curTime - _metadata.GetPauseTime(ent) + ent.Comp.Delay;
+        Dirty(ent);
         return true;
     }
-
-    public bool ActiveDelay(EntityUid uid, UseDelayComponent? component = null)
-    {
-        return Resolve(uid, ref component, false) && component.ActiveDelay;
-    }
-
-    public void Cancel(UseDelayComponent component)
-    {
-        component.DelayEndTime = null;
-        _activeDelays.Remove(component);
-        Dirty(component);
-
-        if (TryComp<ItemCooldownComponent>(component.Owner, out var cooldown))
-        {
-            cooldown.CooldownEnd = _gameTiming.CurTime;
-        }
-    }
 }
index 3aa82c411ced53ff746bada94f248b57b94eb3a0..eb02dd06f8c8d90c7b2ad0a2297094b8ed170077 100644 (file)
@@ -6,10 +6,8 @@ using Content.Shared.Interaction;
 using Content.Shared.Movement.Events;
 using Content.Shared.Physics;
 using Content.Shared.Projectiles;
-using Content.Shared.Timing;
 using Content.Shared.Weapons.Ranged.Components;
 using Content.Shared.Weapons.Ranged.Systems;
-using Robust.Shared.Audio;
 using Robust.Shared.Audio.Systems;
 using Robust.Shared.Network;
 using Robust.Shared.Physics;
@@ -30,7 +28,6 @@ public abstract class SharedGrapplingGunSystem : EntitySystem
     [Dependency] private readonly SharedAudioSystem _audio = default!;
     [Dependency] private readonly SharedJointSystem _joints = default!;
     [Dependency] private readonly SharedPhysicsSystem _physics = default!;
-    [Dependency] private readonly UseDelaySystem _delay = default!;
 
     public const string GrapplingJoint = "grappling";
 
@@ -117,10 +114,9 @@ public abstract class SharedGrapplingGunSystem : EntitySystem
 
     private void OnGunActivate(EntityUid uid, GrapplingGunComponent component, ActivateInWorldEvent args)
     {
-        if (!Timing.IsFirstTimePredicted || _delay.ActiveDelay(uid))
+        if (!Timing.IsFirstTimePredicted || args.Handled)
             return;
 
-        _delay.BeginDelay(uid);
         _audio.PlayPredicted(component.CycleSound, uid, args.User);
 
         TryComp<AppearanceComponent>(uid, out var appearance);
@@ -137,6 +133,8 @@ public abstract class SharedGrapplingGunSystem : EntitySystem
             component.Projectile = null;
             Dirty(uid, component);
         }
+
+        args.Handled = true;
     }
 
     private void SetReeling(EntityUid uid, GrapplingGunComponent component, bool value, EntityUid? user)
index 10593f56dfebe3e8d261bcc8460371e224bec2d8..260f08c40a55b06b719313433629ce9458d19fa4 100644 (file)
@@ -15,6 +15,7 @@ public sealed class UseDelayOnShootSystem : EntitySystem
 
     private void OnUseShoot(EntityUid uid, UseDelayOnShootComponent component, ref GunShotEvent args)
     {
-        _delay.BeginDelay(uid);
+        if (TryComp(uid, out UseDelayComponent? useDelay))
+            _delay.TryResetDelay((uid, useDelay));
     }
 }
index 72db0c4a3ab054aac19728fc3ee777194c187be6..0f6422241cf96dfbd42b5fdcc687dcad8f4a18f9 100644 (file)
@@ -1,27 +1,24 @@
-using Content.Shared.DoAfter;
 using Content.Shared.Hands;
 using Content.Shared.Hands.Components;
 using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Interaction.Events;
 using Content.Shared.Item;
 using Content.Shared.Popups;
+using Content.Shared.Timing;
 using Content.Shared.Verbs;
 using Content.Shared.Weapons.Melee;
-using Content.Shared.Weapons.Melee.Events;
 using Content.Shared.Weapons.Melee.Components;
+using Content.Shared.Weapons.Melee.Events;
 using Content.Shared.Weapons.Ranged.Components;
 using Content.Shared.Weapons.Ranged.Systems;
 using Content.Shared.Wieldable.Components;
-using Robust.Shared.Audio;
 using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
-using Content.Shared.Timing;
 
 namespace Content.Shared.Wieldable;
 
 public sealed class WieldableSystem : EntitySystem
 {
-    [Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
     [Dependency] private readonly SharedHandVirtualItemSystem _virtualItemSystem = default!;
     [Dependency] private readonly SharedHandsSystem _handsSystem = default!;
     [Dependency] private readonly SharedItemSystem _itemSystem = default!;
@@ -120,18 +117,18 @@ public sealed class WieldableSystem : EntitySystem
         if (args.Handled)
             return;
 
-        if(!component.Wielded)
+        if (!component.Wielded)
             args.Handled = TryWield(uid, component, args.User);
         else
             args.Handled = TryUnwield(uid, component, args.User);
     }
 
-    public bool CanWield(EntityUid uid, WieldableComponent component, EntityUid user, bool quiet=false)
+    public bool CanWield(EntityUid uid, WieldableComponent component, EntityUid user, bool quiet = false)
     {
         // Do they have enough hands free?
         if (!EntityManager.TryGetComponent<HandsComponent>(user, out var hands))
         {
-            if(!quiet)
+            if (!quiet)
                 _popupSystem.PopupClient(Loc.GetString("wieldable-component-no-hands"), user, user);
             return false;
         }
@@ -190,10 +187,12 @@ public sealed class WieldableSystem : EntitySystem
             _virtualItemSystem.TrySpawnVirtualItemInHand(used, user);
         }
 
-        _delay.BeginDelay(used);
+        if (TryComp(used, out UseDelayComponent? useDelay)
+            && !_delay.TryResetDelay((used, useDelay), true))
+            return false;
 
         _popupSystem.PopupClient(Loc.GetString("wieldable-component-successful-wield", ("item", used)), user, user);
-        _popupSystem.PopupEntity(Loc.GetString("wieldable-component-successful-wield-other", ("user", user),("item", used)), user, Filter.PvsExcept(user), true);
+        _popupSystem.PopupEntity(Loc.GetString("wieldable-component-successful-wield-other", ("user", user), ("item", used)), user, Filter.PvsExcept(user), true);
 
         var targEv = new ItemWieldedEvent();
         RaiseLocalEvent(used, ref targEv);
@@ -224,6 +223,7 @@ public sealed class WieldableSystem : EntitySystem
     {
         if (args.User == null)
             return;
+
         if (!component.Wielded)
             return;
 
@@ -255,6 +255,7 @@ public sealed class WieldableSystem : EntitySystem
     {
         if (!component.Wielded || uid != args.Unequipped)
             return;
+
         RaiseLocalEvent(uid, new ItemUnwieldedEvent(args.User, force: true), true);
     }
 
@@ -268,6 +269,7 @@ public sealed class WieldableSystem : EntitySystem
     {
         if (!TryComp<WieldableComponent>(uid, out var wield))
             return;
+
         if (!wield.Wielded)
             return;
 
index 00f3ef4c9886418867042c69bdf6db7ce2688e75..bfcb3bc2270a0695d586cf9ebc688608191b8f6e 100644 (file)
@@ -100405,7 +100405,6 @@ entities:
         - Pressed: Toggle
         1065:
         - Pressed: Toggle
-    - type: ItemCooldown
   - uid: 7826
     components:
     - type: Transform
@@ -100451,7 +100450,6 @@ entities:
         - Pressed: Toggle
         2822:
         - Pressed: Toggle
-    - type: ItemCooldown
   - uid: 8749
     components:
     - type: Transform
@@ -100550,7 +100548,6 @@ entities:
       linkedPorts:
         4205:
         - Pressed: Toggle
-    - type: ItemCooldown
   - uid: 17649
     components:
     - type: Transform
@@ -100563,7 +100560,6 @@ entities:
       linkedPorts:
         3066:
         - Pressed: Toggle
-    - type: ItemCooldown
 - proto: SignalButtonBridge
   entities:
   - uid: 4305
index 3dab4f1e19db141ee98d8af984498f0777185c13..db00d2d62f2240e4bb894de11b96e5c97e701044 100644 (file)
@@ -67091,7 +67091,7 @@ entities:
         3218:\r
         - Pressed: Toggle\r
       type: DeviceLinkSource\r
-    - type: ItemCooldown\r
+    - type: UseDelay\r
   - uid: 5389\r
     components:\r
     - rot: 1.5707963267948966 rad\r
@@ -67104,7 +67104,7 @@ entities:
         3218:\r
         - Pressed: Toggle\r
       type: DeviceLinkSource\r
-    - type: ItemCooldown\r
+    - type: UseDelay\r
   - uid: 5447\r
     components:\r
     - rot: 3.141592653589793 rad\r
index 14636c10961c64364f3b7f2c1cd2723c3abbb73c..653721d1ce5f1d9517cecb0aa5e0fcfd8dc127f2 100644 (file)
@@ -74740,7 +74740,7 @@ entities:
         1663:
         - Pressed: Toggle
       type: DeviceLinkSource
-    - type: ItemCooldown
+    - type: UseDelay
   - uid: 9640
     components:
     - pos: -20.5,-1.5
index de01876acbc8c8936faab398bfa8b1f26c25d69e..d26f4ac59b9483b9c28c318b2d679263546ef5b8 100644 (file)
@@ -142471,7 +142471,6 @@ entities:
         - Pressed: Toggle\r
         20499:\r
         - Pressed: Toggle\r
-    - type: ItemCooldown\r
   - uid: 20513\r
     components:\r
     - type: Transform\r
@@ -142704,7 +142703,6 @@ entities:
         - Pressed: Toggle\r
         20423:\r
         - Pressed: Toggle\r
-    - type: ItemCooldown\r
   - uid: 20528\r
     components:\r
     - type: Transform\r
index 6b77eb7525379b0fd873b51d8857666afc44ca19..c7e6486c5369ee8d5b0e94735f570efc582b555b 100644 (file)
@@ -118234,7 +118234,6 @@ entities:
         - Pressed: Toggle\r
         9404:\r
         - Pressed: Toggle\r
-    - type: ItemCooldown\r
   - uid: 8610\r
     components:\r
     - type: Transform\r
index 15a11add3fa41d98b5fc02653665118a1c383c21..93d8d49f6051412beff46dfa9888897e4697fcea 100644 (file)
@@ -135841,7 +135841,6 @@ entities:
         - Pressed: Toggle\r
         19434:\r
         - Pressed: Toggle\r
-    - type: ItemCooldown\r
   - uid: 19438\r
     components:\r
     - type: MetaData\r
index 35db1567da163a32e676f0895c1edfe88ceac8d5..3a6f173e912c4e88f5f591489bbef0b80c50640b 100644 (file)
@@ -79806,7 +79806,6 @@ entities:
     - pos: -46.5,62.5
       parent: 2
       type: Transform
-    - type: ItemCooldown
 - proto: ClothingBackpackMedical
   entities:
   - uid: 12350
@@ -163449,7 +163448,6 @@ entities:
         - On: Open
         - Off: Close
       type: DeviceLinkSource
-    - type: ItemCooldown
   - uid: 24195
     components:
     - rot: -1.5707963267948966 rad
@@ -163481,7 +163479,6 @@ entities:
         - On: Open
         - Off: Close
       type: DeviceLinkSource
-    - type: ItemCooldown
   - uid: 24196
     components:
     - name: shutters switch
@@ -163514,7 +163511,6 @@ entities:
         - On: Open
         - Off: Close
       type: DeviceLinkSource
-    - type: ItemCooldown
   - uid: 24197
     components:
     - name: blast door switch
@@ -163528,7 +163524,6 @@ entities:
         - On: Open
         - Off: Close
       type: DeviceLinkSource
-    - type: ItemCooldown
   - uid: 24198
     components:
     - rot: -1.5707963267948966 rad
@@ -163557,7 +163552,6 @@ entities:
         - On: Open
         - Off: Close
       type: DeviceLinkSource
-    - type: ItemCooldown
   - uid: 24199
     components:
     - rot: 1.5707963267948966 rad
@@ -163572,7 +163566,6 @@ entities:
         - On: Open
         - Off: Close
       type: DeviceLinkSource
-    - type: ItemCooldown
   - uid: 24200
     components:
     - rot: 3.141592653589793 rad
@@ -163624,7 +163617,6 @@ entities:
         - On: Open
         - Off: Close
       type: DeviceLinkSource
-    - type: ItemCooldown
   - uid: 24204
     components:
     - rot: 3.141592653589793 rad
@@ -163671,7 +163663,6 @@ entities:
         - On: Open
         - Off: Close
       type: DeviceLinkSource
-    - type: ItemCooldown
   - uid: 24207
     components:
     - pos: -52.5,-11.5
@@ -163728,7 +163719,6 @@ entities:
         - On: Open
         - Off: Close
       type: DeviceLinkSource
-    - type: ItemCooldown
   - uid: 24210
     components:
     - pos: -49.5,24.5
@@ -163793,7 +163783,6 @@ entities:
         - On: Open
         - Off: Close
       type: DeviceLinkSource
-    - type: ItemCooldown
   - uid: 24214
     components:
     - pos: 58.5,48.5
@@ -164016,7 +164005,6 @@ entities:
         - On: Open
         - Off: Close
       type: DeviceLinkSource
-    - type: ItemCooldown
   - uid: 24228
     components:
     - pos: 54.5,51.5
@@ -164033,7 +164021,6 @@ entities:
         - On: Open
         - Off: Close
       type: DeviceLinkSource
-    - type: ItemCooldown
   - uid: 24229
     components:
     - pos: 5.5,49.5
@@ -164229,7 +164216,6 @@ entities:
         - On: Open
         - Off: Close
       type: DeviceLinkSource
-    - type: ItemCooldown
   - uid: 24238
     components:
     - rot: 3.141592653589793 rad
@@ -164273,7 +164259,6 @@ entities:
         - On: Open
         - Off: Close
       type: DeviceLinkSource
-    - type: ItemCooldown
   - uid: 24239
     components:
     - name: shutters switch
@@ -164294,7 +164279,6 @@ entities:
         - Off: Close
         - Status: Toggle
       type: DeviceLinkSource
-    - type: ItemCooldown
   - uid: 24240
     components:
     - pos: -51.5,36.5
@@ -164305,7 +164289,6 @@ entities:
         - On: Open
         - Off: Close
       type: DeviceLinkSource
-    - type: ItemCooldown
   - uid: 24241
     components:
     - name: shutters switch
@@ -164342,7 +164325,6 @@ entities:
         - On: Open
         - Off: Close
       type: DeviceLinkSource
-    - type: ItemCooldown
   - uid: 24242
     components:
     - name: visitation switch
@@ -164363,7 +164345,6 @@ entities:
         - On: Open
         - Off: Close
       type: DeviceLinkSource
-    - type: ItemCooldown
   - uid: 24243
     components:
     - name: shutters switch
@@ -164402,7 +164383,6 @@ entities:
         - On: Open
         - Off: Close
       type: DeviceLinkSource
-    - type: ItemCooldown
   - uid: 24245
     components:
     - name: shutters switch
@@ -164521,7 +164501,6 @@ entities:
         - Off: Close
         - Status: Toggle
       type: DeviceLinkSource
-    - type: ItemCooldown
   - uid: 24248
     components:
     - pos: -74.5,-43.5
@@ -175048,7 +175027,6 @@ entities:
         - Right: Reverse
         - Middle: Off
       type: DeviceLinkSource
-    - type: ItemCooldown
   - uid: 25925
     components:
     - pos: -41.5,17.5
@@ -175351,7 +175329,6 @@ entities:
         - Right: Reverse
         - Middle: Off
       type: DeviceLinkSource
-    - type: ItemCooldown
   - uid: 25933
     components:
     - pos: 47.5,39.5
@@ -175551,7 +175528,6 @@ entities:
         - Right: Forward
         - Middle: Off
       type: DeviceLinkSource
-    - type: ItemCooldown
 - proto: UnfinishedMachineFrame
   entities:
   - uid: 25938
index 7a955f62a747ce19a084eb7834ca0917b7550ac6..c3f158b98573bc21d50fab319ecb66087fbd5d1b 100644 (file)
@@ -56927,7 +56927,6 @@ entities:
         260:
         - Pressed: Toggle
       type: DeviceLinkSource
-    - type: ItemCooldown
   - uid: 8766
     components:
     - pos: -13.5,12.5
@@ -56965,7 +56964,6 @@ entities:
         7588:
         - Pressed: Toggle
       type: DeviceLinkSource
-    - type: ItemCooldown
   - uid: 10449
     components:
     - pos: 51.5,18.5
index f651254c9b12858b97027a9689ddbbe0ca912b83..4b8628213b84b55e5eda67973caf27340a519a4b 100644 (file)
@@ -53,7 +53,6 @@
     qualities:
     - Rolling
     speed: 0.25 # its small so takes longer to roll the entire dough flat
-  - type: ItemCooldown
   - type: SpaceGarbage
   - type: TrashOnSolutionEmpty
     solution: drink
index e626e21cb884c1c23cc92e0bcd4d9374f40a2113..1fbc53c9225918cac2869e368c1d2fc1ac6a16a9 100644 (file)
@@ -37,7 +37,6 @@
     damage:
       types:
         Blunt: 0
-  - type: ItemCooldown
 
 - type: entity
   parent: DrinkBaseCup
index f4bc48a2415b8157322a5f864aff3667b96c20c2..6d324b6bedcf57554e91253e0b5238f2a5ac2d90 100644 (file)
@@ -16,7 +16,6 @@
     prototype: MobHumanSyndicateAgent
   - type: EmitSoundOnUse
     sound: /Audio/Effects/Emotes/parp1.ogg
-  - type: ItemCooldown
   - type: UseDelay
     delay: 300
 
index e1137d7b8cef07b5579a41d1d450b87e132e70ab..c347a911800165c22c895551dfbb8b34bb055350 100644 (file)
@@ -5,9 +5,7 @@
   description: A handy-dandy holographic projector that displays a janitorial sign.
   components:
   - type: HolosignProjector
-  - type: ItemCooldown
   - type: UseDelay
-    delay: 1.0
   - type: ContainerContainer
     containers:
       cell_slot: !type:ContainerSlot {}
index caf2b909c605777ad48c69bfc21e14461fef4bc9..e3fe9d8949b450310ea67d938394c6f8ee6a3a2d 100644 (file)
@@ -14,7 +14,6 @@
     sprite: Objects/Fun/bikehorn.rsi
     slots: [Belt]
     quickEquip: false
-  - type: ItemCooldown
   - type: EmitSoundOnUse
     sound:
       collection: BikeHorn
@@ -52,7 +51,7 @@
   name: broken bike horn
   description: A broken horn off of a bicycle.
   components:
-  - type: ItemCooldown
+  - type: UseDelay
   - type: Sprite
     sprite: Objects/Fun/cluwnehorn.rsi
     state: icon
index 8d8565361d499287f97d0bbf44526f513eed2957..a4e86e1b113a49f9fccb224bacf5ad81d7fbdf9f 100644 (file)
@@ -42,7 +42,6 @@
   - type: Item
     size: Tiny
     sprite: Objects/Fun/Darts/dart_red.rsi
-  - type: ItemCooldown
   - type: SolutionContainerManager
     solutions:
       melee:
     items:
     - id: HypoDart
     sound:
-      path: /Audio/Effects/unwrap.ogg
\ No newline at end of file
+      path: /Audio/Effects/unwrap.ogg
index d5f28d09b62940a8eaa49473267fb725a0bcbd62..090245cb50da8fcc84544fc8d9209e49f22452df 100644 (file)
@@ -4,7 +4,6 @@
   id: BaseDice
   components:
   - type: Dice
-  - type: ItemCooldown
   - type: UseDelay
   - type: Sprite
     sprite: Objects/Fun/dice.rsi
index 037f9ec80dff82d03e878f863a9ebec9fae751f3..0061270df2feef993bef4f2ff4dbb192271aee56 100644 (file)
@@ -9,7 +9,6 @@
     state: icon
   - type: Item
     sprite: Objects/Misc/skub.rsi
-  - type: ItemCooldown
   - type: EmitSoundOnUse
     sound:
       collection: Skub
index ae6d37b554ba1d68570964491941968b74e85a32..41233ffecdfe8545e8d0d2173ac65a39a3c1ac29 100644 (file)
@@ -19,7 +19,6 @@
   - type: EmitSoundOnLand
     sound:
       collection: ToyFall
-  - type: ItemCooldown
   - type: UseDelay
     delay: 1.0
   - type: MeleeWeapon
     size: Small
     sprite: Objects/Fun/toys.rsi
     heldPrefix: foamblade
-  - type: ItemCooldown
+  - type: UseDelay
 
 # MISC
 
     sprite: Objects/Fun/whoopie.rsi
     state: icon
     quickEquip: false
-  - type: ItemCooldown
   - type: EmitSoundOnUse
     sound:
       collection: Parp
index 797cee6b4fc53f199f0dbc1734b2b27823767501..d880d9d1814eb1d222ee4a83bcb55c39f1770152 100644 (file)
@@ -20,7 +20,6 @@
       - enum.DamageStateVisualLayers.Base:
           shard3: ""
   - type: SpaceGarbage
-  - type: ItemCooldown
   - type: MeleeWeapon
     attackRate: 1.5
     damage:
index c5abc9d8cc06a4e1da8771c75a0ea08c0508b848..3dd254b0c42e4d4e88b544c1b036939968b270e5 100644 (file)
@@ -18,7 +18,6 @@
           shard2: ""
       - enum.DamageStateVisualLayers.Base:
           shard3: ""
-  - type: ItemCooldown
   - type: MeleeWeapon
     attackRate: 1.5
     damage:
index e7f2088b646afe83fc297a1a9bbaea52404c450b..c5d970af50d99f7ccbb0f9f7845429dd685a9ad4 100644 (file)
@@ -5,7 +5,6 @@
   description: In Space Glasgow this is called a conversation starter.
   components:
   - type: Sharp
-  - type: ItemCooldown
   - type: MeleeWeapon
     attackRate: 1.5
     damage:
@@ -27,4 +26,3 @@
     materialComposition:
       Glass: 50
   - type: SpaceGarbage
-
index 12406f2890d8f8042028f6fe0fc8d7a2d768cb8b..092722ec1701ca491303866c6cd84e1de46b88c2 100644 (file)
@@ -32,7 +32,6 @@
       params:
           variation: 0.03
           volume: 3
-  - type: ItemCooldown
   - type: UseDelay
     delay: 0.5
   - type: MeleeWeapon
index 1deafac00bfbc99bb3c7b85291003b8eaca7ab85..bae33f27f1706c2ee6018c61cdc0537df6358fba 100644 (file)
@@ -24,7 +24,7 @@
   - type: DrainableSolution
     solution: spray
   - type: SolutionTransfer
-  - type: ItemCooldown
+  - type: UseDelay
   - type: Spray
     transferAmount: 10
     pushbackAmount: 60
index e66829c7d47168abef31db8d007f5329a0a7be22..16966a4e4d2fe836be2c0059dbe5d785bf37d3b4 100644 (file)
   - type: Sprite
     sprite: Objects/Misc/bureaucracy.rsi
     state: overpriced_pen
-  - type: ItemCooldown
   - type: MeleeWeapon
     wideAnimationRotation: -45
     damage:
index 75ce118d9fb432db5e21aebd2262c4ca5d05c083..fef4d47be037387884862a7ad9c6ca1959ef3226 100644 (file)
@@ -26,7 +26,6 @@
     mixMessage: "bible-mixing-success"
     reactionTypes:
     - Holy
-  - type: ItemCooldown
   - type: Sprite
     sprite: Objects/Specific/Chapel/bible.rsi
     state: icon
index e54dedb066897eac1c7c33609ed729493ff96e1b..9d9f3b7324bf6e25c4af39957cc863ebee9d4430 100644 (file)
@@ -45,7 +45,6 @@
     solution: spray
   - type: Spillable
     solution: spray
-  - type: ItemCooldown
   - type: Tag
     tags:
     - Spray
index 1209d2a3f98464923d7079ed1502280672166e50..d389a35fe07c53f9393f74c417123ae48bc052ed 100644 (file)
@@ -11,7 +11,6 @@
   - type: Sprite
     sprite: Objects/Tools/Hydroponics/hoe.rsi
     state: icon
-  - type: ItemCooldown
   - type: MeleeWeapon
     wideAnimationRotation: 135
     swingLeft: true
@@ -33,7 +32,6 @@
   - type: Sprite
     sprite: Objects/Tools/Hydroponics/clippers.rsi
     state: icon
-  - type: ItemCooldown
   - type: MeleeWeapon
     wideAnimationRotation: 90
     damage:
@@ -53,7 +51,6 @@
   - type: Sprite
     sprite: Objects/Tools/Hydroponics/scythe.rsi
     state: icon
-  - type: ItemCooldown
   - type: MeleeWeapon
     wideAnimationRotation: 135
     damage:
@@ -81,7 +78,6 @@
   - type: Sprite
     sprite: Objects/Tools/Hydroponics/hatchet.rsi
     state: icon
-  - type: ItemCooldown
   - type: MeleeWeapon
     wideAnimationRotation: 135
     swingLeft: true
   - type: Sprite
     sprite: Objects/Tools/Hydroponics/spade.rsi
     state: icon
-  - type: ItemCooldown
   - type: MeleeWeapon
     wideAnimationRotation: 45
     damage:
index e819d6c39f53c178aa0832e5e4add1d424f17c48..e284944a537cdb117b9abdce81616196d0781197 100644 (file)
   - type: Item
     sprite: Objects/Specific/Janitorial/plunger.rsi
     heldPrefix: plunger
-  - type: ItemCooldown
   - type: GuideHelp
     guides:
     - Janitorial
index ed55afea1d870f57e7f23f4c8efbaadd6687be98..dbbea7074688e9db1a10ed724cbc2b956f12d029 100644 (file)
@@ -24,7 +24,7 @@
     solution: spray
   - type: SolutionTransfer
     canChangeTransferAmount: true
-  - type: ItemCooldown
+  - type: UseDelay
   - type: Spray
     transferAmount: 10
     sprayVelocity: 2
index 2d1af8f24656bb67cf986d86e4c7a717cbfba449..3c93a0a876d5385d50361461241382afb9c2278b 100644 (file)
@@ -29,7 +29,6 @@
             False: { visible: false }
     - type: Item
       size: Large
-    - type: ItemCooldown
     - type: Speech
       speechVerb: Robotic
     - type: Defibrillator
index 354cee2f995ea3c0bd7a4c38dae0b3c8d9d8a692..e157817ec46339e5ce1a761287d3a96036accd6b 100644 (file)
@@ -22,7 +22,6 @@
     state: cautery
   - type: Item
     sprite: Objects/Specific/Medical/Surgery/cautery.rsi
-  - type: ItemCooldown
   - type: MeleeWeapon
     damage:
        types:
@@ -43,7 +42,6 @@
     state: drill
   - type: Item
     sprite: Objects/Specific/Medical/Surgery/drill.rsi
-  - type: ItemCooldown
   - type: MeleeWeapon
     damage:
       types:
@@ -69,7 +67,6 @@
     state: scalpel
   - type: Item
     sprite: Objects/Specific/Medical/Surgery/scalpel.rsi
-  - type: ItemCooldown
   - type: MeleeWeapon
     attackRate: 1.5
     damage:
     state: retractor
   - type: Item
     sprite: Objects/Specific/Medical/Surgery/scissors.rsi
-  - type: ItemCooldown
 
 - type: entity
   name: hemostat
     state: saw
   - type: Item
     sprite: Objects/Specific/Medical/Surgery/saw.rsi
-  - type: ItemCooldown
   - type: Tool
     qualities:
       - Sawing
index 6abdd790c9cb5d44c80dce4678704bf46d9ae14a..f3be0167246d648cdb43b9070aaf7bfde179b37b 100644 (file)
@@ -12,7 +12,6 @@
     - state: base
     - state: green_bit
       shader: unshaded
-  - type: ItemCooldown
   - type: MeleeWeapon
     damage:
       types:
index e6a7a43fa40a2896b39533eb3dbdd7ee5e1b0008..05a80043e81d8e6bcb724398899c44756b3a2e0f 100644 (file)
@@ -10,7 +10,6 @@
   - type: Sprite
     sprite: Objects/Tools/Cowtools/haycutters.rsi
     state: haycutters
-  - type: ItemCooldown
   - type: MeleeWeapon
     damage:
       types:
@@ -36,7 +35,6 @@
     state: moodriver
   - type: Item
     sprite: Objects/Tools/Cowtools/moodriver.rsi
-  - type: ItemCooldown
   - type: MeleeWeapon
     attackRate: 1.5
     damage:
@@ -60,7 +58,6 @@
     state: wronch
   - type: Item
     sprite: Objects/Tools/Cowtools/wronch.rsi
-  - type: ItemCooldown
   - type: MeleeWeapon
     attackRate: 1.5
     damage:
@@ -84,7 +81,6 @@
     state: cowbar
   - type: Item
     sprite: Objects/Tools/Cowtools/cowbar.rsi
-  - type: ItemCooldown
   - type: MeleeWeapon
     damage:
       types:
     - id: Mooltitool
     - id: Cowelder
     - id: Milkalyzer
-
index e9315a6418aa8048b0dca2da915a5b1cf81ee6ea..ab11fb65b6eac9a90e43f0c4a04cd37da7923dc9 100644 (file)
@@ -71,7 +71,7 @@
   - type: Item
     size: Tiny
     sprite: Objects/Tools/lighters.rsi
-  - type: ItemCooldown
+  - type: UseDelay
   - type: RefillableSolution
     solution: Welder
   - type: SolutionContainerManager
index 2627bbeedaf1c8029e1bf69956b37ba3360d9cfc..64efe53f43daf6e0998216ef41c26e7246ce63d0 100644 (file)
@@ -13,7 +13,6 @@
     - 0,0,6,3
   - type: Item
     size: Ginormous
-  - type: ItemCooldown
   - type: MeleeWeapon
     damage:
       types:
index c173eb7e7616448bc813ff412bd773524e179678..8d85a13429aa901979a347be8c0b062ee85b201c 100644 (file)
@@ -17,7 +17,6 @@
     - state: cutters
       map: [ "enum.DamageStateVisualLayers.Base" ]
     - state: cutters-cutty-thingy
-  - type: ItemCooldown
   - type: MeleeWeapon
     wideAnimationRotation: -90
     damage:
@@ -66,7 +65,6 @@
   - type: Item
     sprite: Objects/Tools/screwdriver.rsi
     storedRotation: -90
-  - type: ItemCooldown
   - type: MeleeWeapon
     wideAnimationRotation: -90
     attackRate: 1
     storedSprite:
       sprite: Objects/Tools/wrench.rsi
       state: storage
-  - type: ItemCooldown
   - type: MeleeWeapon
     wideAnimationRotation: 135
     attackRate: 1.5
     storedSprite:
       sprite: Objects/Tools/crowbar.rsi
       state: storage
-  - type: ItemCooldown
   - type: MeleeWeapon
     wideAnimationRotation: -135
     damage:
     maxCharges: 5
     charges: 5
   - type: UseDelay
-    delay: 1.0
   - type: Sprite
     sprite: Objects/Tools/rcd.rsi
     state: icon
   - type: Sprite
     sprite: Objects/Tools/shovel.rsi
     state: icon
-  - type: ItemCooldown
   - type: MeleeWeapon
     wideAnimationRotation: -135
     damage:
     quickEquip: false
     slots:
     - Belt
-  - type: ItemCooldown
   - type: MeleeWeapon
     wideAnimationRotation: -135
     damage:
index eeb2f11179e39edf3f5b65c007f211a3c6cdda88..60dfe0f1363d56ee779b625dfb94b33ff5739657 100644 (file)
@@ -64,7 +64,7 @@
       right:
       - state: inhand-right-flame
         shader: unshaded
-  - type: ItemCooldown
+  - type: UseDelay
   - type: MeleeWeapon
     wideAnimationRotation: -90
     damage:
index 3c7c1a7865e5e55c14d39ce1d851d1684b85c1b1..106e8bf4400e241ead2f4c6918eb4e3f9fc14e07 100644 (file)
@@ -10,7 +10,6 @@
   - type: Utensil
     types:
       - Knife
-  - type: ItemCooldown
   - type: MeleeWeapon
     wideAnimationRotation: -135
     damage:
index d8809389a7fef50331cf9313daf38ddacecdc3d3..4368f162a2f3db46e07cf6b00afc51b1bac10987 100644 (file)
@@ -10,7 +10,6 @@
   - type: Sprite
     sprite: Objects/Weapons/Melee/pickaxe.rsi
     state: pickaxe
-  - type: ItemCooldown
   - type: MeleeWeapon
     wideAnimationRotation: -135
     damage:
@@ -31,7 +30,6 @@
     sprite: Objects/Weapons/Melee/pickaxe.rsi
     storedRotation: -45
   - type: UseDelay
-    delay: 1
 
 - type: entity
   name: mining drill
@@ -45,7 +43,6 @@
   - type: Sprite
     sprite: Objects/Tools/handdrill.rsi
     state: handdrill
-  - type: ItemCooldown
   - type: MeleeWeapon
     attackRate: 1.5
     damage:
index e704fc90a4fe5b581e2531ea2c2cc2ec5bd8b92d..4dff7f3ee1ed1c6913f9a0dc60447c8057cef2ac 100644 (file)
@@ -55,7 +55,6 @@
   - type: Construction
     graph: Spear
     node: spear
-  - type: ItemCooldown
   - type: SolutionContainerManager
     solutions:
       melee:
       types:
         Blunt: 5
   - type: UseDelay
-    delay: 1
   - type: Appearance
   - type: SolutionContainerVisuals
     maxFillLevels: 1
index 6a566927db8c9173964dd9149651a78cc55e8ce3..b0b166f6ce815c9a40333f38fede0ea085a24ce5 100644 (file)
@@ -44,7 +44,7 @@
   - type: Battery
     maxCharge: 360
     startingCharge: 360
-  - type: ItemCooldown
+  - type: UseDelay
   - type: Item
     heldPrefix: off
     size: Normal
index d55a396164a31cdee253d9c665dccfb3aa60217f..93bc0a2dd322616303c837691fe2f0eab16f7464 100644 (file)
@@ -46,7 +46,7 @@
   - type: Battery
     maxCharge: 1000
     startingCharge: 1000
-  - type: ItemCooldown
+  - type: UseDelay
   - type: Item
     heldPrefix: off
     size: Normal
     - type: Item
       size: Small
       sprite: Objects/Weapons/Melee/flash.rsi
-    - type: ItemCooldown
+    - type: UseDelay
     - type: StaticPrice
       price: 40
     - type: Appearance
index e43c80400e49c0bd96ba972c0535b8be7bcacfbb..73ce22178788fcbabdde7aa432c3205938f8ef3e 100644 (file)
     guides: [ Singularity, Power ]
   - type: ContainerContainer
     containers:
-      GasTank: !type:ContainerSlot {}
+      gas_tank: !type:ContainerSlot {}
   - type: ItemSlots
     slots:
-      GasTank:
+      gas_tank:
         startingItem: PlasmaTank
         whitelist:
           components:
           - GasTank
+  - type: UseDelay
+    delay: 1
 
 - type: entity
   id: RadiationCollectorNoTank
   components:
   - type: ItemSlots
     slots:
-      GasTank:
+      gas_tank:
         whitelist:
           components:
           - GasTank
-        
+
 - type: entity
   id: RadiationCollectorFullTank
   suffix: Filled tank
   components:
   - type: ItemSlots
     slots:
-      GasTank:
+      gas_tank:
         startingItem: PlasmaTankFilled
         whitelist:
           components:
-          - GasTank
\ No newline at end of file
+          - GasTank
index 06e08beb75733c3d27826b752cf12c6a761cc147..6679b2d53331efdf8185063c97bda0333481197a 100644 (file)
@@ -20,7 +20,6 @@
           False: { visible: false }
   - type: Item
     size: Normal
-  - type: ItemCooldown
   - type: EmitSoundOnUse #placeholder for future unical mechanic
     sound:
       collection: RadiationPulse
index edfd64b06cf1e356c2206c01f7704fe41744ec41..65ebcab94472a949faff450b21b0fa25709fd402 100644 (file)
     components:
     - Item
   permanentComponents:
-  - type: ItemCooldown
+  - type: UseDelay
   - type: MeleeWeapon
     damage:
       types: