コード例 #1
0
ファイル: Monster.cs プロジェクト: Tayum/KPI-Courses
 /// <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);
 }
コード例 #2
0
ファイル: CasualMonster.cs プロジェクト: maximgonchar/kpi
 /// <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);
 }
コード例 #3
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);
 }
コード例 #4
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);
 }
コード例 #5
0
ファイル: Boss.cs プロジェクト: maximgonchar/kpi
 /// <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);
 }
コード例 #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);
        }