LockOn patrols orbit 3 by index; the probe file is dropped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5f1fa7d63b
commit
f0cb87277b
4 changed files with 15 additions and 47 deletions
|
|
@ -309,11 +309,14 @@ public sealed partial class RunStartTests
|
|||
}
|
||||
CultRecordKey[] Circuit(Zone arena) => ((PatrolOrbitsTask) Assert.Single(arena.Agents).Task).Circuit;
|
||||
|
||||
// The orbit keys are fresh per galaxy, so a circuit is compared by the place of each orbit among its zone's.
|
||||
int[] Places(Zone arena) => Circuit(arena).Select(key => arena.Orbits.Keys.ToList().IndexOf(key)).ToArray();
|
||||
|
||||
var plain = Arena(0);
|
||||
var disturbed = Arena(3);
|
||||
Assert.True(plain.Orbits.Count > 4, "the zone has orbits to choose a circuit among");
|
||||
Assert.Equal(4, Circuit(plain).Length);
|
||||
Assert.Equal(Circuit(plain), Circuit(disturbed));
|
||||
Assert.Equal(4, Places(plain).Length);
|
||||
Assert.Equal(Places(plain), Places(disturbed));
|
||||
}
|
||||
|
||||
// A fit that states its quality mints every lot it builds at it, assembly and role fills alike; the same fit without one
|
||||
|
|
|
|||
|
|
@ -1,37 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Xunit;
|
||||
using static CultMath.math;
|
||||
|
||||
public sealed partial class RunStartTests
|
||||
{
|
||||
[Fact]
|
||||
public void ZProbeLockOn()
|
||||
{
|
||||
var log = new List<string>();
|
||||
for (var which = -1; which < 13; which++)
|
||||
{
|
||||
var (_, arena, staged, failures) = Launch(new LockOn(), Inputs(() => GalaxySeed));
|
||||
var player = staged.Player;
|
||||
var hostile = staged.Entities.Single();
|
||||
var keys = arena.Orbits.Keys.ToList();
|
||||
var agent = arena.Agents.Single();
|
||||
var task = (PatrolOrbitsTask) agent.Task;
|
||||
if (which < 0)
|
||||
foreach (var b in arena.PlanetInstances)
|
||||
log.Add($"PROBE body {arena.Planets[b.Key].Name} orbit idx {keys.IndexOf(b.Value.Orbit.Data == null ? default : keys.First(k => ReferenceEquals(arena.Orbits[k], b.Value.Orbit)))}");
|
||||
else task.Circuit = new[] { keys[which] };
|
||||
var minD = 1e9f;
|
||||
var lockedAt = -1;
|
||||
for (var tick = 0; tick < 600 && lockedAt < 0; tick++)
|
||||
{
|
||||
arena.Update(.1f);
|
||||
minD = min(minD, length(hostile.Position.xz - player.Position.xz));
|
||||
if (player.IncomingPaints.Any(p => p.Mode == PaintMode.Track)) lockedAt = tick;
|
||||
}
|
||||
log.Add($"PROBE only-orbit {which} start={arena.Orbits[keys[Math.Max(which, 0)]].Position} locked={lockedAt} minD={minD}");
|
||||
}
|
||||
Assert.Fail(string.Join(Environment.NewLine, log));
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue