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 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()); }
public void PlayerCastSpell(DestructionSpell destructionSpell) { StartCoroutine(PlayerCastDestructionSpellTxt(destructionSpell)); }