// Constructor public BattleScreen(Hero hero, Monster monster) { this.monster = monster; this.hero = hero; this.monsterStartHealt = monster.Health; this.heroStartHealth = hero.Health; }
private static void MonsterAttack(Hero hero, Monster monster) { activated = hero.Shield.ActivateSpecial(); hero.TakeDamage(monster.Damage - (int)hero.Shield.Defense); if (activated) { hero.Shield.DeactivateSpecial(); } if (hero.Health <= 0) { hero.Die(); Sounds.StopBattleMusic(); Sounds.StartMapMusic(); } BlessingOfTheBattle(monster); }
/// <summary> /// Performs the hero attack /// </summary> public static void HeroAttack(Hero hero, Monster monster) { activated = hero.Weapon.ActivateSpecial(); monster.TakeDamage( randomGenerator.Next( hero.Damage + hero.Weapon.Damage, hero.DamageMax + hero.Weapon.Damage + 1)); if (activated) { hero.Weapon.DeactivateSpecial(); } if (monster.Health <= 0) { monster.Die(); Sounds.StopBattleMusic(); Sounds.StartMapMusic(); } BlessingOfTheBattle(hero); if (!(activated && hero.Weapon is Flail)) { MonsterAttack(hero, monster); } }