3 private int m_Efficiency0To10;
4 static private float m_EfficiencyDecayStart = 0.1;
8 m_Efficiency0To10 = 10;
9 RegisterNetSyncVariableInt(
"m_Efficiency0To10");
13 float GetEfficiency0To1()
15 return m_Efficiency0To10 / 10;
19 float GetEfficiencyDecayStart()
21 return m_EfficiencyDecayStart;
25 override void OnEnergyConsumed()
27 super.OnEnergyConsumed();
31 float energyCoef = GetCompEM().GetEnergy0To1();
33 if (energyCoef < m_EfficiencyDecayStart && m_EfficiencyDecayStart > 0)
35 m_Efficiency0To10 =
Math.Round((energyCoef / m_EfficiencyDecayStart) * 10);
42 override void OnEnergyAdded()
44 super.OnEnergyAdded();
48 float energyCoef = GetCompEM().GetEnergy0To1();
49 if (energyCoef < m_EfficiencyDecayStart && m_EfficiencyDecayStart > 0)
51 m_Efficiency0To10 =
Math.Round((energyCoef / m_EfficiencyDecayStart) * 10);
56 m_Efficiency0To10 = 10;
62 override void SetActions()