gameimpl store alliances

This commit is contained in:
evanpelle
2024-09-17 20:30:15 -07:00
parent f3307300ef
commit d4d0be5e37
7 changed files with 69 additions and 24 deletions
@@ -6,7 +6,6 @@ export class AllianceRequestExecution implements Execution {
private requestor: Player;
private recipient: Player
constructor(private requestorID: PlayerID, private recipientID: PlayerID) { }
init(mg: MutableGame, ticks: number): void {
@@ -16,8 +15,7 @@ export class AllianceRequestExecution implements Execution {
}
tick(ticks: number): void {
alert('recied request')
this.mg.createAllianceRequest(this.requestor, this.recipient)
this.active = false
}
+4 -5
View File
@@ -40,6 +40,10 @@ export class BotExecution implements Execution {
return
}
this.bot.incomingAllianceRequests().forEach(ar => {
ar.accept()
})
if (this.neighborsTerraNullius) {
for (const b of this.bot.borderTiles()) {
for (const n of b.neighbors()) {
@@ -66,11 +70,6 @@ export class BotExecution implements Execution {
return
}
}
// if (owner.type() == PlayerType.Human) {
// if (this.random.chance(2)) {
// return
// }
// }
}
this.sendAttack(owner)
}