public override int Attack(HumanClass target) { if (target is HumanClass) { int critical = rand.Next(1, 6); int dmg = 5 * Dexterity; if (critical == 1) { dmg += 10; target.Health -= dmg; Console.WriteLine($"{this.Name} critically kicked {target.Name} in the face! "); Console.WriteLine($"{target.Name} took {dmg} damage and has {target.Health} health left."); return(target.Health); } else { target.Health -= dmg; Console.WriteLine($"{Name} kicked {target.Name}! "); Console.WriteLine($"{target.Name} took {dmg} damage and has {target.Health} health left."); return(target.Health); } } else { throw new Exception("You can't attack that!"); } }
public int Heal(HumanClass target) { int heals = 10 * this.Intelligence; target.Health += heals; Console.WriteLine($"{this.Name} heals {target.Name} for {heals} health from {target.Health-heals}, and now has {target.Health}"); return(target.Health); }
public void Steal(HumanClass target) { int stealHealth = 5; target.Health -= stealHealth; this.Health = this.Health + stealHealth; Console.WriteLine($"{target.Name} took {stealHealth} damage and has {target.Health} health left."); Console.WriteLine($"{this.Name} took {stealHealth} health from {target.Name} and has {this.Health} health left."); }
public virtual int Attack(HumanClass target) { if (target is HumanClass) { int dmg = 5 * Strength; target.health -= dmg; Console.WriteLine($"{Name} devlivered a punishing blow to {target.Name} dealing {dmg} damage! "); return(target.health); } else { throw new Exception("You can't attack that!"); } }
public override int Attack(HumanClass target) { if (target.Health <= 50) { Console.WriteLine($"{this.Name} took advantage of {target.Name}'s weakend state and killed them in cold blood"); target.Health = 0; return(target.Health); } else { base.Attack(target); return(target.Health); } }
public override int Attack(HumanClass target) { if (target is HumanClass) { int dmg = 5 * Intelligence; target.Health -= dmg; this.Health += dmg; Console.WriteLine($"{Name} casted a fire spell at {target.Name}! "); Console.WriteLine($"{target.Name} took {dmg} damage and has {target.Health} health left."); Console.WriteLine($"{this.Name} gained { dmg } health and now has {this.Health}"); return(target.Health); } else { throw new Exception("You can't attack that!"); } }