mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-19 08:14:59 +00:00
better troop addition
This commit is contained in:
@@ -12,7 +12,15 @@ export class PlayerExecution implements Execution {
|
||||
}
|
||||
|
||||
tick(ticks: number) {
|
||||
this.player.addTroops(Math.sqrt(this.player.numTilesOwned() * this.player.troops() + 1000) / 1000)
|
||||
let toAdd = Math.sqrt(this.player.numTilesOwned() * this.player.troops()) / 5
|
||||
|
||||
const max = Math.sqrt(this.player.numTilesOwned()) * 100 + 1000
|
||||
const ratio = 1 - this.player.troops() / max
|
||||
toAdd *= ratio * ratio * ratio
|
||||
this.player.addTroops(
|
||||
Math.max(2, toAdd)
|
||||
);
|
||||
this.player.setTroops(Math.min(this.player.troops(), max))
|
||||
}
|
||||
|
||||
owner(): MutablePlayer {
|
||||
|
||||
@@ -22,7 +22,7 @@ export class SpawnExecution implements Execution {
|
||||
if (!this.isActive()) {
|
||||
return
|
||||
}
|
||||
const player = this.gs.addPlayer(this.playerInfo)
|
||||
const player = this.gs.addPlayer(this.playerInfo, 1000)
|
||||
getSpawnCells(this.gs, this.cell).forEach(c => {
|
||||
console.log('conquering cell')
|
||||
player.conquer(this.gs.tile(c))
|
||||
|
||||
Reference in New Issue
Block a user