1
0

TreeBranchesComponent.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using Robust.Shared.Prototypes;
  2. namespace Content.Shared.TreeBranch;
  3. [RegisterComponent]
  4. public sealed partial class TreeBranchesComponent : Component
  5. {
  6. /// <summary>
  7. /// The current number of branches on the tree.
  8. /// </summary>
  9. [DataField("currentBranches")]
  10. public int CurrentBranches = 0;
  11. /// <summary>
  12. /// The maximum number of branches the tree can have.
  13. /// </summary>
  14. [DataField("maxBranches")]
  15. public int MaxBranches = 3;
  16. /// <summary>
  17. /// Time (in seconds) between each branch growth.
  18. /// </summary>
  19. [DataField("growthTime")]
  20. public float GrowthTime = 3600.0f; // 1 hour per branch
  21. /// <summary>
  22. /// Probability of spawning an item when collecting a branch.
  23. /// There is a chance that the collection attempt yields no usable branch.
  24. /// </summary>
  25. [DataField("spawnProbability")]
  26. public float SpawnProbability = 0.8f;
  27. /// <summary>
  28. /// The timestamp of the last branch growth.
  29. /// </summary>
  30. [DataField("lastGrowthTime")]
  31. public TimeSpan LastGrowthTime = TimeSpan.Zero;
  32. /// <summary>
  33. /// The time taken to collect branch from a tree
  34. /// </summary>
  35. [DataField("collectionTime")]
  36. public float CollectionTime { get; set; } = 5.0f;
  37. }