Exemplo n.º 1
0
        public void EquipeMagicItemTest2()
        {
            Character hero = new Character()
            {
                BaseStrength     = 10,
                BaseDexterity    = 10,
                BaseConstitution = 10,
                BaseInteligence  = 10,
                BaseWisdom       = 10,
                BaseCharisma     = 10,
                SizeType         = SizeType.Medium
            };

            var ring = MagicItems.RingOfAcrobatics();

            Assert.Empty(hero.Inventory);

            hero.AddToInventory(ring);

            Assert.Single(hero.Inventory);

            Assert.True(hero.CanEquipeItem(SlotType.Ring, ring, out EquipmentSlot slot));

            Assert.Equal(0, hero.BasicSkillInfo(SkillType.Acrobatics)[2]);

            hero.EquipeItem(ring);

            Assert.Equal(1, hero.BasicSkillInfo(SkillType.Acrobatics)[2]);

            hero.UnEquipeItem(ring);

            Assert.Equal(0, hero.MiscStrength);
        }
Exemplo n.º 2
0
        public void EquipeMagicItemTest1()
        {
            Character hero = new Character()
            {
                BaseStrength     = 10,
                BaseDexterity    = 10,
                BaseConstitution = 10,
                BaseInteligence  = 10,
                BaseWisdom       = 10,
                BaseCharisma     = 10,
                SizeType         = SizeType.Medium
            };

            var belt = MagicItems.BeltOfGiantStrength();

            Assert.Empty(hero.Inventory);

            hero.AddToInventory(belt);

            Assert.Single(hero.Inventory);

            Assert.True(hero.CanEquipeItem(SlotType.Belt, belt, out EquipmentSlot slot));

            Assert.Equal(0, hero.MiscStrength);

            hero.EquipeItem(belt);

            Assert.Equal(2, hero.MiscStrength);

            hero.UnEquipeItem(belt);

            Assert.Equal(0, hero.MiscStrength);
        }
Exemplo n.º 3
0
        public void UseMagicalItem(string itemName)
        {
            int powerReduction = 10;

            var itemToReduce = MagicItems.First(item => item.Name == itemName && item.Power > 0);

            if (itemToReduce != null)
            {
                itemToReduce.Power -= powerReduction;
            }
        }
Exemplo n.º 4
0
        public void MogwaiMagicItem()
        {
            var ringOfMogwan  = MagicItems.BoneOfMogwan();
            var ringOfTheBear = MagicItems.RingOfTheBear();

            Assert.Empty(Mogwai.Inventory);

            Mogwai.AddToInventory(ringOfMogwan);
            Mogwai.AddToInventory(ringOfTheBear);

            Assert.Equal(2, Mogwai.Inventory.Count);
            Assert.Equal(0, Mogwai.StrengthMod);
            Assert.Equal(0, Mogwai.DexterityMod);
            Assert.Equal(0, Mogwai.ConstitutionMod);
            Assert.Equal(0, Mogwai.InteligenceMod);
            Assert.Equal(1, Mogwai.WisdomMod);
            Assert.Equal(3, Mogwai.CharismaMod);

            Mogwai.EquipeItem(SlotType.Ring, ringOfMogwan, 0);

            Assert.Equal(1, Mogwai.Inventory.Count);
            Assert.Equal(1, Mogwai.StrengthMod);
            Assert.Equal(1, Mogwai.DexterityMod);
            Assert.Equal(1, Mogwai.ConstitutionMod);
            Assert.Equal(1, Mogwai.InteligenceMod);
            Assert.Equal(2, Mogwai.WisdomMod);
            Assert.Equal(4, Mogwai.CharismaMod);

            Mogwai.EquipeItem(SlotType.Ring, ringOfTheBear, 0);

            Assert.Equal(1, Mogwai.Inventory.Count);
            Assert.Equal(1, Mogwai.StrengthMod);
            Assert.Equal(0, Mogwai.DexterityMod);
            Assert.Equal(0, Mogwai.ConstitutionMod);
            Assert.Equal(0, Mogwai.InteligenceMod);
            Assert.Equal(1, Mogwai.WisdomMod);
            Assert.Equal(3, Mogwai.CharismaMod);
        }
Exemplo n.º 5
0
        public void UnitySampleTest()
        {
            Character hero = new Character()
            {
                Name = "Kazmuk",

                BaseStrength     = 16,
                BaseDexterity    = 16,
                BaseConstitution = 12,
                BaseInteligence  = 16,
                BaseWisdom       = 16,
                BaseCharisma     = 10,

                SizeType  = SizeType.Medium,
                BaseSpeed = 30
            };

            var weapon = Weapons.DwarvenLonghammer(hero.SizeType);

            hero.AddToInventory(weapon);
            hero.EquipeWeapon(weapon);

            var belt = MagicItems.BeltOfGiantStrength();

            hero.AddToInventory(belt);
            hero.EquipeItem(belt);

            Assert.Equal(0, hero.MiscInitiative);

            hero.LevelClass(ClassType.Inquisitor);
            hero.LevelUp();

            hero.LevelClass(ClassType.Inquisitor);

            Assert.Equal(3, hero.MiscInitiative);
        }
Exemplo n.º 6
0
 public void AddMagicItem(MagicItem item)
 {
     MagicItems.Add(item);
 }