await this.save(city);
- const due = Duration.fromObject({ hours: unit.time});
+ // barracks can drop this by 0.01% for each barrack.
+ const barracksOffset = _.round((this.barracksImprovement(city) * unit.time) + unit.time, 2);
+
+ const due = Duration.fromObject({ hours: barracksOffset});
+
const queue = await this.unitTrainigQueue.create(
city.owner,
DateTime.now().plus({ milliseconds: due.as('milliseconds') }).toMillis(),
return power
}
+ barracksImprovement(city: City): number {
+ return city.barracks * 0.0001;
+ }
+
maxPopulation(city: City): number {
return city.homes * 25;
}