mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-05 01:26:08 +00:00
dogpile fix
This commit is contained in:
@@ -200,7 +200,7 @@ export class DefaultConfig implements Config {
|
||||
return 40;
|
||||
}
|
||||
defensePostDefenseBonus(): number {
|
||||
return 4;
|
||||
return 5;
|
||||
}
|
||||
spawnNPCs(): boolean {
|
||||
return !this._gameConfig.disableNPCs;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user