Support Advanced native Homeworld return
Verify and publish checkpoint container / container (push) Successful in 11m10s
Verify and publish checkpoint container / container (push) Successful in 11m10s
This commit is contained in:
1 parent
1cf90f1328
commit
89569e92a1
14 files changed
+429
-39
No files matched your search
+11
-3
@@ -31921,7 +31921,11 @@ function findLegalBattlePlan(
|
||||
for (let source = 0; source < (nativeFee ? nativeSources?.length ?? 0 : 1); source++) {
|
||||
for (const n of numerical) {
|
||||
const candidate: Partial<Plan> = { ...partial, ...n };
|
||||
if (nativeFee) candidate.reinforcementsSources = nativeSources![source];
|
||||
if (nativeFee) {
|
||||
candidate.reinforcementsSources = nativeSources![source];
|
||||
candidate.reinforcementsElite = Object.values(candidate.reinforcementsSources)
|
||||
.reduce((sum, forces) => sum + forces.elite, 0);
|
||||
}
|
||||
if (!accepts(candidate)) continue;
|
||||
try {
|
||||
return validatePlan(g, p, candidate, promises);
|
||||
@@ -31931,6 +31935,7 @@ function findLegalBattlePlan(
|
||||
if (alternateSpecial) {
|
||||
candidate.planetologistSpecial = true;
|
||||
delete candidate.reinforcementsSources;
|
||||
delete candidate.reinforcementsElite;
|
||||
try {
|
||||
return validatePlan(g, p, candidate, promises);
|
||||
} catch (error) {
|
||||
@@ -38416,9 +38421,12 @@ function declareHomeworldShipment(g: Game, p: Player, intent: HomeworldShipmentI
|
||||
} else continueHomeworldShipment(g, shipment);
|
||||
}
|
||||
function homeworldUsesGuildTransport(g: Game,
|
||||
shipment: HomeworldShipmentIntent & {route?: 'arrakis'}): boolean {
|
||||
shipment: HomeworldShipmentIntent & {route?: 'arrakis'; guildTransportEvent?: string}): boolean {
|
||||
// The revised Advanced rules grant World-to-World transport to every
|
||||
// faction. Preserve already-open native Guild permission windows in saves.
|
||||
return getPlayer(g, shipment.player).faction === 'guild' &&
|
||||
(shipment.route === 'arrakis' || shipment.destination === 'homeworld:guild');
|
||||
(shipment.route === 'arrakis' || shipment.destination === 'homeworld:guild' &&
|
||||
(!g.advanced || !!shipment.guildTransportEvent));
|
||||
}
|
||||
function continueHomeworldShipment(g: Game, shipment: PendingHomeworldShipment) {
|
||||
if (!openHomeworldTransportPermission(g, shipment) && !openHomeworldGuildRate(g, shipment))
|
||||
|
||||
Reference in new issue
Block a user