better troop addition

This commit is contained in:
evanpelle
2024-08-11 17:28:34 -07:00
parent 1070a5171a
commit 14e7cb2ac9
6 changed files with 16 additions and 8 deletions
+9 -1
View File
@@ -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 {
+1 -1
View File
@@ -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))