Пример #1
0
    public void AddComponent(AuricaSpellComponent newComponent)
    {
        if (currentComponents.Count >= 10)
        {
            currentManaCost += 10f;
        }
        else if (currentComponents.Count > 12)
        {
            currentManaCost += 20f;
        }
        currentComponents.Add(newComponent);
        currentManaCost += newComponent.GetManaCost(aura.GetAura());
        ManaDistribution oldMd = currentDistribution;

        currentDistribution = newComponent.CalculateDistributionChange(currentDistribution, aura.GetAura());

        //Debug.Log("Added component: " + newComponent.c_name + "    Current Mana Cost: " + currentManaCost);
        //Debug.Log("Old Distribution: " + oldMd.ToString() + "    New Distribution: " + currentDistribution.ToString());

        if (distDisplay != null)
        {
            distDisplay.SetDistribution(currentDistribution);
        }
        if (cpUI != null)
        {
            cpUI.AddComponent(newComponent);
        }
    }
Пример #2
0
    public void PopulateFromSpell(AuricaSpell s)
    {
        spell            = s;
        title.text       = spell.c_name;
        description.text = spell.description;
        targetDistDisplay.SetDistribution(spell.targetDistribution);
        targetDistDisplayValues.SetDistribution(spell.targetDistribution);
        // Debug.Log("IDEAL AURA:    "+spell.IdealAuraCalculation().ToString());
        if (!isCasterAgnostic)
        {
            spellEfficacyText.text = string.Format("{0:N2}", AuricaCaster.LocalCaster.GetSpellStrength() * 100f) + "%";
            manaCostText.text      = string.Format("{0:N2}", AuricaCaster.LocalCaster.GetManaCost());
        }
        if (componentUIList != null)
        {
            componentUIList.ResetList();
            foreach (var component in spell.keyComponents)
            {
                componentUIList.AddComponent(component);
            }
        }

        if (gameObject.activeInHierarchy)
        {
            StartCoroutine(SetTargetDist(spell.targetDistribution));
        }
    }
Пример #3
0
    public void SetAura(Aura a)
    {
        aura = a;
        auraDisplay.SetDistribution(aura.GetAura());
        auraValues.SetDistribution(aura.GetAura());
        resistanceValues.SetDistribution(aura.GetInnateStrength());
        strengthValues.SetDistribution(aura.GetInnateStrength());
        manaText.text = "Maximum Mana: " + (aura.GetAggregatePower() * 100f);

        gameObject.SetActive(false);
    }