ExtractionTests: a rig's call pays only the named ore, the player's both

This commit is contained in:
soul 2026-11-29 09:13:46 +01:00
commit caab9f5ad2

View file

@ -386,6 +386,21 @@ public sealed class ExtractionTests : IDisposable
Assert.True(silo.Count(_oreA) == shareA || silo.Count(_oreB) == shareB, $"A {silo.Count(_oreA)} of {shareA}, B {silo.Count(_oreB)} of {shareB}");
}
// A rock of a belt that holds two ores pays only the one a rig names, and the player's own call (no `only`) still pays both.
[Fact]
public void ExtractPaysTheNamedOreOnly()
{
var world = Build("Extraction Rig", new[] { 4 });
var hitpoints = world.Zone.Settings.AsteroidHitpoints.Evaluate(.5f);
var rock = new ChunkId(world.Belts[0], 0);
FireControl.Extract(world.Zone, rock, hitpoints * .99f, world.Station, SimulationDice.For(world.Zone.DropSeed, SimulationDice.RigStream, 1), _oreB);
Assert.True(world.Hold.Held(_oreB) > 0, "the named ore is paid");
Assert.Equal(0, world.Hold.Held(_oreA));
foreach (var index in new[] { 1, 2, 3 })
FireControl.Extract(world.Zone, new ChunkId(world.Belts[0], index), hitpoints * .99f, world.Station, SimulationDice.For(world.Zone.DropSeed, SimulationDice.RigStream, (uint) index));
Assert.True(world.Hold.Held(_oreA) > 0, "the player's call pays the rock's own mix");
}
// A design that lists ore and volatiles: on screen the ore goes by the rocks and the volatile by its recipe, never the ore by the pick.
[Fact]
public void MixedListSplitsOnScreen()