Пример #1
0
        public void TestDropFail()
        {
            var config    = this.GetGameConfig();
            var generator = new DefaultDropGenerator(config, this.GetRandomizer(9999));
            var item      = generator.GenerateItemDrops(this.GetMonster(1), 0, TestHelper.CreatePlayer(), out _).FirstOrDefault();

            Assert.That(item, Is.Null);
        }
Пример #2
0
        public void TestItemDropItemByMonster()
        {
            var config  = this.GetGameConfig();
            var monster = this.GetMonster(1);

            monster.DropItemGroups.AddBasicDropItemGroups();
            monster.DropItemGroups.Add(3000, SpecialItemType.Ancient, true);

            var generator = new DefaultDropGenerator(config, this.GetRandomizer2(0, 0.5));
            var item      = generator.GenerateItemDrops(monster, 1, TestHelper.CreatePlayer(), out _).FirstOrDefault();

            Assert.That(item, Is.Not.Null);

            // ReSharper disable once PossibleNullReferenceException
            Assert.That(item !.Definition, Is.EqualTo(monster.DropItemGroups.Last().PossibleItems.First()));
        }