mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 15:10:43 +00:00
alliance stops existing attacks
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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}`)
|
||||
|
||||
Reference in New Issue
Block a user