コード例 #1
0
 public void Cast()
 {
     if (spell.spellType == SpellType.Destruction)
     {
         DestructionSpell destructionSpell = (DestructionSpell)spell;
         BattleSystem.battleSystem.PlayerCastSpell(destructionSpell);
     }
     else if (spell.spellType == SpellType.Restoration)
     {
         RestorationSpell restorationSpell = (RestorationSpell)spell;
         BattleSystem.battleSystem.PlayerCastSpell(restorationSpell);
     }
     else if (spell.spellType == SpellType.StatusEffect)
     {
         StatusEffectSpell statusEffectSpell = (StatusEffectSpell)spell;
         BattleSystem.battleSystem.PlayerCastSpell(statusEffectSpell);
     }
 }
コード例 #2
0
    IEnumerator PlayerCastDestructionSpellTxt(DestructionSpell destructionSpell)
    {
        if (player1.mana - destructionSpell.manaCost < 0)
        {
            optionMenu.SetFullText(player1.characterName + " is out of mana");
            yield return(new WaitForSeconds(2f));
        }
        else
        {
            dmg = destructionSpell.damage.roll();
            optionMenu.SetFullText(player1.characterName + " cast " + destructionSpell.spellName + " and did " + dmg + " damage");
            yield return(new WaitForSeconds(2f));

            player1.TriggerSpellAnimation();
            yield return(new WaitForSeconds(2f));

            player1.SetMana(destructionSpell.manaCost);
        }

        StartCoroutine(PlayerAnimationEnd());
    }
コード例 #3
0
 public void PlayerCastSpell(DestructionSpell destructionSpell)
 {
     StartCoroutine(PlayerCastDestructionSpellTxt(destructionSpell));
 }