add recharge
This commit is contained in:
+11
-2
@@ -52,11 +52,20 @@ struct UnitConfig {
|
||||
QStringList impassableTerrains;
|
||||
QStringList passableTerrains;
|
||||
|
||||
// Recharge / Cooldown configuration for military units
|
||||
int rechargeTime; // Time in milliseconds between attacks
|
||||
float rechargeDuration; // Duration of recharge state (optional, for visual indication)
|
||||
int attackFlashDuration; // How long the flash effect lasts (in ms)
|
||||
|
||||
UnitConfig()
|
||||
: id(""), name(""), category(UnitCategory::Builder),
|
||||
movementDomain(MovementDomain::Land), health(100),
|
||||
movementSpeed(2.0f), cost(10), laborCost(1000), attackDamage(0), attackRange(1),
|
||||
buildCharges(-1), infiniteCharges(true), requiredTech(""), obsoleteTech(""), iconPath("") {}
|
||||
buildCharges(-1), infiniteCharges(true), requiredTech(""), obsoleteTech(""), iconPath(""),
|
||||
rechargeTime(500), // Default recharge time: 500ms (0.5 seconds)
|
||||
rechargeDuration(300), // Visual cooldown bar duration: 300ms
|
||||
attackFlashDuration(400) // Attack flash effect duration: 400ms
|
||||
{}
|
||||
|
||||
bool isRanged() const { return attackRange > 1; }
|
||||
bool isMilitary() const { return category == UnitCategory::Military; }
|
||||
@@ -89,4 +98,4 @@ private:
|
||||
QMap<QString, UnitConfig> m_configs;
|
||||
};
|
||||
|
||||
#endif // UNITCONFIG_H
|
||||
#endif // UNITCONFIG_H
|
||||
Reference in New Issue
Block a user