Clean up YAML issues in animals.yml (#26696)

* Cleaned up YAML issues in animals.yml

* Cleaned up TimedSpawnerComponent
This commit is contained in:
Tayrtahn
2024-04-04 02:26:21 -04:00
committed by GitHub
parent b709e24d87
commit 1e43980482
2 changed files with 49 additions and 37 deletions

View File

@@ -1,33 +1,48 @@
using System.Threading; using System.Threading;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Server.Spawners.Components namespace Content.Server.Spawners.Components;
/// <summary>
/// Spawns entities at a set interval.
/// Can configure the set of entities, spawn timing, spawn chance,
/// and min/max number of entities to spawn.
/// </summary>
[RegisterComponent]
public sealed partial class TimedSpawnerComponent : Component, ISerializationHooks
{ {
[RegisterComponent] /// <summary>
public sealed partial class TimedSpawnerComponent : Component, ISerializationHooks /// List of entities that can be spawned by this component. One will be randomly
{ /// chosen for each entity spawned. When multiple entities are spawned at once,
[ViewVariables(VVAccess.ReadWrite)] /// each will be randomly chosen separately.
[DataField("prototypes", customTypeSerializer:typeof(PrototypeIdListSerializer<EntityPrototype>))] /// </summary>
public List<string> Prototypes { get; set; } = new(); [DataField]
public List<EntProtoId> Prototypes = [];
[ViewVariables(VVAccess.ReadWrite)] /// <summary>
[DataField("chance")] /// Chance of an entity being spawned at the end of each interval.
public float Chance { get; set; } = 1.0f; /// </summary>
[DataField]
public float Chance = 1.0f;
[ViewVariables(VVAccess.ReadWrite)] /// <summary>
[DataField("intervalSeconds")] /// Length of the interval between spawn attempts.
public int IntervalSeconds { get; set; } = 60; /// </summary>
[DataField]
public int IntervalSeconds = 60;
[ViewVariables(VVAccess.ReadWrite)] /// <summary>
[DataField("MinimumEntitiesSpawned")] /// The minimum number of entities that can be spawned when an interval elapses.
public int MinimumEntitiesSpawned { get; set; } = 1; /// </summary>
[DataField]
public int MinimumEntitiesSpawned = 1;
[ViewVariables(VVAccess.ReadWrite)] /// <summary>
[DataField("MaximumEntitiesSpawned")] /// The maximum number of entities that can be spawned when an interval elapses.
public int MaximumEntitiesSpawned { get; set; } = 1; /// </summary>
[DataField]
public int MaximumEntitiesSpawned = 1;
public CancellationTokenSource? TokenSource; public CancellationTokenSource? TokenSource;
@@ -36,5 +51,4 @@ namespace Content.Server.Spawners.Components
if (MinimumEntitiesSpawned > MaximumEntitiesSpawned) if (MinimumEntitiesSpawned > MaximumEntitiesSpawned)
throw new ArgumentException("MaximumEntitiesSpawned can't be lower than MinimumEntitiesSpawned!"); throw new ArgumentException("MaximumEntitiesSpawned can't be lower than MinimumEntitiesSpawned!");
} }
}
} }

View File

@@ -415,7 +415,6 @@
makeSentient: true makeSentient: true
allowSpeech: true allowSpeech: true
allowMovement: true allowMovement: true
whitelistRequired: false
name: ghost-role-information-mothroach-name name: ghost-role-information-mothroach-name
description: ghost-role-information-mothroach-description description: ghost-role-information-mothroach-description
- type: Fixtures - type: Fixtures
@@ -744,9 +743,8 @@
Quantity: 30 Quantity: 30
- type: Udder - type: Udder
reagentId: Milk reagentId: Milk
targetSolution: udder quantityPerUpdate: 25
quantity: 25 growthDelay: 30
updateRate: 30
- type: Butcherable - type: Butcherable
spawned: spawned:
- id: FoodMeat - id: FoodMeat
@@ -3057,7 +3055,7 @@
- type: Bloodstream - type: Bloodstream
bloodMaxVolume: 60 bloodMaxVolume: 60
- type: CanEscapeInventory - type: CanEscapeInventory
BaseResistTime: 3 baseResistTime: 3
- type: MobPrice - type: MobPrice
price: 60 price: 60
- type: NonSpreaderZombie - type: NonSpreaderZombie