[C++] Weapon reload time
Posted: 06 Jun 2015, 00:33
How to get weapon's reload percentage?
Consider armbanth in ZK. It has manually fired weapon, UnitDef::CanManualFire == true, WeaponDef::GetReload == 30. But i didn't find any Unit's or WeaponMount's state call to get current reload percents.
As a workaround i saved the frame in which weapon fired and did next fire check only after constant number of reload frames. But logic breaks if unit was paralyzed or disarmed.
BTW, side question: There is Unit::IsParalyzed for stunned units, but how can i access disarmed state (e.g. unit can move but can't fire)?
Consider armbanth in ZK. It has manually fired weapon, UnitDef::CanManualFire == true, WeaponDef::GetReload == 30. But i didn't find any Unit's or WeaponMount's state call to get current reload percents.
As a workaround i saved the frame in which weapon fired and did next fire check only after constant number of reload frames. But logic breaks if unit was paralyzed or disarmed.
BTW, side question: There is Unit::IsParalyzed for stunned units, but how can i access disarmed state (e.g. unit can move but can't fire)?