Esempio n. 1
0
 public void UpdateIconStatus(AbilityTypes t, float status)
 {
     if (slots.Count == 0)
     {
         Debug.LogError("AbilityDisplay::UpdateIconStatus(" + t.ToString() + ", " + status.ToString() + "): slots.Count==0");
         return;
     }
     if (indxForAbility [(int)t] >= slots.Count || indxForAbility [(int)t] < 0)
     {
         Debug.LogError("AbilityDisplay::UpdateIconStatus for " + t.ToString() + " has index " + indxForAbility [(int)t].ToString());
         return;
     }
     slots [indxForAbility [(int)t]].SetFill(1 - status);
 }
Esempio n. 2
0
    public void UseAbility()
    {
        AbilitySpawnPoint = GameObject.Find($"{Type.ToString()}SpawnPoint").transform; //TODO how inefficient is this
        Instantiate(AbilityPrefab, AbilitySpawnPoint.position, Quaternion.identity);

        //Debug.Log($"{Name} has been fired");
    }
Esempio n. 3
0
        public virtual string GetDescription()
        {
            string description = AbilityName + " - " + abilityType.ToString() + "\n";

            description += "MP: " + abilityCost + " - Range: " + range + "\n";
            description += "Target: " + TargetingType.ToString();

            return(description);
        }
Esempio n. 4
0
    public void Remove(AbilityTypes t)
    {
        int i = indxForAbility [(int)t];

        if (i < 0 || i >= slots.Count)
        {
            Debug.LogError("AbilityDisplay::Remove(" + t.ToString() + ") has indxForAbility = " + i.ToString() + " and slots.Count is " + slots.Count.ToString());
            return;
        }
        AbilityIcon icon = slots[i];

        icon.Fade();
        slots.RemoveAt(i);
        free.Add(icon);
        indxForAbility [(int)t] = -1;
        for (int j = i; j < slots.Count; ++j)
        {
            slots [j].ShiftLeft();
            --indxForAbility [(int)slots [j].Type()];
        }
    }
Esempio n. 5
0
    public void UpgradeAbility(AbilityTypes at)
    {
        if (!CanUpgrade(at))
        {
            Debug.LogWarning("Store::UpgradeAbility: You don't have enough money to upgrade ability " + at.ToString());
            return;
        }
        int level = AbilityLevel(at);
        int price = abilities[at].cost[level + 1];

        ++data.abilityLevels[at];
        data.money -= price;
        SendDataChangedEvent();
        Save();
    }