From: xangelo Date: Wed, 25 May 2022 14:58:31 +0000 (-0400) Subject: new buildings: mining! increase alloy + max alloy cap X-Git-Url: https://git.xangelo.ca/?p=browser-rts.git;a=commitdiff_plain;h=9c0287740b282030291008cd9cf204c7f1ca8958 new buildings: mining! increase alloy + max alloy cap --- diff --git a/src/render/kingdom-overview.ts b/src/render/kingdom-overview.ts index 744afe1..2e787d6 100644 --- a/src/render/kingdom-overview.ts +++ b/src/render/kingdom-overview.ts @@ -53,7 +53,7 @@ export function renderKingomOverview(city: CityWithLocation & Usage, account: Ac Alloys - ${city.alloys.toLocaleString()} + ${city.alloys.toLocaleString()} @ ${percent(city.alloys, cityRepo.maxAlloy(city), 100)} % Ore Refiniery Utilization Special Attackers ${city.sp_attackers.toLocaleString()} @@ -61,7 +61,7 @@ export function renderKingomOverview(city: CityWithLocation & Usage, account: Ac Energy ${city.energy.toLocaleString()} (${energyRateOfChange.toLocaleString()}) - @ ${percent(city.energy, city.accumulators, 100)}% Accumulator Utilization + @ ${percent(city.energy, cityRepo.maxEnergy(city), 100)}% Accumulator Utilization Special Defenders ${city.sp_defenders.toLocaleString()} @@ -69,7 +69,7 @@ export function renderKingomOverview(city: CityWithLocation & Usage, account: Ac Food - ${city.food.toLocaleString()} (${foodRateOfChange.toLocaleString()}) @ ${percent(city.food, city.warehouses, 100)}% Warehouse utilization + ${city.food.toLocaleString()} (${foodRateOfChange.toLocaleString()}) @ ${percent(city.food, cityRepo.maxFood(city), 100)}% Warehouse utilization diff --git a/src/repository/city.ts b/src/repository/city.ts index 0ab8478..c3bcae8 100644 --- a/src/repository/city.ts +++ b/src/repository/city.ts @@ -32,6 +32,7 @@ export type City = { solar_panels: number; accumulators: number; mining_facilities: number; + ore_refinery: number; barracks: number; special_attacker_trainer: number; special_defender_trainer: number; @@ -83,6 +84,7 @@ export class CityRepository extends Repository { solar_panels: 5, accumulators: 5, mining_facilities: 5, + ore_refinery: 5, barracks: 0, special_attacker_trainer: 0, special_defender_trainer: 0, @@ -340,6 +342,10 @@ where l.sector_id = ?`, [sector_id]); return city.accumulators * 150; } + maxAlloy(city: City): number { + return city.ore_refinery * 75; + } + async foodProductionPerTick(city: City): Promise { // eventually we should supply the warehouse formula // to calculate the max amount of food created per tick