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