Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
    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);
    }
Ejemplo n.º 3
0
 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();
 }
Ejemplo n.º 4
0
    private IEnumerator DoUpgrade(float time)
    {
        EventManager.Instance.BuildingUpgradeStarted(this);
        upgradeCooldown.SetCooldown(upgradeTime);
        isUpgrading = true;
        yield return(new WaitForSeconds(time));

        isUpgrading = false;
        currentLevel++;
        Sound.Instance.PlaySoundClipWithSource(upgradeCompleteSoundHolder, audioSource, 0);
        behaviour.LevelUp();
        base.LevelUp();
        DispenseAllSettlers();
        EventLog.Instance.AddAction(LogType.Upgraded, objectName.ToString() + " leveled from " + (currentLevel - 1) + " to " + currentLevel, transform.position);
    }
Ejemplo n.º 5
0
 public void ExecuteSkill(Transform target)
 {
     Manager.Instance.SkillOnMouse = false;
     PoolHolder.Instance.GetObjectActive(ParentObjectNameEnum.Character).GetComponent <Character>().Cast(skillObject, target);
     buttonCooldown.SetCooldown(skill.CooldownAmount);
 }