Implement config-driven unlock groups so that multiple things can be unlocked at once (including buildings)

This commit is contained in:
2026-07-22 21:34:59 +02:00
parent a8a6a04f1e
commit a9082c57f3
36 changed files with 1005 additions and 543 deletions

View File

@@ -0,0 +1,26 @@
#pragma once
#include <string>
#include <vector>
// A single [[unlock]] entry from unlocks.toml — an unlock group, the unit of
// loot awarded by defence station drops (REQ-DEF-SCHEMATIC-DROP,
// REQ-LOCK-EXPLICIT). Awarding a group unlocks all of its granted members at
// once. Anything not granted by any group is available from game start.
struct UnlockGroupDef
{
std::string id; // Unique unlock-group id.
int stationLevel; // Min destroyed station level to become eligible.
std::vector<std::string> requiredGroupIds; // Prerequisite unlock-group ids (REQ-LOCK-PREREQ).
// Granted ids by kind (each defaults to empty; a group grants >= 1 item).
std::vector<std::string> ships;
std::vector<std::string> modules;
std::vector<std::string> buildings;
std::vector<std::string> recipes; // Assembler recipe ids only.
};
struct UnlocksConfig
{
std::vector<UnlockGroupDef> groups;
};