From 6f39ee86887f8d1b6abb7eebe4d17652cb06651a Mon Sep 17 00:00:00 2001 From: ScarKy0 <106310278+ScarKy0@users.noreply.github.com> Date: Sat, 8 Mar 2025 21:48:02 +0100 Subject: [PATCH] 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> --- Content.Server/Delivery/CargoDeliveryDataComponent.cs | 2 +- Content.Server/Delivery/DeliverySystem.Spawning.cs | 7 ++++++- .../Prototypes/Entities/Objects/Deliveries/deliveries.yml | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Content.Server/Delivery/CargoDeliveryDataComponent.cs b/Content.Server/Delivery/CargoDeliveryDataComponent.cs index f54da6cea5..3bee0413fc 100644 --- a/Content.Server/Delivery/CargoDeliveryDataComponent.cs +++ b/Content.Server/Delivery/CargoDeliveryDataComponent.cs @@ -32,7 +32,7 @@ public sealed partial class CargoDeliveryDataComponent : Component /// 1 delivery per X players. /// [DataField] - public int PlayerToDeliveryRatio = 7; + public float PlayerToDeliveryRatio = 7f; /// /// The minimum amount of deliveries that will spawn. diff --git a/Content.Server/Delivery/DeliverySystem.Spawning.cs b/Content.Server/Delivery/DeliverySystem.Spawning.cs index 022e67c246..19087e7448 100644 --- a/Content.Server/Delivery/DeliverySystem.Spawning.cs +++ b/Content.Server/Delivery/DeliverySystem.Spawning.cs @@ -59,9 +59,14 @@ public sealed partial class DeliverySystem if (spawners.Count == 0) 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 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) { diff --git a/Resources/Prototypes/Entities/Objects/Deliveries/deliveries.yml b/Resources/Prototypes/Entities/Objects/Deliveries/deliveries.yml index 66828743d0..ffa9a5791a 100644 --- a/Resources/Prototypes/Entities/Objects/Deliveries/deliveries.yml +++ b/Resources/Prototypes/Entities/Objects/Deliveries/deliveries.yml @@ -74,7 +74,7 @@ - type: Item size: Huge - type: Delivery - spesoReward: 1000 + spesoReward: 800 - type: EntityTableContainerFill containers: delivery: !type:NestedSelector @@ -113,7 +113,7 @@ - type: Item storedRotation: 90 - type: Delivery - spesoReward: 500 + spesoReward: 400 - type: EntityTableContainerFill containers: delivery: !type:NestedSelector