Support paid No-Field companions in Basic allied transit
Verify and publish checkpoint container / container (push) Successful in 10m34s

This commit is contained in:
Quintine committed 2026-10-28 22:49:42 +11:00
1 parent 8083598cef
commit 40d567a053
7 files changed
+270 -9

No files matched your search

+25 -2
View File
@@ -3548,6 +3548,8 @@ function policyActions(g: GameView): Action[] {
const physicalAlongsideMarker = marker
? countAt(me, marker.location.territory) > 0
: !!(deployedWorld && g.homeworlds?.worlds?.find(world => world.id === deployedWorld)?.forces[me.id]);
const visitingMarker = !!marker && !!g.basicAlliedShipment?.noField &&
territory(marker.location.territory).name === g.basicAlliedShipment.territory;
const reveal =
noField?.canReveal &&
deployed &&
@@ -3555,7 +3557,7 @@ function policyActions(g: GameView): Action[] {
? { type: 'revealNoField', token: deployed.tokenId, event: noField.event }
: null;
if (
reveal &&
reveal && !visitingMarker &&
(physicalAlongsideMarker ||
!me.shipped ||
(me.moved ?? 0) >= (me.movesAllowed ?? 1))
@@ -3602,7 +3604,7 @@ function policyActions(g: GameView): Action[] {
const smuggler = !!quoteSmugglerNoField(g, me.id, to.t);
const companions = noField.homeworldForcesEnabled && me.reserves > (smuggler ? 1 : 0) ? [1, 0] : [0];
for (const amount of companions) {
if ((amount > 0 || smuggler) && isAlliedShipmentVisit(g, me, to.t)) continue;
if (smuggler && isAlliedShipmentVisit(g, me, to.t)) continue;
const group = quoteRicheseHomeworldForces({ enabled: !!noField.homeworldForcesEnabled,
reserves: me.reserves, amount, smuggler });
if (Math.min(selected.value, me.reserves) + group.physical === 0 && to.enemy > 0) continue;
@@ -3629,6 +3631,20 @@ function policyActions(g: GameView): Action[] {
const ordinary = botGroundMoveAllowed(g, me, from, to.key, 0);
if (!ordinary && !(markerPlanetologist &&
botGroundMoveAllowed(g, me, from, to.key, 0, 'range'))) continue;
if (visitingMarker && g.basicAlliedShipment && g.basicAlliedShipment.normal > 0) {
let remaining = g.basicAlliedShipment.normal;
const forces: Record<string, number> = {};
for (const [key, total] of Object.entries(me.forces)) {
if (splitLocation(key).territory !== marker.location.territory ||
!botGroundMoveAllowed(g, me, key, to.key, 0, ordinary ? undefined : 'range')) continue;
const normal = total - (me.elites?.forces[key] ?? 0);
const count = Math.min(remaining, normal);
if (count > 0) { forces[key] = count; remaining -= count; }
}
if (!remaining) actions.push({ type: 'move', ...(!ordinary ? {planetologist: 'range'} : {}),
forces, noField: marker.tokenId,
event: noField.event, territory: to.t, sector: to.s });
}
actions.push({
type: 'move',
...(!ordinary ? { planetologist: 'range' } : {}),
@@ -4517,6 +4533,13 @@ export function botActions(g: GameView): Action[] {
(territory(splitLocation(action.from).territory).name === g.basicAlliedShipment?.territory ||
advancedDepartures?.includes(territory(splitLocation(action.from).territory).name)) ||
!!action.noField && !!g.basicAlliedShipment?.noField && markerTerritory === g.basicAlliedShipment.territory));
if (g.basicAlliedShipment?.noField && g.basicAlliedShipment.normal > 0) {
const together = departures.filter(action => action.noField && action.forces &&
typeof action.forces === 'object' && !Array.isArray(action.forces) &&
Object.values(action.forces).reduce<number>((sum, value) => sum + (typeof value === 'number' ? value : 0), 0) >=
g.basicAlliedShipment!.normal);
if (together.length) return together;
}
if (departures.length) return departures;
}
const ghola = standaloneGholaAction(g, actions);