public int GetTotalRemainingSeconds() { var result = 0; var firstUnit = true; if (m_vUnits.Count > 0) { foreach (var ds in m_vUnits) { var cd = (CombatItemData)ds.Data; if (cd != null) { var count = ds.Value; if (count >= 1) { if (firstUnit) { if (m_vTimer != null) { result += m_vTimer.GetRemainingSeconds(GetParent().GetLevel().GetTime()); } count--; firstUnit = false; } var ca = GetParent().GetLevel().GetHomeOwnerAvatar(); result += count * cd.GetTrainingTime(ca.GetUnitUpgradeLevel(cd)); } } } } return(result); }
public int GetRemainingSeconds() { var result = 0; if (m_vTimer != null) { result = m_vTimer.GetRemainingSeconds(GetParent().GetLevel().GetTime()); } return(result); }
public int GetRemainingSeconds() { var result = 0; if (m_vTimer != null) { result = m_vTimer.GetRemainingSeconds(GetParent().Avatar.Avatar.LastTickSaved); } return(result); }
public override void Tick() { if (m_vTimer?.GetRemainingSeconds(GetParent().Avatar.Avatar.LastTickSaved) <= 0) { FinishUpgrading(); } }
public JObject Save(JObject jsonData) { var jobj = new JObject(); jobj.Add("respawnSeed", m_vRespawnSeed); jobj.Add("obstacleClearCounter", m_vObstacleClearCount); if (m_vNormalTimer != null) { jobj.Add("secondsFromLastRespawn", m_vObstacleRespawnSeconds - m_vNormalTimer.GetRemainingSeconds(m_vLevel.GetTime())); jobj.Add("time_to_gembox_drop", m_vGemBoxTimer.GetRemainingSeconds(m_vLevel.GetTime())); jobj.Add("time_to_special_drop", m_vSpecialTimer.GetRemainingSeconds(m_vLevel.GetTime())); jobj.Add("normal_t", m_vNormalTimer.GetStartTime()); jobj.Add("gembox_t", m_vGemBoxTimer.GetStartTime()); jobj.Add("special_t", m_vSpecialTimer.GetStartTime()); } jsonData.Add("respawnVars", jobj); return(jsonData); }
public JObject Save(JObject jsonData) { //"respawnVars":{"secondsFromLastRespawn":369,"respawnSeed":-212853765,"obstacleClearCounter":0,"time_to_gembox_drop":359631,"time_in_gembox_period":244800,"time_to_special_drop":248031,"time_to_special_period":97200} var jobj = new JObject(); jobj.Add("respawnSeed", m_vRespawnSeed); jobj.Add("obstacleClearCounter", m_vObstacleClearCount); if (m_vNormalTimer != null) { jobj.Add("secondsFromLastRespawn", m_vObstacleRespawnSeconds - m_vNormalTimer.GetRemainingSeconds(m_vLevel.GetTime())); jobj.Add("time_to_gembox_drop", m_vGemBoxTimer.GetRemainingSeconds(m_vLevel.GetTime())); jobj.Add("time_to_special_drop", m_vSpecialTimer.GetRemainingSeconds(m_vLevel.GetTime())); jobj.Add("normal_t", m_vNormalTimer.GetStartTime()); jobj.Add("gembox_t", m_vGemBoxTimer.GetStartTime()); jobj.Add("special_t", m_vSpecialTimer.GetStartTime()); } jsonData.Add("respawnVars", jobj); return(jsonData); }
public int GetRemainingUpgradeSeconds() { return(m_vTimer.GetRemainingSeconds(GetParent().GetLevel().GetTime())); }
//public ConstructionItemData GetConstructionItemData() => (ConstructionItemData)Data; /*public HeroBaseComponent GetHeroBaseComponent(bool enabled = false) * { * Component comp = GetComponent(10, enabled); * if (comp != null && comp.Type != -1) * { * return (HeroBaseComponent) comp; * } * return null; * }*/ public int GetRemainingConstructionTime() => m_vTimer.GetRemainingSeconds(m_vLevel.Avatar.LastTickSaved);
public int GetRemainingConstructionTime() { return(m_vTimer.GetRemainingSeconds(m_vLevel.GetTime())); }
public int GetRemainingClearingTime() { return(m_vTimer.GetRemainingSeconds(m_vLevel.GetTime())); }
public int GetRemainingUpgradeSeconds() => m_vTimer.GetRemainingSeconds(GetParent().Avatar.Avatar.LastTickSaved);