bots don't attack allies

This commit is contained in:
evanpelle
2024-09-17 21:01:57 -07:00
parent 0ef18a1602
commit 4bab6a5271
4 changed files with 11 additions and 0 deletions
+4
View File
@@ -64,7 +64,11 @@ export class BotExecution implements Execution {
const toAttack = border[this.random.nextInt(0, border.length)]
const owner = toAttack.owner()
if (owner.isPlayer()) {
if (this.bot.alliedWith(owner)) {
return
}
if (owner.type() == PlayerType.FakeHuman) {
if (!this.random.chance(2)) {
return