From 4935a956878fbc978fca72c074506dc61bce5237 Mon Sep 17 00:00:00 2001 From: deltanedas <39013340+deltanedas@users.noreply.github.com> Date: Wed, 23 Aug 2023 22:34:39 +0100 Subject: [PATCH] borg construction module (#19260) * cant insert materials into machine if unremoveable * lingering materials * add construction cyborg module * fix empty stack color * lathe recipe * a --------- Co-authored-by: deltanedas <@deltanedas:kde.org> --- .../Materials/SharedMaterialStorageSystem.cs | 6 +++++- Content.Shared/Stacks/SharedStackSystem.cs | 4 ++++ .../Entities/Objects/Materials/Sheets/glass.yml | 11 +++++++++++ .../Entities/Objects/Materials/Sheets/metal.yml | 11 +++++++++++ .../Entities/Objects/Materials/parts.yml | 11 +++++++++++ .../Objects/Specific/Robotics/borg_modules.yml | 15 +++++++++++++++ .../Entities/Structures/Machines/lathe.yml | 1 + Resources/Prototypes/Recipes/Lathes/robotics.yml | 10 ++++++++++ .../borgmodule.rsi/icon-construction.png | Bin 0 -> 583 bytes .../Specific/Robotics/borgmodule.rsi/meta.json | 5 ++++- 10 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 Resources/Textures/Objects/Specific/Robotics/borgmodule.rsi/icon-construction.png diff --git a/Content.Shared/Materials/SharedMaterialStorageSystem.cs b/Content.Shared/Materials/SharedMaterialStorageSystem.cs index d2a7af52c6..be93f8dac5 100644 --- a/Content.Shared/Materials/SharedMaterialStorageSystem.cs +++ b/Content.Shared/Materials/SharedMaterialStorageSystem.cs @@ -1,5 +1,6 @@ -using System.Linq; +using System.Linq; using Content.Shared.Interaction; +using Content.Shared.Interaction.Components; using Content.Shared.Stacks; using JetBrains.Annotations; using Robust.Shared.GameStates; @@ -201,6 +202,9 @@ public abstract class SharedMaterialStorageSystem : EntitySystem if (storage.EntityWhitelist?.IsValid(toInsert) == false) return false; + if (HasComp(toInsert)) + return false; + // Material Whitelist checked implicitly by CanChangeMaterialAmount(); var multiplier = TryComp(toInsert, out var stackComponent) ? stackComponent.Count : 1; diff --git a/Content.Shared/Stacks/SharedStackSystem.cs b/Content.Shared/Stacks/SharedStackSystem.cs index c5cd70ced0..5e25c20701 100644 --- a/Content.Shared/Stacks/SharedStackSystem.cs +++ b/Content.Shared/Stacks/SharedStackSystem.cs @@ -336,6 +336,10 @@ namespace Content.Shared.Stacks private void OnStackStarted(EntityUid uid, StackComponent component, ComponentStartup args) { + // on client, lingering stacks that start at 0 need to be darkened + // on server this does nothing + SetCount(uid, component.Count, component); + if (!TryComp(uid, out AppearanceComponent? appearance)) return; diff --git a/Resources/Prototypes/Entities/Objects/Materials/Sheets/glass.yml b/Resources/Prototypes/Entities/Objects/Materials/Sheets/glass.yml index 76dc23b69b..f22eb93e86 100644 --- a/Resources/Prototypes/Entities/Objects/Materials/Sheets/glass.yml +++ b/Resources/Prototypes/Entities/Objects/Materials/Sheets/glass.yml @@ -100,6 +100,17 @@ - type: Item size: 1 +- type: entity + parent: SheetGlass + id: SheetGlassLingering0 + suffix: Lingering, 0 + components: + - type: Item + size: 0 + - type: Stack + lingering: true + count: 0 + - type: entity parent: SheetGlassBase id: SheetRGlass diff --git a/Resources/Prototypes/Entities/Objects/Materials/Sheets/metal.yml b/Resources/Prototypes/Entities/Objects/Materials/Sheets/metal.yml index 725fb93441..d38cfd5240 100644 --- a/Resources/Prototypes/Entities/Objects/Materials/Sheets/metal.yml +++ b/Resources/Prototypes/Entities/Objects/Materials/Sheets/metal.yml @@ -98,6 +98,17 @@ stackType: Steel count: 1 +- type: entity + parent: SheetSteel + id: SheetSteelLingering0 + suffix: Lingering, 0 + components: + - type: Item + size: 0 + - type: Stack + lingering: true + count: 0 + - type: entity parent: SheetMetalBase id: SheetPlasteel diff --git a/Resources/Prototypes/Entities/Objects/Materials/parts.yml b/Resources/Prototypes/Entities/Objects/Materials/parts.yml index 5606de22b9..d07f511fdf 100644 --- a/Resources/Prototypes/Entities/Objects/Materials/parts.yml +++ b/Resources/Prototypes/Entities/Objects/Materials/parts.yml @@ -93,3 +93,14 @@ count: 1 - type: Item size: 1 + +- type: entity + parent: PartRodMetal + id: PartRodMetalLingering0 + suffix: Lingering, 0 + components: + - type: Item + size: 0 + - type: Stack + lingering: true + count: 0 diff --git a/Resources/Prototypes/Entities/Objects/Specific/Robotics/borg_modules.yml b/Resources/Prototypes/Entities/Objects/Specific/Robotics/borg_modules.yml index bcd81225bf..1ac61972ce 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Robotics/borg_modules.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Robotics/borg_modules.yml @@ -212,6 +212,21 @@ items: - GasAnalyzer +- type: entity + id: BorgModuleConstruction + parent: [ BaseBorgModuleEngineering, BaseProviderBorgModule ] + name: construction cyborg module + components: + - type: Sprite + layers: + - state: engineering + - state: icon-construction + - type: ItemBorgModule + items: + - SheetSteelLingering0 + - SheetGlassLingering0 + - PartRodMetalLingering0 + - type: entity id: BorgModuleRCD parent: [ BaseBorgModuleEngineering, BaseProviderBorgModule ] diff --git a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml index 985d11f74d..977f98ed0f 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml @@ -394,6 +394,7 @@ - BorgModuleRadiationDetection - BorgModuleTool - BorgModuleAppraisal + - BorgModuleConstruction - CyborgEndoskeleton - LeftArmBorg - RightArmBorg diff --git a/Resources/Prototypes/Recipes/Lathes/robotics.yml b/Resources/Prototypes/Recipes/Lathes/robotics.yml index 1ace3c4929..90a794a265 100644 --- a/Resources/Prototypes/Recipes/Lathes/robotics.yml +++ b/Resources/Prototypes/Recipes/Lathes/robotics.yml @@ -399,6 +399,16 @@ Plastic: 250 Gold: 50 +- type: latheRecipe + id: BorgModuleConstruction + result: BorgModuleConstruction + completetime: 3 + materials: + Steel: 500 + Glass: 750 + Plastic: 250 + Gold: 50 + - type: latheRecipe id: BorgModuleGasAnalyzer result: BorgModuleGasAnalyzer diff --git a/Resources/Textures/Objects/Specific/Robotics/borgmodule.rsi/icon-construction.png b/Resources/Textures/Objects/Specific/Robotics/borgmodule.rsi/icon-construction.png new file mode 100644 index 0000000000000000000000000000000000000000..fa53867b36779bdb3f68a3e752953db105ec9a9f GIT binary patch literal 583 zcmV-N0=WH&P)f+&ci*1@HSR0XRpX-r!oX+zQ?#Z_=|C^(2N zz6SpTT?JPKK~Mw{H+Nr)lz6T!w1~ao=KT2X{SGHzz!x=j%WawjE0c3#Gm+p@d^zZU zB|s-#jN;dH*Pfc2i&A%e-P54z-LUFa|K7i=bfXb1?8>$Z~uJXl9uf{&W?rw%qrRlg$SlrF z?UUV)ON<#J1WAx*9g`fxQZtg-|Gtr5-z-`2=<>EH;D{qdTD)OV^U~FjniSoT$E2Wg z|C^_q92+fnZ;L?lv**1JfPWWCMbG;__Po*wG(N#)rs~g1P7|M^7pq$65IVNt{Hm%Y z_TXY0dLM1g(SD^y*}h~F-p-&s4&ArVvQo~fa?a@kENsdzx`F)z7?k@Rt3M2vXb)hD zJgNWy010qNS#tmY3labT3lag+-G2N4004hUL_t(o!((6=1*2dTjDk@x3I-T3lB%J4 z4Is zFv`wmc;D&5AXvT!%s)4EDt$r#7XUek?hbhI;V=Eu04TMSB0dU6!6+C7qhJ&e0sv-N VC*8Y|5W4^X002ovPDHLkV1gKK{qq0- literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Specific/Robotics/borgmodule.rsi/meta.json b/Resources/Textures/Objects/Specific/Robotics/borgmodule.rsi/meta.json index abfd0e18a9..780803d815 100644 --- a/Resources/Textures/Objects/Specific/Robotics/borgmodule.rsi/meta.json +++ b/Resources/Textures/Objects/Specific/Robotics/borgmodule.rsi/meta.json @@ -1,7 +1,7 @@ { "version": 1, "license": "CC0-1.0", - "copyright": "Created by EmoGarbage404 (github) for Space Station 14.", + "copyright": "Created by EmoGarbage404 (github) for Space Station 14. icon-construction.png created by deltanedas (github).", "size": { "x": 32, "y": 32 @@ -31,6 +31,9 @@ { "name": "icon-clown" }, + { + "name": "icon-construction" + }, { "name": "icon-defib" },