DebrisFeaturePlacerControllerComponent.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System.Numerics;
  2. using Content.Server.Worldgen.Prototypes;
  3. using Content.Server.Worldgen.Systems.Debris;
  4. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
  5. namespace Content.Server.Worldgen.Components.Debris;
  6. /// <summary>
  7. /// This is used for controlling the debris feature placer.
  8. /// </summary>
  9. [RegisterComponent]
  10. [Access(typeof(DebrisFeaturePlacerSystem))]
  11. public sealed partial class DebrisFeaturePlacerControllerComponent : Component
  12. {
  13. /// <summary>
  14. /// Whether or not to clip debris that would spawn at a location that has a density of zero.
  15. /// </summary>
  16. [DataField("densityClip")] public bool DensityClip = true;
  17. /// <summary>
  18. /// Whether or not entities are already spawned.
  19. /// </summary>
  20. public bool DoSpawns = true;
  21. [DataField("ownedDebris")] public Dictionary<Vector2, EntityUid?> OwnedDebris = new();
  22. /// <summary>
  23. /// The chance spawning a piece of debris will just be cancelled randomly.
  24. /// </summary>
  25. [DataField("randomCancelChance")] public float RandomCancellationChance = 0.1f;
  26. /// <summary>
  27. /// Radius in which there should be no objects for debris to spawn.
  28. /// </summary>
  29. [DataField("safetyZoneRadius")] public float SafetyZoneRadius = 16.0f;
  30. /// <summary>
  31. /// The noise channel to use as a density controller.
  32. /// </summary>
  33. [DataField("densityNoiseChannel", customTypeSerializer: typeof(PrototypeIdSerializer<NoiseChannelPrototype>))]
  34. public string DensityNoiseChannel { get; private set; } = default!;
  35. }