alliance stops existing attacks

This commit is contained in:
evanpelle
2024-09-19 16:14:04 -07:00
parent 81eab56fc1
commit f2d1eb8e21
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -120,7 +120,7 @@
* break alliance makes you a traitor DONE 9/18/2024
* add traitor icon DONE 9/18/2024
* make alliance icon DONE 9/19/2024
* bots attack traitors
* bots attack traitors DONE 9/19/2024
* BUG: alliance should stop attack
* create event box
* make fake humans easier
+6
View File
@@ -113,6 +113,12 @@ export class AttackExecution implements Execution {
this.breakAlliance = false
this._owner.breakAllianceWith(this.target as Player)
}
if (this.target.isPlayer() && this._owner.alliedWith(this.target)) {
// In this case a new alliance was created AFTER the attack started.
this._owner.addTroops(this.troops)
this.active = false
return
}
let numTilesPerTick = this.mg.config().attackTilesPerTick(this._owner, this.target, this.border.size + this.random.nextInt(0, 5))
// console.log(`num tiles per tick: ${numTilesPerTick}`)