]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Cherry Pick Round-start Solar Variation (#36825)
authorSouthbridge <7013162+southbridge-fur@users.noreply.github.com>
Tue, 22 Apr 2025 19:46:38 +0000 (15:46 -0400)
committerGitHub <noreply@github.com>
Tue, 22 Apr 2025 19:46:38 +0000 (15:46 -0400)
* 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 <tayrtahn@gmail.com>
* Update Content.Server/GameTicking/Rules/VariationPass/Components/ReplacementMarkers/SolarPanelReplacementMarkerComponent.cs

Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
---------

Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
Content.Server/GameTicking/Rules/VariationPass/Components/ReplacementMarkers/SolarPanelReplacementMarkerComponent.cs [new file with mode: 0644]
Content.Server/GameTicking/Rules/VariationPass/Components/SolarPanelReplaceVariationPassComponent.cs [new file with mode: 0644]
Content.Server/GameTicking/Rules/VariationPass/SolarPanelReplaceVariationPassSystem.cs [new file with mode: 0644]
Resources/Prototypes/Entities/Structures/Power/Generation/solar.yml
Resources/Prototypes/GameRules/roundstart.yml
Resources/Prototypes/GameRules/variation.yml

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 (file)
index 0000000..8e61467
--- /dev/null
@@ -0,0 +1,7 @@
+namespace Content.Server.GameTicking.Rules.VariationPass.Components.ReplacementMarkers;
+
+/// <summary>
+/// This component marks replaceable solar panels for use with fast queries in variation passes.
+/// </summary>
+[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 (file)
index 0000000..54e0703
--- /dev/null
@@ -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 (file)
index 0000000..041ce32
--- /dev/null
@@ -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;
+
+/// <summary>
+/// This handles the ability to replace entities marked with <see cref="SolarPanelReplacementMarkerComponent"/> in a variation pass
+/// </summary>
+public sealed class SolarPanelReplaceVariationPassSystem : BaseEntityReplaceVariationPassSystem<SolarPanelReplacementMarkerComponent, SolarPanelReplaceVariationPassComponent>
+{
+}
index f4bbf9e686e3d94b0f669c7fa7c3b1e41349ca35..97802a869630b76969a6f79ab1f4c2f155b65d27 100644 (file)
   - type: Construction
     graph: SolarPanel
     node: solarpanel
+  - type: SolarPanelReplacementMarker
 
 - type: entity
   id: SolarPanelBroken
index bb855d93aabbc50e5bdcda84cd53fe5009b94e0f..f5730ab00cdaeefb953753bbc696186a370e075a 100644 (file)
       orGroup: puddleMess
     - id: SmugglerStashVariationPass
       prob: 0.90
+    - id: SolarPanelDamageVariationPass
+    - id: SolarPanelEmptyVariationPass
index 093a832d72f81688f8337aeb7388862902895e61..d080965697a00c7b87180d1661ee65798a73f18e 100644 (file)
     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