Пример #1
0
    public void SpendMana(Spell _spell)
    {
        int realManaCost = spellRepository.Get(_spell.ID).manaCost;

        if (_spell.ID == SPELL.WORD_OF_KINGS_FAITH)
        {
            if (ConsumeCasterBuff(CASTERBUFF.HAND_OF_LIGHT))
            {
                realManaCost = 0;
            }
        }

        if (_spell.ID == SPELL.WORD_OF_KINGS_LOYALTY)
        {
            realManaCost = (int)Mathf.Max(0, realManaCost - realManaCost * myCaster.myAura[(int)AURA.ROYALTY].stacks * VALUES.ROYALTY_PERCENT);
        }


        bool spellException = false;

        if (_spell.ID == (int)SPELL.WORD_OF_KINGS_LIGHT)
        {
            if (myCaster.myAura[(int)AURA.MODESTY].isActive)
            {
                if (isTSR)
                {
                    spellException = true;
                }
            }
        }

        if ((GameCore.Core.spellRepository.Get(_spell.ID).manaCost > 0) && (!spellException))
        {
            TSRtimer = 0;
            if (isTSR)
            {
                isTSR = false;
                myManaBar.GetComponent <Image>().sprite = Resources.Load <Sprite>("manabar");
            }
        }

        ManaCurrent -= realManaCost;
    }
Пример #2
0
    public static string GetSpellDescription(CHAMPION classID, int num)
    {
        SpellRepository spellRepo = GameCore.Core.spellRepository;

        if (classID == CHAMPION.PALADIN)
        {
            switch (num)
            {
            case 0: return(spellRepo.Get(SPELL.WORD_OF_KINGS_LIGHT).GetSpellDescription());

            case 1: return(spellRepo.Get(SPELL.WORD_OF_KINGS_COURAGE).GetSpellDescription());

            case 2: return(spellRepo.Get(SPELL.WORD_OF_KINGS_FAITH).GetSpellDescription());

            case 3: return(spellRepo.Get(SPELL.WORD_OF_KINGS_LOYALTY).GetSpellDescription());

            case 4: return(spellRepo.Get(SPELL.DIVINE_INTERVENTION).GetSpellDescription());
            }
        }
        else
        if (classID == CHAMPION.SHADOWMANCER)
        {
            switch (num)
            {
            case 0: return(spellRepo.Get(SPELL.SOOTHING_VOID).GetSpellDescription());

            case 1: return(spellRepo.Get(SPELL.SHADOWSURGE).GetSpellDescription());

            case 2: return(spellRepo.Get(SPELL.TWILIGHT_BEAM).GetSpellDescription());

            case 3: return(spellRepo.Get(SPELL.SHADOWSONG).GetSpellDescription());

            case 4: return(spellRepo.Get(SPELL.SACRIFICE).GetSpellDescription());
            }
        }
        return("");
    }