mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-16 17:12:41 +00:00
* deleted old maps
* fixed bug where NPC and Bots had same id * NPCs spawn near IRL location * NPCs have different strength (starting troops) * game has more NPCs than before * Needs more balancing
This commit is contained in:
@@ -26,7 +26,8 @@ export class Executor {
|
||||
private random: PseudoRandom = null
|
||||
|
||||
constructor(private gs: Game, private gameID: GameID) {
|
||||
this.random = new PseudoRandom(simpleHash(gameID))
|
||||
// Add one to avoid id collisions with bots.
|
||||
this.random = new PseudoRandom(simpleHash(gameID) + 1)
|
||||
}
|
||||
|
||||
createExecs(turn: Turn): Execution[] {
|
||||
@@ -86,15 +87,17 @@ export class Executor {
|
||||
|
||||
fakeHumanExecutions(numFakes: number): Execution[] {
|
||||
const execs = []
|
||||
for (let i = 0; i < numFakes; i++) {
|
||||
execs.push(
|
||||
new FakeHumanExecution(new PlayerInfo(
|
||||
this.usernames[this.random.nextInt(0, this.usernames.length)],
|
||||
for (const nation of this.gs.nations()) {
|
||||
execs.push(new FakeHumanExecution(
|
||||
new PlayerInfo(
|
||||
nation.name,
|
||||
PlayerType.FakeHuman,
|
||||
null,
|
||||
this.random.nextID()
|
||||
))
|
||||
)
|
||||
),
|
||||
nation.cell,
|
||||
nation.strength
|
||||
))
|
||||
}
|
||||
return execs
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user