fakehumans send boats, improved map

This commit is contained in:
evanpelle
2024-09-08 20:21:39 -07:00
parent 8331047a9b
commit a7ad8790aa
19 changed files with 437 additions and 55 deletions
+8 -2
View File
@@ -1,4 +1,4 @@
import {Cell, Execution, MutableGame, MutablePlayer, Player, PlayerID, PlayerInfo, TerraNullius} from "../Game"
import {Cell, Execution, MutableGame, MutablePlayer, Player, PlayerID, PlayerInfo, PlayerType, TerraNullius} from "../Game"
import {PseudoRandom} from "../PseudoRandom"
import {simpleHash} from "../Util";
import {AttackExecution} from "./AttackExecution";
@@ -59,7 +59,13 @@ export class BotExecution implements Execution {
}
const toAttack = border[this.random.nextInt(0, border.length)]
this.sendAttack(toAttack.owner())
const owner = toAttack.owner()
if (owner.isPlayer() && (owner.type() == PlayerType.FakeHuman || owner.type() == PlayerType.Human)) {
if (this.random.nextInt(0, 1) == 1) {
return
}
}
this.sendAttack(owner)
}
sendAttack(toAttack: Player | TerraNullius) {