public override void FastForward(int seconds) { ConstructionTimer?.FastForward(seconds); BoostTimer?.FastForward(seconds); base.FastForward(seconds); }
public void SpeedUpConstruction() { if (ConstructionTimer == null) { return; } var cost = GamePlayUtil.GetSpeedUpCost(ConstructionTimer.GetRemainingSeconds(Home.Time)); if (Home.UseDiamonds(cost)) { FinishConstruction(); } else { Logger.Log("Payment failed.", GetType(), Logger.ErrorLevel.Warning); } }
public override void Tick() { if (ConstructionTimer != null) { if (ConstructionTimer.GetRemainingSeconds(Home.Time) <= 0) { FinishConstruction(); } } if (BoostTimer != null) { if (BoostTimer.GetRemainingSeconds(Home.Time) <= 0) { BoostTimer = null; } } base.Tick(); }
public override JObject Save() { var jObject = base.Save(); jObject.Add("data", Data); jObject.Add("lvl", _upgradeLevel); if (Id > 0) { jObject.Add("id", Id); } if (ConstructionTimer != null) { jObject.Add("const_t", ConstructionTimer.GetRemainingSeconds(Home.Time)); } if (BoostTimer != null) { jObject.Add("boost_t", BoostTimer.GetRemainingSeconds(Home.Time)); } if (Locked) { jObject.Add("locked", true); } if (AttackMode) { jObject.Add("attack_mode", true); } if (BoostPause) { jObject.Add("boost_pause", true); } return(jObject); }