62 lines
1.4 KiB
C++
62 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include <optional>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "Formula.h"
|
|
#include "RecipesConfig.h"
|
|
|
|
// A single stat modifier contributed by a module instance.
|
|
// REQ-MOD-STAT-CALC: final = base * (1 + sum(m_i - 1)) + sum(additives).
|
|
struct ModuleStatModifier
|
|
{
|
|
std::string stat; // e.g. "hp", "speed", "sensor_range"
|
|
std::string modifierType; // "additive" or "multiplicative"
|
|
Formula formula;
|
|
};
|
|
|
|
// Capability sections — present when the module grants that capability.
|
|
struct ModuleWeaponCapability
|
|
{
|
|
Formula damageFormula;
|
|
Formula attackRangeFormula;
|
|
Formula attackRateFormula;
|
|
};
|
|
|
|
struct ModuleSalvageCapability
|
|
{
|
|
Formula collectionRangeFormula;
|
|
Formula cargoCapacityFormula;
|
|
Formula collectionRateFormula;
|
|
};
|
|
|
|
struct ModuleRepairCapability
|
|
{
|
|
Formula repairRateFormula;
|
|
Formula repairRangeFormula;
|
|
};
|
|
|
|
struct ModuleDef
|
|
{
|
|
std::string id;
|
|
int unlockAtStationLevel;
|
|
std::vector<std::string> surfaceMask;
|
|
std::vector<RecipeIngredient> materials;
|
|
int playerProductionLevel;
|
|
double productionTimeSeconds;
|
|
double threatCost;
|
|
std::string fillColor;
|
|
std::string glyph;
|
|
std::vector<ModuleStatModifier> statModifiers;
|
|
|
|
std::optional<ModuleWeaponCapability> weaponCapability;
|
|
std::optional<ModuleSalvageCapability> salvageCapability;
|
|
std::optional<ModuleRepairCapability> repairCapability;
|
|
};
|
|
|
|
struct ModulesConfig
|
|
{
|
|
std::vector<ModuleDef> modules;
|
|
};
|