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

@@ -3,23 +3,43 @@
#include <string>
#include <vector>
// The kind of a single granted schematic within an unlock option.
enum class SchematicType
{
Ship,
Module,
Recipe,
Artifact
Building,
Recipe
};
// One item granted by an unlock group (REQ-LOCK-EXPLICIT), shown in the
// schematic choice dialog's granted-items list.
struct GrantedSchematic
{
SchematicType type;
std::string id;
std::string displayName;
};
// One option presented to the player in the schematic choice dialog
// (REQ-DEF-SCHEMATIC-DROP). Built by the simulation when enemy stations are
// destroyed; the UI reads these to populate the dialog.
// destroyed; the UI reads these to populate the dialog. A non-artifact option
// represents one unlock group; selecting it awards the whole group.
struct SchematicChoiceOption
{
std::string schematicId;
SchematicType type;
bool isArtifact = false;
// Unlock group id (empty for the artifact option).
std::string unlockGroupId;
// Display name shown as the option's title: the unlock group's derived name,
// or "Artifact" for the artifact option.
std::string displayName;
// The ships, modules, buildings, and assembler recipes this group grants
// (empty for the artifact option).
std::vector<GrantedSchematic> grantedItems;
// Ids of miner/assembler recipes that would newly become implicitly
// unlocked (REQ-LOCK-IMPLICIT) if this option is selected. Sorted
// alphabetically by display name; empty if none.