|
|
@@ -5,12 +5,14 @@ let blueprint: Record<string, number>;
|
|
|
let BUY: Set<string>;
|
|
|
let renderTarget: Element;
|
|
|
let cx: string;
|
|
|
+let daysPerBundle: number;
|
|
|
const apiKey = document.querySelector('#api-key') as HTMLInputElement;
|
|
|
|
|
|
-export function setupProduction(bp: Record<string, number>, buy: Set<string>, cxCode: string, target: Element) {
|
|
|
+export function setupProduction(bp: Record<string, number>, buy: Set<string>, cxCode: string, days: number, target: Element) {
|
|
|
blueprint = bp;
|
|
|
BUY = buy;
|
|
|
cx = cxCode;
|
|
|
+ daysPerBundle = days;
|
|
|
renderTarget = target;
|
|
|
|
|
|
const storedApiKey = localStorage.getItem('punoted-api-key');
|
|
|
@@ -269,7 +271,7 @@ function renderProduction(expertiseGroups: Record<string, string[]>, production:
|
|
|
const outputPerRun = recipe.outputs.find((o) => o.material_ticker === mat)!.material_amount;
|
|
|
buildingMins += amount / outputPerRun * (recipe.time_ms / 1000 / 60);
|
|
|
}
|
|
|
- const numBuildings = buildingMins / (24*60) / 5 / 1.605; // one ship every 5 days, 160.5% efficiency
|
|
|
+ const numBuildings = buildingMins / (24*60) / daysPerBundle / 1.605; // 160.5% efficiency
|
|
|
const consumablesCost = buildingDailyCost(buildings[building], prices) * Math.round(Math.max(1, numBuildings));
|
|
|
totalConsumablesCost += consumablesCost;
|
|
|
buildingRow.prepend(document.createTextNode(
|
|
|
@@ -288,7 +290,7 @@ function renderProduction(expertiseGroups: Record<string, string[]>, production:
|
|
|
}
|
|
|
|
|
|
section.append(element('h4', {textContent: `total consumables cost: ${formatWhole(totalConsumablesCost)}/day,
|
|
|
- ${formatWhole(totalConsumablesCost * 5)}/ship`}));
|
|
|
+ ${formatWhole(totalConsumablesCost * daysPerBundle)}/bundle`}));
|
|
|
return section;
|
|
|
}
|
|
|
|