Exemplo n.º 1
0
 public void SetValues(string name, bool isEquiped, EquippedInSlot equippedInSlot, int sellValue, string
                       description, Stats stats, string modelName)
 {
     this.Name      = name; this.IsEquipped = isEquiped; this.EquippedInSlot = equippedInSlot;
     this.SellValue = sellValue; this.Description = description; this.Stats = stats;
     this.ModelName = modelName;
 }
Exemplo n.º 2
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;
            }
            }
        }
Exemplo n.º 3
0
 public void ResetValues()
 {
     this._imagePath         = "";
     this._index             = -1;
     this._indexSlot         = -1;
     this._inventorySlotType = InventorySlotType.None;
     this._equippedInSlot    = EquippedInSlot.None;
 }
Exemplo n.º 4
0
        public void AddToInventory(InventorySlotType slotType, EquippedInSlot inSlot, string imagePath, int index)
        {
            InventorySlotInfo newSlot = _slotsInventoryInfo[_itemsInInventory];

            _itemsInInventory++;
            newSlot.SetValue(imagePath, slotType, inSlot, index, _itemsInInventory);
            _infoItemsInInventory.Add(newSlot);
            if (newSlot.InventorySlotType == _inventorySlotShow || _inventorySlotShow == InventorySlotType.All)
            {
                UpdateUISlots();
            }
        }
Exemplo n.º 5
0
 public void SetValue(string image, InventorySlotType inventorySlotType, EquippedInSlot inSlot, int index, int indexSlot)
 {
     if (_itemImage == null)
     {
         _itemImage = this.gameObject.GetComponent <Image>();
     }
     this._imagePath         = image;
     this._inventorySlotType = inventorySlotType;
     this._index             = index;
     this._indexSlot         = indexSlot;
     this._equippedInSlot    = inSlot;
     UpdateSprite();
 }
Exemplo n.º 6
0
 private string IconNameArmor(EquippedInSlot slot)
 {
     return(Random.Range(0, 3).ToString());
 }