derive threat cost dynamically

This commit is contained in:
2026-06-13 21:50:00 +02:00
parent 3716c2b734
commit 10c5ad678f
28 changed files with 498 additions and 79 deletions

View File

@@ -3,6 +3,7 @@
#include <algorithm>
#include "ShipSystem.h"
#include "ThreatCostCalculator.h"
#include "tracing.h"
WaveSystem::WaveSystem(const GameConfig& config, std::mt19937& rng)
@@ -177,7 +178,8 @@ std::vector<WaveSystem::SpawnEntry> WaveSystem::selectWaveShips(double& budget,
std::vector<EligibleShip> eligible;
for (const ShipDef& def : m_config.ships.ships)
{
const double cost = def.threat.costFormula.evaluate(static_cast<double>(shipLevel));
const double cost = calculateShipThreatCost(m_config.threatCosts, m_config,
def.id, def.defaultModules);
if (cost > 0.0)
{
EligibleShip es;