mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-18 09:14:09 +00:00
adjust further
This commit is contained in:
@@ -682,7 +682,7 @@ export class DefaultConfig implements Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
troopAdjustmentRate(player: Player): number {
|
troopAdjustmentRate(player: Player): number {
|
||||||
const maxDiff = this.maxPopulation(player) / 500;
|
const maxDiff = player.population() / 300;
|
||||||
const target = player.population() * player.targetTroopRatio();
|
const target = player.population() * player.targetTroopRatio();
|
||||||
const diff = target - player.troops();
|
const diff = target - player.troops();
|
||||||
if (Math.abs(diff) < maxDiff) {
|
if (Math.abs(diff) < maxDiff) {
|
||||||
|
|||||||
@@ -77,10 +77,10 @@ export class PlayerExecution implements Execution {
|
|||||||
|
|
||||||
const popInc = this.config.populationIncreaseRate(this.player);
|
const popInc = this.config.populationIncreaseRate(this.player);
|
||||||
this.player.addWorkers(
|
this.player.addWorkers(
|
||||||
(popInc * this.player.workers()) / this.player.totalPopulation(),
|
(popInc * this.player.workers()) / this.player.population(),
|
||||||
);
|
);
|
||||||
this.player.addTroops(
|
this.player.addTroops(
|
||||||
popInc * (1 - this.player.workers() / this.player.totalPopulation()),
|
popInc * (1 - this.player.workers() / this.player.population()),
|
||||||
);
|
);
|
||||||
const goldFromWorkers = this.config.goldAdditionRate(this.player);
|
const goldFromWorkers = this.config.goldAdditionRate(this.player);
|
||||||
this.player.addGold(goldFromWorkers);
|
this.player.addGold(goldFromWorkers);
|
||||||
|
|||||||
Reference in New Issue
Block a user