Implement city production projects for units and buildings
This commit is contained in:
@@ -42,6 +42,13 @@ bool UnitConfigManager::loadConfigFile(const QString &filePath)
|
||||
cfg.health = root.hasChild("health") ? root["health"].asInt(100) : 100;
|
||||
cfg.movementSpeed = root.hasChild("movement_speed") ? root["movement_speed"].asFloat(2.0f) : 2.0f;
|
||||
cfg.cost = root.hasChild("cost") ? root["cost"].asInt(20) : 20;
|
||||
if (root.hasChild("labor_cost")) {
|
||||
cfg.laborCost = root["labor_cost"].asInt(1000);
|
||||
} else if (root.hasChild("production_cost")) {
|
||||
cfg.laborCost = root["production_cost"].asInt(1000);
|
||||
} else {
|
||||
cfg.laborCost = cfg.cost * 20;
|
||||
}
|
||||
cfg.attackDamage = root.hasChild("attack_damage") ? root["attack_damage"].asInt(0) : 0;
|
||||
cfg.attackRange = root.hasChild("attack_range") ? root["attack_range"].asInt(1) : 1;
|
||||
cfg.buildCharges = root.hasChild("build_charges") ? root["build_charges"].asInt(-1) : -1;
|
||||
|
||||
Reference in New Issue
Block a user