public void AddChampionToInventoryIfAlive(string championUid) { InventoryStorage champion = base.Inventory.Champion; if (champion.GetItemCapacity(championUid) != 0) { champion.ModifyItemAmount(championUid, 1 - champion.GetItemAmount(championUid)); } }
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); }
public void RemoveChampionFromInventory(string championUid) { InventoryStorage champion = base.Inventory.Champion; champion.ModifyItemAmount(championUid, -champion.GetItemAmount(championUid)); }