mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 09:40:44 +00:00
can betray traitor without becoming traitor. allied bots less likely to attack traitor than non allied.
This commit is contained in:
@@ -121,6 +121,7 @@
|
||||
* add traitor icon DONE 9/18/2024
|
||||
* make alliance icon DONE 9/19/2024
|
||||
* bots attack traitors
|
||||
* BUG: alliance should stop attack
|
||||
* create event box
|
||||
* make fake humans easier
|
||||
* click alliance sends alliance request
|
||||
|
||||
@@ -50,8 +50,10 @@ export class BotExecution implements Execution {
|
||||
|
||||
const traitors = this.bot.neighbors().filter(n => n.isPlayer() && n.isTraitor()) as Player[]
|
||||
if (traitors.length > 0) {
|
||||
if (this.random.chance(2)) {
|
||||
this.sendAttack(this.random.randElement(traitors))
|
||||
const toAttack = this.random.randElement(traitors)
|
||||
const odds = this.bot.alliedWith(toAttack) ? 6 : 3
|
||||
if (this.random.chance(odds)) {
|
||||
this.sendAttack(toAttack)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +144,9 @@ export class PlayerImpl implements MutablePlayer {
|
||||
if (!this.alliedWith(other)) {
|
||||
throw new Error('cannot break alliance, already allied')
|
||||
}
|
||||
this.isTraitor_ = true
|
||||
if (!other.isTraitor()) {
|
||||
this.isTraitor_ = true
|
||||
}
|
||||
this.gs.breakAlliance(this, other)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user