mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 10:00:44 +00:00
updated balance
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1>OpenFront.io</h1>
|
||||
<h2>(v0.3.8)</h2>
|
||||
<h2>(v0.3.10)</h2>
|
||||
<div id="username-container">
|
||||
<input type="text" id="username" placeholder="Enter your username">
|
||||
</div>
|
||||
|
||||
@@ -20,7 +20,7 @@ export class DefaultConfig implements Config {
|
||||
return 400
|
||||
}
|
||||
numFakeHumans(gameID: GameID): number {
|
||||
return simpleHash(gameID) % 5
|
||||
return simpleHash(gameID) % 20
|
||||
}
|
||||
turnIntervalMs(): number {
|
||||
return 100
|
||||
@@ -53,10 +53,10 @@ export class DefaultConfig implements Config {
|
||||
speed = mag
|
||||
|
||||
if (attacker.isPlayer() && defender.isPlayer()) {
|
||||
if (attacker.type() == PlayerType.Bot && defender.type() == PlayerType.FakeHuman) {
|
||||
if (attacker.type() == PlayerType.Bot && (defender.type() == PlayerType.FakeHuman || defender.type() == PlayerType.Human)) {
|
||||
mag *= 1.2
|
||||
}
|
||||
if (attacker.type() == PlayerType.FakeHuman && defender.type() == PlayerType.Bot) {
|
||||
if ((attacker.type() == PlayerType.FakeHuman || attacker.type() == PlayerType.Human) && defender.type() == PlayerType.Bot) {
|
||||
mag *= .8
|
||||
}
|
||||
}
|
||||
@@ -118,10 +118,10 @@ export class DefaultConfig implements Config {
|
||||
// console.log(`to add ${toAdd}`)
|
||||
|
||||
if (player.type() == PlayerType.FakeHuman) {
|
||||
toAdd *= 1.1
|
||||
toAdd *= 1.0
|
||||
}
|
||||
if (player.type() == PlayerType.Bot) {
|
||||
toAdd *= .8
|
||||
toAdd *= .7
|
||||
}
|
||||
|
||||
return Math.min(player.troops() + toAdd, max)
|
||||
|
||||
@@ -17,6 +17,7 @@ export const devConfig = new class extends DefaultConfig {
|
||||
numBots(): number {
|
||||
return 400
|
||||
}
|
||||
|
||||
|
||||
// numFakeHumans(gameID: GameID): number {
|
||||
// return 10
|
||||
|
||||
@@ -62,7 +62,7 @@ export class BotExecution implements Execution {
|
||||
const owner = toAttack.owner()
|
||||
if (owner.isPlayer()) {
|
||||
if (owner.type() == PlayerType.FakeHuman) {
|
||||
if (!this.random.chance(4)) {
|
||||
if (!this.random.chance(2)) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user