예제 #1
0
 /// <summary>
 /// <see text="Overridden from " cref="Monster.getDamage(int, Monster, Hero)"/>
 /// </summary>
 public override 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;
     }
     Logger.printMsgPlayer("Arggh, Casual Monster got damaged...");
     this.Health -= damage - (int)(this.armor * 0.25);
 }
예제 #2
0
 /// <summary>
 /// <see text="Overridden from " cref="Hero.doCritical(Monster, Hero)"/>
 /// </summary>
 public override void doCritical(Monster monster = null, Hero hero = null)
 {
     if (monster == null)
     {
         Logger.printMsgSystem("Sorry, but there is no Monster to attack!");
         return;
     }
     Logger.printMsgSystem(String.Format("Hero {0} did a critical damage to {1}!", this.Name, monster.getMonsterName()));
     int criticalDamageToDeal = (int)(this.Damage * this.criticalChance) + this.Damage;
     monster.getDamage(criticalDamageToDeal, hero: this);
 }
예제 #3
0
파일: Monster.cs 프로젝트: maximgonchar/kpi
 /// <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);
 }
예제 #4
0
 /// <summary>
 /// <see text="Overridden from " cref="Monster.dealDamage(Monster, Hero)"/>
 /// </summary>
 public override 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("Arggh, Casual Monster is attacking!");
     hero.getDamage(this.Damage, monster: this);
 }
예제 #5
0
 /// <summary>
 /// <see text="Overridden from " cref="Hero.getDamage(int, Monster, Hero)"/>
 /// </summary>
 public override void getDamage(int damage, Monster monster = null, Hero hero = null)
 {
     Logger.printMsgPlayer("Oh no, our SwordsMan has been damaged!");
     this.Health -= 1;
 }
예제 #6
0
 /// <summary>
 /// <see text="Overridden from " cref="Hero.dealDamage(Monster, Hero)"/>
 /// </summary>
 public override void dealDamage(Monster monster = null, Hero hero = null)
 {
     this.prepareToFight();
     Logger.printMsgPlayer("Ha-Ha, our Swordsman is attacking!");
     monster.getDamage(this.Damage, hero: this);
 }
예제 #7
0
 /// <summary>
 /// <see text="Overridden from " cref="Hero.getDamage(int, Monster, Hero)"/>
 /// </summary>
 public override void getDamage(int damage, Monster monster = null, Hero hero = null)
 {
     Logger.printMsgPlayer("Oh no, Weak knight got damaged...");
     this.Health -= damage;
 }
예제 #8
0
 /// <summary>
 /// <see text="Overridden from " cref="Hero.dealDamage(Monster, Hero)"/>
 /// </summary>
 public override void dealDamage(Monster monster = null, Hero hero = null)
 {
     this.prepareToFight();
     Logger.printMsgPlayer("Master, I will fight for you! WeakKnight is attacking!");
     monster.getDamage(this.Damage, hero: this);
 }
예제 #9
0
파일: Monster.cs 프로젝트: maximgonchar/kpi
 /// <summary>
 /// <para>Deal a critical damage to the Monster.</para>
 /// <see cref="SwordsMan" text=" - Overridden in SwordsMan class."/>
 /// </summary>
 /// <param name="monster">Monster that deals a critical damage.</param>
 /// <param name="hero">Hero, that hits a monster.</param>
 public virtual void doCritical(Monster monster = null, Hero hero = null)
 {
     Logger.printMsgSystem("This monster cannot use a critical hit ability.");
 }
예제 #10
0
파일: Monster.cs 프로젝트: maximgonchar/kpi
 /// <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));
 }
예제 #11
0
파일: Hero.cs 프로젝트: maximgonchar/kpi
 /// <summary>
 /// <para>Get damage from the Monster.</para>
 /// <para>Usage: you can leave Hero object empty and only pass a Monster instance and damage as arguments.</para>
 /// </summary>
 /// <param name="damage">Damage to be taken.</param>
 /// <param name="monster">Monster to take damage from.</param>
 /// <param name="hero">Leave it empty.</param>
 public virtual void getDamage(int damage, Monster monster = null, Hero hero = null)
 {
     if (monster == null)
     {
         Logger.printMsgSystem("Sorry, but there is no Monster to get damage from!");
         return;
     }
     this.Health -= damage;
     Logger.printMsgPlayer(
         String.Format(
             "Oh no, monster {0} dealed {1} damage to me, {2}!",
             monster.getMonsterName(), damage, this.Name));
 }