diff --git a/Content.Shared/_Goobstation/Clothing/Components/ClothingGrantComponentComponent.cs b/Content.Shared/_Goobstation/Clothing/Components/ClothingGrantComponentComponent.cs new file mode 100644 index 0000000000..b23565e065 --- /dev/null +++ b/Content.Shared/_Goobstation/Clothing/Components/ClothingGrantComponentComponent.cs @@ -0,0 +1,15 @@ +using Robust.Shared.Prototypes; + +namespace Content.Shared._Goobstation.Clothing.Components +{ + [RegisterComponent] + public sealed partial class ClothingGrantComponentComponent : Component + { + [DataField("component", required: true)] + [AlwaysPushInheritance] + public ComponentRegistry Components { get; private set; } = new(); + + [ViewVariables(VVAccess.ReadWrite)] + public Dictionary Active = new(); // Goobstation + } +} diff --git a/Content.Shared/_Goobstation/Clothing/Components/ClothingGrantTagComponent.cs b/Content.Shared/_Goobstation/Clothing/Components/ClothingGrantTagComponent.cs new file mode 100644 index 0000000000..cbbc4fa3c3 --- /dev/null +++ b/Content.Shared/_Goobstation/Clothing/Components/ClothingGrantTagComponent.cs @@ -0,0 +1,14 @@ +using Content.Shared.Tag; // harmony +using Robust.Shared.Prototypes; // harmony + +namespace Content.Shared._Goobstation.Clothing.Components; + +[RegisterComponent] +public sealed partial class ClothingGrantTagComponent : Component +{ + [DataField("tag", required: true), ViewVariables(VVAccess.ReadWrite)] + public ProtoId Tag = ""; // Harmony - change to protoid + + [ViewVariables(VVAccess.ReadWrite)] + public bool IsActive = false; +} diff --git a/Content.Shared/_Goobstation/Clothing/Systems/ClothingGrantingSystem.cs b/Content.Shared/_Goobstation/Clothing/Systems/ClothingGrantingSystem.cs new file mode 100644 index 0000000000..2e86df1cbb --- /dev/null +++ b/Content.Shared/_Goobstation/Clothing/Systems/ClothingGrantingSystem.cs @@ -0,0 +1,100 @@ +using Content.Shared.Clothing.Components; +using Content.Shared.Inventory.Events; +using Content.Shared.Tag; +using Robust.Shared.Serialization.Manager; + +namespace Content.Shared._Goobstation.Clothing.Systems; + +public sealed class ClothingGrantingSystem : EntitySystem +{ + [Dependency] private readonly IComponentFactory _componentFactory = default!; + [Dependency] private readonly ISerializationManager _serializationManager = default!; + [Dependency] private readonly TagSystem _tagSystem = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnCompEquip); + SubscribeLocalEvent(OnCompUnequip); + + SubscribeLocalEvent(OnTagEquip); + SubscribeLocalEvent(OnTagUnequip); + } + + private void OnCompEquip(EntityUid uid, Content.Shared._Goobstation.Clothing.Components.ClothingGrantComponentComponent component, GotEquippedEvent args) + { + if (!TryComp(uid, out var clothing)) return; + + if (!clothing.Slots.HasFlag(args.SlotFlags)) return; + + // Goobstation + //if (component.Components.Count > 1) + //{ + // Logger.Error("Although a component registry supports multiple components, we cannot bookkeep more than 1 component for ClothingGrantComponent at this time."); + // return; + //} + + foreach (var (name, data) in component.Components) + { + var newComp = (Component) _componentFactory.GetComponent(name); + + if (HasComp(args.Equipee, newComp.GetType())) + continue; + + newComp.Owner = args.Equipee; + + var temp = (object) newComp; + _serializationManager.CopyTo(data.Component, ref temp); + EntityManager.AddComponent(args.Equipee, (Component)temp!); + + component.Active[name] = true; // Goobstation + } + } + + private void OnCompUnequip(EntityUid uid, Content.Shared._Goobstation.Clothing.Components.ClothingGrantComponentComponent component, GotUnequippedEvent args) + { + // Goobstation + //if (!component.IsActive) return; + + foreach (var (name, data) in component.Components) + { + // Goobstation + if (!component.Active.ContainsKey(name) || !component.Active[name]) + continue; + + var newComp = (Component) _componentFactory.GetComponent(name); + + RemComp(args.Equipee, newComp.GetType()); + component.Active[name] = false; // Goobstation + } + + // Goobstation + //component.IsActive = false; + } + + + private void OnTagEquip(EntityUid uid, Content.Shared._Goobstation.Clothing.Components.ClothingGrantTagComponent component, GotEquippedEvent args) + { + if (!TryComp(uid, out var clothing)) + return; + + if (!clothing.Slots.HasFlag(args.SlotFlags)) + return; + + EnsureComp(args.Equipee); + _tagSystem.AddTag(args.Equipee, component.Tag); + + component.IsActive = true; + } + + private void OnTagUnequip(EntityUid uid, Content.Shared._Goobstation.Clothing.Components.ClothingGrantTagComponent component, GotUnequippedEvent args) + { + if (!component.IsActive) + return; + + _tagSystem.RemoveTag(args.Equipee, component.Tag); + + component.IsActive = false; + } +} diff --git a/Resources/Locale/en-US/_Goobstation/store/uplink-catalog.ftl b/Resources/Locale/en-US/_Goobstation/store/uplink-catalog.ftl new file mode 100644 index 0000000000..d2805b498b --- /dev/null +++ b/Resources/Locale/en-US/_Goobstation/store/uplink-catalog.ftl @@ -0,0 +1,4 @@ +uplink-hardsuit-cybersun-stealth-name = Cybersun Stealth Hardsuit +uplink-hardsuit-cybersun-stealth-desc = Reversed engineered from Spider Clan technology, this hardsuit has stealth plating in it for those special ops. Faster, but less armored than the default hardsuits. +## Harmony - Fixed typo +## DeltaV - no slowdown diff --git a/Resources/Prototypes/_Goobstation/Catalog/Fills/Backpacks/duffelbag.yml b/Resources/Prototypes/_Goobstation/Catalog/Fills/Backpacks/duffelbag.yml new file mode 100644 index 0000000000..dc02870d8a --- /dev/null +++ b/Resources/Prototypes/_Goobstation/Catalog/Fills/Backpacks/duffelbag.yml @@ -0,0 +1,13 @@ +- type: entity + parent: ClothingBackpackDuffelSyndicateBundle + id: ClothingBackpackDuffelSyndicateStealthHardsuitBundle + name: cybersun stealthsuit bundle + description: "An advanced cybersun stealth hardsuit bundle." + components: + - type: StorageFill + contents: + - id: ClothingOuterHardsuitCybersunStealth + - id: ClothingMaskGasSyndicate + - id: ClothingHandsGlovesCombat + - id: DoubleEmergencyOxygenTankFilled + - id: DoubleEmergencyNitrogenTankFilled diff --git a/Resources/Prototypes/_Goobstation/Catalog/uplink_catalog.yml b/Resources/Prototypes/_Goobstation/Catalog/uplink_catalog.yml new file mode 100644 index 0000000000..d280db98e1 --- /dev/null +++ b/Resources/Prototypes/_Goobstation/Catalog/uplink_catalog.yml @@ -0,0 +1,19 @@ +- type: listing + id: UplinkHardsuitCybersunStealth + name: uplink-hardsuit-cybersun-stealth-name + description: uplink-hardsuit-cybersun-stealth-desc + icon: { sprite: /Textures/_Goobstation/Clothing/OuterClothing/Hardsuits/cybersunstealth.rsi, state: icon } + productEntity: ClothingBackpackDuffelSyndicateStealthHardsuitBundle + cost: + Telecrystal: 15 # Harmony - modified since goob has different TC ratio. + categories: + - UplinkWearables +# begin Harmony change - yeah let's not give this to syndies + # Begin DeltaV additions - we ARE giving this to syndies + #conditions: + #- !type:StoreWhitelistCondition + # whitelist: + # tags: + # - NukeOpsUplink + # End DeltaV additions - we ARE giving this to syndies +# end Harmony change diff --git a/Resources/Prototypes/_Goobstation/Entities/Clothing/Head/hardsuit-helmets.yml b/Resources/Prototypes/_Goobstation/Entities/Clothing/Head/hardsuit-helmets.yml new file mode 100644 index 0000000000..ec70efb9f0 --- /dev/null +++ b/Resources/Prototypes/_Goobstation/Entities/Clothing/Head/hardsuit-helmets.yml @@ -0,0 +1,31 @@ +- type: entity + parent: [ ClothingHeadHardsuitBase, ClothingHeadSuitWithLightBase ] # Harmony - Changed parent to upstream convention + id: ClothingHeadHelmetHardsuitCybersunStealth + # suffix: stealth - Harmony change + name: cybersun stealth hardsuit helmet + description: A helmet with plating for stealth operations. + components: + - type: Sprite + sprite: _Goobstation/Clothing/Head/Hardsuits/cybersunstealth.rsi + - type: Clothing + sprite: _Goobstation/Clothing/Head/Hardsuits/cybersunstealth.rsi + - type: PointLight + color: green + - type: PressureProtection + highPressureMultiplier: 0.08 + lowPressureMultiplier: 1000 + - type: Armor + modifiers: + coefficients: + Blunt: 0.95 + Slash: 0.95 + Piercing: 0.95 + Heat: 0.95 + - type: ClothingGrantComponent + component: + - type: Stealth + # Harmony start + - type: StealthOnMove + passiveVisibilityRate: -0.5 + movementVisibilityRate: 0.45 # DeltaV - was 0.6 + # Harmony end diff --git a/Resources/Prototypes/_Goobstation/Entities/Clothing/OuterClothing/hardsuits.yml b/Resources/Prototypes/_Goobstation/Entities/Clothing/OuterClothing/hardsuits.yml new file mode 100644 index 0000000000..51e25b1f36 --- /dev/null +++ b/Resources/Prototypes/_Goobstation/Entities/Clothing/OuterClothing/hardsuits.yml @@ -0,0 +1,46 @@ +- type: entity + parent: [ ClothingOuterHardsuitBase, BaseSyndicateContraband ] + id: ClothingOuterHardsuitCybersunStealth + # suffix: stealth - Harmony change + name: cybersun stealth hardsuit + description: A hardsuit with stealth plating for operations, the shielding doesn't work while you're moving though! Needs the helmet on to finish the stealth field. + components: + - type: Sprite + sprite: _Goobstation/Clothing/OuterClothing/Hardsuits/cybersunstealth.rsi + - type: Item + size: Huge + - type: Clothing + sprite: _Goobstation/Clothing/OuterClothing/Hardsuits/cybersunstealth.rsi + - type: PressureProtection + highPressureMultiplier: 0.05 + lowPressureMultiplier: 1000 + - type: ExplosionResistance + damageCoefficient: 0.8 # DeltaV - was 0.65 + - type: Armor + modifiers: + coefficients: + Blunt: 0.7 # DeltaV - was 0.65 + Slash: 0.7 # DeltaV - was 0.65 + Piercing: 0.6 + Heat: 0.8 # DeltaV - was 0.6 + Radiation: 0.8 # DeltaV - was 0.55 + #Caustic: 0.7 # DeltaV + - type: StaminaResistance # DeltaV + damageCoefficient: 0.7 + - type: ClothingSpeedModifier + walkModifier: 1.0 # DeltaV - was 0.8 + sprintModifier: 1.0 # DeltaV - was 0.85 + - type: HeldSpeedModifier + - type: ToggleableClothing + clothingPrototype: ClothingHeadHelmetHardsuitCybersunStealth + - type: Tag + tags: + - Hardsuit + - WhitelistChameleon + # Harmony start + # - type: ClothingGrantComponent + # component: + # - type: StealthOnMove + # passiveVisibilityRate: -0.5 + # movementVisibilityRate: 0.6 + # Harmony end diff --git a/Resources/Textures/_Goobstation/Clothing/Head/Hardsuits/cybersunstealth.rsi/icon-flash.png b/Resources/Textures/_Goobstation/Clothing/Head/Hardsuits/cybersunstealth.rsi/icon-flash.png new file mode 100644 index 0000000000..902c847556 Binary files /dev/null and b/Resources/Textures/_Goobstation/Clothing/Head/Hardsuits/cybersunstealth.rsi/icon-flash.png differ diff --git a/Resources/Textures/_Goobstation/Clothing/Head/Hardsuits/cybersunstealth.rsi/icon.png b/Resources/Textures/_Goobstation/Clothing/Head/Hardsuits/cybersunstealth.rsi/icon.png new file mode 100644 index 0000000000..7e08dc20a8 Binary files /dev/null and b/Resources/Textures/_Goobstation/Clothing/Head/Hardsuits/cybersunstealth.rsi/icon.png differ diff --git a/Resources/Textures/_Goobstation/Clothing/Head/Hardsuits/cybersunstealth.rsi/meta.json b/Resources/Textures/_Goobstation/Clothing/Head/Hardsuits/cybersunstealth.rsi/meta.json new file mode 100644 index 0000000000..c7fa1cabe6 --- /dev/null +++ b/Resources/Textures/_Goobstation/Clothing/Head/Hardsuits/cybersunstealth.rsi/meta.json @@ -0,0 +1,25 @@ +{ + "version": 1, + "license": "CC-BY-SA-3.0", + "copyright": "Sprites made by InfinityPandaRed for Goobstation", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "icon" + }, + { + "name": "icon-flash" + }, + { + "name": "off-equipped-HELMET", + "directions": 4 + }, + { + "name": "on-equipped-HELMET", + "directions": 4 + } + ] +} diff --git a/Resources/Textures/_Goobstation/Clothing/Head/Hardsuits/cybersunstealth.rsi/off-equipped-HELMET.png b/Resources/Textures/_Goobstation/Clothing/Head/Hardsuits/cybersunstealth.rsi/off-equipped-HELMET.png new file mode 100644 index 0000000000..53c9cabfcf Binary files /dev/null and b/Resources/Textures/_Goobstation/Clothing/Head/Hardsuits/cybersunstealth.rsi/off-equipped-HELMET.png differ diff --git a/Resources/Textures/_Goobstation/Clothing/Head/Hardsuits/cybersunstealth.rsi/on-equipped-HELMET.png b/Resources/Textures/_Goobstation/Clothing/Head/Hardsuits/cybersunstealth.rsi/on-equipped-HELMET.png new file mode 100644 index 0000000000..d1d62fa7ff Binary files /dev/null and b/Resources/Textures/_Goobstation/Clothing/Head/Hardsuits/cybersunstealth.rsi/on-equipped-HELMET.png differ diff --git a/Resources/Textures/_Goobstation/Clothing/OuterClothing/Hardsuits/cybersunstealth.rsi/equipped-OUTERCLOTHING.png b/Resources/Textures/_Goobstation/Clothing/OuterClothing/Hardsuits/cybersunstealth.rsi/equipped-OUTERCLOTHING.png new file mode 100644 index 0000000000..311aab9ba8 Binary files /dev/null and b/Resources/Textures/_Goobstation/Clothing/OuterClothing/Hardsuits/cybersunstealth.rsi/equipped-OUTERCLOTHING.png differ diff --git a/Resources/Textures/_Goobstation/Clothing/OuterClothing/Hardsuits/cybersunstealth.rsi/icon.png b/Resources/Textures/_Goobstation/Clothing/OuterClothing/Hardsuits/cybersunstealth.rsi/icon.png new file mode 100644 index 0000000000..474bca0f87 Binary files /dev/null and b/Resources/Textures/_Goobstation/Clothing/OuterClothing/Hardsuits/cybersunstealth.rsi/icon.png differ diff --git a/Resources/Textures/_Goobstation/Clothing/OuterClothing/Hardsuits/cybersunstealth.rsi/inhand-left.png b/Resources/Textures/_Goobstation/Clothing/OuterClothing/Hardsuits/cybersunstealth.rsi/inhand-left.png new file mode 100644 index 0000000000..2eadf95d78 Binary files /dev/null and b/Resources/Textures/_Goobstation/Clothing/OuterClothing/Hardsuits/cybersunstealth.rsi/inhand-left.png differ diff --git a/Resources/Textures/_Goobstation/Clothing/OuterClothing/Hardsuits/cybersunstealth.rsi/inhand-right.png b/Resources/Textures/_Goobstation/Clothing/OuterClothing/Hardsuits/cybersunstealth.rsi/inhand-right.png new file mode 100644 index 0000000000..b3d23c6752 Binary files /dev/null and b/Resources/Textures/_Goobstation/Clothing/OuterClothing/Hardsuits/cybersunstealth.rsi/inhand-right.png differ diff --git a/Resources/Textures/_Goobstation/Clothing/OuterClothing/Hardsuits/cybersunstealth.rsi/meta.json b/Resources/Textures/_Goobstation/Clothing/OuterClothing/Hardsuits/cybersunstealth.rsi/meta.json new file mode 100644 index 0000000000..fdd5058584 --- /dev/null +++ b/Resources/Textures/_Goobstation/Clothing/OuterClothing/Hardsuits/cybersunstealth.rsi/meta.json @@ -0,0 +1,26 @@ +{ + "version": 1, + "license": "CC-BY-SA-3.0", + "copyright": "made by InfinityPandaRed for goob station", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "icon" + }, + { + "name": "equipped-OUTERCLOTHING", + "directions": 4 + }, + { + "name": "inhand-left", + "directions": 4 + }, + { + "name": "inhand-right", + "directions": 4 + } + ] +}