mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 10:32:41 +00:00
make bots receive half troops, update version
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<h1>OpenFront.io</h1>
|
<h1>OpenFront.io</h1>
|
||||||
<h2>(v0.2.0)</h2>
|
<h2>(v0.3.0)</h2>
|
||||||
<div id="username-container">
|
<div id="username-container">
|
||||||
<input type="text" id="username" placeholder="Enter your username">
|
<input type="text" id="username" placeholder="Enter your username">
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export class DefaultConfig implements Config {
|
|||||||
return 100
|
return 100
|
||||||
}
|
}
|
||||||
numBots(): number {
|
numBots(): number {
|
||||||
return 350
|
return 400
|
||||||
}
|
}
|
||||||
turnIntervalMs(): number {
|
turnIntervalMs(): number {
|
||||||
return 100
|
return 100
|
||||||
@@ -39,14 +39,14 @@ export class DefaultConfig implements Config {
|
|||||||
mag = 15
|
mag = 15
|
||||||
break
|
break
|
||||||
case TerrainType.Mountain:
|
case TerrainType.Mountain:
|
||||||
mag = 50
|
mag = 40
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
if (defender.isPlayer()) {
|
if (defender.isPlayer()) {
|
||||||
return {
|
return {
|
||||||
attackerTroopLoss: within(defender.troops() / attacker.troops() * mag, 1, 1000),
|
attackerTroopLoss: within(defender.troops() / attacker.troops() * mag, 1, 1000),
|
||||||
defenderTroopLoss: within(attacker.troops() / defender.troops(), 1, 1000),
|
defenderTroopLoss: within(attacker.troops() / defender.troops(), 1, 1000),
|
||||||
tilesPerTickUsed: mag + 1
|
tilesPerTickUsed: within(attacker.numTilesOwned() / defender.numTilesOwned(), 1, 5) * mag
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
@@ -94,6 +94,10 @@ export class DefaultConfig implements Config {
|
|||||||
toAdd *= ratio
|
toAdd *= ratio
|
||||||
// console.log(`to add ${toAdd}`)
|
// console.log(`to add ${toAdd}`)
|
||||||
|
|
||||||
|
if (player.type() == PlayerType.Bot) {
|
||||||
|
toAdd *= .5
|
||||||
|
}
|
||||||
|
|
||||||
return Math.min(player.troops() + toAdd, max)
|
return Math.min(player.troops() + toAdd, max)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user