From ae57355ce5094e57bbb0431220f0522b92ef6abd Mon Sep 17 00:00:00 2001 From: 20kdc Date: Tue, 8 Dec 2020 10:58:46 +0000 Subject: [PATCH] Antimatter Engine Crates (#2708) * Remove the unused light bulb crate that explicitly says it needs to be removed * Crates/Cargo: Add antimatter reactor crates * Fix AME crate issues * Descriptions and prices for AME crates. --- .../Power/AME/AMEControllerComponent.cs | 2 +- .../Catalog/Cargo/cargo_engines.yml | 36 +++++++++++++++++++ .../Constructible/Power/cargo_console.yml | 3 ++ .../Specific/Engines/AME/ame_controller.yml | 14 ++++++++ .../Storage/Crates/Filled/crate_engines.yml | 29 ++++++++++++--- .../Storage/Crates/crate_types.yml | 24 ------------- 6 files changed, 78 insertions(+), 30 deletions(-) create mode 100644 Resources/Prototypes/Catalog/Cargo/cargo_engines.yml diff --git a/Content.Server/GameObjects/Components/Power/AME/AMEControllerComponent.cs b/Content.Server/GameObjects/Components/Power/AME/AMEControllerComponent.cs index bad33210b3..3f0f769938 100644 --- a/Content.Server/GameObjects/Components/Power/AME/AMEControllerComponent.cs +++ b/Content.Server/GameObjects/Components/Power/AME/AMEControllerComponent.cs @@ -279,7 +279,7 @@ namespace Content.Server.GameObjects.Components.Power.AME var engineNodeGroup = nodeContainer?.Nodes .Select(node => node.NodeGroup) .OfType() - .First(); + .FirstOrDefault(); return engineNodeGroup; } diff --git a/Resources/Prototypes/Catalog/Cargo/cargo_engines.yml b/Resources/Prototypes/Catalog/Cargo/cargo_engines.yml new file mode 100644 index 0000000000..ab59e2a4ce --- /dev/null +++ b/Resources/Prototypes/Catalog/Cargo/cargo_engines.yml @@ -0,0 +1,36 @@ +- type: cargoProduct + name: "packaged antimatter reactor crate" + id: cargo.enginesameshielding + description: "9 parts for the main body of an antimatter reactor, or for expanding an existing one." + icon: + sprite: Objects/Power/AME/ame_part.rsi + state: box + product: CrateEngineeringAMEShielding + cost: 1500 + category: Engineering + group: market + +- type: cargoProduct + name: "antimatter containment jar crate" + id: cargo.enginesamejar + description: "3 antimatter jars, for fuelling an antimatter reactor." + icon: + sprite: Objects/Power/AME/ame_jar.rsi + state: jar + product: CrateEngineeringAMEJar + cost: 600 + category: Engineering + group: market + +- type: cargoProduct + name: "antimatter control unit crate" + id: cargo.enginesamecontrol + description: "The control unit of an antimatter reactor." + icon: + sprite: Constructible/Power/ame_controller.rsi + state: control + product: CrateEngineeringAMEControl + cost: 500 + category: Engineering + group: market + diff --git a/Resources/Prototypes/Entities/Constructible/Power/cargo_console.yml b/Resources/Prototypes/Entities/Constructible/Power/cargo_console.yml index 65dae577d3..5f9060bb39 100644 --- a/Resources/Prototypes/Entities/Constructible/Power/cargo_console.yml +++ b/Resources/Prototypes/Entities/Constructible/Power/cargo_console.yml @@ -31,6 +31,9 @@ - cargo.hydroponicsseedsexotic - cargo.servicejanitorial - cargo.servicelightsreplacement + - cargo.enginesameshielding + - cargo.enginesamejar + - cargo.enginesamecontrol - cargo.funplushies - cargo.funartsupplies - cargo.funinstruments diff --git a/Resources/Prototypes/Entities/Constructible/Specific/Engines/AME/ame_controller.yml b/Resources/Prototypes/Entities/Constructible/Specific/Engines/AME/ame_controller.yml index fc1ee02e47..2ad2ea5523 100644 --- a/Resources/Prototypes/Entities/Constructible/Specific/Engines/AME/ame_controller.yml +++ b/Resources/Prototypes/Entities/Constructible/Specific/Engines/AME/ame_controller.yml @@ -11,6 +11,8 @@ sprite: Constructible/Power/ame_controller.rsi state: control - type: Physics + # Mass of 1? Unmovable. Mass of 25? Fine. What on earth is going on? + mass: 25 shapes: - !type:PhysShapeAabb layer: @@ -28,6 +30,8 @@ - type: SnapGrid offset: Center - type: Anchorable + snap: true + - type: Pullable - type: AMEController - type: UserInterface interfaces: @@ -45,3 +49,13 @@ - type: PowerReceiver - type: PowerSupplier supplyRate: 0 + +- type: entity + id: AMEControllerUnanchored + parent: AMEController + suffix: Unanchored + abstract: true + components: + - type: Physics + anchored: false + diff --git a/Resources/Prototypes/Entities/Constructible/Storage/Crates/Filled/crate_engines.yml b/Resources/Prototypes/Entities/Constructible/Storage/Crates/Filled/crate_engines.yml index c23976c06d..47efb558be 100644 --- a/Resources/Prototypes/Entities/Constructible/Storage/Crates/Filled/crate_engines.yml +++ b/Resources/Prototypes/Entities/Constructible/Storage/Crates/Filled/crate_engines.yml @@ -1,15 +1,34 @@ - type: entity - id: CrateEngineeringAME - name: ame crate - parent: CrateRadiation + id: CrateEngineeringAMEShielding + name: packaged antimatter reactor crate + description: "9 parts for the main body of an antimatter reactor, or for expanding an existing one." + parent: CrateEngineeringSecure components: - type: StorageFill contents: - - name: Multitool - amount: 1 - name: AMEPart amount: 9 + +- type: entity + id: CrateEngineeringAMEJar + name: antimatter containment jar crate + description: "3 antimatter jars, for fuelling an antimatter reactor." + parent: CrateEngineeringSecure + components: + - type: StorageFill + contents: - name: AMEJar + amount: 3 + +- type: entity + id: CrateEngineeringAMEControl + name: antimatter control unit crate + description: "The control unit of an antimatter reactor." + parent: CrateEngineeringSecure + components: + - type: StorageFill + contents: + - name: AMEControllerUnanchored amount: 1 - type: entity diff --git a/Resources/Prototypes/Entities/Constructible/Storage/Crates/crate_types.yml b/Resources/Prototypes/Entities/Constructible/Storage/Crates/crate_types.yml index 0788088025..3c00a38b73 100644 --- a/Resources/Prototypes/Entities/Constructible/Storage/Crates/crate_types.yml +++ b/Resources/Prototypes/Entities/Constructible/Storage/Crates/crate_types.yml @@ -503,27 +503,3 @@ state_open: weaponcrate_open state_closed: weaponcrate_door -#### REMOVE THIS SWEPT!! - -- type: entity - id: CrateLightBulb - name: plastic crate - parent: CrateGeneric - components: - - type: Sprite - sprite: Constructible/Storage/Crates/plastic.rsi - layers: - - state: plasticcrate - - state: plasticcrate_door - map: ["enum.StorageVisualLayers.Door"] - - state: welded - visible: false - map: ["enum.StorageVisualLayers.Welded"] - - type: Icon - sprite: Constructible/Storage/Crates/plastic.rsi - state: plasticcrate_icon - - type: Appearance - visuals: - - type: StorageVisualizer - state_open: plasticcrate_open - state_closed: plasticcrate_door