From 00a93a650ddb2c695b508e2c4b34c6924b9deff3 Mon Sep 17 00:00:00 2001 From: Wiebe Geertsma <1354802+GreaseMonk@users.noreply.github.com> Date: Thu, 7 Mar 2024 20:00:05 +0100 Subject: [PATCH 1/2] Fix tabletopping --- .../NodeEntities/BoardNodeEntity.cs | 2 +- .../Machines/Computers/computers_tabletop.yml | 36 ----------- .../Machines/Computers/frame_tabletop.yml | 64 ++++++++++++++++++- .../Graphs/machines/computer_tabletop.yml | 2 +- .../_NF/Recipes/Construction/machines.yml | 2 +- 5 files changed, 65 insertions(+), 41 deletions(-) diff --git a/Content.Server/Construction/NodeEntities/BoardNodeEntity.cs b/Content.Server/Construction/NodeEntities/BoardNodeEntity.cs index 28c25eef04d..3e73ffde3e1 100644 --- a/Content.Server/Construction/NodeEntities/BoardNodeEntity.cs +++ b/Content.Server/Construction/NodeEntities/BoardNodeEntity.cs @@ -31,7 +31,7 @@ public sealed partial class BoardNodeEntity : IGraphNodeEntity // Frontier - adds tabletop variants if (args.EntityManager.TryGetComponent(container.Owner, out ConstructionComponent? constructionComponent) - && constructionComponent.Graph == "GraphComputerTabletop" + && constructionComponent.Graph == "ComputerTabletop" && args.EntityManager.TryGetComponent(board, out ComputerTabletopBoardComponent? tabletopComputer)) { return tabletopComputer.Prototype; diff --git a/Resources/Prototypes/_NF/Entities/Structures/Machines/Computers/computers_tabletop.yml b/Resources/Prototypes/_NF/Entities/Structures/Machines/Computers/computers_tabletop.yml index d95743bab8b..d87dd73bd24 100644 --- a/Resources/Prototypes/_NF/Entities/Structures/Machines/Computers/computers_tabletop.yml +++ b/Resources/Prototypes/_NF/Entities/Structures/Machines/Computers/computers_tabletop.yml @@ -1,39 +1,3 @@ -# Base structures -- type: entity - id: BaseStructureComputerTabletop - suffix: Tabletop - abstract: true - components: - - type: Sprite - sprite: _NF/Structures/Machines/computer_tabletop.rsi - drawdepth: SmallObjects - layers: - - map: ["computerLayerBody"] - sprite: _NF/Structures/Machines/computer_tabletop.rsi - state: computer_tabletop - - map: ["computerLayerKeyboard"] - sprite: _NF/Structures/Machines/computer_tabletop.rsi - state: generic_keyboard_tabletop - - map: ["computerLayerScreen"] - sprite: Structures/Machines/computers.rsi - state: generic - - map: ["computerLayerKeys"] - sprite: Structures/Machines/computers.rsi - state: generic_keys - - type: Fixtures - fixtures: - fix1: - shape: - !type:PhysShapeAabb - bounds: "-0.45,-0.45,0.45,0.45" - density: 60 - mask: - - Impassable - - LowImpassable -# - TabletopMachineMask -# layer: -# - TabletopMachineLayer - # Computers: Base Game - type: entity parent: [BaseStructureComputerTabletop, ComputerAlert] diff --git a/Resources/Prototypes/_NF/Entities/Structures/Machines/Computers/frame_tabletop.yml b/Resources/Prototypes/_NF/Entities/Structures/Machines/Computers/frame_tabletop.yml index 1d93b8d1cf3..64ffe2cf089 100644 --- a/Resources/Prototypes/_NF/Entities/Structures/Machines/Computers/frame_tabletop.yml +++ b/Resources/Prototypes/_NF/Entities/Structures/Machines/Computers/frame_tabletop.yml @@ -1,10 +1,70 @@ - type: entity - parent: ComputerFrame + id: BaseStructureComputerTabletop + parent: BaseStructure + suffix: Tabletop + abstract: true + components: + - type: Physics + bodyType: Static + - type: Fixtures + fixtures: + fix1: + shape: + !type:PhysShapeAabb + bounds: "-0.25,-0.35,0.25,0.35" + density: 190 + mask: + - MachineMask + layer: + - MachineLayer + - type: InteractionOutline + - type: Rotatable + - type: Anchorable + - type: Construction + graph: ComputerTabletop + node: frameUnsecured + - type: Sprite + sprite: _NF/Structures/Machines/computer_tabletop.rsi + drawdepth: Objects + layers: + - map: [ "computerLayerBody" ] + sprite: _NF/Structures/Machines/computer_tabletop.rsi + state: computer_tabletop + - map: [ "computerLayerKeyboard" ] + sprite: _NF/Structures/Machines/computer_tabletop.rsi + state: generic_keyboard_tabletop + - map: [ "computerLayerScreen" ] + sprite: Structures/Machines/computers.rsi + state: generic + - map: [ "computerLayerKeys" ] + sprite: Structures/Machines/computers.rsi + state: generic_keys + - type: Damageable + damageContainer: Inorganic + damageModifierSet: Electronic + - type: Destructible + thresholds: + - trigger: + !type:DamageTrigger + damage: 100 + behaviors: + - !type:PlaySoundBehavior + sound: + collection: GlassBreak + - !type:ChangeConstructionNodeBehavior + node: monitorBroken + - !type:DoActsBehavior + acts: ["Destruction"] + - type: StaticPrice + price: 100 + +- type: entity + parent: BaseStructureComputerTabletop name: computer id: ComputerTabletopFrame components: - type: Construction - graph: GraphComputerTabletop + graph: ComputerTabletop node: frameUnsecured containers: - board diff --git a/Resources/Prototypes/_NF/Recipes/Construction/Graphs/machines/computer_tabletop.yml b/Resources/Prototypes/_NF/Recipes/Construction/Graphs/machines/computer_tabletop.yml index 5e9198b04b6..5cc27fc1e69 100644 --- a/Resources/Prototypes/_NF/Recipes/Construction/Graphs/machines/computer_tabletop.yml +++ b/Resources/Prototypes/_NF/Recipes/Construction/Graphs/machines/computer_tabletop.yml @@ -1,5 +1,5 @@ - type: constructionGraph - id: GraphComputerTabletop + id: ComputerTabletop start: start graph: - node: start diff --git a/Resources/Prototypes/_NF/Recipes/Construction/machines.yml b/Resources/Prototypes/_NF/Recipes/Construction/machines.yml index 312fe46d24b..ff303800b5a 100644 --- a/Resources/Prototypes/_NF/Recipes/Construction/machines.yml +++ b/Resources/Prototypes/_NF/Recipes/Construction/machines.yml @@ -1,7 +1,7 @@ - type: construction name: computer (tabletop) id: ConstructionComputerTabletop - graph: GraphComputerTabletop + graph: ComputerTabletop startNode: start targetNode: tabletop computer category: construction-category-machines From bcb131270369edc0d6944a021a69dad7e5a65075 Mon Sep 17 00:00:00 2001 From: Wiebe Geertsma <1354802+GreaseMonk@users.noreply.github.com> Date: Thu, 7 Mar 2024 20:45:12 +0100 Subject: [PATCH 2/2] Fix physics --- .../Structures/Machines/Computers/frame_tabletop.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Resources/Prototypes/_NF/Entities/Structures/Machines/Computers/frame_tabletop.yml b/Resources/Prototypes/_NF/Entities/Structures/Machines/Computers/frame_tabletop.yml index 64ffe2cf089..20eb154dfc8 100644 --- a/Resources/Prototypes/_NF/Entities/Structures/Machines/Computers/frame_tabletop.yml +++ b/Resources/Prototypes/_NF/Entities/Structures/Machines/Computers/frame_tabletop.yml @@ -5,7 +5,6 @@ abstract: true components: - type: Physics - bodyType: Static - type: Fixtures fixtures: fix1: @@ -14,9 +13,9 @@ bounds: "-0.25,-0.35,0.25,0.35" density: 190 mask: - - MachineMask + - TabletopMachineMask layer: - - MachineLayer + - TabletopMachineLayer - type: InteractionOutline - type: Rotatable - type: Anchorable