Remove schematic upgrades and module and ship levels
This commit is contained in:
@@ -94,7 +94,7 @@ TEST_CASE("ShipSystem: interceptor spawn has weapon child and attack behavior, n
|
||||
const GameConfig cfg = loadConfig();
|
||||
ShipSystem ss(cfg, admin);
|
||||
|
||||
const entt::entity e = ss.spawn("interceptor", 1, QVector2D(0.0f, 0.0f));
|
||||
const entt::entity e = ss.spawn("interceptor", QVector2D(0.0f, 0.0f));
|
||||
|
||||
REQUIRE(admin.isValid(e));
|
||||
REQUIRE(admin.isValid(firstWeaponChild(admin, e)));
|
||||
@@ -118,7 +118,7 @@ TEST_CASE("ShipSystem: enemy combat ship has no rally or retreat behavior", "[sh
|
||||
const GameConfig cfg = loadConfig();
|
||||
ShipSystem ss(cfg, admin);
|
||||
|
||||
const entt::entity e = ss.spawn("interceptor", 1, QVector2D(0.0f, 0.0f), /*isEnemy=*/true);
|
||||
const entt::entity e = ss.spawn("interceptor", QVector2D(0.0f, 0.0f), /*isEnemy=*/true);
|
||||
|
||||
REQUIRE(admin.hasAll<AttackBehavior>(e));
|
||||
REQUIRE(admin.hasAll<AdvanceBehavior>(e));
|
||||
@@ -133,7 +133,7 @@ TEST_CASE("ShipSystem: setRetreatEnabled(false) suppresses player retreat behavi
|
||||
ShipSystem ss(cfg, admin);
|
||||
ss.setRetreatEnabled(false);
|
||||
|
||||
const entt::entity e = ss.spawn("interceptor", 1, QVector2D(0.0f, 0.0f));
|
||||
const entt::entity e = ss.spawn("interceptor", QVector2D(0.0f, 0.0f));
|
||||
|
||||
// Other player behaviors are unaffected; only retreat is suppressed.
|
||||
REQUIRE(admin.hasAll<AttackBehavior>(e));
|
||||
@@ -147,7 +147,7 @@ TEST_CASE("ShipSystem: interceptor level 1 stats match config formulas", "[ship]
|
||||
const GameConfig cfg = loadConfig();
|
||||
ShipSystem ss(cfg, admin);
|
||||
|
||||
const entt::entity e = ss.spawn("interceptor", 1, QVector2D(0.0f, 0.0f));
|
||||
const entt::entity e = ss.spawn("interceptor", QVector2D(0.0f, 0.0f));
|
||||
|
||||
// hp_formula = "40 + 5*x" at x=1 → 45
|
||||
REQUIRE(admin.get<HealthComponent>(e).maxHp == Approx(45.0f));
|
||||
@@ -163,28 +163,28 @@ TEST_CASE("ShipSystem: interceptor level 1 stats match config formulas", "[ship]
|
||||
REQUIRE(admin.get<WeaponComponent>(wc).cooldownTicks == Approx(0.0f));
|
||||
}
|
||||
|
||||
TEST_CASE("ShipSystem: interceptor level 5 hp matches formula", "[ship]")
|
||||
TEST_CASE("ShipSystem: interceptor hp matches config value", "[ship]")
|
||||
{
|
||||
EntityAdmin admin;
|
||||
const GameConfig cfg = loadConfig();
|
||||
ShipSystem ss(cfg, admin);
|
||||
|
||||
const entt::entity e = ss.spawn("interceptor", 5, QVector2D(0.0f, 0.0f));
|
||||
const entt::entity e = ss.spawn("interceptor", QVector2D(0.0f, 0.0f));
|
||||
|
||||
// hp_formula = "40 + 5*x" at x=5 → 65
|
||||
REQUIRE(admin.get<HealthComponent>(e).maxHp == Approx(65.0f));
|
||||
// interceptor hp = 45 (plain value) in the test config
|
||||
REQUIRE(admin.get<HealthComponent>(e).maxHp == Approx(45.0f));
|
||||
}
|
||||
|
||||
TEST_CASE("ShipSystem: interceptor level 0 maxSpeed_tpt matches formula / tileSize / kTickRateHz", "[ship]")
|
||||
TEST_CASE("ShipSystem: interceptor maxSpeed_tpt matches config value / tileSize / kTickRateHz", "[ship]")
|
||||
{
|
||||
EntityAdmin admin;
|
||||
const GameConfig cfg = loadConfig();
|
||||
ShipSystem ss(cfg, admin);
|
||||
|
||||
const entt::entity e = ss.spawn("interceptor", 0, QVector2D(0.0f, 0.0f));
|
||||
const entt::entity e = ss.spawn("interceptor", QVector2D(0.0f, 0.0f));
|
||||
|
||||
// speed_mps_formula = "2000 + 50*x" m/s at x=0 → 2000 m/s; maxSpeed_tpt = 2000/(10*30)
|
||||
const float expected = 2000.0f / 10.0f / static_cast<float>(kTickRateHz);
|
||||
// speed_mps = 2050 m/s in the test config; maxSpeed_tpt = 2050/(10*30)
|
||||
const float expected = 2050.0f / 10.0f / static_cast<float>(kTickRateHz);
|
||||
REQUIRE(admin.get<DynamicBodyComponent>(e).maxSpeed_tpt == Approx(expected));
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ TEST_CASE("ShipSystem: salvage_ship spawn with salvage module has cargo child an
|
||||
ShipSystem ss(cfg, admin);
|
||||
|
||||
const ShipLayoutConfig layout = makeSingleModuleLayout("salvager");
|
||||
const entt::entity e = ss.spawn("salvage_ship", 1, QVector2D(0.0f, 0.0f), false, layout);
|
||||
const entt::entity e = ss.spawn("salvage_ship", QVector2D(0.0f, 0.0f), false, layout);
|
||||
|
||||
REQUIRE(admin.isValid(firstSalvageChild(admin, e)));
|
||||
REQUIRE(admin.hasAll<SalvageScrapBehavior>(e));
|
||||
@@ -216,7 +216,7 @@ TEST_CASE("ShipSystem: salvage_ship cargo capacity matches config", "[ship]")
|
||||
ShipSystem ss(cfg, admin);
|
||||
|
||||
const ShipLayoutConfig layout = makeSingleModuleLayout("salvager");
|
||||
const entt::entity e = ss.spawn("salvage_ship", 1, QVector2D(0.0f, 0.0f), false, layout);
|
||||
const entt::entity e = ss.spawn("salvage_ship", QVector2D(0.0f, 0.0f), false, layout);
|
||||
|
||||
// salvager: cargo_capacity_formula = "10", collection_range_m_formula = "500" m → 500/10 = 50 tiles
|
||||
const entt::entity sc = firstSalvageChild(admin, e);
|
||||
@@ -241,7 +241,7 @@ TEST_CASE("ShipSystem: repair_ship spawn with repair module has repair child and
|
||||
ShipSystem ss(cfg, admin);
|
||||
|
||||
const ShipLayoutConfig layout = makeSingleModuleLayout("repair_tool");
|
||||
const entt::entity e = ss.spawn("repair_ship", 1, QVector2D(0.0f, 0.0f), false, layout);
|
||||
const entt::entity e = ss.spawn("repair_ship", QVector2D(0.0f, 0.0f), false, layout);
|
||||
|
||||
REQUIRE(admin.isValid(firstRepairChild(admin, e)));
|
||||
REQUIRE(admin.hasAll<RepairBehavior>(e));
|
||||
@@ -256,7 +256,7 @@ TEST_CASE("ShipSystem: repair_ship level 1 repair stats match config formulas",
|
||||
ShipSystem ss(cfg, admin);
|
||||
|
||||
const ShipLayoutConfig layout = makeSingleModuleLayout("repair_tool");
|
||||
const entt::entity e = ss.spawn("repair_ship", 1, QVector2D(0.0f, 0.0f), false, layout);
|
||||
const entt::entity e = ss.spawn("repair_ship", QVector2D(0.0f, 0.0f), false, layout);
|
||||
|
||||
const entt::entity rc = firstRepairChild(admin, e);
|
||||
REQUIRE(admin.isValid(rc));
|
||||
@@ -280,9 +280,9 @@ TEST_CASE("ShipSystem: spawned ships are valid entities", "[ship]")
|
||||
const GameConfig cfg = loadConfig();
|
||||
ShipSystem ss(cfg, admin);
|
||||
|
||||
const entt::entity e1 = ss.spawn("interceptor", 1, QVector2D(0.0f, 0.0f));
|
||||
const entt::entity e1 = ss.spawn("interceptor", QVector2D(0.0f, 0.0f));
|
||||
const ShipLayoutConfig salvageLayout = makeSingleModuleLayout("salvager");
|
||||
const entt::entity e2 = ss.spawn("salvage_ship", 1, QVector2D(1.0f, 0.0f), false, salvageLayout);
|
||||
const entt::entity e2 = ss.spawn("salvage_ship", QVector2D(1.0f, 0.0f), false, salvageLayout);
|
||||
|
||||
REQUIRE(admin.isValid(e1));
|
||||
REQUIRE(admin.isValid(e2));
|
||||
@@ -295,7 +295,7 @@ TEST_CASE("ShipSystem: despawn removes the ship and its weapon children", "[ship
|
||||
const GameConfig cfg = loadConfig();
|
||||
ShipSystem ss(cfg, admin);
|
||||
|
||||
const entt::entity e = ss.spawn("interceptor", 1, QVector2D(0.0f, 0.0f));
|
||||
const entt::entity e = ss.spawn("interceptor", QVector2D(0.0f, 0.0f));
|
||||
const entt::entity wc = firstWeaponChild(admin, e);
|
||||
REQUIRE(admin.isValid(e));
|
||||
REQUIRE(admin.isValid(wc));
|
||||
|
||||
Reference in New Issue
Block a user