From f88358a12aeaa270a0dc95abefb1a3005a74ee9d Mon Sep 17 00:00:00 2001 From: Peptide90 <78795277+Peptide90@users.noreply.github.com> Date: Sat, 1 Jan 2022 16:51:56 +0000 Subject: [PATCH] Substations now explode when destroyed (#5729) * Substation destructible component Substations now explode and create a destroyed machine which can be deconstructed. * construction graph test failed Does not need a path from start to finish but adding anyway to fix tests * railing to structures * Fixed Review Updated parent to fix most comments. Updated node to camelcase * Updated target node graph Still recovering... * Final fix of graph I swear * Altered destroyed machine spawns Removed HV cable and reduced steel sheets. --- .../Entities/Structures/Machines/frame.yml | 34 ++++++++++++++++++ .../Entities/Structures/Power/substation.yml | 22 ++++++++++++ .../Construction/Graphs/machines/machine.yml | 17 +++++++++ .../Graphs/{ => structures}/railing.yml | 0 .../Recipes/Construction/machines.yml | 12 +++++++ .../Machines/parts.rsi/destroyed.png | Bin 0 -> 903 bytes .../Structures/Machines/parts.rsi/meta.json | 5 ++- 7 files changed, 89 insertions(+), 1 deletion(-) rename Resources/Prototypes/Recipes/Construction/Graphs/{ => structures}/railing.yml (100%) create mode 100644 Resources/Textures/Structures/Machines/parts.rsi/destroyed.png diff --git a/Resources/Prototypes/Entities/Structures/Machines/frame.yml b/Resources/Prototypes/Entities/Structures/Machines/frame.yml index 4ac69da524..f51b4aea23 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/frame.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/frame.yml @@ -105,3 +105,37 @@ - type: Appearance visuals: - type: MachineFrameVisualizer + + +- type: entity + id: MachineFrameDestroyed + parent: BaseStructureDynamic + name: destroyed machine frame + placement: + mode: SnapgridCenter + components: + - type: Transform + anchored: true + - type: Construction + graph: machine + node: destroyedMachineFrame + - type: Damageable + damageContainer: Inorganic + damageModifierSet: Metallic + - type: Destructible + thresholds: + - trigger: + !type:DamageTrigger + damage: 100 + behaviors: + - !type:SpawnEntitiesBehavior + spawn: + SheetSteel1: + min: 1 + max: 3 + - !type:DoActsBehavior + acts: ["Destruction"] + - type: Sprite + netsync: false + sprite: Structures/Machines/parts.rsi + state: destroyed \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Structures/Power/substation.yml b/Resources/Prototypes/Entities/Structures/Power/substation.yml index e7434f42fc..c84f7b0271 100644 --- a/Resources/Prototypes/Entities/Structures/Power/substation.yml +++ b/Resources/Prototypes/Entities/Structures/Power/substation.yml @@ -42,3 +42,25 @@ maxChargeRate: 5000 supplyRampTolerance: 5000 supplyRampRate: 1000 + - type: Destructible + thresholds: + - trigger: + !type:DamageTrigger + damage: 100 + behaviors: + - !type:DoActsBehavior + acts: ["Destruction"] + - !type:PlaySoundBehavior + sound: + path: /Audio/Effects/metalbreak.ogg + - !type:ExplodeBehavior + - !type:SpawnEntitiesBehavior #in future should also emit a cloud of hot gas + spawn: + MachineFrameDestroyed: + min: 1 + max: 1 + - type: Explosive + devastationRange: 1 + heavyImpactRange: 3 + lightImpactRange: 5 + flashRange: 6 \ No newline at end of file diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/machines/machine.yml b/Resources/Prototypes/Recipes/Construction/Graphs/machines/machine.yml index b5ad5d548f..c3d62547dd 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/machines/machine.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/machines/machine.yml @@ -16,6 +16,11 @@ - material: Steel amount: 5 doAfter: 2.5 + - to: destroyedMachineFrame + steps: + - material: Steel + amount: 5 + doAfter: 2.5 - node: missingWires entity: UnfinishedMachineFrame @@ -98,3 +103,15 @@ - tool: Prying doAfter: 0.25 + - node: destroyedMachineFrame + entity: MachineFrameDestroyed + edges: + - to: start + steps: + - tool: Welding + doAfter: 5 + completed: + - !type:SpawnPrototype + prototype: SheetSteel1 + amount: 3 + - !type:DeleteEntity {} diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/railing.yml b/Resources/Prototypes/Recipes/Construction/Graphs/structures/railing.yml similarity index 100% rename from Resources/Prototypes/Recipes/Construction/Graphs/railing.yml rename to Resources/Prototypes/Recipes/Construction/Graphs/structures/railing.yml diff --git a/Resources/Prototypes/Recipes/Construction/machines.yml b/Resources/Prototypes/Recipes/Construction/machines.yml index 5853767457..0582a223dd 100644 --- a/Resources/Prototypes/Recipes/Construction/machines.yml +++ b/Resources/Prototypes/Recipes/Construction/machines.yml @@ -23,3 +23,15 @@ icon: sprite: Structures/Machines/parts.rsi state: "box_0" + +- type: construction + name: destroyed machine frame + id: MachineFrameDestroyed + graph: machine + startNode: start + targetNode: destroyedMachineFrame + placementMode: SnapgridCenter + canBuildInImpassable: false + icon: + sprite: Structures/Machines/parts.rsi + state: "destroyed" \ No newline at end of file diff --git a/Resources/Textures/Structures/Machines/parts.rsi/destroyed.png b/Resources/Textures/Structures/Machines/parts.rsi/destroyed.png new file mode 100644 index 0000000000000000000000000000000000000000..1a95fae9729478559c45ac7888ae6b08dc8c1fa4 GIT binary patch literal 903 zcmV;219<$2P)Px&K}keGR9J=WmrqC=K@`S+E42sPnvE18yIshsv@sA0Vof~?{_COi(34OE4;Jqd z@Zcfz)@!kP2<@e(f;Na%dylQ97eN#0DUgzdB0535c$psJjJx?~LL)u29}Ic3GjHBE z-@JLdf&ci+Fq9FE#bo8+-tMkZ`K;aOP{BL9;&gV!DV0iecEz#nXiZY>#x-Rex|;w* zB16Cl0Ja?kkZ^TsbSNVd8RB+m41ldq?+t)Z$Re3syizr;c{|h3hgnb$Xe=fx7e6PW)lfv*qDC|plcN)p zGT752M<*sPJ?qhlNx72F$dznoxHQXUKKzoHZwEJ!on;7H*VZ%===K32f4KLlD*wsqr*EX^>&R!VxH5}pSqn% zheTqYGwJXk{-R3itxxZbnVDIZmlsJU%T4(v67&2x_`;8aFRY|9641Xs1)OkL4i7(T zAe0~PQm?9%n3|rGu3H2ko6Qgi1OVvoA8ELT?-sajv87z_BE6c@_Q2pc*=(ljxf%0pf=nbCG8yw2{w^jKcDGw--%^LwwegI5-lCr_uF4se;TCg815-cma?Jtw`zsWQpxA(zWynkEB-D3g+M@PQhE4xuL=5kr?-;V(0*KR8xD7r>BbI02W^