Exemple #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);
     }
 }
    IEnumerator PlayerCastStatusEffectSpellTxt(StatusEffectSpell spell)
    {
        if (player1.mana - spell.manaCost < 0)
        {
            optionMenu.SetFullText(player1.characterName + " is out of mana");
            yield return(new WaitForSeconds(2f));
        }
        else
        {
            optionMenu.SetFullText(player1.characterName + " cast " + spell.spellName + " and poisoned " + AI.characterName);
            yield return(new WaitForSeconds(2f));

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

            player1.SetMana(spell.manaCost);
            AI.activeStatus.Add(spell);
        }
        player1.PlayAttackAudio();

        StartCoroutine(PlayerAnimationEnd());
    }
 public void PlayerCastSpell(StatusEffectSpell spell)
 {
     StartCoroutine(PlayerCastStatusEffectSpellTxt(spell));
 }