Merge branch 'v26'

This commit is contained in:
evanpelle
2025-10-23 15:02:46 -07:00
25 changed files with 589 additions and 457 deletions
+4 -1
View File
@@ -17,6 +17,7 @@ import { TileRef, euclDistFN } from "../game/GameMap";
import { PseudoRandom } from "../PseudoRandom";
import { GameID } from "../Schemas";
import { boundingBoxTiles, calculateBoundingBox, simpleHash } from "../Util";
import { AllianceRequestExecution } from "./alliance/AllianceRequestExecution";
import { ConstructionExecution } from "./ConstructionExecution";
import { EmojiExecution } from "./EmojiExecution";
import { structureSpawnTileValue } from "./nation/structureSpawnTileValue";
@@ -221,7 +222,9 @@ export class FakeHumanExecution implements Execution {
if (this.random.chance(20)) {
const toAlly = this.random.randElement(enemies);
if (this.player.canSendAllianceRequest(toAlly)) {
this.player.createAllianceRequest(toAlly);
this.mg.addExecution(
new AllianceRequestExecution(this.player, toAlly.id()),
);
}
}
+1 -1
View File
@@ -118,7 +118,7 @@ export class PlayerExecution implements Execution {
if (main === undefined) throw new Error("No clusters");
this.player.largestClusterBoundingBox = calculateBoundingBox(this.mg, main);
const surroundedBy = this.surroundedBySamePlayer(main);
if (surroundedBy && !this.player.isFriendly(surroundedBy)) {
if (surroundedBy && !surroundedBy.isFriendly(this.player)) {
this.removeCluster(main);
}
+1
View File
@@ -202,6 +202,7 @@ const _structureTypes: ReadonlySet<UnitType> = new Set([
UnitType.SAMLauncher,
UnitType.MissileSilo,
UnitType.Port,
UnitType.Factory,
]);
export function isStructureType(type: UnitType): boolean {