/// <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); }
/// <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); }
/// <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); }