Explorar el Código

roi: assume MCG/triple-green for capex

raylu hace 1 mes
padre
commit
73b6fa5692
Se han modificado 2 ficheros con 5 adiciones y 2 borrados
  1. 4 1
      roi.py
  2. 1 1
      www/roi.html

+ 4 - 1
roi.py

@@ -103,7 +103,10 @@ def calc_profit(recipe: Recipe, buildings: typing.Mapping[str, Building], hab_ar
 			average_traded_7d=output_prices[lowest_liquidity['material_ticker']].average_traded_7d)
 
 def building_construction_cost(building: Building, prices: typing.Mapping[str, Price]) -> float:
-	return sum(bc['material_amount'] * prices[bc['material_ticker']].vwap_7d for bc in building['costs']) # pyright: ignore[reportOperatorIssue]
+	cost = sum(bc['material_amount'] * prices[bc['material_ticker']].vwap_7d for bc in building['costs']) # pyright: ignore[reportOperatorIssue]
+	# https://handbook.apex.prosperousuniverse.com/wiki/building-costs/#rocky-planets
+	cost += building['area_cost'] * 4 * prices['MCG'].vwap_7d # pyright: ignore[reportOperatorIssue]
+	return cost
 
 def building_daily_cost(building: Building, prices: typing.Mapping[str, Price]) -> float:
 	consumption = {

+ 1 - 1
www/roi.html

@@ -33,7 +33,7 @@
 					<th>expertise</th>
 					<th data-tooltip="125% efficiency. area includes worker habitation">daily<br>profit/area</th>
 					<th>break<br>even</th>
-					<th data-tooltip="construction cost of 1 building and fractional habitation">capex</th>
+					<th data-tooltip="construction cost of 1 building and fractional habitation on triple-green planet">capex</th>
 					<th data-tooltip="input and worker costs of 1 building (deterioration/repair not included)">daily<br>opex</th>
 					<th data-tooltip="max of input and output t and m³ per area. 2 ≅ 2 SCB visits/day. 0.25 ≅ SCB visit every 4 days">logistics</th>
 					<th data-tooltip="units output by 1 building over average daily traded">daily output<br>traded</th>