Remove schematic upgrades and module and ship levels
This commit is contained in:
@@ -110,11 +110,9 @@ TEST_CASE("Ship spawn: no modules leaves base stats unchanged", "[modules]")
|
||||
const ShipDef* def = findSchematic(sim.config(), "interceptor");
|
||||
REQUIRE(def != nullptr);
|
||||
|
||||
const double x = static_cast<double>(def->schematic.playerProductionLevel);
|
||||
const float expectedHp = static_cast<float>(def->health.hpFormula.evaluate(x));
|
||||
const float expectedHp = static_cast<float>(def->health.hp);
|
||||
|
||||
const entt::entity e = sim.ships().spawn("interceptor",
|
||||
def->schematic.playerProductionLevel,
|
||||
QVector2D(5.0f, 5.0f), false, std::nullopt);
|
||||
|
||||
REQUIRE(sim.admin().isValid(e));
|
||||
@@ -127,8 +125,7 @@ TEST_CASE("Ship spawn: multiplicative HP module applies correctly", "[modules]")
|
||||
const ShipDef* def = findSchematic(sim.config(), "interceptor");
|
||||
REQUIRE(def != nullptr);
|
||||
|
||||
const double x = static_cast<double>(def->schematic.playerProductionLevel);
|
||||
const float baseHp = static_cast<float>(def->health.hpFormula.evaluate(x));
|
||||
const float baseHp = static_cast<float>(def->health.hp);
|
||||
|
||||
ShipLayoutConfig layout;
|
||||
PlacedModule pm;
|
||||
@@ -138,7 +135,6 @@ TEST_CASE("Ship spawn: multiplicative HP module applies correctly", "[modules]")
|
||||
layout.placedModules.push_back(pm);
|
||||
|
||||
const entt::entity e = sim.ships().spawn("interceptor",
|
||||
def->schematic.playerProductionLevel,
|
||||
QVector2D(5.0f, 5.0f), false, layout);
|
||||
|
||||
REQUIRE(sim.admin().isValid(e));
|
||||
@@ -154,9 +150,8 @@ TEST_CASE("Ship spawn: additive sensor module applies correctly", "[modules]")
|
||||
const ShipDef* def = findSchematic(sim.config(), "interceptor");
|
||||
REQUIRE(def != nullptr);
|
||||
|
||||
const double x = static_cast<double>(def->schematic.playerProductionLevel);
|
||||
const float tileSize = static_cast<float>(sim.config().world.tileSize_m);
|
||||
const float baseRange_tiles = static_cast<float>(def->sensor.sensorRangeFormula.evaluate(x)) / tileSize;
|
||||
const float baseRange_tiles = static_cast<float>(def->sensor.sensorRange_m) / tileSize;
|
||||
|
||||
ShipLayoutConfig layout;
|
||||
PlacedModule pm;
|
||||
@@ -166,7 +161,6 @@ TEST_CASE("Ship spawn: additive sensor module applies correctly", "[modules]")
|
||||
layout.placedModules.push_back(pm);
|
||||
|
||||
const entt::entity e = sim.ships().spawn("interceptor",
|
||||
def->schematic.playerProductionLevel,
|
||||
QVector2D(5.0f, 5.0f), false, layout);
|
||||
|
||||
REQUIRE(sim.admin().isValid(e));
|
||||
@@ -181,8 +175,7 @@ TEST_CASE("Ship spawn: multiple modules stack correctly", "[modules]")
|
||||
const ShipDef* def = findSchematic(sim.config(), "interceptor");
|
||||
REQUIRE(def != nullptr);
|
||||
|
||||
const double x = static_cast<double>(def->schematic.playerProductionLevel);
|
||||
const float baseHp = static_cast<float>(def->health.hpFormula.evaluate(x));
|
||||
const float baseHp = static_cast<float>(def->health.hp);
|
||||
|
||||
ShipLayoutConfig layout;
|
||||
for (int i = 0; i < 2; ++i)
|
||||
@@ -195,7 +188,6 @@ TEST_CASE("Ship spawn: multiple modules stack correctly", "[modules]")
|
||||
}
|
||||
|
||||
const entt::entity e = sim.ships().spawn("interceptor",
|
||||
def->schematic.playerProductionLevel,
|
||||
QVector2D(5.0f, 5.0f), false, layout);
|
||||
|
||||
REQUIRE(sim.admin().isValid(e));
|
||||
@@ -321,7 +313,6 @@ TEST_CASE("Ship spawn: weapon_primer multiplies attack rate in simulation", "[mo
|
||||
}
|
||||
|
||||
const entt::entity ship = sim.ships().spawn("interceptor",
|
||||
def->schematic.playerProductionLevel,
|
||||
QVector2D(5.0f, 5.0f), false, layout);
|
||||
|
||||
const entt::entity weapon = findFirstWeaponChild(sim.admin(), ship);
|
||||
@@ -349,7 +340,6 @@ TEST_CASE("Ship spawn: weapon_stabilizer multiplies attack range in simulation",
|
||||
}
|
||||
|
||||
const entt::entity ship = sim.ships().spawn("interceptor",
|
||||
def->schematic.playerProductionLevel,
|
||||
QVector2D(5.0f, 5.0f), false, layout);
|
||||
|
||||
const entt::entity weapon = findFirstWeaponChild(sim.admin(), ship);
|
||||
@@ -364,10 +354,9 @@ TEST_CASE("Ship spawn: afterburner additive main_acceleration is converted m/s²
|
||||
const ShipDef* def = findSchematic(sim.config(), "interceptor");
|
||||
REQUIRE(def != nullptr);
|
||||
|
||||
const double x = static_cast<double>(def->schematic.playerProductionLevel);
|
||||
const float tileSize = static_cast<float>(sim.config().world.tileSize_m);
|
||||
const float tickRate = static_cast<float>(kTickRateHz);
|
||||
const float base_mpss = static_cast<float>(def->movement.mainAccelerationFormula.evaluate(x));
|
||||
const float base_mpss = static_cast<float>(def->movement.mainAcceleration_mpss);
|
||||
|
||||
ShipLayoutConfig layout;
|
||||
PlacedModule pm;
|
||||
@@ -377,7 +366,6 @@ TEST_CASE("Ship spawn: afterburner additive main_acceleration is converted m/s²
|
||||
layout.placedModules.push_back(pm);
|
||||
|
||||
const entt::entity e = sim.ships().spawn("interceptor",
|
||||
def->schematic.playerProductionLevel,
|
||||
QVector2D(5.0f, 5.0f), false, layout);
|
||||
|
||||
// added_main_acceleration_mpss = 60; same conversion as base: / tileSize / tickRate
|
||||
@@ -391,10 +379,9 @@ TEST_CASE("Ship spawn: maneuvering_thrusters additive maneuvering_acceleration i
|
||||
const ShipDef* def = findSchematic(sim.config(), "interceptor");
|
||||
REQUIRE(def != nullptr);
|
||||
|
||||
const double x = static_cast<double>(def->schematic.playerProductionLevel);
|
||||
const float tileSize = static_cast<float>(sim.config().world.tileSize_m);
|
||||
const float tickRate = static_cast<float>(kTickRateHz);
|
||||
const float base_mpss = static_cast<float>(def->movement.maneuveringAccelerationFormula.evaluate(x));
|
||||
const float base_mpss = static_cast<float>(def->movement.maneuveringAcceleration_mpss);
|
||||
|
||||
ShipLayoutConfig layout;
|
||||
PlacedModule pm;
|
||||
@@ -404,7 +391,6 @@ TEST_CASE("Ship spawn: maneuvering_thrusters additive maneuvering_acceleration i
|
||||
layout.placedModules.push_back(pm);
|
||||
|
||||
const entt::entity e = sim.ships().spawn("interceptor",
|
||||
def->schematic.playerProductionLevel,
|
||||
QVector2D(5.0f, 5.0f), false, layout);
|
||||
|
||||
// added_maneuvering_acceleration_mpss = 10; same conversion as base: / tileSize / tickRate
|
||||
@@ -433,7 +419,7 @@ TEST_CASE("calculateShipStats: weapon_primer multiplies attack rate in stats vie
|
||||
}
|
||||
|
||||
const ShipStats stats = calculateShipStats(cfg, "interceptor",
|
||||
def->schematic.playerProductionLevel, modules);
|
||||
modules);
|
||||
|
||||
REQUIRE(stats.weapons.has_value());
|
||||
// base: damage = 2, rate = 2.0 hz; weapon_primer multiplies rate by 1.2 → DPS = 2 * 2.4 = 4.8
|
||||
@@ -459,7 +445,7 @@ TEST_CASE("calculateShipStats: weapon_stabilizer multiplies attack range in stat
|
||||
}
|
||||
|
||||
const ShipStats stats = calculateShipStats(cfg, "interceptor",
|
||||
def->schematic.playerProductionLevel, modules);
|
||||
modules);
|
||||
|
||||
REQUIRE(stats.weapons.has_value());
|
||||
// base range = 50 m / tileSize; weapon_stabilizer multiplier = 1.5
|
||||
@@ -472,9 +458,8 @@ TEST_CASE("calculateShipStats: afterburner additive main_acceleration is convert
|
||||
const ShipDef* def = findSchematic(cfg, "interceptor");
|
||||
REQUIRE(def != nullptr);
|
||||
|
||||
const double x = static_cast<double>(def->schematic.playerProductionLevel);
|
||||
const float tileSize = static_cast<float>(cfg.world.tileSize_m);
|
||||
const float base_mpss = static_cast<float>(def->movement.mainAccelerationFormula.evaluate(x));
|
||||
const float base_mpss = static_cast<float>(def->movement.mainAcceleration_mpss);
|
||||
|
||||
std::vector<PlacedModule> modules;
|
||||
PlacedModule pm;
|
||||
@@ -484,7 +469,7 @@ TEST_CASE("calculateShipStats: afterburner additive main_acceleration is convert
|
||||
modules.push_back(pm);
|
||||
|
||||
const ShipStats stats = calculateShipStats(cfg, "interceptor",
|
||||
def->schematic.playerProductionLevel, modules);
|
||||
modules);
|
||||
|
||||
// added_main_acceleration_mpss = 60; converted to tiles/s²: / tileSize
|
||||
const float expected = (base_mpss + 60.0f) / tileSize;
|
||||
@@ -497,9 +482,8 @@ TEST_CASE("calculateShipStats: maneuvering_thrusters additive maneuvering_accele
|
||||
const ShipDef* def = findSchematic(cfg, "interceptor");
|
||||
REQUIRE(def != nullptr);
|
||||
|
||||
const double x = static_cast<double>(def->schematic.playerProductionLevel);
|
||||
const float tileSize = static_cast<float>(cfg.world.tileSize_m);
|
||||
const float base_mpss = static_cast<float>(def->movement.maneuveringAccelerationFormula.evaluate(x));
|
||||
const float base_mpss = static_cast<float>(def->movement.maneuveringAcceleration_mpss);
|
||||
|
||||
std::vector<PlacedModule> modules;
|
||||
PlacedModule pm;
|
||||
@@ -509,7 +493,7 @@ TEST_CASE("calculateShipStats: maneuvering_thrusters additive maneuvering_accele
|
||||
modules.push_back(pm);
|
||||
|
||||
const ShipStats stats = calculateShipStats(cfg, "interceptor",
|
||||
def->schematic.playerProductionLevel, modules);
|
||||
modules);
|
||||
|
||||
// added_maneuvering_acceleration_mpss = 10; converted to tiles/s²: / tileSize
|
||||
const float expected = (base_mpss + 10.0f) / tileSize;
|
||||
|
||||
Reference in New Issue
Block a user