Beispiel #1
0
    public void SetEquipUI()
    {
        if (GameManager.Inst().UpgManager.BData[BulletType].GetEquipIndex() > -1)
        {
            EqData e = GetItem(GameManager.Inst().UpgManager.BData[BulletType].GetEquipIndex());

            EquipIcon.sprite = e.Icon;

            if (GameManager.Inst().EquipDatas[e.Type, e.Rarity, 0] > 0)
            {
                EquipBar.fillAmount = 1.0f - (e.CoolTime / GameManager.Inst().EquipDatas[e.Type, e.Rarity, 0]);
            }
            else
            {
                if (e.Type == 3)
                {
                    EquipBar.fillAmount = 1.0f;
                }
                else if (e.Type == 6)
                {
                    EquipBar.fillAmount = 1.0f - (ShootCount / e.Value);
                }
            }
        }
        else
        {
            EquipIcon.sprite    = QuestionMark;
            EquipBar.fillAmount = 0.0f;
        }
    }
Beispiel #2
0
    public int AddItem(Item_ZzinEquipment item)
    {
        for (int i = 0; i < MaxInventory; i++)
        {
            if (Inventory[i] == null)
            {
                Inventory[i]          = new EqData();
                Inventory[i].Icon     = item.GetIcon();
                Inventory[i].Type     = item.GetEqType();
                Inventory[i].Rarity   = item.GetRarity();
                Inventory[i].Value    = item.GetValue();
                Inventory[i].UID      = item.GetUID();
                Inventory[i].Quantity = 1;
                Inventory[i].CoolTime = item.GetCoolTime();

                CurInventory++;

                return(i);
            }
        }

        GameManager.Inst().UiManager.InventoryFull();

        return(-1);
    }
Beispiel #3
0
    public int AddItem(EqData item)
    {
        if (item.UID / 100 == 3)
        {
            if (ReinforceInventory[item.Type] != null)
            {
                ReinforceInventory[item.Type].Quantity++;
            }
            else
            {
                ReinforceInventory[item.Type]          = new EqData();
                ReinforceInventory[item.Type].Icon     = item.Icon;
                ReinforceInventory[item.Type].Type     = item.Type;
                ReinforceInventory[item.Type].Rarity   = item.Rarity;
                ReinforceInventory[item.Type].Value    = item.Value;
                ReinforceInventory[item.Type].UID      = item.UID;
                ReinforceInventory[item.Type].Quantity = item.Quantity;
            }
        }
        else
        {
            for (int i = 0; i < MaxInventory; i++)
            {
                if (Inventory[i] == null)
                {
                    Inventory[i]        = new EqData();
                    Inventory[i].Icon   = item.Icon;
                    Inventory[i].Type   = item.Type;
                    Inventory[i].Rarity = item.Rarity;
                    Inventory[i].Value  = item.Value;
                    Inventory[i].UID    = item.UID;
                    if (item.Quantity > 0)
                    {
                        Inventory[i].Quantity = item.Quantity;
                    }
                    else
                    {
                        Inventory[i].Quantity = 1;
                    }
                    Inventory[i].CoolTime = item.CoolTime;

                    CurInventory++;

                    return(i);
                }
            }
        }

        return(-1);
    }
Beispiel #4
0
    public EqData DiscardItem(int index)
    {
        EqData e = new EqData();

        e.Icon   = Inventory[index].Icon;
        e.Type   = Inventory[index].Type;
        e.Rarity = Inventory[index].Rarity;
        e.Value  = Inventory[index].Value;

        Inventory[index] = null;

        CurInventory--;

        return(e);
    }
Beispiel #5
0
 void Swap(int i, int j)
 {
     if (Inventory[i] == null)
     {
         Inventory[i] = Inventory[j];
         Inventory[j] = null;
     }
     else if (Inventory[j] == null)
     {
         Inventory[j] = Inventory[i];
         Inventory[i] = null;
     }
     else if (Inventory[i] != null && Inventory[j] != null)
     {
         EqData temp = new EqData();
         temp         = Inventory[i];
         Inventory[i] = Inventory[j];
         Inventory[j] = temp;
     }
 }