From 69f10b58ef82c600c5efdc1fc01169c2e7641bd5 Mon Sep 17 00:00:00 2001 From: FoxxoTrystan Date: Wed, 3 Jul 2024 02:00:23 +0200 Subject: [PATCH 1/3] Test --- Resources/Prototypes/Entities/Mobs/Species/arachnid.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Resources/Prototypes/Entities/Mobs/Species/arachnid.yml b/Resources/Prototypes/Entities/Mobs/Species/arachnid.yml index c135ac2b829..77e796dadc9 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/arachnid.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/arachnid.yml @@ -19,6 +19,8 @@ productionLength: 2 entityProduced: MaterialWebSilk1 hungerCost: 4 # Should total to 25 total silk on full hunger + - type: Spider + - type: IgnoreSpiderWeb - type: Tag tags: - CanPilot From e8eb1730bbcb50b61d355b15027711d3f2686503 Mon Sep 17 00:00:00 2001 From: FoxxoTrystan Date: Wed, 3 Jul 2024 02:19:36 +0200 Subject: [PATCH 2/3] Spooders --- Content.Server/Atmos/Rotting/RottingSystem.cs | 12 ++++++++ Content.Server/Spider/SpiderSystem.cs | 25 +++++++-------- .../Cuffs/Components/HandcuffComponent.cs | 6 ++++ Resources/Prototypes/Actions/spider.yml | 2 +- .../Entities/Objects/Misc/handcuffs.yml | 29 ++++++++++++++++++ .../Entities/Objects/Misc/spider_web.yml | 3 ++ .../Entities/Structures/Furniture/beds.yml | 12 ++++++++ .../Recipes/Construction/Graphs/web.yml | 20 ++++++++++++ .../Prototypes/Recipes/Construction/web.yml | 18 +++++++++++ .../Recipes/Crafting/Graphs/web.yml | 14 +++++++-- Resources/Prototypes/Recipes/Crafting/web.yml | 13 ++++++++ .../Misc/webcocoon.rsi/body-overlay-2.png | Bin 0 -> 809 bytes .../Misc/webcocoon.rsi/cocoon.png | Bin 0 -> 353 bytes .../Misc/webcocoon.rsi/meta.json | 18 +++++++++++ .../Textures/Structures/Web/nest.rsi/icon.png | Bin 0 -> 546 bytes .../Structures/Web/nest.rsi/meta.json | 14 +++++++++ 16 files changed, 169 insertions(+), 17 deletions(-) create mode 100644 Resources/Textures/Clothing/OuterClothing/Misc/webcocoon.rsi/body-overlay-2.png create mode 100644 Resources/Textures/Clothing/OuterClothing/Misc/webcocoon.rsi/cocoon.png create mode 100644 Resources/Textures/Clothing/OuterClothing/Misc/webcocoon.rsi/meta.json create mode 100644 Resources/Textures/Structures/Web/nest.rsi/icon.png create mode 100644 Resources/Textures/Structures/Web/nest.rsi/meta.json diff --git a/Content.Server/Atmos/Rotting/RottingSystem.cs b/Content.Server/Atmos/Rotting/RottingSystem.cs index 47bac84e0ca..e5d7aa8ccb0 100644 --- a/Content.Server/Atmos/Rotting/RottingSystem.cs +++ b/Content.Server/Atmos/Rotting/RottingSystem.cs @@ -88,6 +88,18 @@ public bool IsRotProgressing(EntityUid uid, PerishableComponent? perishable) return false; } + if (TryComp(uid, out var cuffed) && cuffed.CuffedHandCount > 0) + { + if (TryComp(cuffed.LastAddedCuffs, out var cuffcomp)) + { + if (cuffcomp.NoRot) + { + return false; + } + } + } + + var ev = new IsRottingEvent(); RaiseLocalEvent(uid, ref ev); diff --git a/Content.Server/Spider/SpiderSystem.cs b/Content.Server/Spider/SpiderSystem.cs index 449e43984c3..e9f22bfa2fe 100644 --- a/Content.Server/Spider/SpiderSystem.cs +++ b/Content.Server/Spider/SpiderSystem.cs @@ -4,12 +4,15 @@ using Content.Shared.Maps; using Robust.Server.GameObjects; using Robust.Shared.Map; +using Content.Shared.Nutrition.EntitySystems; +using Content.Shared.Nutrition.Components; namespace Content.Server.Spider; public sealed class SpiderSystem : SharedSpiderSystem { [Dependency] private readonly PopupSystem _popup = default!; + [Dependency] private readonly HungerSystem _hungerSystem = default!; public override void Initialize() { @@ -22,6 +25,13 @@ private void OnSpawnNet(EntityUid uid, SpiderComponent component, SpiderWebActio if (args.Handled) return; + if (TryComp(uid, out var hungerComp) + && _hungerSystem.IsHungerBelowState(uid, HungerThreshold.Okay, hungerComp.CurrentHunger - 5, hungerComp)) + { + _popup.PopupEntity(Loc.GetString("sericulture-failure-hunger"), args.Performer, args.Performer); + return; + } + var transform = Transform(uid); if (transform.GridUid == null) @@ -42,22 +52,10 @@ private void OnSpawnNet(EntityUid uid, SpiderComponent component, SpiderWebActio result = true; } - // Spawn web in other directions - for (var i = 0; i < 4; i++) - { - var direction = (DirectionFlag) (1 << i); - coords = transform.Coordinates.Offset(direction.AsDir().ToVec()); - - if (!IsTileBlockedByWeb(coords)) - { - Spawn(component.WebPrototype, coords); - result = true; - } - } - if (result) { _popup.PopupEntity(Loc.GetString("spider-web-action-success"), args.Performer, args.Performer); + _hungerSystem.ModifyHunger(uid, -5); args.Handled = true; } else @@ -74,4 +72,3 @@ private bool IsTileBlockedByWeb(EntityCoordinates coords) return false; } } - diff --git a/Content.Shared/Cuffs/Components/HandcuffComponent.cs b/Content.Shared/Cuffs/Components/HandcuffComponent.cs index 77a77cf2f84..cd94437637b 100644 --- a/Content.Shared/Cuffs/Components/HandcuffComponent.cs +++ b/Content.Shared/Cuffs/Components/HandcuffComponent.cs @@ -9,6 +9,12 @@ namespace Content.Shared.Cuffs.Components; [Access(typeof(SharedCuffableSystem))] public sealed partial class HandcuffComponent : Component { + /// + /// Whether or not the entity can rot when cuffed (for spooder cocoon) + /// + [DataField, ViewVariables(VVAccess.ReadWrite)] + public bool NoRot = false; + /// /// The time it takes to cuff an entity. /// diff --git a/Resources/Prototypes/Actions/spider.yml b/Resources/Prototypes/Actions/spider.yml index 14b9fb6ccbb..9f42f11b2bf 100644 --- a/Resources/Prototypes/Actions/spider.yml +++ b/Resources/Prototypes/Actions/spider.yml @@ -7,7 +7,7 @@ - type: InstantAction icon: Interface/Actions/web.png event: !type:SpiderWebActionEvent - useDelay: 25 + useDelay: 30 - type: entity id: ActionSericulture diff --git a/Resources/Prototypes/Entities/Objects/Misc/handcuffs.yml b/Resources/Prototypes/Entities/Objects/Misc/handcuffs.yml index 5f970da1840..e1e422bbc7d 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/handcuffs.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/handcuffs.yml @@ -157,3 +157,32 @@ - type: Sprite sprite: Clothing/OuterClothing/Misc/straight_jacket.rsi state: icon + +- type: entity + name: web cocoon + description: Strong web cocoon used to restrain criminal or preys, its also prevent rotting. + id: WebCocoon + parent: ClothingOuterStraightjacket + components: + - type: Handcuff + noRot: true + cuffedRSI: Clothing/OuterClothing/Misc/webcocoon.rsi + bodyIconState: body-overlay + breakOnRemove: true + brokenPrototype: MaterialWebSilk1 + startCuffSound: + path: /Audio/Items/Handcuffs/rope_start.ogg + endCuffSound: + path: /Audio/Items/Handcuffs/rope_end.ogg + startUncuffSound: + path: /Audio/Items/Handcuffs/rope_start.ogg + endUncuffSound: + path: /Audio/Items/Handcuffs/rope_breakout.ogg + startBreakoutSound: + path: /Audio/Items/Handcuffs/rope_takeoff.ogg + - type: Construction + graph: WebObjects + node: cocoon + - type: Sprite + sprite: Clothing/OuterClothing/Misc/webcocoon.rsi + state: cocoon diff --git a/Resources/Prototypes/Entities/Objects/Misc/spider_web.yml b/Resources/Prototypes/Entities/Objects/Misc/spider_web.yml index e1f4d086d45..6abd79eea21 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/spider_web.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/spider_web.yml @@ -7,6 +7,9 @@ snap: - Wall components: + - type: Construction + graph: WebStructures + node: spiderweb - type: MeleeSound soundGroups: Brute: diff --git a/Resources/Prototypes/Entities/Structures/Furniture/beds.yml b/Resources/Prototypes/Entities/Structures/Furniture/beds.yml index 7a1c066c189..8cfb2b2ecaa 100644 --- a/Resources/Prototypes/Entities/Structures/Furniture/beds.yml +++ b/Resources/Prototypes/Entities/Structures/Furniture/beds.yml @@ -179,3 +179,15 @@ MaterialWoodPlank: min: 2 max: 2 + +- type: entity + parent: WebBed + id: WebNest + name: web nest + components: + - type: Sprite + sprite: Structures/Web/nest.rsi + state: icon + - type: Construction + graph: WebStructures + node: nest diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/web.yml b/Resources/Prototypes/Recipes/Construction/Graphs/web.yml index 4eb368f5ab7..1e92fb6d1b8 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/web.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/web.yml @@ -60,6 +60,14 @@ amount: 8 doAfter: 6 + - to: nest + completed: + - !type:SnapToGrid + southRotation: true + steps: + - material: WebSilk + amount: 6 + doAfter: 3 # Deconstruction is down here - node: wall @@ -133,3 +141,15 @@ steps: - tool: Cutting doAfter: 3 + + - node: nest + entity: WebNest + edges: + - to: start + completed: + - !type:SpawnPrototype + prototype: MaterialWebSilk1 + amount: 5 + steps: + - tool: Cutting + doAfter: 2 diff --git a/Resources/Prototypes/Recipes/Construction/web.yml b/Resources/Prototypes/Recipes/Construction/web.yml index 9a0d832d012..f249cbd5957 100644 --- a/Resources/Prototypes/Recipes/Construction/web.yml +++ b/Resources/Prototypes/Recipes/Construction/web.yml @@ -117,3 +117,21 @@ - SpiderCraft conditions: - !type:TileNotBlocked + +- type: construction + name: web nest + id: WebNest + graph: WebStructures + startNode: start + targetNode: nest + category: construction-category-furniture + description: Fun fact, you eating spiders in your sleep is false. + icon: + sprite: Structures/Web/nest.rsi + state: icon + objectType: Structure + placementMode: SnapgridCenter + canRotate: false + canBuildInImpassable: false + conditions: + - !type:TileNotBlocked diff --git a/Resources/Prototypes/Recipes/Crafting/Graphs/web.yml b/Resources/Prototypes/Recipes/Crafting/Graphs/web.yml index 7c17cbc0806..ed257e546be 100644 --- a/Resources/Prototypes/Recipes/Crafting/Graphs/web.yml +++ b/Resources/Prototypes/Recipes/Crafting/Graphs/web.yml @@ -41,13 +41,20 @@ - material: WebSilk amount: 12 doAfter: 6 - + - to: boots steps: - material: WebSilk amount: 2 doAfter: 4 - + + - to: cocoon + steps: + - material: WebSilk + amount: 8 + doAfter: 6 + + # Deconstruction - node: tile entity: FloorTileItemWeb @@ -69,3 +76,6 @@ - node: boots entity: ClothingShoesBootsWinterWeb + + - node: cocoon + entity: WebCocoon diff --git a/Resources/Prototypes/Recipes/Crafting/web.yml b/Resources/Prototypes/Recipes/Crafting/web.yml index 5fe9d1b85a3..66cbf7030d2 100644 --- a/Resources/Prototypes/Recipes/Crafting/web.yml +++ b/Resources/Prototypes/Recipes/Crafting/web.yml @@ -109,3 +109,16 @@ sprite: Clothing/Shoes/Boots/winterbootsweb.rsi state: icon objectType: Item + +- type: construction + name: web cocoon + id: WebCocoon + graph: WebObjects + startNode: start + targetNode: cocoon + category: construction-category-clothing + description: "Strong web cocoon used to restrain criminal or preys, its also prevent rotting." + icon: + sprite: Clothing/OuterClothing/Misc/webcocoon.rsi + state: cocoon + objectType: Item diff --git a/Resources/Textures/Clothing/OuterClothing/Misc/webcocoon.rsi/body-overlay-2.png b/Resources/Textures/Clothing/OuterClothing/Misc/webcocoon.rsi/body-overlay-2.png new file mode 100644 index 0000000000000000000000000000000000000000..dc9448e2fcbea5c3099641d935fd3562964ea2d2 GIT binary patch literal 809 zcmV+^1J?YBP)Px#1ZP1_K>z@;j|==^1poj5Hc(7dMQUnlv$M1R|Nrjp?)Ufi(b3V#$;sK-+2G*d zT3T9%hll6q=fc9mySuyo{{Eevovf^^0000>-k!w(000tnQchF<|NsC0|NsC0|NsC0 z|NsC00OG&D5&!@I32;bRa{vGi!vFvd!vV){sAK>D0$xc(K~z{r?UuooSH3h73gsZe4GPk^J}0NpS^ER#sCYK*|s2Owa63-~1EPy^uT z1E6P0HIwpj{8oAb9DO)pPsEj&atx0t@bxM3t5jIHI(xy^7l7891wRj9>60Hy)x@0S zWdm$|24ImiWx^`=H>=tDW0Bk@_ibJX7%r*e0-qiq10mE=NmNre>a`nz57!808 zz@;EqMkL|Q!QBAZfP&8vfFLJ@(EvV1ADP+>2BhQ)C0$I(|0* z9-u;Ol{ja(0(t|`pC6VhCb+5#xEcUw00?NR)}_uCAB)%;03Sd(VY{#gxEcU+5u5Fd z6nI(11@P_-fDZt^#q`H7TL8TQ@Kbe6aNuD4 ni0}dZ{tvqi*t)qNrGz@s6&OXW`CY0!h1dBv(g(;%h4hiLf{V-Q+qIYJe(S{zK| z2`wo6q>ptDGb%jPc2jycTIE*P1gS{X+->4X=piG0yQ)_YBj7JR+-wB&x>EQYtFC@? zFY$Pcg-a^FeEVUBeKft8^!%~JeVp7Y(~rbA1C0j*-G^;B00000NkvXXu0mjfS$3uX literal 0 HcmV?d00001 diff --git a/Resources/Textures/Clothing/OuterClothing/Misc/webcocoon.rsi/meta.json b/Resources/Textures/Clothing/OuterClothing/Misc/webcocoon.rsi/meta.json new file mode 100644 index 00000000000..101fefc436a --- /dev/null +++ b/Resources/Textures/Clothing/OuterClothing/Misc/webcocoon.rsi/meta.json @@ -0,0 +1,18 @@ +{ + "version": 1, + "license": "CC-BY-SA-3.0", + "copyright": "Made by Heroman3003", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "cocoon" + }, + { + "name": "body-overlay-2", + "directions": 4 + } + ] +} diff --git a/Resources/Textures/Structures/Web/nest.rsi/icon.png b/Resources/Textures/Structures/Web/nest.rsi/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..378e6af55b2788f747c88342b27d7a8a137714ef GIT binary patch literal 546 zcmV+-0^R+IP)_!NI}i=H{E5o7vgfs;a8Aw6w`5dOZLD00DGTPE!Ct=GbNc00FW|L_t(2 zksVU8Zrd;rJwg6b6c literal 0 HcmV?d00001 diff --git a/Resources/Textures/Structures/Web/nest.rsi/meta.json b/Resources/Textures/Structures/Web/nest.rsi/meta.json new file mode 100644 index 00000000000..5cde3e94233 --- /dev/null +++ b/Resources/Textures/Structures/Web/nest.rsi/meta.json @@ -0,0 +1,14 @@ +{ + "version": 1, + "size": { + "x": 32, + "y": 32 + }, + "license": "CC-BY-SA-3.0", + "copyright": "Made by Heroman3003", + "states": [ + { + "name": "icon" + } + ] +} From c7ff91f6e6725cd49d318cc5a9b1a4b08104352b Mon Sep 17 00:00:00 2001 From: FoxxoTrystan Date: Wed, 3 Jul 2024 02:28:59 +0200 Subject: [PATCH 3/3] Oops --- Content.Server/Atmos/Rotting/RottingSystem.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Content.Server/Atmos/Rotting/RottingSystem.cs b/Content.Server/Atmos/Rotting/RottingSystem.cs index e5d7aa8ccb0..24d6514cba0 100644 --- a/Content.Server/Atmos/Rotting/RottingSystem.cs +++ b/Content.Server/Atmos/Rotting/RottingSystem.cs @@ -13,6 +13,7 @@ using Robust.Server.Containers; using Robust.Shared.Physics.Components; using Robust.Shared.Timing; +using Content.Shared.Cuffs.Components; namespace Content.Server.Atmos.Rotting;