From 5eb6425c42e74218b4e00159a65b064f3dede1ab Mon Sep 17 00:00:00 2001
From: IgorAnt028 <118114530+IgorAnt028@users.noreply.github.com>
Date: Wed, 31 Jul 2024 19:09:51 +0300
Subject: [PATCH] A small addition to the documentation (#30506)
* Completion of documentation
Comments have been added to ConditionalSpawnerComponent and RandomSpawnerComponent
* Appear fix
Some fixes with word "appear"
---
.../Components/ConditionalSpawnerComponent.cs | 11 +++++++++++
.../Spawners/Components/RandomSpawnerComponent.cs | 15 +++++++++++++++
2 files changed, 26 insertions(+)
diff --git a/Content.Server/Spawners/Components/ConditionalSpawnerComponent.cs b/Content.Server/Spawners/Components/ConditionalSpawnerComponent.cs
index 1b06367b0d..c6f4871b7e 100644
--- a/Content.Server/Spawners/Components/ConditionalSpawnerComponent.cs
+++ b/Content.Server/Spawners/Components/ConditionalSpawnerComponent.cs
@@ -6,14 +6,25 @@ namespace Content.Server.Spawners.Components
[Virtual]
public partial class ConditionalSpawnerComponent : Component
{
+ ///
+ /// A list of entities, one of which can spawn in after calling Spawn()
+ ///
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public List Prototypes { get; set; } = new();
+ ///
+ /// A list of game rules.
+ /// If at least one of them was launched in the game,
+ /// an attempt will occur to spawn one of the objects in the Prototypes list
+ ///
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public List GameRules = new();
+ ///
+ /// Chance of spawning an entity
+ ///
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public float Chance { get; set; } = 1.0f;
diff --git a/Content.Server/Spawners/Components/RandomSpawnerComponent.cs b/Content.Server/Spawners/Components/RandomSpawnerComponent.cs
index e6a597f365..ec1b3249a9 100644
--- a/Content.Server/Spawners/Components/RandomSpawnerComponent.cs
+++ b/Content.Server/Spawners/Components/RandomSpawnerComponent.cs
@@ -5,18 +5,33 @@ namespace Content.Server.Spawners.Components
[RegisterComponent, EntityCategory("Spawner")]
public sealed partial class RandomSpawnerComponent : ConditionalSpawnerComponent
{
+ ///
+ /// A list of rarer entities that can spawn with the RareChance
+ /// instead of one of the entities in the Prototypes list.
+ ///
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public List RarePrototypes { get; set; } = new();
+ ///
+ /// The chance that a rare prototype may spawn instead of a common prototype
+ ///
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public float RareChance { get; set; } = 0.05f;
+ ///
+ /// Scatter of entity spawn coordinates
+ ///
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public float Offset { get; set; } = 0.2f;
+ ///
+ /// A variable meaning whether the spawn will
+ /// be able to be used again or whether
+ /// it will be destroyed after the first use
+ ///
[DataField]
public bool DeleteSpawnerAfterSpawn = true;
}