示例#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));
        }
示例#2
0
 public override Type TypeOfAttack()
 {
     return(attack.TypeOfAttack());
 }