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 00000000000..dc9448e2fcb Binary files /dev/null and b/Resources/Textures/Clothing/OuterClothing/Misc/webcocoon.rsi/body-overlay-2.png differ diff --git a/Resources/Textures/Clothing/OuterClothing/Misc/webcocoon.rsi/cocoon.png b/Resources/Textures/Clothing/OuterClothing/Misc/webcocoon.rsi/cocoon.png new file mode 100644 index 00000000000..4d4b07d7a92 Binary files /dev/null and b/Resources/Textures/Clothing/OuterClothing/Misc/webcocoon.rsi/cocoon.png differ 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 00000000000..378e6af55b2 Binary files /dev/null and b/Resources/Textures/Structures/Web/nest.rsi/icon.png differ 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" + } + ] +}