コード例 #1
0
 /// <summary>
 /// <para>Deal damage to the Monster.</para>
 /// <para>Usage: you can leave Hero object empty and only pass a Monster instance as an argument.</para>
 /// </summary>
 /// <param name="monster">Monster to deal damage.</param>
 /// <param name="hero">Leave it empty.</param>
 public virtual void dealDamage(Monster monster = null, Hero hero = null)
 {
     if (monster == null)
     {
         Logger.printMsgSystem("Sorry, but there is no Monster to attack!");
         return;
     }
     this.prepareToFight();
     Logger.printMsgPlayer(String.Format("Hero {0} is starting hitting a monster {1}!", this.Name, monster.getMonsterName()));
     monster.getDamage(this.Damage, hero: this);
 }
コード例 #2
0
ファイル: SwordsMan.cs プロジェクト: maximgonchar/kpi
 /// <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
ファイル: Hero.cs プロジェクト: maximgonchar/kpi
 /// <summary>
 /// <para>Deal damage to the Monster.</para>
 /// <para>Usage: you can leave Hero object empty and only pass a Monster instance as an argument.</para>
 /// </summary>
 /// <param name="monster">Monster to deal damage.</param>
 /// <param name="hero">Leave it empty.</param>
 public virtual void dealDamage(Monster monster = null, Hero hero = null)
 {
     if (monster == null)
     {
         Logger.printMsgSystem("Sorry, but there is no Monster to attack!");
         return;
     }
     this.prepareToFight();
     Logger.printMsgPlayer(String.Format("Hero {0} is starting hitting a monster {1}!", this.Name, monster.getMonsterName()));
     monster.getDamage(this.Damage, hero: this);
 }
コード例 #4
0
ファイル: SwordsMan.cs プロジェクト: Tayum/KPI-Courses
        /// <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);
        }
コード例 #5
0
ファイル: SwordsMan.cs プロジェクト: maximgonchar/kpi
 /// <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);
 }
コード例 #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("Master, I will fight for you! WeakKnight is attacking!");
     monster.getDamage(this.Damage, hero: this);
 }
コード例 #7
0
ファイル: WeakKnight.cs プロジェクト: maximgonchar/kpi
 /// <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);
 }
コード例 #8
0
ファイル: SwordsMan.cs プロジェクト: Tayum/KPI-Courses
 /// <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);
 }