Пример #1
0
        /// <summary>
        /// update the game item category lists
        /// </summary>
        public void UpdateInventoryCategories()
        {
            Medical.Clear();
            Weapons.Clear();
            Treasure.Clear();
            Clues.Clear();

            foreach (var gameItem in _inventory)
            {
                if (gameItem is MedicalAid)
                {
                    Medical.Add(gameItem);
                }
                if (gameItem is Weapon)
                {
                    Weapons.Add(gameItem);
                }
                if (gameItem is Treasure)
                {
                    Treasure.Add(gameItem);
                }
                if (gameItem is Clues)
                {
                    Clues.Add(gameItem);
                }
            }
        }
Пример #2
0
        public void InventoryUpdate()
        {
            Weapons.Clear();
            Artifacts.Clear();
            Spells.Clear();
            Treasure.Clear();


            foreach (var gameItem in _inventory)
            {
                if (gameItem is Weapon)
                {
                    Weapons.Add(gameItem);                     //1000
                }
                if (gameItem is Artifact)
                {
                    Artifacts.Add(gameItem);                       //2000
                }
                if (gameItem is Spell)
                {
                    Spells.Add(gameItem);                    //3000
                }
                if (gameItem is Treasure)
                {
                    Treasure.Add(gameItem);                       //4000
                }
            }
        }
Пример #3
0
        public void UpdateInventoryCategories()
        {
            Potions.Clear();
            Weapons.Clear();
            Treasure.Clear();
            Keys.Clear();

            foreach (var gameItemQuantity in _inventory)
            {
                if (gameItemQuantity.GameItem is Potions)
                {
                    Potions.Add(gameItemQuantity);
                }
                if (gameItemQuantity.GameItem is Weapons)
                {
                    Weapons.Add(gameItemQuantity);
                }
                if (gameItemQuantity.GameItem is Treasure)
                {
                    Treasure.Add(gameItemQuantity);
                }
                if (gameItemQuantity.GameItem is Keys)
                {
                    Keys.Add(gameItemQuantity);
                }
            }
        }
Пример #4
0
        private void InitializeLoot()
        {
            Random rand = new Random();

            _chest = new Treasure(rand.Next(1, 11));

            _chest.GenerateItems();
            _chest.PopulateContainer();

            _NPCList.NPCs[2].Inventory.Add(_chest.Keys[0]);
        }