implement sensor range requirements
This commit is contained in:
@@ -397,6 +397,14 @@ ShipsConfig ConfigLoader::loadShips(const std::string& path)
|
||||
def.movement.speedFormula = requireFormula(mMt["speed_formula"], file, mPath + ".speed_formula");
|
||||
}
|
||||
|
||||
// Sensor
|
||||
{
|
||||
const std::string snsPath = elemPath + ".sensor";
|
||||
const toml::table& snsTable = requireTable(mt["sensor"], file, snsPath);
|
||||
toml::table& snsMt = const_cast<toml::table&>(snsTable);
|
||||
def.sensor.sensorRangeFormula = requireFormula(snsMt["sensor_range_formula"], file, snsPath + ".sensor_range_formula");
|
||||
}
|
||||
|
||||
// Loot
|
||||
{
|
||||
const std::string lPath = elemPath + ".loot";
|
||||
|
||||
@@ -33,6 +33,11 @@ struct ShipMovement
|
||||
Formula speedFormula; // REQ-SHP-STATS, REQ-SHP-MOVEMENT
|
||||
};
|
||||
|
||||
struct ShipSensor
|
||||
{
|
||||
Formula sensorRangeFormula; // REQ-SHP-SENSOR, REQ-SHP-STATS
|
||||
};
|
||||
|
||||
struct ShipCombat
|
||||
{
|
||||
Formula damageFormula;
|
||||
@@ -69,6 +74,7 @@ struct ShipDef
|
||||
ShipThreat threat;
|
||||
ShipHealth health;
|
||||
ShipMovement movement;
|
||||
ShipSensor sensor;
|
||||
ShipLoot loot;
|
||||
|
||||
// Role-specific sections. A ship is a combat ship if combat is present,
|
||||
|
||||
Reference in New Issue
Block a user