From: Minerva <218184747+mnva0@users.noreply.github.com> Date: Thu, 22 Jan 2026 18:27:45 +0000 (-0500) Subject: Makes defib cabinets constructable and deconstructable (#42571) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=c58e63c5c154c0806efce2e552dc2072b5dcec89;p=space-station-14.git Makes defib cabinets constructable and deconstructable (#42571) * Makes defib cabinets constructable and deconstructable * fix crash on master --------- Co-authored-by: Janet Blackquill --- diff --git a/Content.Client/Construction/ConstructionSystem.cs b/Content.Client/Construction/ConstructionSystem.cs index d693f4ac47..9900f860c3 100644 --- a/Content.Client/Construction/ConstructionSystem.cs +++ b/Content.Client/Construction/ConstructionSystem.cs @@ -306,6 +306,7 @@ namespace Content.Client.Construction var targetSprite = EnsureComp(dummy); EntityManager.System().OnChangeData(dummy, targetSprite); + var addedIndex = 0; for (var i = 0; i < targetSprite.AllLayers.Count(); i++) { if (!targetSprite[i].Visible || !targetSprite[i].RsiState.IsValid) @@ -316,10 +317,11 @@ namespace Content.Client.Construction state.StateId.Name is null) continue; - _sprite.AddBlankLayer((ghost.Value, sprite), i); - _sprite.LayerSetSprite((ghost.Value, sprite), i, new SpriteSpecifier.Rsi(rsi.Path, state.StateId.Name)); - sprite.LayerSetShader(i, "unshaded"); - _sprite.LayerSetVisible((ghost.Value, sprite), i, true); + _sprite.AddBlankLayer((ghost.Value, sprite), addedIndex); + _sprite.LayerSetSprite((ghost.Value, sprite), addedIndex, new SpriteSpecifier.Rsi(rsi.Path, state.StateId.Name)); + sprite.LayerSetShader(addedIndex, "unshaded"); + _sprite.LayerSetVisible((ghost.Value, sprite), addedIndex, true); + addedIndex++; } Del(dummy); diff --git a/Resources/Prototypes/Entities/Structures/Wallmounts/Storage/Cabinets/defib_cabinet.yml b/Resources/Prototypes/Entities/Structures/Wallmounts/Storage/Cabinets/defib_cabinet.yml index 0ca51b5c78..66528890a8 100644 --- a/Resources/Prototypes/Entities/Structures/Wallmounts/Storage/Cabinets/defib_cabinet.yml +++ b/Resources/Prototypes/Entities/Structures/Wallmounts/Storage/Cabinets/defib_cabinet.yml @@ -24,6 +24,9 @@ whitelist: components: - Defibrillator + - type: Construction + graph: DefibrillatorCabinet + node: done - type: Destructible thresholds: - trigger: !type:DamageTrigger diff --git a/Resources/Prototypes/Recipes/Crafting/Graphs/storage/defib_cabinet.yml b/Resources/Prototypes/Recipes/Crafting/Graphs/storage/defib_cabinet.yml new file mode 100644 index 0000000000..9e774d5531 --- /dev/null +++ b/Resources/Prototypes/Recipes/Crafting/Graphs/storage/defib_cabinet.yml @@ -0,0 +1,27 @@ +- type: constructionGraph + id: DefibrillatorCabinet + start: start + graph: + - node: start + edges: + - to: done + steps: + - material: Steel + amount: 2 + doAfter: 5 + - node: done + entity: DefibrillatorCabinet + edges: + - to: start + steps: + - tool: Screwing + doAfter: 5 + conditions: + - !type:ContainerEmpty + container: "ItemCabinet" + completed: + - !type:SpawnPrototype + prototype: SheetSteel1 + amount: 2 + - !type:EmptyAllContainers + - !type:DeleteEntity diff --git a/Resources/Prototypes/Recipes/Crafting/defib_cabinet.yml b/Resources/Prototypes/Recipes/Crafting/defib_cabinet.yml new file mode 100644 index 0000000000..042a796f36 --- /dev/null +++ b/Resources/Prototypes/Recipes/Crafting/defib_cabinet.yml @@ -0,0 +1,12 @@ +- type: construction + id: DefibrillatorCabinet + graph: DefibrillatorCabinet + startNode: start + targetNode: done + category: construction-category-storage + objectType: Structure + placementMode: SnapgridCenter + canRotate: true + canBuildInImpassable: true + conditions: + - !type:WallmountCondition