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 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-30 15:45:32 +02:00
commit 89ef80d298
2 changed files with 35 additions and 0 deletions

View file

@ -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<GearData>(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<HullData> hullFilter = null)
{

View file

@ -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<Thermotoggle>().Any(t => !t.ThermotoggleData.HighPass) && item.Behaviors.OfType<Heat>().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.