From 1e794a30d08d136dc8633f46dd528d6660b94a19 Mon Sep 17 00:00:00 2001 From: Southbridge <7013162+southbridge-fur@users.noreply.github.com> Date: Tue, 22 Apr 2025 15:46:38 -0400 Subject: [PATCH] Cherry Pick Round-start Solar Variation (#36825) * Roundstart Variation for Solar Panels (#86) * Added roundstart variation for solar panels * Removed HV cable spawner since i don't want to bother with mapping them * Solar Panel Variation Pass Fix (#96) Added a second variation pass for regular solar assemblies, since otherwise they would spawn both it and the broken variety * Reorganized everything to no longer be in the _Moffstation subdirectory * Removed a forgotten tag for Moffstation * Removed the moffstation namespace settings * Update Content.Server/GameTicking/Rules/VariationPass/Components/SolarPanelReplaceVariationPassComponent.cs Co-authored-by: Tayrtahn * Update Content.Server/GameTicking/Rules/VariationPass/Components/ReplacementMarkers/SolarPanelReplacementMarkerComponent.cs Co-authored-by: Tayrtahn --------- Co-authored-by: Tayrtahn --- .../SolarPanelReplacementMarkerComponent.cs | 7 ++++++ ...SolarPanelReplaceVariationPassComponent.cs | 5 +++++ .../SolarPanelReplaceVariationPassSystem.cs | 11 ++++++++++ .../Structures/Power/Generation/solar.yml | 1 + Resources/Prototypes/GameRules/roundstart.yml | 2 ++ Resources/Prototypes/GameRules/variation.yml | 22 +++++++++++++++++++ 6 files changed, 48 insertions(+) create mode 100644 Content.Server/GameTicking/Rules/VariationPass/Components/ReplacementMarkers/SolarPanelReplacementMarkerComponent.cs create mode 100644 Content.Server/GameTicking/Rules/VariationPass/Components/SolarPanelReplaceVariationPassComponent.cs create mode 100644 Content.Server/GameTicking/Rules/VariationPass/SolarPanelReplaceVariationPassSystem.cs diff --git a/Content.Server/GameTicking/Rules/VariationPass/Components/ReplacementMarkers/SolarPanelReplacementMarkerComponent.cs b/Content.Server/GameTicking/Rules/VariationPass/Components/ReplacementMarkers/SolarPanelReplacementMarkerComponent.cs new file mode 100644 index 0000000000..8e6146765d --- /dev/null +++ b/Content.Server/GameTicking/Rules/VariationPass/Components/ReplacementMarkers/SolarPanelReplacementMarkerComponent.cs @@ -0,0 +1,7 @@ +namespace Content.Server.GameTicking.Rules.VariationPass.Components.ReplacementMarkers; + +/// +/// This component marks replaceable solar panels for use with fast queries in variation passes. +/// +[RegisterComponent] +public sealed partial class SolarPanelReplacementMarkerComponent : Component; diff --git a/Content.Server/GameTicking/Rules/VariationPass/Components/SolarPanelReplaceVariationPassComponent.cs b/Content.Server/GameTicking/Rules/VariationPass/Components/SolarPanelReplaceVariationPassComponent.cs new file mode 100644 index 0000000000..54e07037e3 --- /dev/null +++ b/Content.Server/GameTicking/Rules/VariationPass/Components/SolarPanelReplaceVariationPassComponent.cs @@ -0,0 +1,5 @@ +namespace Content.Server.GameTicking.Rules.VariationPass.Components; + + +[RegisterComponent] +public sealed partial class SolarPanelReplaceVariationPassComponent : Component; diff --git a/Content.Server/GameTicking/Rules/VariationPass/SolarPanelReplaceVariationPassSystem.cs b/Content.Server/GameTicking/Rules/VariationPass/SolarPanelReplaceVariationPassSystem.cs new file mode 100644 index 0000000000..041ce32726 --- /dev/null +++ b/Content.Server/GameTicking/Rules/VariationPass/SolarPanelReplaceVariationPassSystem.cs @@ -0,0 +1,11 @@ +using Content.Server.GameTicking.Rules.VariationPass.Components; +using Content.Server.GameTicking.Rules.VariationPass.Components.ReplacementMarkers; + +namespace Content.Server.GameTicking.Rules.VariationPass; + +/// +/// This handles the ability to replace entities marked with in a variation pass +/// +public sealed class SolarPanelReplaceVariationPassSystem : BaseEntityReplaceVariationPassSystem +{ +} diff --git a/Resources/Prototypes/Entities/Structures/Power/Generation/solar.yml b/Resources/Prototypes/Entities/Structures/Power/Generation/solar.yml index f4bbf9e686..97802a8696 100644 --- a/Resources/Prototypes/Entities/Structures/Power/Generation/solar.yml +++ b/Resources/Prototypes/Entities/Structures/Power/Generation/solar.yml @@ -151,6 +151,7 @@ - type: Construction graph: SolarPanel node: solarpanel + - type: SolarPanelReplacementMarker - type: entity id: SolarPanelBroken diff --git a/Resources/Prototypes/GameRules/roundstart.yml b/Resources/Prototypes/GameRules/roundstart.yml index bb855d93aa..f5730ab00c 100644 --- a/Resources/Prototypes/GameRules/roundstart.yml +++ b/Resources/Prototypes/GameRules/roundstart.yml @@ -447,3 +447,5 @@ orGroup: puddleMess - id: SmugglerStashVariationPass prob: 0.90 + - id: SolarPanelDamageVariationPass + - id: SolarPanelEmptyVariationPass diff --git a/Resources/Prototypes/GameRules/variation.yml b/Resources/Prototypes/GameRules/variation.yml index 093a832d72..d080965697 100644 --- a/Resources/Prototypes/GameRules/variation.yml +++ b/Resources/Prototypes/GameRules/variation.yml @@ -123,3 +123,25 @@ blacklist: components: - ParticleAcceleratorControlBox + +- type: entity + id: SolarPanelDamageVariationPass + parent: BaseVariationPass + components: + - type: SolarPanelReplaceVariationPass + - type: EntityReplaceVariationPass + entitiesPerReplacementAverage: 30 + entitiesPerReplacementStdDev: 5 + replacements: + - id: SolarPanelBroken + +- type: entity + id: SolarPanelEmptyVariationPass + parent: BaseVariationPass + components: + - type: SolarPanelReplaceVariationPass + - type: EntityReplaceVariationPass + entitiesPerReplacementAverage: 30 + entitiesPerReplacementStdDev: 5 + replacements: + - id: SolarAssembly