Remove schematic upgrades and module and ship levels

This commit is contained in:
2026-07-02 21:32:36 +02:00
parent 81b1c7a66b
commit 18e732ae99
43 changed files with 498 additions and 666 deletions

View File

@@ -231,7 +231,7 @@ void ArenaSimulation::spawnShips()
for (int i = 0; i < entry.count; ++i)
{
const QVector2D pos(xDist(m_rng), yDist(m_rng));
m_shipSystem->spawn(entry.schematicId, entry.level, pos, false,
m_shipSystem->spawn(entry.schematicId, pos, false,
entry.layout);
}
}
@@ -248,7 +248,7 @@ void ArenaSimulation::spawnShips()
for (int i = 0; i < entry.count; ++i)
{
const QVector2D pos(xDist(m_rng), yDist(m_rng));
m_shipSystem->spawn(entry.schematicId, entry.level, pos, true,
m_shipSystem->spawn(entry.schematicId, pos, true,
entry.layout);
}
}
@@ -500,7 +500,7 @@ void ArenaSimulation::updateStatus()
{
ArenaStatus::Entry entry;
entry.displayName = shipEntry.schematicId;
entry.level = shipEntry.level;
// Ships no longer carry a level (level suffix stays empty).
entry.total = shipEntry.count;
int surviving = 0;
@@ -512,7 +512,6 @@ void ArenaSimulation::updateStatus()
{
if (f.isEnemy == isEnemyTeam
&& si.schematicId == shipEntry.schematicId
&& si.level == shipEntry.level
&& h.hp > 0.0f)
{
++surviving;

View File

@@ -3,6 +3,7 @@
#include <atomic>
#include <memory>
#include <mutex>
#include <optional>
#include <random>
#include <string>
#include <vector>
@@ -32,7 +33,9 @@ struct ArenaStatus
struct Entry
{
std::string displayName;
int level;
// Level suffix shown in the widget/inspect display. Set for the HQ and
// defence stations; empty for ships, which no longer have a level.
std::optional<int> level;
int total;
int surviving;
};

View File

@@ -126,11 +126,14 @@ void ArenaWidget::updateStatus(const ArenaStatus& status)
{
lines += "\n";
}
lines += QString("%1/%2 %3 L%4")
lines += QString("%1/%2 %3")
.arg(entry.surviving)
.arg(entry.total)
.arg(QString::fromStdString(entry.displayName))
.arg(entry.level);
.arg(QString::fromStdString(entry.displayName));
if (entry.level.has_value())
{
lines += QString(" L%1").arg(entry.level.value());
}
}
content->setText(lines);
}

View File

@@ -125,8 +125,6 @@ BalancingConfig loadBalancingConfig(const std::string& path)
ArenaShipEntry entry;
entry.schematicId = requireString((*shipTbl)["schematic"],
sPrefix + ".schematic");
entry.level = static_cast<int>(
requireInt((*shipTbl)["level"], sPrefix + ".level"));
entry.count = static_cast<int>(
requireInt((*shipTbl)["count"], sPrefix + ".count"));

View File

@@ -18,7 +18,6 @@ struct ArenaStationEntry
struct ArenaShipEntry
{
std::string schematicId;
int level;
int count;
std::optional<ShipLayoutConfig> layout;
};

View File

@@ -223,11 +223,14 @@ void InspectWindow::updateInfoPanel(const ArenaStatus& status)
{
lines += "\n";
}
lines += QString("%1/%2 %3 L%4")
lines += QString("%1/%2 %3")
.arg(entry.surviving)
.arg(entry.total)
.arg(QString::fromStdString(entry.displayName))
.arg(entry.level);
.arg(QString::fromStdString(entry.displayName));
if (entry.level.has_value())
{
lines += QString(" L%1").arg(entry.level.value());
}
}
content->setText(lines);
}
@@ -256,9 +259,8 @@ void InspectWindow::handleEvent(std::shared_ptr<const EntitySelectedEvent> event
const ShipIdentityComponent& identity = admin.get<ShipIdentityComponent>(entity);
const HealthComponent& health = admin.get<HealthComponent>(entity);
m_entityTitleLabel->setText(tr("Ship: %1 (Lv %2)")
.arg(QString::fromStdString(identity.schematicId))
.arg(identity.level));
m_entityTitleLabel->setText(tr("Ship: %1")
.arg(QString::fromStdString(identity.schematicId)));
m_entityTitleLabel->show();
const ShipStats stats = buildShipStatsFromEntity(admin, entity);