示例#1
0
        public void AddChampionToInventoryIfAlive(string championUid)
        {
            InventoryStorage champion = base.Inventory.Champion;

            if (champion.GetItemCapacity(championUid) != 0)
            {
                champion.ModifyItemAmount(championUid, 1 - champion.GetItemAmount(championUid));
            }
        }
示例#2
0
        private bool SetDeployableCount(string uid, int amount, InventoryStorage storage, int size)
        {
            if (amount < 0)
            {
                Service.Logger.Debug("Cannot set a deployable count less than zero. uid: " + uid);
                return(false);
            }
            int num = storage.GetTotalStorageAmount() + amount * size;

            if (num > storage.GetTotalStorageCapacity())
            {
                Service.Logger.Debug("Not enough capacity for deployable. uid: " + uid);
                return(false);
            }
            int delta = amount - storage.GetItemAmount(uid);

            storage.ModifyItemAmount(uid, delta);
            return(true);
        }
示例#3
0
        public void RemoveChampionFromInventory(string championUid)
        {
            InventoryStorage champion = base.Inventory.Champion;

            champion.ModifyItemAmount(championUid, -champion.GetItemAmount(championUid));
        }