define ship roles via added modules and allow multiple weapons
This commit is contained in:
@@ -34,7 +34,7 @@ void WaveSystem::tickWaveScheduler(Tick currentTick, ShipSystem& ships,
|
||||
if (currentTick >= entry.spawnAt)
|
||||
{
|
||||
ships.spawn(entry.schematicId, entry.level, entry.position,
|
||||
/*isEnemy=*/true);
|
||||
/*isEnemy=*/true, entry.layout);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -90,8 +90,9 @@ std::vector<WaveSystem::SpawnEntry> WaveSystem::composeWave(Tick currentTick,
|
||||
// Build eligible ship list with their costs at the current level.
|
||||
struct EligibleShip
|
||||
{
|
||||
std::string schematicId;
|
||||
double cost;
|
||||
std::string schematicId;
|
||||
double cost;
|
||||
std::vector<PlacedModule> defaultModules;
|
||||
};
|
||||
std::vector<EligibleShip> eligible;
|
||||
for (const ShipDef& def : m_config.ships.ships)
|
||||
@@ -100,8 +101,9 @@ std::vector<WaveSystem::SpawnEntry> WaveSystem::composeWave(Tick currentTick,
|
||||
if (cost > 0.0)
|
||||
{
|
||||
EligibleShip es;
|
||||
es.schematicId = def.id;
|
||||
es.cost = cost;
|
||||
es.schematicId = def.id;
|
||||
es.cost = cost;
|
||||
es.defaultModules = def.defaultModules;
|
||||
eligible.push_back(es);
|
||||
}
|
||||
}
|
||||
@@ -151,11 +153,12 @@ std::vector<WaveSystem::SpawnEntry> WaveSystem::composeWave(Tick currentTick,
|
||||
budget -= chosen.cost;
|
||||
|
||||
SpawnEntry entry;
|
||||
entry.schematicId = chosen.schematicId;
|
||||
entry.level = shipLevel;
|
||||
entry.spawnAt = 0; // set below after all picks are done
|
||||
entry.position = QVector2D(xDist(m_rng),
|
||||
static_cast<float>(yDist(m_rng)) + 0.5f);
|
||||
entry.schematicId = chosen.schematicId;
|
||||
entry.level = shipLevel;
|
||||
entry.spawnAt = 0; // set below after all picks are done
|
||||
entry.position = QVector2D(xDist(m_rng),
|
||||
static_cast<float>(yDist(m_rng)) + 0.5f);
|
||||
entry.layout.placedModules = chosen.defaultModules;
|
||||
picked.push_back(entry);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user