public void Test_Initializing_SwordAttack_Items()
        {
            AttackItem attackItem = _factory.CreateAttackItem("sword", "Sting", 40);

            Assert.Equal("Sting", attackItem.Name);
            Assert.Equal(40, attackItem.Damage);
            Assert.Equal("Sword", attackItem.Type);
            Assert.Equal(1, attackItem.Range);
        }
Beispiel #2
0
        public void SetUpEnemyCreatures(int amountOfEnemies)
        {
            var    rndRank    = rnd.Next(0, 3);
            string rankString = "";

            if (rndRank == 1)
            {
                rankString = "boss";
            }
            if (rndRank == 2)
            {
                rankString = "lieutenant";
            }
            if (rndRank == 3)
            {
                rankString = "minion";
            }
            var creature = CreatureFactory.CreateEnemyCreature(rankString, null);

            creature.AttackItems.AddAttackItem(ItemFactory.CreateAttackItem("sword", "Orchrist", 15, 1));
            creature.DefencesItems.AddDefenceItem(ItemFactory.CreateDefenceItem("armour", "BreastPlate of Salazar", 10));
            creature.DefencesItems.AddDefenceItem(ItemFactory.CreateDefenceItem("boots", "Boots of Thunder", 2));

            World.WorldPlayGround[creature.Position.X, creature.Position.Y].Creature = creature;
            if (amountOfEnemies - 1 > 0)
            {
                SetUpEnemyCreatures(--amountOfEnemies);
            }
        }
Beispiel #3
0
 public void SetUpPlayer(string name, Position?position)
 {
     Player = CreatureFactory.CreatePlayerCreature(name, position);
     Player.AttackItems.AddAttackItem(ItemFactory.CreateAttackItem("sword", "Sting", 50, 1));
     Player.DefencesItems.AddDefenceItem(ItemFactory.CreateDefenceItem("armour", "Mithril Coat", 45));
     Player.DefencesItems.AddDefenceItem(ItemFactory.CreateDefenceItem("boots", "Hairy Hobbit Feet", 5));
     Player.DefencesItems.AddDefenceItem(ItemFactory.CreateDefenceItem("helmet", "Helmet of Gloin", 15));
     World.WorldPlayGround[Player.Position.X, Player.Position.Y].Creature = Player;
 }
Beispiel #4
0
 public void SetUpPlayer(string name, Position?position)
 {
     Player = CreatureFactory.CreatePlayerCreature(name, position);
     Player.AttackItems.AddAttackItem(ItemFactory.CreateAttackItem("bow", "Bow of the Galadhrim", 25, RangeEnum.Long));
     Player.AttackItems.AddAttackItem(ItemFactory.CreateAttackItem("sword", "Dual long knives", 50, RangeEnum.Short));
     Player.DefenceItems.AddDefenceItem(ItemFactory.CreateDefenceItem("armour", "Leather coat", 25));
     Player.DefenceItems.AddDefenceItem(ItemFactory.CreateDefenceItem("boots", "Leather boots", 15));
     World.WorldPlayGround[Player.Position.X, Player.Position.Y].Creature = Player;
 }
Beispiel #5
0
        public void Test_Creature_Drops_Inventory_Upon_Death()
        {
            var sword  = _itmFactory.CreateAttackItem("sword", "Orchrist", 60, 1);
            var helmet = _itmFactory.CreateDefenceItem("helmet", "Gimli's helmet", 20);

            _enemy.AttackItems.AddAttackItem(sword);
            _enemy.DefencesItems.AddDefenceItem(helmet);
            _enemy.HitPoints = 5;
            _player.Hit(_enemy);

            var expectedItemsOnGround = new List <IItem>
            {
                sword,
                helmet,
            };

            Assert.Equal(expectedItemsOnGround, _world.WorldPlayGround[_enemy.Position.X, _enemy.Position.Y].Object);
        }