]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Initial delivery balance changes (#35728)
authorScarKy0 <106310278+ScarKy0@users.noreply.github.com>
Sat, 8 Mar 2025 20:48:02 +0000 (21:48 +0100)
committerGitHub <noreply@github.com>
Sat, 8 Mar 2025 20:48:02 +0000 (21:48 +0100)
* 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
Content.Server/Delivery/DeliverySystem.Spawning.cs
Resources/Prototypes/Entities/Objects/Deliveries/deliveries.yml

index f54da6cea528b0533af87494f3ae4754e80559f1..3bee0413fce18092073cdd2a0c4cbb347788cbd8 100644 (file)
@@ -32,7 +32,7 @@ public sealed partial class CargoDeliveryDataComponent : Component
     /// 1 delivery per X players.
     /// </summary>
     [DataField]
-    public int PlayerToDeliveryRatio = 7;
+    public float PlayerToDeliveryRatio = 7f;
 
     /// <summary>
     /// The minimum amount of deliveries that will spawn.
index 022e67c2463231fc3d0707887bada13713191090..19087e74487a77282823dbd64b04f3c73d97ebb3 100644 (file)
@@ -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)
         {
index 66828743d0a19ee5d52bfc8d0fa3873c305de59a..ffa9a5791a11f8f0da130749d7daf696ab41d166 100644 (file)
@@ -74,7 +74,7 @@
   - type: Item
     size: Huge
   - type: Delivery
-    spesoReward: 1000
+    spesoReward: 800
   - type: EntityTableContainerFill
     containers:
       delivery: !type:NestedSelector
   - type: Item
     storedRotation: 90
   - type: Delivery
-    spesoReward: 500
+    spesoReward: 400
   - type: EntityTableContainerFill
     containers:
       delivery: !type:NestedSelector