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:
Meta Vens 2026-10-17 21:38:50 +02:00
commit f0cb87277b
4 changed files with 15 additions and 47 deletions

View file

@ -136,16 +136,15 @@ public sealed class ScenarioStage
return entity;
}
// The patrol order a piloted entity starts on: the one orbit that sits nearest `near` when the stage opens. A check
// that rests on where a pilot goes states it here, so the pilot's circuit is not a draw. An entity that is not
// piloted or not placed is a failure.
public void Patrol(Entity entity, float2 near)
// The patrol order a piloted entity starts on: the one orbit at this index of the arena's orbits, which a galaxy seed
// fixes. A check that rests on where a pilot goes states it here, so the pilot's circuit is not a draw. An entity that
// is not placed and piloted, or an index past the orbits, is a failure.
public void Patrol(Entity entity, int orbit)
{
var placement = _placed.FirstOrDefault(p => ReferenceEquals(p.Entity, entity));
if (placement == null || !placement.Piloted) { _failures.Add($"patrol: {entity?.Name ?? "no entity"} is not a placed, piloted ship"); return; }
var orbit = Arena.Orbits.Keys.OrderBy(key => lengthsq(Arena.GetOrbitPosition(key) - near)).Cast<CultRecordKey?>().FirstOrDefault();
if (orbit == null) { _failures.Add("patrol: the arena has no orbit to patrol"); return; }
placement.Circuit = new[] { orbit.Value };
if (orbit < 0 || orbit >= Arena.Orbits.Count) { _failures.Add($"patrol: the arena has no orbit {orbit} (it has {Arena.Orbits.Count})"); return; }
placement.Circuit = new[] { Arena.Orbits.Keys.ElementAt(orbit) };
}
// Items in the entity's first cargo bay, one per name. A name is an equippable or consumable design (open: the stage

View file

@ -21,6 +21,9 @@ public sealed class LockOn : Scenario
// The fit's lots are minted at this quality, and the hostile's patrol order is stated, so the lock follows from the
// staged situation and not from item draws or the pilot's drawn circuit (ruling scenario-stages-hostile-task).
const float StagedQuality = .6f;
// The orbit it patrols: the fourth of the arena's, which carries the hostile across the player's lock envelope (lock
// at about 35 s, closest 880 m; the other twelve, patrolled alone, do not lock it in 600 ticks).
const int PatrolOrbit = 3;
public override Galaxy Generate(GalaxyStage stage) => stage.Prelude(DemoTerminus.Cast);
@ -46,6 +49,6 @@ public sealed class LockOn : Scenario
stage.Player(fighter, float2(0, 0), facing: float2(0, 1));
var hostile = stage.Place(fighter, HostileAt, facing: normalize(-HostileAt), stance: ScenarioStance.Hostile, piloted: true);
stage.Patrol(hostile, float2(0, 0)); // it patrols the orbit by the player, which brings it into lock range
stage.Patrol(hostile, PatrolOrbit);
}
}