public void TestInitializer() { Trace.WriteLine("Creating default map..."); map = new Map(new Size(100, 100), 1, MapGenerator.Grass); Trace.WriteLine("Creating default player..."); player = new Player(map.Layers.First(), new Point(50, 50)); Trace.WriteLine("Creating default mob..."); mob = new Mob("TestMob", map.Layers.First(), new Point(1, 1), null, null, 2, 1, 0, 15, 'M', ConsoleColor.Black, MobType.Orc); Assert.IsInstanceOfType(map, typeof(Map), "Failed to initialize the map."); Assert.IsInstanceOfType(player, typeof(Player), "Failed to initiaze the player."); Assert.IsInstanceOfType(mob, typeof(Mob), "Failed to initialize the mob."); }
/// <summary> /// Attacks the specified mob /// </summary> /// <param name="mob"></param> /// <param name="attackStrength"></param> /// <returns>Tuple containing the amount of damage dealt to the mob and if the attack killed the mob or not</returns> public Tuple<int, bool> AttackMob(Mob mob, int attackStrength) { return Tuple.Create(mob.ReceiveDamage(attackStrength + (int)Math.Floor(this.AttackStat * (this.OffensiveSlot == null ? 1 : this.OffensiveSlot.AttackMultiplier))), mob.Health < 1); }