From 0a34c4b8a9c8a7bebe64ad3c540059c1cfbf96f4 Mon Sep 17 00:00:00 2001 From: Peptide90 <78795277+Peptide90@users.noreply.github.com> Date: Fri, 12 Mar 2021 21:11:06 +0000 Subject: [PATCH] Adds construction for wooden barricades, solar panels + solar trackers (#3472) * Added barricades and textures for hidden doors Constructable barricades and textures for square wall hidden doors * Added solar assembly & tracker. Restructured power construction Added solar tracker and assembly construction and textures. (Trackers don't work at present). Moved APC and solar item sot construction/power.yml Moved power based items to "Utility" in construction menu. * Localisation changes Added flammable to barricades. Added localisation to barricades and all solar entities. * Removed hidden doors Removed .rsi for hidden doors as wasn't able to get non airlock doors working. * Adds solar crate to cargo * Fixed tests * Removed glass from solar crate Removing glass from solars crate until stacks can be specified. * Added deconstruction to solar graphs * Added deconstruction to barricade And fixed nodes for solars. * Fixed materials * Fixed meta indent and solartracker type * Fixed materials, physics & naming Added new physics fixtures to barricade and solars Changed solar tracker board to electronics. Changed material ID for destruction of wooden barricades to new ID. * Changed back to prototype from component step Component step does not work for electronics only machine boards. * Localisation fixes 1 * yaml linter fixes Removed obsolete code * Update meta.json * Fix trailing comma Co-authored-by: DrSmugleaf --- .../Locale/en-US/entities/barricades.ftl | 5 + .../Locale/en-US/entities/solar_panels.ftl | 15 +++ .../Catalog/Cargo/cargo_engines.yml | 12 +++ .../Catalog/Fills/Storage/Crates/engines.yml | 10 ++ .../Constructible/Power/cargo_console.yml | 1 + .../Constructible/Power/power_base.yml | 101 ++++++++++++++++-- .../Constructible/Specific/barricades.yml | 57 ++++++++++ .../Entities/Objects/Power/solar_parts.yml | 17 +++ .../Construction/Graphs/barricades.yml | 27 +++++ .../Construction/Graphs/solarpanel.yml | 88 +++++++++++++++ .../Prototypes/Recipes/Construction/power.yml | 31 ++++++ .../Recipes/Construction/structures.yml | 18 ++-- .../Power/solar_panel.rsi/meta.json | 2 +- .../Power/solar_panel.rsi/solar_assembly.png | Bin 0 -> 315 bytes .../Power/solar_panel.rsi/solar_tracker.png | Bin 0 -> 506 bytes .../barricades.rsi/barricadewooden.png | Bin 0 -> 409 bytes .../Structures/barricades.rsi/meta.json | 14 +++ .../Objects/Power/solar_parts.rsi/meta.json | 14 +++ .../solar_parts.rsi/solar_assembly_parts.png | Bin 0 -> 447 bytes 19 files changed, 395 insertions(+), 17 deletions(-) create mode 100644 Resources/Locale/en-US/entities/barricades.ftl create mode 100644 Resources/Locale/en-US/entities/solar_panels.ftl create mode 100644 Resources/Prototypes/Entities/Constructible/Specific/barricades.yml create mode 100644 Resources/Prototypes/Entities/Objects/Power/solar_parts.yml create mode 100644 Resources/Prototypes/Recipes/Construction/Graphs/barricades.yml create mode 100644 Resources/Prototypes/Recipes/Construction/Graphs/solarpanel.yml create mode 100644 Resources/Prototypes/Recipes/Construction/power.yml create mode 100644 Resources/Textures/Constructible/Power/solar_panel.rsi/solar_assembly.png create mode 100644 Resources/Textures/Constructible/Power/solar_panel.rsi/solar_tracker.png create mode 100644 Resources/Textures/Constructible/Structures/barricades.rsi/barricadewooden.png create mode 100644 Resources/Textures/Constructible/Structures/barricades.rsi/meta.json create mode 100644 Resources/Textures/Objects/Power/solar_parts.rsi/meta.json create mode 100644 Resources/Textures/Objects/Power/solar_parts.rsi/solar_assembly_parts.png diff --git a/Resources/Locale/en-US/entities/barricades.ftl b/Resources/Locale/en-US/entities/barricades.ftl new file mode 100644 index 0000000000..ebfab4436c --- /dev/null +++ b/Resources/Locale/en-US/entities/barricades.ftl @@ -0,0 +1,5 @@ +### Barricades entity prototype data. + +ent-barricade = wooden barricade + .desc = The poor man's barrier, not nearly as strong or cool looking. + diff --git a/Resources/Locale/en-US/entities/solar_panels.ftl b/Resources/Locale/en-US/entities/solar_panels.ftl new file mode 100644 index 0000000000..cb583d813a --- /dev/null +++ b/Resources/Locale/en-US/entities/solar_panels.ftl @@ -0,0 +1,15 @@ +### Power entity prototype data. + + +###Solars +ent-solar-tracker = solar tracker + .desc = A solar tracker. Can be wired to a solar array and computer to track solar positions. +ent-solar-assembly = solar assembly + .desc = A solar assembly. Anchor to a wire to start building a solar panel. +ent-solar-panel = solar panel + .desc = Generates power from sunlight. Usually used to power replacements for sunlight. Fragile. + +ent-solar-tracker-electronics = solar tracker electronics + .desc = An electronics board for making a solar tracker. +ent-solar-assembly-part = solar assembly parts + .desc = Used in the construction of solar assemblies for solar panels and trackers. \ No newline at end of file diff --git a/Resources/Prototypes/Catalog/Cargo/cargo_engines.yml b/Resources/Prototypes/Catalog/Cargo/cargo_engines.yml index 22c5055115..b5db133182 100644 --- a/Resources/Prototypes/Catalog/Cargo/cargo_engines.yml +++ b/Resources/Prototypes/Catalog/Cargo/cargo_engines.yml @@ -93,3 +93,15 @@ cost: 10000 category: Engineering group: market + +- type: cargoProduct + name: "solar assembly parts" + id: cargo.enginessolar + description: "Parts for constructing solar panels and trackers." + icon: + sprite: Objects/Power/solar_parts.rsi + state: solar_assembly_parts + product: CrateEngineeringSolar + cost: 500 + category: Engineering + group: market diff --git a/Resources/Prototypes/Catalog/Fills/Storage/Crates/engines.yml b/Resources/Prototypes/Catalog/Fills/Storage/Crates/engines.yml index 06b1f294ab..bc931598a0 100644 --- a/Resources/Prototypes/Catalog/Fills/Storage/Crates/engines.yml +++ b/Resources/Prototypes/Catalog/Fills/Storage/Crates/engines.yml @@ -126,3 +126,13 @@ contents: - name: DebugGenerator amount: 1 + +- type: entity + id: CrateEngineeringSolar + name: solar assembly crate + parent: CrateEngineering + components: + - type: StorageFill + contents: + - name: SolarAssemblyPart + amount: 6 diff --git a/Resources/Prototypes/Entities/Constructible/Power/cargo_console.yml b/Resources/Prototypes/Entities/Constructible/Power/cargo_console.yml index 4cc74bbd03..c34bea117d 100644 --- a/Resources/Prototypes/Entities/Constructible/Power/cargo_console.yml +++ b/Resources/Prototypes/Entities/Constructible/Power/cargo_console.yml @@ -37,6 +37,7 @@ - cargo.engineameshielding - cargo.engineamejar - cargo.engineamecontrol + - cargo.enginessolar - cargo.funplushies - cargo.funartsupplies - cargo.funinstruments diff --git a/Resources/Prototypes/Entities/Constructible/Power/power_base.yml b/Resources/Prototypes/Entities/Constructible/Power/power_base.yml index 70703b996c..2de01f995c 100644 --- a/Resources/Prototypes/Entities/Constructible/Power/power_base.yml +++ b/Resources/Prototypes/Entities/Constructible/Power/power_base.yml @@ -1,6 +1,6 @@ - type: entity id: BaseGenerator - description: A high efficiency thermoelectric generator. + description: "A high efficiency thermoelectric generator." name: Base Generator abstract: true placement: @@ -45,7 +45,7 @@ - type: entity id: BaseSmes - description: A high-capacity superconducting magnetic energy storage (SMES) unit. + description: "A high-capacity superconducting magnetic energy storage (SMES) unit." name: Base Smes abstract: true placement: @@ -104,7 +104,7 @@ - type: entity id: BaseSubstation - description: Reduces the voltage of electricity put into it. + description: "Reduces the voltage of electricity put into it." name: Base Substation abstract: true placement: @@ -164,7 +164,7 @@ - type: entity id: BaseApc - description: A control terminal for the area's electrical systems. + description: "A control terminal for the area's electrical systems." name: Base Apc abstract: true placement: @@ -222,16 +222,14 @@ - type: entity id: SolarPanel - name: solar panel - description: Generates power from sunlight. Usually used to power replacements for sunlight. Fragile. placement: mode: SnapgridCenter components: - type: Clickable - type: InteractionOutline - type: Physics - mass: 25 - bodyType: Dynamic + mass: 100 + bodyType: Static fixtures: - shape: !type:PhysShapeAabb {} @@ -273,3 +271,90 @@ - type: ClientEntitySpawner prototypes: - HVDummyWire + - type: Construction + graph: solarpanel + node: solarpanel + +- type: entity + id: SolarAssembly + name: solar assembly + description: "A solar assembly. Anchor to a wire to start building a solar panel." + placement: + mode: SnapgridCenter + components: + - type: Clickable + - type: InteractionOutline + - type: Physics + mass: 75 + bodyType: Static + fixtures: + - shape: + !type:PhysShapeAabb {} + mask: + - VaultImpassable + layer: + - VaultImpassable + - type: Sprite + sprite: Constructible/Power/solar_panel.rsi + state: solar_assembly + - type: SnapGrid + offset: Center + - type: Damageable + resistances: metallicResistances + - type: Destructible + thresholds: + - trigger: + !type:DamageTrigger + damage: 100 + behaviors: + - !type:DoActsBehavior + acts: ["Breakage"] + - type: Anchorable + - type: Pullable + - type: Construction + graph: solarpanel + node: solarassembly + +- type: entity + id: SolarTracker + placement: + mode: SnapgridCenter + components: + - type: Clickable + - type: InteractionOutline + - type: Physics + mass: 100 + bodyType: Static + fixtures: + - shape: + !type:PhysShapeAabb {} + mask: + - Impassable + - MobImpassable + - VaultImpassable + - SmallImpassable + layer: + - Opaque + - MobImpassable + - VaultImpassable + - SmallImpassable + - type: Sprite + sprite: Constructible/Power/solar_panel.rsi + state: solar_tracker + - type: SnapGrid + offset: Center + - type: Damageable + resistances: metallicResistances + - type: Destructible + thresholds: + - trigger: + !type:DamageTrigger + damage: 100 + behaviors: + - !type:DoActsBehavior + acts: ["Breakage"] + - type: Anchorable + - type: Pullable + - type: Construction + graph: solarpanel + node: solartracker diff --git a/Resources/Prototypes/Entities/Constructible/Specific/barricades.yml b/Resources/Prototypes/Entities/Constructible/Specific/barricades.yml new file mode 100644 index 0000000000..a2fe7fa1a0 --- /dev/null +++ b/Resources/Prototypes/Entities/Constructible/Specific/barricades.yml @@ -0,0 +1,57 @@ +- type: entity + id: Barricade + components: + - type: Clickable + - type: InteractionOutline + - type: Construction + graph: barricade + node: barricadewooden + - type: Sprite + sprite: Constructible/Structures/barricades.rsi + state: barricadewooden + - type: Physics + mass: 75 + bodyType: Static + fixtures: + - shape: + !type:PhysShapeAabb + bounds: "-0.5, -0.5, 0.5, 0.5" + layer: + - Opaque + - Impassable + - MobImpassable + - VaultImpassable + - SmallImpassable + - type: Tag + tags: + - ExplosivePassable + - type: Damageable + resistances: metallicResistances + - type: Destructible + thresholds: + - trigger: + !type:DamageTrigger + damage: 50 + behaviors: + - !type:SpawnEntitiesBehavior + spawn: + MaterialWoodPlank1: + min: 3 + max: 3 + - !type:DoActsBehavior + acts: [ "Destruction" ] + - type: AtmosExposed + - type: Flammable + fireSpread: true + - type: Appearance + visuals: + - type: FireVisualizer + sprite: Effects/fire.rsi + normalState: 1 + Sprite: + drawdepth: Overlays + - type: SnapGrid + offset: Edge + placement: + snap: + - Wall diff --git a/Resources/Prototypes/Entities/Objects/Power/solar_parts.yml b/Resources/Prototypes/Entities/Objects/Power/solar_parts.yml new file mode 100644 index 0000000000..5d148ce017 --- /dev/null +++ b/Resources/Prototypes/Entities/Objects/Power/solar_parts.yml @@ -0,0 +1,17 @@ +- type: entity + id: SolarAssemblyPart + parent: BaseItem + components: + - type: Item + size: 10 + - type: Sprite + sprite: Objects/Power/solar_parts.rsi + state: solar_assembly_parts + +- type: entity + id: SolarTrackerElectronics + parent: BaseItem + components: + - type: Sprite + sprite: Constructible/Misc/module.rsi + state: generic \ No newline at end of file diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/barricades.yml b/Resources/Prototypes/Recipes/Construction/Graphs/barricades.yml new file mode 100644 index 0000000000..0743717e92 --- /dev/null +++ b/Resources/Prototypes/Recipes/Construction/Graphs/barricades.yml @@ -0,0 +1,27 @@ +- type: constructionGraph + id: barricade + start: start + graph: + - node: start + edges: + - to: barricadewooden + steps: + - material: WoodPlank + amount: 5 + doAfter: 3 + + - node: barricadewooden + entity: Barricade + edges: + - to: start + completed: + - !type:SpawnPrototype + prototype: MaterialWoodPlank1 + amount: 4 #returns 1 less as one breaks + - !type:DeleteEntity {} + conditions: + - !type:EntityAnchored + anchored: true + steps: + - tool: Prying + doAfter: 5 \ No newline at end of file diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/solarpanel.yml b/Resources/Prototypes/Recipes/Construction/Graphs/solarpanel.yml new file mode 100644 index 0000000000..29d61a6358 --- /dev/null +++ b/Resources/Prototypes/Recipes/Construction/Graphs/solarpanel.yml @@ -0,0 +1,88 @@ +- type: constructionGraph + id: solarpanel + start: start + graph: + - node: start + edges: + - to: solarassembly + steps: + - prototype: SolarAssemblyPart + name: Solar Assembly Parts + icon: + sprite: Objects/Power/solar_parts.rsi + state: solar_assembly_parts + doAfter: 1 + + - node: solarassembly + entity: SolarAssembly + edges: + - to: start + completed: + - !type:SpawnPrototype + prototype: SolarAssemblyPart + amount: 1 + - !type:DeleteEntity {} + steps: + - tool: Screwing + doAfter: 2 + - to: solarpanel + conditions: + - !type:EntityAnchored + value: true + steps: + - material: Glass + amount: 2 + doAfter: 0.5 + completed: + - !type:SnapToGrid + offset: Center + - to: solartracker + conditions: + - !type:EntityAnchored + value: true + steps: + - prototype: SolarTrackerElectronics + name: Solar Tracker Electronics + icon: + sprite: Constructible/Misc/module.rsi + state: id_mod + doAfter: 1 + - material: Glass + amount: 2 + doAfter: 2 + completed: + - !type:SnapToGrid + offset: Center + + - node: solarpanel + entity: SolarPanel + edges: + - to: solarassembly + completed: + - !type:SpawnPrototype + prototype: SheetGlass1 + amount: 2 + conditions: + - !type:EntityAnchored + anchored: true + steps: + - tool: Prying + doAfter: 0.5 + + - node: solartracker + entity: SolarTracker + edges: + - to: solarassembly + completed: + - !type:SpawnPrototype + prototype: SheetGlass1 + amount: 2 + - !type:SpawnPrototype + prototype: SolarTrackerElectronics + amount: 1 + conditions: + - !type:EntityAnchored + anchored: true + steps: + - tool: Prying + doAfter: 1 diff --git a/Resources/Prototypes/Recipes/Construction/power.yml b/Resources/Prototypes/Recipes/Construction/power.yml new file mode 100644 index 0000000000..4375e042be --- /dev/null +++ b/Resources/Prototypes/Recipes/Construction/power.yml @@ -0,0 +1,31 @@ +- type: construction + name: APC + id: apc + graph: apc + startNode: start + targetNode: apc + category: Utility + description: "Area Power Controller (APC). Controls power. In an area." + icon: + sprite: Constructible/Power/apc.rsi + state: apc0 + objectType: Structure + placementMode: AlignWallProper + canBuildInImpassable: true + +- type: construction + name: Solar Assembly + id: SolarPanel + graph: solarpanel + startNode: start + targetNode: solarpanel + category: Utility + description: "Can be turned into a solar panel or solar tracker." + icon: + sprite: Constructible/Power/solar_panel.rsi + state: solar_assembly + objectType: Structure + placementMode: SnapgridCenter + canBuildInImpassable: false + conditions: + - !type:TileNotBlocked {} \ No newline at end of file diff --git a/Resources/Prototypes/Recipes/Construction/structures.yml b/Resources/Prototypes/Recipes/Construction/structures.yml index 9850da038d..f3adfd4023 100644 --- a/Resources/Prototypes/Recipes/Construction/structures.yml +++ b/Resources/Prototypes/Recipes/Construction/structures.yml @@ -198,16 +198,18 @@ canBuildInImpassable: false - type: construction - name: APC - id: apc - graph: apc + name: Wooden Barricade + id: Barricade + graph: barricade startNode: start - targetNode: apc + targetNode: barricadewooden category: Structures - description: Area Power Controller (APC). Controls power. In an area. + description: An improvised barricade made out of wooden planks. icon: - sprite: Constructible/Power/apc.rsi - state: apc0 + sprite: Constructible/Structures/barricades.rsi + state: barricadewooden objectType: Structure placementMode: SnapgridCenter - canBuildInImpassable: true + canBuildInImpassable: false + conditions: + - !type:TileNotBlocked {} diff --git a/Resources/Textures/Constructible/Power/solar_panel.rsi/meta.json b/Resources/Textures/Constructible/Power/solar_panel.rsi/meta.json index 377fa6ccb7..49c9b279ad 100644 --- a/Resources/Textures/Constructible/Power/solar_panel.rsi/meta.json +++ b/Resources/Textures/Constructible/Power/solar_panel.rsi/meta.json @@ -1 +1 @@ -{"version":1,"license":"CC-BY-SA-3.0","copyright":"Taken from https://github.com/discordia-space/CEV-Eris/blob/d1e0161af146835f4fb79d21a6200caa9cc842d0/icons/obj/power.dmi and modified.","size":{"x":32,"y":32},"states":[{"name":"normal","select":[],"flags":{},"directions":8},{"name":"broken","select":[],"flags":{},"directions":1}]} +{"version":1,"license":"CC-BY-SA-3.0","copyright":"Taken from https://github.com/discordia-space/CEV-Eris/blob/d1e0161af146835f4fb79d21a6200caa9cc842d0/icons/obj/power.dmi and modified.","size":{"x":32,"y":32},"states":[{"name":"normal","select":[],"flags":{},"directions":8},{"name":"broken","select":[],"flags":{},"directions":1},{"name": "solar_assembly"},{"name": "solar_tracker"}]} diff --git a/Resources/Textures/Constructible/Power/solar_panel.rsi/solar_assembly.png b/Resources/Textures/Constructible/Power/solar_panel.rsi/solar_assembly.png new file mode 100644 index 0000000000000000000000000000000000000000..6714f199e4fc177c295a1474baea2b4035a9fdab GIT binary patch literal 315 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCiji0(?STf%M+JdrzM}J$dqEK0dzZ&z~C_8Uh7(Oxo!Tq&P}~{DS{O0K>iJ zy^%mM&H|6fVg?4j!ywFfJby(BP;iE)i(`m||J{C1A!b7k=Ht?T{vQ`ykZ^43%2SoU zTs+^ldgq%Qm?+~UpIoH!UO4Rkp#vI+W_21cMMo5?Z0Z%+)9-HZ<&P(q?4eD3$LF`a zNIauuvR_o8S8ldbf>wBP1((c!!5zOe1y;^~^JCw4HG_TYGr6n&t1K`!_#2X~ql;t7grb#lUbz zO6q?>K|yqMw7tFknKTANLqi#v|K{fZ|IgIQ%KGo&@gHc8DZ6F_kdiD3@(cct128a} zaBT-F;wEak-;lFpn?V=V10oKx3QAq~@^N;`co22WB zbdI#&7b`Q@59FNZ#G(LYk?c1Iwso{r>LMGTPo%7SY*e}{RM z``;_7?_tx|73Dhr-uFWA64M_32Ii!bF^&g}mrFQ5{GKeK-q13`DBMd=z$RQRgDJdA zt$_6*r%9u>45LZo>c{`O?d>*syq>@RrE_n3rnqbR8buH9R_zT3mp9l>y|$ka%q>67AFleUx;pH3LKWi++b=b777bGmmHuT= YpW@EZJ?&L8Fw7V{UHx3vIVCg!00q6y7ytkO literal 0 HcmV?d00001 diff --git a/Resources/Textures/Constructible/Structures/barricades.rsi/barricadewooden.png b/Resources/Textures/Constructible/Structures/barricades.rsi/barricadewooden.png new file mode 100644 index 0000000000000000000000000000000000000000..c65024c63429c20f612e0d8637d4654cdf2282df GIT binary patch literal 409 zcmV;K0cQS*P)i>Z zKP5FUDY2+1GdVFORf&r;C9|j)C}YUQnO2mTn+jnoE4cc(fGq$3k5(Qu91XYL0002I zNkl-4>b$0LMM`%kCdM=9~6I(L&&1K3>3?5MsqjRwc1_A&7lm)YG?QvfHM zXSM{=)(ma}lG@i*1T?#Q(JVly)B=R26$r)cLemOaiEe@6jt&Px$c}YY;R9J=Wl}$?mQ51%sqLs|LR^fUCQQAce8Y4Igu1eYjL2cc*6cLdjTC|GR z{eYldPzDLc5P?uALGu%8TFU75wh%2Lo$J`gW}e--_gvohoO@>u1Ox;G{4)zON%6I) z@GH=MdY-DWBqP4EvOKe}bL^1|U&smi5DXLKRDh^>51$gq{q3DHHQGrHK@-xcYM z?)i2W{hG5Z%kReuIrfC9TnkGgz^|uB#))Q0XS@HY~zhYSy$z&3M!=oDIQgyVh zY1;1_&@^q-{&J~Gv)KfoQmOb72On2(|8O@oo)ymy6l(=s*B-_7t6N~u_Ce*J)w^z= zVyyt!$Rc$GYDC4zrcjj7*!s!o@tC+8QOEWj=ly3447oVFoVaJ~=m7M4E&!c&$8!*Y p#59!on|;U4bwg^>1_T5Id;knEn;Cq5AKU-{002ovPDHLkV1mio%hvz^ literal 0 HcmV?d00001