dogpile fix

This commit is contained in:
1brucben
2025-05-05 21:27:05 +02:00
parent e3052546c5
commit 82a5f1795c
2 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -200,7 +200,7 @@ export class DefaultConfig implements Config {
return 40;
}
defensePostDefenseBonus(): number {
return 4;
return 5;
}
spawnNPCs(): boolean {
return !this._gameConfig.disableNPCs;
+6 -3
View File
@@ -260,14 +260,15 @@ export class FakeHumanExecution implements Execution {
handleEnemies() {
this.behavior.forgetOldEnemies();
this.behavior.checkIncomingAttacks();
this.behavior.assistAllies();
const sharesBorderWithTN = Array.from(this.player.borderTiles())
.flatMap((t) => this.mg.neighbors(t))
.some((t) => this.mg.isLand(t) && !this.mg.hasOwner(t));
if (sharesBorderWithTN) return;
this.behavior.checkIncomingAttacks();
this.behavior.assistAllies();
let enemy: Player | null = null;
if (
@@ -881,6 +882,8 @@ export class FakeHumanExecution implements Execution {
}
private updateDogpile() {
if (!this.player) return;
if (this.mg.ticks() < 3000) {
this.dogpileTarget = null;
return;
@@ -921,7 +924,7 @@ export class FakeHumanExecution implements Execution {
// Dominant player condition
if (top.numTilesOwned() > second.numTilesOwned() * 2) {
// Enter dogpile with probability (e.g. 30%)
if (this.dogpileTarget !== top && this.random.chance(5)) {
if (this.dogpileTarget !== top && this.random.chance(30)) {
this.dogpileTarget = top;
}
} else {