Remove schematic upgrades and module and ship levels
This commit is contained in:
@@ -300,13 +300,6 @@ TEST_CASE("RecipeSchematic: newlyUnlockedItemNames is sorted, deduplicated, and
|
||||
{
|
||||
CHECK(opt.newlyUnlockedItemNames[j - 1] < opt.newlyUnlockedItemNames[j]);
|
||||
}
|
||||
|
||||
// A level-up doesn't change the explicit unlock state, so the
|
||||
// implicit unlock set - and thus this preview - must be empty.
|
||||
if (!opt.isNewUnlock)
|
||||
{
|
||||
CHECK(opt.newlyUnlockedItemNames.empty());
|
||||
}
|
||||
}
|
||||
|
||||
SimulationTestAccess::applySchematicChoice(sim, 0);
|
||||
@@ -361,3 +354,54 @@ TEST_CASE("RecipeSchematic: newlyUnlockedItemNames matches recipes that actually
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Owned ship/module schematics leave the drop pool (REQ-DEF-SCHEMATIC-DROP)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
TEST_CASE("SchematicDrop: an owned ship schematic is never offered again",
|
||||
"[recipe_schematic]")
|
||||
{
|
||||
// repair_ship has unlock_at_station_level = 0 in the test config, so it is
|
||||
// locked at start and becomes eligible once a station set is destroyed.
|
||||
Simulation sim(loadConfig());
|
||||
REQUIRE_FALSE(sim.isSchematicUnlocked("repair_ship"));
|
||||
|
||||
bool wasUnlocked = false;
|
||||
for (int i = 0; i < 200; ++i)
|
||||
{
|
||||
killEnemyStations(sim);
|
||||
if (!sim.hasSchematicChoicesPending()) { continue; }
|
||||
|
||||
const std::vector<SchematicChoiceOption>& choices =
|
||||
sim.getPendingSchematicChoices();
|
||||
|
||||
// Locate the repair_ship option, if present in this drop.
|
||||
int repairShipIndex = -1;
|
||||
for (int j = 0; j < static_cast<int>(choices.size()); ++j)
|
||||
{
|
||||
if (choices[j].schematicId == "repair_ship") { repairShipIndex = j; }
|
||||
}
|
||||
|
||||
// Once owned, it must never appear in the pool again.
|
||||
if (sim.isSchematicUnlocked("repair_ship"))
|
||||
{
|
||||
CHECK(repairShipIndex == -1);
|
||||
}
|
||||
|
||||
// Prefer picking repair_ship the first time it shows up so we exercise
|
||||
// the transition from unowned to owned; otherwise just take choice 0.
|
||||
int pick = 0;
|
||||
if (repairShipIndex >= 0 && !sim.isSchematicUnlocked("repair_ship"))
|
||||
{
|
||||
pick = repairShipIndex;
|
||||
wasUnlocked = true;
|
||||
}
|
||||
SimulationTestAccess::applySchematicChoice(sim, pick);
|
||||
}
|
||||
|
||||
// Sanity: we actually unlocked it at some point, so the exclusion CHECK above
|
||||
// was meaningfully exercised.
|
||||
CHECK(wasUnlocked);
|
||||
CHECK(sim.isSchematicUnlocked("repair_ship"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user