Exemple #1
0
        public override string Attack(Attack attack, Entity target)
        {
            if (attack.TypeOfAttack() == typeof(Spell) && attack.Cost > CurrentMana)
            {
                return("Not enough mana to cast this spell.");
            }
            else if (attack.TypeOfAttack() == typeof(Weapon) && attack.Cost > CurrentStamina)
            {
                return("You are too tired to do that.");
            }

            if (attack.TypeOfAttack() == typeof(Spell))
            {
                CurrentMana -= attack.Cost;
            }
            else
            {
                CurrentStamina -= attack.Cost;
            }

            return(base.Attack(attack, target));
        }
Exemple #2
0
 public override Type TypeOfAttack()
 {
     return(attack.TypeOfAttack());
 }