From caab9f5ad2581327c2a8d6a928c9be0f81e4c272 Mon Sep 17 00:00:00 2001 From: soul Date: Sun, 29 Nov 2026 09:13:46 +0100 Subject: [PATCH] ExtractionTests: a rig's call pays only the named ore, the player's both --- tests/Aetheria.Shared.Tests/ExtractionTests.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/Aetheria.Shared.Tests/ExtractionTests.cs b/tests/Aetheria.Shared.Tests/ExtractionTests.cs index c4e831160..96699c0b5 100644 --- a/tests/Aetheria.Shared.Tests/ExtractionTests.cs +++ b/tests/Aetheria.Shared.Tests/ExtractionTests.cs @@ -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()