Initial delivery balance changes (#35728)

* init

* small balance

* guess not

* Update Content.Server/Delivery/CargoDeliveryDataComponent.cs

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
ScarKy0
2025-03-08 21:48:02 +01:00
committed by GitHub
parent 4735097385
commit 6f39ee8688
3 changed files with 9 additions and 4 deletions

View File

@@ -32,7 +32,7 @@ public sealed partial class CargoDeliveryDataComponent : Component
/// 1 delivery per X players. /// 1 delivery per X players.
/// </summary> /// </summary>
[DataField] [DataField]
public int PlayerToDeliveryRatio = 7; public float PlayerToDeliveryRatio = 7f;
/// <summary> /// <summary>
/// The minimum amount of deliveries that will spawn. /// The minimum amount of deliveries that will spawn.

View File

@@ -59,9 +59,14 @@ public sealed partial class DeliverySystem
if (spawners.Count == 0) if (spawners.Count == 0)
return; return;
// Skip if there's nobody in crew manifest
if (records.Records.Keys.Count == 0)
return;
// We take the amount of mail calculated based on player amount or the minimum, whichever is higher. // We take the amount of mail calculated based on player amount or the minimum, whichever is higher.
// We don't want stations with less than the player ratio to not get mail at all // We don't want stations with less than the player ratio to not get mail at all
var deliveryCount = Math.Max(records.Records.Keys.Count / ent.Comp.PlayerToDeliveryRatio, ent.Comp.MinimumDeliverySpawn); var initialDeliveryCount = (int)Math.Ceiling(records.Records.Keys.Count / ent.Comp.PlayerToDeliveryRatio);
var deliveryCount = Math.Max(initialDeliveryCount, ent.Comp.MinimumDeliverySpawn);
if (!ent.Comp.DistributeRandomly) if (!ent.Comp.DistributeRandomly)
{ {

View File

@@ -74,7 +74,7 @@
- type: Item - type: Item
size: Huge size: Huge
- type: Delivery - type: Delivery
spesoReward: 1000 spesoReward: 800
- type: EntityTableContainerFill - type: EntityTableContainerFill
containers: containers:
delivery: !type:NestedSelector delivery: !type:NestedSelector
@@ -113,7 +113,7 @@
- type: Item - type: Item
storedRotation: 90 storedRotation: 90
- type: Delivery - type: Delivery
spesoReward: 500 spesoReward: 400
- type: EntityTableContainerFill - type: EntityTableContainerFill
containers: containers:
delivery: !type:NestedSelector delivery: !type:NestedSelector