Example #1
0
    Inventory GetInventory(Unit unit)
    {
        Inventory inv = null;

        if (item_lootable.GetItemType() == ItemTypes.dust)
        {
            inv = PlayerInventory.Instance;
        }
        else
        {
            inv = unit.GetComponent <UnitInventory>();
        }

        return(inv);
    }
Example #2
0
    public override void SetItem(object obj)
    {
        IInventoryItem item = obj as IInventoryItem;

        Title.text = item.GetItemType().ToString();
        descr.text = "BLa bla bla";
    }
Example #3
0
 void UpdatedInventory(IInventoryItem item, int count)
 {
     if (item.GetItemType() == ItemType)
     {
         UpdateResource(item.GetCount());
     }
 }
Example #4
0
 void UpdatedInventory(IInventoryItem item, int count)
 {
     if (item.GetItemType() == ItemTypes.rest_pack && count > 0 && CanShowStimpackPrompt())
     {
         ShowStimpackPrompt();
     }
 }
Example #5
0
    public override void AddItem(IInventoryItem item, int count)
    {
        if (item.GetItemType() == ItemTypes.weapon)
        {
            EquipedWeapon = item as Weapon;
        }

        base.AddItem(item, count);
    }
Example #6
0
    public virtual void AddItem(IInventoryItem item, int count)
    {
        if (Items == null)
        {
            Items = new List <ItemInInventory>();
        }

        if (!HasItem(item.GetItemType(), 0))
        {
            Items.Add(new ItemInInventory(item, count));
        }
    }
Example #7
0
 void OnLoot(IInventoryItem item, int count)
 {
     if (item.GetItemType() == type)
     {
         count += count;
         if (count >= LootAmount)
         {
             if (_spawned_arrow != null)
             {
                 GameObject.Destroy(_spawned_arrow);
             }
             m_Unit.Inventory.OnInventoryUpdated -= OnLoot;
             GlobalUpdateDispatcher.OnUpdate     -= _update;
             Complete();
         }
     }
 }
Example #8
0
    public virtual void AddItem(IInventoryItem item, bool use_saved)
    {
        if (Items == null)
        {
            Items = new List <ItemInInventory>();
        }

        if (!HasItem(item.GetItemType(), 0))
        {
            if (use_saved)
            {
                Items.Add(new ItemInInventory(item));
            }
            else
            {
                Items.Add(new ItemInInventory(item, item.GetCount()));
            }
        }
    }
Example #9
0
 public ItemTypes GetItemType()
 {
     return(m_item.GetItemType());
 }