From 1b2b3138047ef3cdbbfff9f1f779467f25eb3b3c Mon Sep 17 00:00:00 2001 From: Viktor <125474183+OmntnsV@users.noreply.github.com> Date: Thu, 21 Mar 2024 02:08:17 +0200 Subject: [PATCH] Mag gloves (#147) * created yml * +mechanics * textures * full implementation of magnetic gloves without lathe crafts and researches * finale * meeerge * Fixed --- Content.Server/Hands/Systems/HandsSystem.cs | 4 + .../Standing/StandingStateSystem.cs | 8 +- Content.Server/Strip/StrippableSystem.cs | 8 ++ .../_White/MagGloves/MagneticGlovesSystem.cs | 116 ++++++++++++++++++ .../Weapons/Melee/SharedMeleeWeaponSystem.cs | 1 + .../MagGloves/KeepItemsOnFallComponent.cs | 10 ++ .../MagneticGlovesAdvancedComponent.cs | 16 +++ .../MagGloves/MagneticGlovesComponent.cs | 31 +++++ .../MagGloves/PreventDisarmComponent.cs | 10 ++ ...entStrippingFromHandsAndGlovesComponent.cs | 10 ++ .../MagGloves/SharedMagneticGlovesSystem.cs | 107 ++++++++++++++++ .../Locale/en-US/white/magnetic-gloves.ftl | 10 ++ .../Locale/ru-RU/White/magnetic-gloves.ftl | 19 +++ .../Entities/Structures/Machines/lathe.yml | 2 + .../Entities/Structures/Power/chargers.yml | 2 + .../Prototypes/Entities/White/mag-gloves.yml | 77 ++++++++++++ .../Prototypes/Recipes/Lathes/security.yml | 18 +++ Resources/Prototypes/Research/arsenal.yml | 30 ++++- .../MagGloves/maggloves.rsi/equipped-HAND.png | Bin 0 -> 335 bytes .../White/MagGloves/maggloves.rsi/icon-on.png | Bin 0 -> 682 bytes .../White/MagGloves/maggloves.rsi/icon.png | Bin 0 -> 683 bytes .../MagGloves/maggloves.rsi/inhand-left.png | Bin 0 -> 280 bytes .../MagGloves/maggloves.rsi/inhand-right.png | Bin 0 -> 289 bytes .../White/MagGloves/maggloves.rsi/meta.json | 41 +++++++ .../maggloves.rsi/on-equipped-HAND.png | Bin 0 -> 332 bytes .../maggloves.rsi/on-inhand-left.png | Bin 0 -> 266 bytes .../maggloves.rsi/on-inhand-right.png | Bin 0 -> 274 bytes .../magglovesadvanced.rsi/equipped-HAND.png | Bin 0 -> 353 bytes .../magglovesadvanced.rsi/icon-on.png | Bin 0 -> 698 bytes .../MagGloves/magglovesadvanced.rsi/icon.png | Bin 0 -> 706 bytes .../magglovesadvanced.rsi/inhand-left.png | Bin 0 -> 289 bytes .../magglovesadvanced.rsi/inhand-right.png | Bin 0 -> 306 bytes .../MagGloves/magglovesadvanced.rsi/meta.json | 41 +++++++ .../on-equipped-HAND.png | Bin 0 -> 350 bytes .../magglovesadvanced.rsi/on-inhand-left.png | Bin 0 -> 271 bytes .../magglovesadvanced.rsi/on-inhand-right.png | Bin 0 -> 291 bytes 36 files changed, 556 insertions(+), 5 deletions(-) create mode 100644 Content.Server/_White/MagGloves/MagneticGlovesSystem.cs create mode 100644 Content.Shared/_White/MagGloves/KeepItemsOnFallComponent.cs create mode 100644 Content.Shared/_White/MagGloves/MagneticGlovesAdvancedComponent.cs create mode 100644 Content.Shared/_White/MagGloves/MagneticGlovesComponent.cs create mode 100644 Content.Shared/_White/MagGloves/PreventDisarmComponent.cs create mode 100644 Content.Shared/_White/MagGloves/PreventStrippingFromHandsAndGlovesComponent.cs create mode 100644 Content.Shared/_White/MagGloves/SharedMagneticGlovesSystem.cs create mode 100644 Resources/Locale/en-US/white/magnetic-gloves.ftl create mode 100644 Resources/Locale/ru-RU/White/magnetic-gloves.ftl create mode 100644 Resources/Prototypes/Entities/White/mag-gloves.yml create mode 100644 Resources/Textures/White/MagGloves/maggloves.rsi/equipped-HAND.png create mode 100644 Resources/Textures/White/MagGloves/maggloves.rsi/icon-on.png create mode 100644 Resources/Textures/White/MagGloves/maggloves.rsi/icon.png create mode 100644 Resources/Textures/White/MagGloves/maggloves.rsi/inhand-left.png create mode 100644 Resources/Textures/White/MagGloves/maggloves.rsi/inhand-right.png create mode 100644 Resources/Textures/White/MagGloves/maggloves.rsi/meta.json create mode 100644 Resources/Textures/White/MagGloves/maggloves.rsi/on-equipped-HAND.png create mode 100644 Resources/Textures/White/MagGloves/maggloves.rsi/on-inhand-left.png create mode 100644 Resources/Textures/White/MagGloves/maggloves.rsi/on-inhand-right.png create mode 100644 Resources/Textures/White/MagGloves/magglovesadvanced.rsi/equipped-HAND.png create mode 100644 Resources/Textures/White/MagGloves/magglovesadvanced.rsi/icon-on.png create mode 100644 Resources/Textures/White/MagGloves/magglovesadvanced.rsi/icon.png create mode 100644 Resources/Textures/White/MagGloves/magglovesadvanced.rsi/inhand-left.png create mode 100644 Resources/Textures/White/MagGloves/magglovesadvanced.rsi/inhand-right.png create mode 100644 Resources/Textures/White/MagGloves/magglovesadvanced.rsi/meta.json create mode 100644 Resources/Textures/White/MagGloves/magglovesadvanced.rsi/on-equipped-HAND.png create mode 100644 Resources/Textures/White/MagGloves/magglovesadvanced.rsi/on-inhand-left.png create mode 100644 Resources/Textures/White/MagGloves/magglovesadvanced.rsi/on-inhand-right.png diff --git a/Content.Server/Hands/Systems/HandsSystem.cs b/Content.Server/Hands/Systems/HandsSystem.cs index b32899dc5e..d59291c362 100644 --- a/Content.Server/Hands/Systems/HandsSystem.cs +++ b/Content.Server/Hands/Systems/HandsSystem.cs @@ -4,6 +4,7 @@ using Content.Server.Inventory; using Content.Server.Pulling; using Content.Server.Stack; using Content.Server.Stunnable; +using Content.Shared._White.MagGloves; using Content.Shared.ActionBlocker; using Content.Shared.Body.Part; using Content.Shared.CombatMode; @@ -93,6 +94,9 @@ namespace Content.Server.Hands.Systems if (args.Handled) return; + if (HasComp(uid)) + return; + // Break any pulls if (TryComp(uid, out SharedPullerComponent? puller) && puller.Pulling is EntityUid pulled && TryComp(pulled, out SharedPullableComponent? pullable)) diff --git a/Content.Server/Standing/StandingStateSystem.cs b/Content.Server/Standing/StandingStateSystem.cs index e2b6495844..903c88d0f3 100644 --- a/Content.Server/Standing/StandingStateSystem.cs +++ b/Content.Server/Standing/StandingStateSystem.cs @@ -3,6 +3,7 @@ using Content.Shared.Hands.Components; using Content.Shared.Hands.EntitySystems; using Content.Shared.Standing; using Content.Shared.Throwing; +using Content.Shared._White.MagGloves; using Robust.Shared.Physics.Components; using Robust.Shared.Random; @@ -31,8 +32,11 @@ public sealed class StandingStateSystem : EntitySystem if (hand.HeldEntity is not EntityUid held) continue; - if (!_handsSystem.TryDrop(uid, hand, null, checkActionBlocker: false, handsComp: handsComp)) - continue; + if (!HasComp(uid)) + { + if (!_handsSystem.TryDrop(uid, hand, null, checkActionBlocker: false, handsComp: handsComp)) + continue; + } _throwingSystem.TryThrow(held, _random.NextAngle().RotateVec(direction / dropAngle + worldRotation / 50), diff --git a/Content.Server/Strip/StrippableSystem.cs b/Content.Server/Strip/StrippableSystem.cs index 50a9cb9b69..fa825d6231 100644 --- a/Content.Server/Strip/StrippableSystem.cs +++ b/Content.Server/Strip/StrippableSystem.cs @@ -18,6 +18,7 @@ using Content.Shared.Popups; using Content.Shared.Strip; using Content.Shared.Strip.Components; using Content.Shared.Verbs; +using Content.Shared._White.MagGloves; using Robust.Server.GameObjects; using Robust.Shared.Player; using Robust.Shared.Utility; @@ -71,6 +72,13 @@ namespace Content.Server.Strip !TryComp(user, out var userHands)) return; + if ((args.Slot == "gloves" || args.IsHand) && TryComp(strippable, out PreventStrippingFromHandsAndGlovesComponent? mag)) + { + var message = Loc.GetString("maggloves-cant-strip"); + _popup.PopupEntity(message, user, user); + return; + } + if (args.IsHand) { StripHand(user, args.Slot, strippable, userHands); diff --git a/Content.Server/_White/MagGloves/MagneticGlovesSystem.cs b/Content.Server/_White/MagGloves/MagneticGlovesSystem.cs new file mode 100644 index 0000000000..37f61b0522 --- /dev/null +++ b/Content.Server/_White/MagGloves/MagneticGlovesSystem.cs @@ -0,0 +1,116 @@ +using Content.Server.Emp; +using Content.Server.Power.Components; +using Content.Shared.Examine; +using Content.Shared.Inventory.Events; +using Content.Shared._White.MagGloves; +using Content.Shared.Popups; +using Robust.Shared.Containers; +using Robust.Shared.Timing; + +namespace Content.Server._White.MagGloves; + +/// +/// This handles... +/// +public sealed class MagneticGlovesSystem : EntitySystem +{ + + [Dependency] private readonly SharedContainerSystem _sharedContainer = default!; + [Dependency] private readonly IGameTiming _gameTiming = default!; + [Dependency] private readonly SharedPopupSystem _popup = default!; + /// + public override void Initialize() + { + SubscribeLocalEvent(OnGotEquipped); + SubscribeLocalEvent(OnGotUnequipped); + SubscribeLocalEvent(OnExamined); + SubscribeLocalEvent(OnEmp); + } + + public override void Update(float frameTime) + { + var query = EntityQueryEnumerator(); + while (query.MoveNext(out var uid, out var gloves)) + { + if (_gameTiming.CurTime > gloves.GlovesLastActivation + gloves.GlovesActiveTime && gloves.Enabled) + { + RaiseLocalEvent(uid, new ToggleMagneticGlovesEvent()); + } + + } + } + + public void OnEmp(EntityUid uid, MagneticGlovesComponent component, EmpPulseEvent args) + { + if (component.Enabled) + { + RaiseLocalEvent(uid, new ToggleMagneticGlovesEvent()); + } + } + + public void OnGotUnequipped(EntityUid uid, MagneticGlovesComponent component, GotUnequippedEvent args) + { + if (args.Slot == "gloves") + { + ToggleGloves(args.Equipee, component, false, uid); + } + + if (component.Enabled) + { + _popup.PopupEntity(Loc.GetString("maggloves-deactivated"), uid, args.Equipee); + RaiseLocalEvent(uid, new ToggleMagneticGlovesEvent()); + } + } + + public void OnGotEquipped(EntityUid uid, MagneticGlovesComponent component, GotEquippedEvent args) + { + if (args.Slot == "gloves") + { + ToggleGloves(args.Equipee, component, true, uid); + } + } + + public void ToggleGloves(EntityUid owner, MagneticGlovesComponent component, bool active, EntityUid uid) + { + if (!active) + { + RemComp(owner); + if (TryComp(uid, out var adv)) + { + RemComp(owner); + RemComp(owner); + } + } + else if (component.Enabled) + { + EnsureComp(owner); + if (TryComp(uid, out var adv)) + { + EnsureComp(owner); + EnsureComp(owner); + } + } + } + + public void OnExamined(EntityUid uid, MagneticGlovesComponent component, ExaminedEvent args) + { + + if (!args.IsInDetailsRange) + return; + + var message = Loc.GetString("maggloves-ready-in") + " " + component.GlovesReadyAt.Subtract(_gameTiming.CurTime).TotalSeconds.ToString("0"); + + if (component.GlovesReadyAt < _gameTiming.CurTime) + { + message = Loc.GetString("maggloves-ready"); + } + + if (component.Enabled) + { + message = Loc.GetString("maggloves-enabled-till") + " " + (component.GlovesLastActivation + .Add(component.GlovesActiveTime).Subtract(_gameTiming.CurTime).TotalSeconds.ToString("0")); + } + + args.PushMarkup(message); + } +} diff --git a/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs b/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs index dacf2910cb..3ca1a057c9 100644 --- a/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs +++ b/Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs @@ -22,6 +22,7 @@ using Content.Shared.Weapons.Ranged.Components; using Content.Shared.Weapons.Ranged.Events; using Content.Shared.Weapons.Ranged.Systems; using Content.Shared._White; +using Content.Shared._White.MagGloves; using Content.Shared._White.Chaplain; using Robust.Shared.Audio; using Robust.Shared.Audio.Systems; diff --git a/Content.Shared/_White/MagGloves/KeepItemsOnFallComponent.cs b/Content.Shared/_White/MagGloves/KeepItemsOnFallComponent.cs new file mode 100644 index 0000000000..bdfb39dbf5 --- /dev/null +++ b/Content.Shared/_White/MagGloves/KeepItemsOnFallComponent.cs @@ -0,0 +1,10 @@ +namespace Content.Shared._White.MagGloves; + +/// +/// This is used to prevent entity loose it's items on fall. +/// +[RegisterComponent] +public sealed partial class KeepItemsOnFallComponent : Component +{ + +} diff --git a/Content.Shared/_White/MagGloves/MagneticGlovesAdvancedComponent.cs b/Content.Shared/_White/MagGloves/MagneticGlovesAdvancedComponent.cs new file mode 100644 index 0000000000..1a0755a012 --- /dev/null +++ b/Content.Shared/_White/MagGloves/MagneticGlovesAdvancedComponent.cs @@ -0,0 +1,16 @@ +using Robust.Shared.Prototypes; + +namespace Content.Shared._White.MagGloves; + +/// +/// This is used as a marker for advanced magnetic gloves. +/// +[RegisterComponent, AutoGenerateComponentState] +public sealed partial class MagneticGlovesAdvancedComponent : Component +{ + [DataField, AutoNetworkedField] + public EntityUid? ToggleActionEntity; + + [DataField] + public EntProtoId ToggleAction = "ActionToggleMagneticGlovesAdvanced"; +} diff --git a/Content.Shared/_White/MagGloves/MagneticGlovesComponent.cs b/Content.Shared/_White/MagGloves/MagneticGlovesComponent.cs new file mode 100644 index 0000000000..ed2319f299 --- /dev/null +++ b/Content.Shared/_White/MagGloves/MagneticGlovesComponent.cs @@ -0,0 +1,31 @@ +using Robust.Shared.Prototypes; + +namespace Content.Shared._White.MagGloves; + +/// +/// This is used for... +/// +[RegisterComponent, AutoGenerateComponentState] +public sealed partial class MagneticGlovesComponent : Component +{ + [ViewVariables] + public bool Enabled { get; set; } = false; + + [DataField, AutoNetworkedField] + public EntityUid? ToggleActionEntity; + + [DataField("action")] + public EntProtoId ToggleAction = "ActionToggleMagneticGloves"; + + [ViewVariables(VVAccess.ReadOnly)] + public TimeSpan GlovesReadyAt = TimeSpan.Zero; + + [ViewVariables(VVAccess.ReadOnly)] + public TimeSpan GlovesLastActivation = TimeSpan.Zero; + + [DataField("glovesCooldown")] + public TimeSpan GlovesCooldown = TimeSpan.FromSeconds(60); + + [DataField("glovesActiveTime")] + public TimeSpan GlovesActiveTime = TimeSpan.FromSeconds(60); +} diff --git a/Content.Shared/_White/MagGloves/PreventDisarmComponent.cs b/Content.Shared/_White/MagGloves/PreventDisarmComponent.cs new file mode 100644 index 0000000000..7298e192d7 --- /dev/null +++ b/Content.Shared/_White/MagGloves/PreventDisarmComponent.cs @@ -0,0 +1,10 @@ +namespace Content.Shared._White.MagGloves; + +/// +/// This is used to prevent disarming when magnetic gloves are enabled. +/// +[RegisterComponent] +public sealed partial class PreventDisarmComponent : Component +{ + +} diff --git a/Content.Shared/_White/MagGloves/PreventStrippingFromHandsAndGlovesComponent.cs b/Content.Shared/_White/MagGloves/PreventStrippingFromHandsAndGlovesComponent.cs new file mode 100644 index 0000000000..ffc7d878df --- /dev/null +++ b/Content.Shared/_White/MagGloves/PreventStrippingFromHandsAndGlovesComponent.cs @@ -0,0 +1,10 @@ +namespace Content.Shared._White.MagGloves; + +/// +/// This is used to block stripping when magnetic gloves are enabled. +/// +[RegisterComponent] +public sealed partial class PreventStrippingFromHandsAndGlovesComponent : Component +{ + +} diff --git a/Content.Shared/_White/MagGloves/SharedMagneticGlovesSystem.cs b/Content.Shared/_White/MagGloves/SharedMagneticGlovesSystem.cs new file mode 100644 index 0000000000..052395f93d --- /dev/null +++ b/Content.Shared/_White/MagGloves/SharedMagneticGlovesSystem.cs @@ -0,0 +1,107 @@ +using Content.Shared.Actions; +using Content.Shared.Clothing.EntitySystems; +using Content.Shared.Inventory; +using Content.Shared.Item; +using Content.Shared.Popups; +using Content.Shared.Toggleable; +using Robust.Shared.Containers; +using Robust.Shared.Network; +using Robust.Shared.Timing; + +namespace Content.Shared._White.MagGloves; + +/// +/// This handles... +/// +public sealed class SharedMagneticGlovesSystem : EntitySystem + +{ + [Dependency] private readonly SharedActionsSystem _sharedActions = default!; + [Dependency] private readonly InventorySystem _inventory = default!; + [Dependency] private readonly SharedContainerSystem _sharedContainer = default!; + [Dependency] private readonly SharedItemSystem _item = default!; + [Dependency] private readonly SharedAppearanceSystem _appearance = default!; + [Dependency] private readonly ClothingSystem _clothing = default!; + [Dependency] private readonly IGameTiming _gameTiming = default!; + [Dependency] private readonly SharedPopupSystem _popup = default!; + [Dependency] private readonly INetManager _net = default!; + public override void Initialize() + { + SubscribeLocalEvent(OnGetActions); + SubscribeLocalEvent(OnToggleGloves); + } + + public void OnGetActions(EntityUid uid, MagneticGlovesComponent component, GetItemActionsEvent args) + { + if (!args.InHands) + { + args.AddAction(ref component.ToggleActionEntity, component.ToggleAction); + } + + } + + public void OnToggleGloves(EntityUid uid, MagneticGlovesComponent component, ToggleMagneticGlovesEvent args) + { + if (args.Handled || _net.IsClient) + return; + + _sharedContainer.TryGetContainingContainer(uid, out var container); + + if (!component.Enabled) + { + if (component.GlovesReadyAt > _gameTiming.CurTime) + { + if (container != null) + { + _popup.PopupEntity(Loc.GetString("maggloves-not-ready"), uid, container.Owner); + } + return; + } + // If the gloves are not enabled, we want to activate them. + component.Enabled = true; + component.GlovesLastActivation = _gameTiming.CurTime; + _sharedActions.SetToggled(component.ToggleActionEntity, component.Enabled); + + if (container != null) + { + _popup.PopupEntity(Loc.GetString("maggloves-activated"), uid, container.Owner); + EnsureComp(container.Owner); + if (TryComp(uid, out var adv)) + { + EnsureComp(container.Owner); + EnsureComp(container.Owner); + } + } + } + else + { + component.Enabled = false; + _sharedActions.SetToggled(component.ToggleActionEntity, component.Enabled); + component.GlovesReadyAt = _gameTiming.CurTime + component.GlovesCooldown; + + if (container != null) + { + _popup.PopupEntity(Loc.GetString("maggloves-deactivated"), uid, container.Owner); + RemComp(container.Owner); + if (TryComp(uid, out var adv)) + { + RemComp(container.Owner); + RemComp(container.Owner); + } + } + } + + if (TryComp(uid, out var appearance) && + TryComp(uid, out var item)) + { + _item.SetHeldPrefix(uid, component.Enabled ? "on" : "off", false, item); + _appearance.SetData(uid, ToggleVisuals.Toggled, component.Enabled, appearance); + _clothing.SetEquippedPrefix(uid, component.Enabled ? "on" : null); + } + + args.Handled = true; + } + +} + +public sealed partial class ToggleMagneticGlovesEvent : InstantActionEvent {} diff --git a/Resources/Locale/en-US/white/magnetic-gloves.ftl b/Resources/Locale/en-US/white/magnetic-gloves.ftl new file mode 100644 index 0000000000..235951a52a --- /dev/null +++ b/Resources/Locale/en-US/white/magnetic-gloves.ftl @@ -0,0 +1,10 @@ +maggloves-ready = Gloves are ready to use. +maggloves-ready-in = Gloves will be ready in +research-technology-lightweight-magnets = Lightweight Magnets +research-technology-advanced-grips = Advanced Grips +maggloves-not-ready = The gloves are not ready yet +maggloves-already-active = The gloves are already active +maggloves-enabled-till = The gloves are enabled for +maggloves-cant-strip = Magnetic gloves are strongly attached to the item +maggloves-activated = Magnetic gloves activated +maggloves-deactivated = Magnetic gloves deactivated diff --git a/Resources/Locale/ru-RU/White/magnetic-gloves.ftl b/Resources/Locale/ru-RU/White/magnetic-gloves.ftl new file mode 100644 index 0000000000..40a1d0c71f --- /dev/null +++ b/Resources/Locale/ru-RU/White/magnetic-gloves.ftl @@ -0,0 +1,19 @@ +ent-ClothingHandsGlovesMagnetic = магнитные перчатки + .desc = перчатки оснащенные специальными магнитными захватами, что позволяют вещам оставаться в ваших руках после свободного падения. +ent-ClothingHandsGlovesMagneticAdvanced = продвинутые магнитные перчатки + .desc = продвинутые магнитные перчатки оснащенные более мощными захватами, что дополнительно предотвращают возможность разоружения и кражи из рук носителя. +ent-ActionToggleMagneticGloves = активировать магнитные перчатки + .desc = Предотвращает выпадение предметов из рук при падении. +ent-ActionToggleMagneticGlovesAdvanced = активировать продвинутые магнитные перчатки + .desc = Предотвращает выпадение предметов из рук при падении и предотвращает возможность разоружения и кражи из рук носителя. + +maggloves-ready = Перчатки готовы к использованию +maggloves-ready-in = Перчатки будут готовы к использованию через +research-technology-lightweight-magnets = Облегчённые магниты +research-technology-advanced-grips = Продвинутые захваты +maggloves-not-ready = Перчатки не готовы к использованию +maggloves-already-active = Перчатки уже активированы +maggloves-enabled-till = Перчатки будут активны еще +maggloves-cant-strip = Магнитные перчатки надежно удерживают предмет +maggloves-activated = Магнитные перчатки включены +maggloves-deactivated = Магнитные перчатки выключены diff --git a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml index 7d4858eca9..d4d549f26d 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml @@ -762,6 +762,8 @@ - ShuttleGunPerforatorCircuitboard - ShuttleGunFriendshipCircuitboard - ShuttleGunDusterCircuitboard + - ClothingHandsGlovesMagnetic + - ClothingHandsGlovesMagneticAdvanced - type: EmagLatheRecipes emagStaticRecipes: - MagazineLightRifleBox diff --git a/Resources/Prototypes/Entities/Structures/Power/chargers.yml b/Resources/Prototypes/Entities/Structures/Power/chargers.yml index 217be21cd6..7cde196832 100644 --- a/Resources/Prototypes/Entities/Structures/Power/chargers.yml +++ b/Resources/Prototypes/Entities/Structures/Power/chargers.yml @@ -166,6 +166,7 @@ - ProjectileBatteryAmmoProvider - Stunbaton - TwoModeEnergyAmmoProvider + - MagneticGloves - type: entity parent: BaseItemRecharger @@ -190,6 +191,7 @@ - Stunbaton - TwoModeEnergyAmmoProvider - PowerCell + - MagneticGloves blacklist: tags: - PotatoBattery diff --git a/Resources/Prototypes/Entities/White/mag-gloves.yml b/Resources/Prototypes/Entities/White/mag-gloves.yml new file mode 100644 index 0000000000..ff87e36ddb --- /dev/null +++ b/Resources/Prototypes/Entities/White/mag-gloves.yml @@ -0,0 +1,77 @@ +- type: entity + parent: ClothingHandsBase + id: ClothingHandsGlovesMagnetic + name: magnetic gloves + description: A pair of gloves with magnetic palms. Slip proof. + components: + - type: Sprite + sprite: White/MagGloves/maggloves.rsi + layers: + - state: icon +# map: [ "enum.ToggleVisuals.Layer" ] + - type: Clothing + sprite: White/MagGloves/maggloves.rsi + - type: Appearance + - type: GenericVisualizer + visuals: + enum.ToggleVisuals.Toggled: + enum.ToggleVisuals.Layer: + True: {state: icon-on} + False: {state: icon} + - type: GloveHeatResistance + heatResistance: 1400 + - type: Fiber + fiberMaterial: fibers-nanomachines + - type: FingerprintMask + - type: MagneticGloves + glovesActiveTime: 60 + glovesCooldown: 60 + +- type: entity + id: ClothingHandsGlovesMagneticAdvanced + parent: ClothingHandsGlovesMagnetic + name: advanced magnetic gloves + description: A pair of gloves with magnetic palms. Slip proof. + components: + - type: Sprite + sprite: White/MagGloves/magglovesadvanced.rsi + layers: + - state: icon + - type: Clothing + sprite: White/MagGloves/magglovesadvanced.rsi + - type: MagneticGlovesAdvanced + - type: MagneticGloves + action: ActionToggleMagneticGlovesAdvanced + glovesActiveTime: 80 + +- type: entity + id: ActionToggleMagneticGlovesBase + name: Toggle Magnetic Gloves + description: Toggles Magnetic Gloves on and off + noSpawn: true + components: + - type: InstantAction + itemIconStyle: NoItem + event: !type:ToggleMagneticGlovesEvent + +- type: entity + id: ActionToggleMagneticGloves + parent: ActionToggleMagneticGlovesBase + name: Toggle Magnetic Gloves + description: Prevents owner from losing items from hands on fall. + noSpawn: true + components: + - type: InstantAction + icon: { sprite: White/MagGloves/maggloves.rsi, state: icon } + iconOn: { sprite: White/MagGloves/maggloves.rsi, state: icon-on } + +- type: entity + id: ActionToggleMagneticGlovesAdvanced + parent: ActionToggleMagneticGlovesBase + name: Toggle Magnetic Gloves + description: Prevents owner from losing items from hands on fall, being disarmed or robbed. + noSpawn: true + components: + - type: InstantAction + icon: { sprite: White/MagGloves/magglovesadvanced.rsi, state: icon } + iconOn: { sprite: White/MagGloves/magglovesadvanced.rsi, state: icon-on } diff --git a/Resources/Prototypes/Recipes/Lathes/security.yml b/Resources/Prototypes/Recipes/Lathes/security.yml index 56fb788940..5e16440cd1 100644 --- a/Resources/Prototypes/Recipes/Lathes/security.yml +++ b/Resources/Prototypes/Recipes/Lathes/security.yml @@ -647,3 +647,21 @@ Plastic: 100 Glass: 20 +- type: latheRecipe + id: ClothingHandsGlovesMagnetic + result: ClothingHandsGlovesMagnetic + completetime: 3 + materials: + Cloth: 200 + Steel: 100 + Plastic: 50 + +- type: latheRecipe + id: ClothingHandsGlovesMagneticAdvanced + result: ClothingHandsGlovesMagneticAdvanced + completetime: 3 + materials: + Cloth: 200 + Steel: 100 + Plastic: 50 + Silver: 50 diff --git a/Resources/Prototypes/Research/arsenal.yml b/Resources/Prototypes/Research/arsenal.yml index 38ed0ceec8..1166b65417 100644 --- a/Resources/Prototypes/Research/arsenal.yml +++ b/Resources/Prototypes/Research/arsenal.yml @@ -104,6 +104,18 @@ # Tier 2 +- type: technology + id: LightweightMagnets + name: research-technology-lightweight-magnets + icon: + sprite: White/MagGloves/maggloves.rsi + state: icon + discipline: Arsenal + tier: 2 + cost: 7500 + recipeUnlocks: + - ClothingHandsGlovesMagnetic + - type: technology id: ExplosiveTechnology name: research-technology-explosive-technology @@ -149,7 +161,7 @@ - type: technology id: BasicShuttleArmament name: research-technology-basic-shuttle-armament - icon: + icon: sprite: Structures/Power/cage_recharger.rsi state: full discipline: Arsenal @@ -169,6 +181,18 @@ # Tier 3 +- type: technology + id: AdvancedGrips + name: research-technology-advanced-grips + icon: + sprite: White/MagGloves/magglovesadvanced.rsi + state: icon + discipline: Arsenal + tier: 3 + cost: 10000 + recipeUnlocks: + - ClothingHandsGlovesMagneticAdvanced + - type: technology id: PortableMicrofusionWeaponry name: research-technology-portable-microfusion-weaponry @@ -192,11 +216,11 @@ cost: 15000 recipeUnlocks: - WeaponLaserSvalinn - + - type: technology id: AdvancedShuttleWeapon name: research-technology-advanced-shuttle-weapon - icon: + icon: sprite: Objects/Weapons/Guns/Ammunition/Magazine/Grenade/grenade_cartridge.rsi state: icon discipline: Arsenal diff --git a/Resources/Textures/White/MagGloves/maggloves.rsi/equipped-HAND.png b/Resources/Textures/White/MagGloves/maggloves.rsi/equipped-HAND.png new file mode 100644 index 0000000000000000000000000000000000000000..4bfc6c769c3841de4db3de3cfc901560f00b3397 GIT binary patch literal 335 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D%zIXzt*Ln`LH zy}35;P=Lg-kL@g*mq-n<6T0y!wzPr9V|jQzMCbFOzKpv zVF@k_IJ!n=!NLm%{;OC2n)f{StuiCfcm{?C`$Tfu_r0FEy?v6_Q}x=vXTI7=N8Io_dN5S zbZqaepK_+Y*NiLAvV%b&j${w|W| eXJBZM-pI;gz2oPSN$Qm#J3L+eT-G@yGywo>vyM#w literal 0 HcmV?d00001 diff --git a/Resources/Textures/White/MagGloves/maggloves.rsi/icon-on.png b/Resources/Textures/White/MagGloves/maggloves.rsi/icon-on.png new file mode 100644 index 0000000000000000000000000000000000000000..c5dd0ca2a2d9ccbaa19fc0347863c8f7c5d4a540 GIT binary patch literal 682 zcmV;b0#*HqP)Px%WJyFpR9J=Wma%ISQ5?rV7qn)$T!)UCQ^B!|f`w+#f=eNqDp@26ol1vh3lyg! zICd!4sa6CjAyQlygYmYWZD z-vbw(iej-C?}5{!Rb?*sS%T2b?+TLIv>*T?S;0O+`RzI~|~W=WmCwdBxo z^K{(20<%Rj3YOoC4ik{PLCg!kTN%&rQT4*C9%UtTOex1CD#c+i|5aWf;q`k$|28 z5HpWLj*?xNS7RL_TD`umaTCgio9FT9=GoZ|YcrvXlQcg!L3Vb-8phmb8lR?H;mz_c zU>1;g6-TSS=($v{wa4^K&iG!30Ai_L`wxkf-q}&m{e(necoC&amFmXz4=j^Px%Wl2OqR9J=Wma%JEK^(_FPfCz-z7Byd4xP-z4QHCQnM{T|H#K(MdwOgwpC3&NF*U&1%Xgz! zzrJc?ArjX7v=Fgr%>mxbKS78DLL`uKfRqFM9U)xS^7+wK_qYRmekA-G;ei>RJ;QFB{u|ODwseNu!2@=D_$W45d&y-hnBf|E^p7%_L3G1KrR)h z-e@@WM#E8O9|fX})%sqo8G?ubtW-TGXkPIO0G##)w7Nq8+Fp`xUy7DlRHyHkT-sie zwwKi46|bNRH6g6Gz%-XXTH1W2>N(l;TqtrABA1G5(^hxLX>WWxmbd3EWA$t$V5R_s z%!81VBvM)ZY(fO9H}|z}LN&N|5szseU*2{0BDy$A+4LOog~k8Bjw@Bqf&fCP-uMrRlG)io(8GvCVSEwIG}BDCu76(ve9MC` R`-K1i002ovPDHLkV1gP}Ik^A; literal 0 HcmV?d00001 diff --git a/Resources/Textures/White/MagGloves/maggloves.rsi/inhand-left.png b/Resources/Textures/White/MagGloves/maggloves.rsi/inhand-left.png new file mode 100644 index 0000000000000000000000000000000000000000..09920df2b69523a83ce7e9cf06de3395397bb803 GIT binary patch literal 280 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D$|E_u2*hE&XX zdut*f*P3T7o_*<)T*bR( zPi-ZnBJcOk+YGS?M5d*P-8~RuQ^m5~?!oP4Zv@j0FP1KN%e*gll^i2OgZ)Rg#VNj~ T=ci9G1S$4(^>bP0l+XkKc(ZT< literal 0 HcmV?d00001 diff --git a/Resources/Textures/White/MagGloves/maggloves.rsi/inhand-right.png b/Resources/Textures/White/MagGloves/maggloves.rsi/inhand-right.png new file mode 100644 index 0000000000000000000000000000000000000000..9d58d8aeea3056651191a5efdea49d350b67e25c GIT binary patch literal 289 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D$|ZhN{ohE&XX zduuOmlY>P2NAcv7$GMym6Bim@(MizA<>Tjn!ywGIp|s)pDZaz49YxQ6 zUY&mW|GGLCpcx>r;IOLgi}mI+BvR9Nbd+qqmnHdp^1l|NbEQD$j*g!4b3S}O>lD_# z_6!q0S2xw~lkm6IA)9v<#9SA?&u>><8Le8iUv}%-NuGB9Qcs-Qd2(S!dD$(mEj#Vn z*8gsL_G`k@IV!j2&W+D!gxCfo|8?q~J)n`3$@WX)D`RX<2Af-|xABGJEBId|c^d=e a?^Q9C9rt^|)(p652_b$JD>Gz&QI}$hgW-D zbr1ABCi3)7nEv|94?bt6pPN}PX;rhQJ7m9^(bi>mYF4~@`*G>zGfzz8C#C%6-CwcG z^NZ&4nJ2UDAjSg8hWb|#|Nq^tXL90u`nF87Ji2pp^VfshPKZ`L0;|Ekh*fB)JAo7XJm2Ws5-_gJRZ$30))tJhWnP5mP% YUpwz$?fgBhrXZUb6NB2h(Vg;?LPog;Z9AX+(b0iLM#kh8&-IP^6*a%VTdy{^DrH5i;KaF4Z`iCYnlO7unvYI-tg)K6zLo##r#cYR zfn-C6%SGN6p;hi3PAB9PrNr(wWXgZYURcG#!0_*g^mU`)kBfN14}p|>y85}Sb4q9e E0D8=3i~s-t literal 0 HcmV?d00001 diff --git a/Resources/Textures/White/MagGloves/maggloves.rsi/on-inhand-right.png b/Resources/Textures/White/MagGloves/maggloves.rsi/on-inhand-right.png new file mode 100644 index 0000000000000000000000000000000000000000..813c7e80900af87e08e16814d78769c7f5e4a1ae GIT binary patch literal 274 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D$|&Um^whE&XX zdutsfSg-a@St2$2n ztGV?=ux*`+U6zE)X|uA_Rp*bp?l!vnRe7-7&&anWOEYeN`TV+WL2i}h3Ew|! z%C6-xLaYFi|2lPNGb-oYbP0l+XkKmdj}P literal 0 HcmV?d00001 diff --git a/Resources/Textures/White/MagGloves/magglovesadvanced.rsi/equipped-HAND.png b/Resources/Textures/White/MagGloves/magglovesadvanced.rsi/equipped-HAND.png new file mode 100644 index 0000000000000000000000000000000000000000..eb12afbf7a3efac1481bf8c33078c3dc1d8b8e12 GIT binary patch literal 353 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D%zr9E97Ln`LH zy}8$m*-@nJp}&W)K+vj=sR}!8JT+T(NmXE*pYjq<)g^HrQqqd$0!8|bB7%{Q8@U#l zHQ6t@nY4z7#eDP4s}rW~@wYU7Ueli0&jPf8fuZ5-rl-5U*e0JpB`W()_Qk`@MZZ?O zubIC+ZSGIi>rXSJUhWII`0cgJ{Ex?joS(0ZOyBpJ`AlZ)ZtLGxmUfrUzMXsQ`ty~% zpRb6R#!tGEvo-g|+nb@+MNH+vW`l?WZJ%tD*{>epJKHK7(k#z?V#((Hn>5~6i`_S# zxq0sEk1CnJzx&Cg=I-3GPx%bV)=(R9J=WmOp3{Q5?rVR}`1)Wo#j1K#2(LDD85EI4DISra~8KlR#*OK%iuE z>ei)_p->?zf`~NjP?QP{G>hV>P&^cFEVPsKdW%Rohx&WI`%_FRqC>uL+{?T7-uLr< ze;_c>Km+|_835gG_uL1}&lLjz-}hK=w~c=G+P2MwKQ*?jl$x6<6oP&shWa($K4}H> zbH%{2Qdm|B(;UV$hkuSOW(tMiuK{eIv;u&8tx09<`^WhHv0BqFL{BNu4{U#aa5`9m zH}yRLJnyJizy1Iu&!%bN`yK#=D@zn#-sJh~uaHY~ar4u;&EbqLNGdS7rGQ+ze_egk zA>=#o+pe%}J6;1DTRX~J@~p#{rUk&aXYbXX@A<3vzK8F7n5Lzk`MF{smpMzJ6l`qm z1UY+(SDP?-b$$&gD?PY-N^@;Ojel-$mB#0 zfP=$*T-U+*_yK_I*f@=P&46Dms;3~T>HI9N>yXK0$=Oq^wN`1=YlbSqM!jZ4%`2s9 z$Q+=&u*k#aqtM|=l|G%HrM$36d0|mSu~Mqyx(=Q0ZYUC=BGk?IoG;3}QLh=&9Z6bm zw~ghMW*`xJ`>q4P=t!E$iJbafDOFi(t%mlhB9tfqG4m+oS-O_Jtj4bEaB#SvczgZa zPy}RB!lRqty?w(-s^TPNGTGSrq}#^;q9DD_i#pw1Mn}@2^-<_(RL}i?AW5$4#0&%? gDV+liG|+#cAJboIj6dz;Qvd(}07*qoM6N<$f}{LWhX4Qo literal 0 HcmV?d00001 diff --git a/Resources/Textures/White/MagGloves/magglovesadvanced.rsi/icon.png b/Resources/Textures/White/MagGloves/magglovesadvanced.rsi/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..fefad2bf3b14e82288a6f14926926653abb986ce GIT binary patch literal 706 zcmV;z0zLhSP)Px%d`Uz>R9J=WmcMHgVI0OkSDfU{br5W!gF{e=2ranOcJK-jL4!g}hi+{X2niAh zmJI#@B3)WC6slI;9GW;3of>Ey)GmU8^gy_=v=tn3J#=t5r}y=}AHk#!I^=3A1oRDGPZj{U zdjJoA?g8MsonHO=1CVtV!o>4j0B-I+p?>Z<%^w}kGscJSdnY!BF1H}A!Q?3=$knrx z>YWZD-vfWV6_#a1d!V_st;}Vebr>N`0N#AvRckJvzKG|!c%F+8rur<*FZ%K@-4rN6 zb8FjATQj_R`65tPz0+N{qe`MfNH85%&X*9+orqbvvrlgHWdW zmd~a+97s-xgc<`_Ua3dY7z&#^j!iLNCX=0ufaua|t)Es0me6u-F<*{A7yvhJXZ>U{ zrOYMB^i&#v!=rs1$HxBj5rEYA1hs0#fZtbCFF{zD>>Q3`lT4;aTQjV0tWm304Aq3S zYQ+ef7xU$SIY6Pb#A^LfVDq?6&t&H)l$I!zmQ;$xd>O~FX|;C(Nd%fuH~(yZQRcO3 z#gMlnPMeK}vAk0EWnypNwE!3$8Dn}Xt$r8tW!5*=0&7(h$`pWzc^I;rE~PH0XUDNQ zJlc;vy}oZC0XZn+(arDNx@N?6ah#ILRAheK=_3GPkY2~7TJ0T1N5%s4!_eVWPyBx% oPL5+o3?xKcIR_eOp#MU@0E*OY23v|*!2kdN07*qoM6N<$f@QNo>;M1& literal 0 HcmV?d00001 diff --git a/Resources/Textures/White/MagGloves/magglovesadvanced.rsi/inhand-left.png b/Resources/Textures/White/MagGloves/magglovesadvanced.rsi/inhand-left.png new file mode 100644 index 0000000000000000000000000000000000000000..bba01d8b9b1b6e758380c975c8e1dff84d7af0a1 GIT binary patch literal 289 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D$|ZhN{ohE&XX zdut=-p#YKAho6rascFxcBF3qhy~Ia3?*S9nH8H&jyhoz4)deoGGJR|E`?zM#f!PTk z{UbixM~2;bjTn`;LMhszI9Pk_E&TMc7A()`s(}gS(hi(KJ{u7SMWT4-8r}X zdfw);X*+kHy|wjj?D^}5jl>{!0m%a$JxS&l#Jg>qUcUb@;nyAIp0=ZT30aXD8T0ox fe3fHlXt4jtcHw}pWjIHe6G)e*tDnm{r-UW|qgZ%3 literal 0 HcmV?d00001 diff --git a/Resources/Textures/White/MagGloves/magglovesadvanced.rsi/inhand-right.png b/Resources/Textures/White/MagGloves/magglovesadvanced.rsi/inhand-right.png new file mode 100644 index 0000000000000000000000000000000000000000..62babe2897f363ee7ae80dd82a5e0b01ce1feb82 GIT binary patch literal 306 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D$|-gvq=hE&XX zd&`#Vkb^+m!_J6fPq?xaHIg`Xx}8$+$dcAykdXV3bx&hN_FGPt-3|)14*rH=WnJDM z)V1FSzt_9Zclm4w&>Rprz`VR-;r??8kCZK~->zd@98ew@^;+r8qLAjm6?4n3TcjU; zGU55pN4s=q&e`r~)R7(8k|OZ>$)3`f?W*&h@BjYsYSrT3hXcc3`|8@)hpR3RWY>9a ztbUq%XUyqWFZVqt(p5dp9eFPO-1^NB>pk!uDGD tEjN1eUF9_Q)=HV!oy<8mC4ox)?=rNu_?~;TG;BRcr>Co*%Q~loCIEcGePsXu literal 0 HcmV?d00001 diff --git a/Resources/Textures/White/MagGloves/magglovesadvanced.rsi/meta.json b/Resources/Textures/White/MagGloves/magglovesadvanced.rsi/meta.json new file mode 100644 index 0000000000..29234d0c52 --- /dev/null +++ b/Resources/Textures/White/MagGloves/magglovesadvanced.rsi/meta.json @@ -0,0 +1,41 @@ +{ + "version": 1, + "license": "CC-BY-SA-3.0", + "copyright": "Taken from tgstation at https://github.com/tgstation/tgstation/pull/69842/commits/d8138946b0ed06fced522729ac8eaa0596864329 edited by Skarletto (github)", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "icon" + }, + { + "name": "icon-on" + }, + { + "name": "equipped-HAND", + "directions": 4 + }, + { + "name": "on-equipped-HAND", + "directions": 4 + }, + { + "name": "inhand-left", + "directions": 4 + }, + { + "name": "on-inhand-left", + "directions": 4 + }, + { + "name": "inhand-right", + "directions": 4 + }, + { + "name": "on-inhand-right", + "directions": 4 + } + ] +} diff --git a/Resources/Textures/White/MagGloves/magglovesadvanced.rsi/on-equipped-HAND.png b/Resources/Textures/White/MagGloves/magglovesadvanced.rsi/on-equipped-HAND.png new file mode 100644 index 0000000000000000000000000000000000000000..1c05b046549e59c77a346bb9c44c82aa8c0eb8b1 GIT binary patch literal 350 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D%zB|KdmLn`LH zy=CZqI6$QBq5p>H9Cudh70n7if{jWwJYL>#eQ`lY)++slQpbh)7cHA*x!zq861gM8 zA}h1y=K9HuhI>CQo8tD%?)6E_`-&;n6M+^0K|_e`2jBWjW|zNbU!K3^?5--anfsHq z<>cqi$l9uQ{&w&r9h2Gjqvz}2+I;d)Z1lzam=_8E1D>ZZ?~u;9rTP4SnS*>(_HMZN_q`T(mwx*B(B|?_)+cxG&t7}(mHAKAO=;%Qb4#XQ-!6VPrZxNI rzlAy9zZX~--AxFXRSUG>gM1C+|Dt^h1!Jy>fo%13^>bP0l+XkKvg4Ug literal 0 HcmV?d00001 diff --git a/Resources/Textures/White/MagGloves/magglovesadvanced.rsi/on-inhand-left.png b/Resources/Textures/White/MagGloves/magglovesadvanced.rsi/on-inhand-left.png new file mode 100644 index 0000000000000000000000000000000000000000..b655cc9b67ca340c4b85ab66bf6ecf46f056c0b1 GIT binary patch literal 271 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D$|PI|gHhE&XX zdutS-4=?f-Q;sYnK+V3kg*TY0P=J#^;SK&;K94 z*($yleHCT|8UX|i`Zn{#OEs^D+4@$fh}(?@|$oa>+Y`E?Qb#1UrT9{+Dx~^ zoG74}?_?kQ_c=j#w^Z%DyEQNB@}%siT^(<94nIqsR41`ii~GFMb}jDp@@_MypEMGK z7!R_+dCm>qHK}WDn}o03QMNdoWWHg$&X?@>dmFyWF)}pRe`I2r8~j!HW$$*77Ef0{ Jmvv4FO#nxGW?=vT literal 0 HcmV?d00001 diff --git a/Resources/Textures/White/MagGloves/magglovesadvanced.rsi/on-inhand-right.png b/Resources/Textures/White/MagGloves/magglovesadvanced.rsi/on-inhand-right.png new file mode 100644 index 0000000000000000000000000000000000000000..457c1c64925ee7c4163422b4b6ec8e95c2684625 GIT binary patch literal 291 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D$|?s~d7hE&XX zdut z^}nti@9Lt~epW$$;j5_iHKnraZy$U7a?$nMvHiyGIQ1+nY$VC h0mrAD1*-e;g7^E!kgl7Va{@u`^K|udS?83{1OT3@d=mfw literal 0 HcmV?d00001