From 89ef80d298c9df8606156f397538b0cb58d27dd6 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 30 Sep 2026 15:45:32 +0200 Subject: [PATCH] Stations: every generated station carries a heater Operator ruling, 2026-09-30: an idle station has no heat source and cools toward freezing and invisibility, so station generation (LoadoutGenerator, the one owner of station loadouts) equips one heater after the docking bay, from the products whose design is Tool gear with a low-pass Thermotoggle and Heat, the cockpit's thermostat composition. It is required, like the docking bay. Not yet warm: generated stations have no reactor (no reactor product fits Zenith's 16-cell Reactor hardpoint), so the heater's EnergyDraw gets no supply and the station still cools (280 K to ~247 K over ten idle minutes). The test that an idle station stays above freezing waits on that. Co-Authored-By: Claude Opus 5.5 --- .../Scripts/ServerShared/LoadoutGenerator.cs | 18 ++++++++++++++++++ tests/Aetheria.Shared.Tests/RunStartTests.cs | 17 +++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/Assets/Scripts/ServerShared/LoadoutGenerator.cs b/Assets/Scripts/ServerShared/LoadoutGenerator.cs index 044b282df..e78dc9a4f 100644 --- a/Assets/Scripts/ServerShared/LoadoutGenerator.cs +++ b/Assets/Scripts/ServerShared/LoadoutGenerator.cs @@ -92,6 +92,19 @@ public class LoadoutGenerator throw new InvalidLoadoutException("Failed to equip selected docking bay!"); } + // Every station carries a heater (operator, 2026-09-30): an idle station has no other heat source and cools + // toward freezing and invisibility. A heater is general gear whose thermostat runs its heat only below a + // target, the composition a cockpit uses: a low-pass Thermotoggle, then Heat, in its behaviours. + emptyShape = entity.UnoccupiedSpace; + var (heaterProduct, heaterData) = RandomProduct(2, item => IsHeater(item) && item.Shape.FitsWithin(emptyShape, out _, out _), required: true); + if (heaterData == null) throw new InvalidLoadoutException("No compatible heater found for station!"); + + heaterData.Shape.FitsWithin(emptyShape, out var heaterRotation, out var heaterPosition); + var heater = ItemManager.CreateInstance(heaterProduct) as EquippableItem; + heater.Rotation = heaterRotation; + if (!entity.TryEquip(heater, heaterPosition)) + throw new InvalidLoadoutException("Failed to equip selected heater!"); + FillInterior(entity); var cargo = entity.CargoBays.First(); @@ -109,6 +122,11 @@ public class LoadoutGenerator return EntitySerializer.Pack(entity) as OrbitalEntityPack; } + private static bool IsHeater(GearData item) => + item.HardpointType == HardpointType.Tool && + item.Behaviors.Any(b => b is ThermotoggleData { HighPass: false }) && + item.Behaviors.Any(b => b is HeatData); + // Every entity needs a hull, so hulls are always required public (FactionProductData product, HullData design) RandomHull(HullType type, Predicate hullFilter = null) { diff --git a/tests/Aetheria.Shared.Tests/RunStartTests.cs b/tests/Aetheria.Shared.Tests/RunStartTests.cs index a1425b251..fd0356ef9 100644 --- a/tests/Aetheria.Shared.Tests/RunStartTests.cs +++ b/tests/Aetheria.Shared.Tests/RunStartTests.cs @@ -400,6 +400,23 @@ public sealed class RunStartTests : IDisposable Assert.Empty(RunStart.Check(_items, null)); } + // A heater is gear whose thermostat runs its heat only below a target: a low-pass thermotoggle, then heat. + private static bool IsHeater(EquippedItem item) => + item.Behaviors.OfType().Any(t => !t.ThermotoggleData.HighPass) && item.Behaviors.OfType().Any(); + + // Every generated station carries exactly one heater. + [Fact] + public void EveryGeneratedStationCarriesOneHeater() + { + var zone = Arena(null); + var generator = new LoadoutGenerator(ref _items.Random, _items, _galaxy, _galaxy.Entrance, _protagonist, .5f); + for (var i = 0; i < 8; i++) + { + var station = EntitySerializer.Unpack(_items, zone, generator.GenerateStationLoadout()); + Assert.True(station.Equipment.Count(IsHeater) == 1, $"station {i} carries {station.Equipment.Count(IsHeater)} heaters"); + } + } + // Q3, with the operator's 2026-09-30 ruling on the ten product-less designs: a design no product sells is a // scenario test design and nothing else. A test design is one a scenario places: its preset's hull or a slot of // it, or cargo it carries. These are the unsold designs no scenario places, by name.