Faction play 1: s1/s2 fix batch (Engaged-first anchor, doctrine pins, follow verb)

Flight anchors a blind member on an Engaged track before a nearer Hailing one and keeps its anchor only while nothing outranks it. Doctrine.cs states the trespass rule as the zone owner's permission. DoctrineCatalog matches the faction by exact name and its comment names the landed Pirates record. VerseGrammarCommand gains the follow verb. Tests pin default and authored standoff, Grace against ComplySpeed, nearest hail, the Identified boundary, off-origin direction and anchor choice and switch, the unseen-member rule across geometry, combat from follow, the doctrine-catalog dry run and the turret's global hit threshold.

Not yet run: this commit's tests have not been built.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-16 20:31:41 +02:00
commit 04516c72cf
6 changed files with 222 additions and 34 deletions

View file

@ -156,9 +156,13 @@ public class Flight
var held = picture.Where(e => _tracks[e].Phase != Phase.None).ToList();
if (held.Count > 0)
{
// An engaged track outranks a hailed one; the held anchor is kept only while nothing outranks it.
var anyEngaged = held.Any(e => _tracks[e].Phase == Phase.Engaged);
var anchor = member.Agent.Task is FollowTask follow && held.Contains(follow.Anchor)
&& (!anyEngaged || _tracks[follow.Anchor].Phase == Phase.Engaged)
? follow.Anchor
: held.OrderBy(e => lengthsq(ship.Position.xz - e.Position.xz)).First();
: held.OrderBy(e => _tracks[e].Phase == Phase.Engaged ? 0 : 1)
.ThenBy(e => lengthsq(ship.Position.xz - e.Position.xz)).First();
if (!(member.Agent.Task is FollowTask current) || current.Anchor != anchor)
member.Agent.Task = new FollowTask { Anchor = anchor, Standoff = Standoff(ship) };
}

View file

@ -15,7 +15,7 @@ public enum EngageOn
Identified,
// Only a hostile that a member holds a hostile IFF override on (a grudge).
Provoked,
// A hostile whose presence this faction's zone does not permit.
// A hostile whose presence the zone's owner does not permit (Entity.PresencePermitted, the security of the zone it is in), whichever flight sees it.
Trespass,
// Never, not even for a grudge.
Never