mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 10:10:55 +00:00
give fake humans country names, fake humans less likely to betray
This commit is contained in:
@@ -92,7 +92,6 @@ export class ClientGame {
|
||||
|
||||
public start() {
|
||||
this.isActive = true
|
||||
|
||||
this.eventBus.on(PlayerEvent, (e) => this.playerEvent(e))
|
||||
this.eventBus.on(MouseUpEvent, (e) => this.inputEvent(e))
|
||||
|
||||
|
||||
@@ -114,6 +114,9 @@ export class DefaultConfig implements Config {
|
||||
if (playerInfo.playerType == PlayerType.Bot) {
|
||||
return 10000
|
||||
}
|
||||
if (playerInfo.playerType == PlayerType.FakeHuman) {
|
||||
return 50000
|
||||
}
|
||||
return 10000
|
||||
}
|
||||
|
||||
|
||||
@@ -19,16 +19,16 @@ export const devConfig = new class extends DefaultConfig {
|
||||
return 100
|
||||
}
|
||||
|
||||
numBots(): number {
|
||||
return 400
|
||||
}
|
||||
// numBots(): number {
|
||||
// return 1000
|
||||
// }
|
||||
|
||||
// allianceDuration(): Tick {
|
||||
// return 10 * 10
|
||||
// }
|
||||
|
||||
// numFakeHumans(gameID: GameID): number {
|
||||
// return 0
|
||||
// return 50
|
||||
// }
|
||||
|
||||
// startTroops(playerInfo: PlayerInfo): number {
|
||||
|
||||
@@ -106,16 +106,18 @@ export class FakeHumanExecution implements Execution {
|
||||
const toAlly = this.random.randElement(enemies)
|
||||
if (!this.player.isAlliedWith(toAlly)) {
|
||||
this.player.createAllianceRequest(toAlly)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if (this.random.chance(2)) {
|
||||
if (!this.player.isAlliedWith(enemies[0]) || (this.random.chance(90) && this.isTraitor)) {
|
||||
if (!this.player.isAlliedWith(enemies[0]) || (this.random.chance(50) && this.isTraitor)) {
|
||||
this.sendAttack(enemies[0])
|
||||
}
|
||||
} else {
|
||||
if (!this.player.isAlliedWith(enemies[0]) || (this.random.chance(180) && this.isTraitor)) {
|
||||
this.sendAttack(this.random.randElement(enemies))
|
||||
const toAttack = this.random.randElement(enemies)
|
||||
if (!this.player.isAlliedWith(toAttack) || (this.random.chance(100) && this.isTraitor)) {
|
||||
this.sendAttack(toAttack)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -174,6 +176,9 @@ export class FakeHumanExecution implements Execution {
|
||||
if (this.isSmallIsland(dst)) {
|
||||
continue
|
||||
}
|
||||
if (dst.owner().isPlayer() && this.player.isAlliedWith(dst.owner() as Player)) {
|
||||
continue
|
||||
}
|
||||
|
||||
this.mg.addExecution(new BoatAttackExecution(
|
||||
this.player.id(),
|
||||
|
||||
Reference in New Issue
Block a user