From e3f65c894f71e62b38339cf976af4230c923eaee Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 14 Oct 2026 04:37:47 +0200 Subject: [PATCH] Combat measures the gate's planar distance: a test that fails when it measures space The planar-distance mutant survived the first mutation table; no test put a target off the ground plane. Builds: yes. Co-Authored-By: Claude Opus 5.5 --- .../Aetheria.Shared.Tests/FireControlTests.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/Aetheria.Shared.Tests/FireControlTests.cs b/tests/Aetheria.Shared.Tests/FireControlTests.cs index 459332ab4..2f1781d8e 100644 --- a/tests/Aetheria.Shared.Tests/FireControlTests.cs +++ b/tests/Aetheria.Shared.Tests/FireControlTests.cs @@ -369,6 +369,26 @@ public sealed class FireControlTests : IDisposable Assert.Same(weak, shooter.TargetItem.Value); } + // The distance Combat measures is the gate's: planar (FireControl R7). A target 8 above the plane at planar 10 is 12.8 + // away in space, past the Dart's Range of 12, yet the gate and the claim both read 10: the Dart (about 16.7 there against + // Slug's 5) is the chosen claim. Mutation: Combat measures the three-dimensional distance (the Dart then reads 0). + [Fact] + public void TheAIMeasuresTheTargetOnTheGroundPlane() + { + var (shooter, target, zone) = BuildCombatEncounter(float3(0, 8, 10), twoTargetGuns: true); + var strong = target.Equipment.Single(x => x.Data.Name == "Gun"); + var weak = target.Equipment.Single(x => x.Data.Name == "WeakGun"); + + target.Claim(strong, ClaimedDesign("Dart", 100f, range: 12f, effective: 0f)); + target.Claim(weak, ClaimedDesign("Slug", 5f)); + shooter.RecordReveal(target, strong, SignatureChannel.LaunchFlash, target.ClaimOf(strong)); + shooter.RecordReveal(target, weak, SignatureChannel.LaunchFlash, target.ClaimOf(weak)); + zone.Update(1f); + zone.Update(1f); + + Assert.Same(strong, shooter.TargetItem.Value); + } + // The AI settles where its guns do the most damage per second, weighted towards range: with full damage to 500 and none // at 1000 that is the effective range (DF6). Mutation: SampleDps spans from the shortest Range (every sample then reads // 1000, factor 0, and the optimum stays 0), or the factor reads an offset range.