Пример #1
0
        public override string Attack(ICharacter enemy, ISkill skill)
        {
            if (this.ManaPoints >= skill.ManaCost)
            {
                int damage = skill.Hit(enemy);
                this.ManaPoints -= skill.ManaCost;
                return string.Format("Enemy cast {0}\n and dealt {1} damage to you!", skill.Name, damage);
            }

            return string.Format("The {0} does not have enough mana to cast {1}", this.GetType().Name, skill.Name);
        }
Пример #2
0
        public override string Attack(ICharacter enemy, ISkill skill)
        {
            if (this.ManaPoints >= skill.ManaCost)
            {
                int damage = skill.Hit(enemy);
                this.ManaPoints -= skill.ManaCost;
                return string.Format("You cast {0}{1} and dealt {2} damage to the enemy!",
                                    skill.Name, Environment.NewLine, damage);
            }

            return string.Format(Messages.NotEnoughManaError, skill.Name);
        }