Make mining rate dependent on research level
This commit is contained in:
parent
08a2371196
commit
fe201e4a39
|
@ -121,12 +121,14 @@ export default class PlanetResourceManager extends ResourceManager {
|
|||
"gold-mine": "gold"
|
||||
}
|
||||
|
||||
const miningEfficiencyResearch = this.planet.system.data.ownedBy.research.getResearchById('mining-efficiency')?.level ?? 0;
|
||||
|
||||
const output = [];
|
||||
const buildings = this.planet.buildings.buildings;
|
||||
|
||||
for(const building of buildings) {
|
||||
if(Object.keys(mapMinerToResource).includes(building.data.id)) {
|
||||
const miningRate = 20 * Math.pow(building.level, 2) + 40 * building.level + 15;
|
||||
const miningRate = Math.floor((20 * Math.pow(building.level, 2) + 40 * building.level + 15) * (1 + miningEfficiencyResearch * 0.05));
|
||||
|
||||
output.push({
|
||||
id: mapMinerToResource[building.data.id],
|
||||
|
|
Loading…
Reference in New Issue