Beispiel #1
0
 /// <summary>
 /// <para>Deal damage to the hero.</para>
 /// </summary>
 /// <param name="monster">Leave this empty.</param>
 /// <param name="hero">Hero to deal damage.</param>
 public virtual void dealDamage(Monster monster = null, Hero hero = null)
 {
     if (hero == null)
     {
         Logger.printMsgSystem("Sorry, but there is no Hero to attack!");
         return;
     }
     this.prepareToFight();
     Logger.printMsgPlayer(String.Format("Monster {0} is starting hitting a hero {1}!", this.Name, hero.getHeroName()));
     hero.getDamage(this.Damage, monster: this);
 }
Beispiel #2
0
 /// <summary>
 /// <see text="Overridden from " cref="Monster.doCritical(Monster, Hero)"/>
 /// </summary>
 public override void doCritical(Monster monster = null, Hero hero = null)
 {
     if (hero == null)
     {
         Logger.printMsgSystem("Sorry, but there is no Hero to attack!");
         return;
     }
     Logger.printMsgSystem(String.Format("Monster {0} did a critical damage to {1}!", this.Name, hero.getHeroName()));
     int criticalDamageToDeal = (int)(this.Damage * this.criticalChance) + this.Damage;
     hero.getDamage(criticalDamageToDeal, monster: this);
 }
Beispiel #3
0
 /// <summary>
 /// <para>Get damage (reduce Health) from the hero</para>
 /// </summary>
 /// <param name="damage">Damage to get from Hero.</param>
 /// <param name="monster">Leave it empty.</param>
 /// <param name="hero">Hero get damage from.</param>
 public virtual void getDamage(int damage, Monster monster = null, Hero hero = null)
 {
     if (hero == null)
     {
         Logger.printMsgSystem("Sorry, but there is no Hero to get damage from!");
         return;
     }
     this.Health -= damage - (int)(this.armor * 0.25);
     Logger.printMsgPlayer(
         String.Format(
             "Arrrgh, hero {0} dealed {1} damage to me, {2}!",
             hero.getHeroName(), damage, this.Name));
 }
Beispiel #4
0
 /// <summary>
 /// <para>Deal damage to the hero.</para>
 /// </summary>
 /// <param name="monster">Leave this empty.</param>
 /// <param name="hero">Hero to deal damage.</param>
 public virtual void dealDamage(Monster monster = null, Hero hero = null)
 {
     if (hero == null)
     {
         Logger.printMsgSystem("Sorry, but there is no Hero to attack!");
         return;
     }
     this.prepareToFight();
     Logger.printMsgPlayer(String.Format("Monster {0} is starting hitting a hero {1}!", this.Name, hero.getHeroName()));
     hero.getDamage(this.Damage, monster: this);
 }
Beispiel #5
0
 /// <summary>
 /// <para>Get damage (reduce Health) from the hero</para>
 /// </summary>
 /// <param name="damage">Damage to get from Hero.</param>
 /// <param name="monster">Leave it empty.</param>
 /// <param name="hero">Hero get damage from.</param>
 public virtual void getDamage(int damage, Monster monster = null, Hero hero = null)
 {
     if (hero == null)
     {
         Logger.printMsgSystem("Sorry, but there is no Hero to get damage from!");
         return;
     }
     this.Health -= damage - (int)(this.armor * 0.25);
     Logger.printMsgPlayer(
         String.Format(
             "Arrrgh, hero {0} dealed {1} damage to me, {2}!",
             hero.getHeroName(), damage, this.Name));
 }
Beispiel #6
0
        /// <summary>
        /// <see text="Overridden from " cref="Monster.doCritical(Monster, Hero)"/>
        /// </summary>
        public override void doCritical(Monster monster = null, Hero hero = null)
        {
            if (hero == null)
            {
                Logger.printMsgSystem("Sorry, but there is no Hero to attack!");
                return;
            }
            Logger.printMsgSystem(String.Format("Monster {0} did a critical damage to {1}!", this.Name, hero.getHeroName()));
            int criticalDamageToDeal = (int)(this.Damage * this.criticalChance) + this.Damage;

            hero.getDamage(criticalDamageToDeal, monster: this);
        }