public bool ResearchArmor(ButtonCooldown buttonCooldown) { bool canReasearch = false; if (!Manager.Instance.HasEnoughMana(researchCost)) { EventLog.Instance.AddAction(LogType.Error, "Not enough Mana ", transform.position); return(canReasearch); } else if (armorAmount == 3) { EventLog.Instance.AddAction(LogType.Error, Messages.AlreadyReachedMaxResearchLevel, transform.position); return(canReasearch); } else if (armorAmount == building.CurrentLevel) { EventLog.Instance.AddAction(LogType.Error, Messages.UpgradeForgeBeforeResearching, transform.position); return(canReasearch); } else if (building.IsUpgrading) { EventLog.Instance.AddAction(LogType.Error, Messages.CantResearchWhileUpgrading, transform.position); return(canReasearch); } else if (IsDoingResearch) { EventLog.Instance.AddAction(LogType.Error, "cant research while doing another research", transform.position); return(canReasearch); } canReasearch = true; buttonCooldown.SetCooldown(armorResearchTime); EventManager.Instance.ResearchStarted(this); StartCoroutine(UpgradeArmor(armorResearchTime)); return(canReasearch); }
public bool ResearchDamage(ButtonCooldown buttonCooldown) { bool canReasearch = false; if (!Manager.Instance.HasEnoughMana(researchCost)) { EventLog.Instance.AddAction(LogType.Error, "Not enough Mana ", transform.position); return(canReasearch); } else if (damageAmount == 3) { EventLog.Instance.AddAction(LogType.Error, "You already reached max research level", transform.position); return(canReasearch); } else if (damageAmount == building.CurrentLevel) { EventLog.Instance.AddAction(LogType.Error, "Upgrade your Forge ", transform.position); return(canReasearch); } else if (building.IsUpgrading) { EventLog.Instance.AddAction(LogType.Error, "You can't reasearch while the building is upgrading", transform.position); return(canReasearch); } else if (IsDoingResearch) { EventLog.Instance.AddAction(LogType.Error, "You can't research while doing another research", transform.position); return(canReasearch); } canReasearch = true; buttonCooldown.SetCooldown(damageResearchTime); EventManager.Instance.ResearchStarted(this); StartCoroutine(UpgradeDamage(damageResearchTime)); return(canReasearch); }
public void appendJournal(ButtonCooldown b) { GameControl.control.addToJournal(DateTime.Now.ToString ("t") + " - " + b.GetComponentInChildren<Text>().text/*GetComponentsInChildren<Text>()[0].text*/); b.SetCooldown (System.DateTime.Now.Ticks + 10000L * 1000L * 60L); b.interactable = false; AddCooldown (new Node (b.GetComponentInChildren<Text> ().text, b.GetCooldown ())); textboxInputs.text = GameControl.control.getJournal(); }
public void StopAttraction() { if (currentAttraction == null) { return; } if (currentAttraction.running) { currentAttraction.StopAttraction(); ButtonCooldown cooldown = stopButton.GetComponent <ButtonCooldown>(); cooldown.cooldownRunning = false; } }
public void PlayAttraction() { if (currentAttraction == null) { return; } if (!currentAttraction.running) { bool success = currentAttraction.StartAttraction(); if (success) { ButtonCooldown cooldown = stopButton.GetComponent <ButtonCooldown>(); cooldown.cooldown = (float)currentAttraction.duration; cooldown.cooldownRunning = true; PlayRandomAnsage(); } } }