Exemplo n.º 1
0
        private void PopulateDrop(TypeDrop actualDrop)
        {
            switch (actualDrop)
            {
            case TypeDrop.Gold:
            {
                StatsManager.Instance.AddGold(CostDrop());
                break;
            }

            case TypeDrop.Weapon:
            {
                InfoWeapon iw = new InfoWeapon();
                iw.SetValues("Weapon", (float)RarityStats(), false, WeaponType.SimpleSword, WeaponEffect(), actualRarityDrop, 1f, CostDrop(), "/Weapons/" + IconNameWeapon());
                if (InventoryManager.Instance.AvailableWeaponSpace > 0)
                {
                    InventoryManager.Instance.AddToInventory(iw);
                }
                else
                {
                    StatsManager.Instance.AddGold(iw.SellValue);
                }

                break;
            }

            case TypeDrop.Armor:
            {
                InfoArmor      ia    = new InfoArmor();
                EquippedInSlot slot  = SlotArmor();
                Stats          stats = ArmorStats();
                ia.SetValues("Armadura", false, slot, CostDrop(), "Some description randomly to be implemented", stats, "/Armors/" + slot.ToString() + "/" + IconNameArmor(slot));
                if (InventoryManager.Instance.AvailableArmorSpace > 0)
                {
                    InventoryManager.Instance.AddToInventory(ia);
                }
                else
                {
                    StatsManager.Instance.AddGold(ia.SellValue);
                }
                break;
            }

            case TypeDrop.Item:
            {
                InfoItem ii = new InfoItem();
                ii.SetValues("Item", TypeItem.Other, "Some description randomly generated", ConsumeEffect.None, CostDrop(), 1, "/Items/" + IconNameItem());
                if (InventoryManager.Instance.AvailableItemSpace > 0)
                {
                    InventoryManager.Instance.AddToInventory(ii);
                }
                else
                {
                    StatsManager.Instance.AddGold(ii.SellValue);
                }
                break;
            }
            }
        }