Пример #1
0
 public void UseItem(string itemName, PartyMember user)
 {
     if (enemyPartyMemberInventories != null)
     {
         Inventory innerInventory;
         if (enemyPartyMemberInventories.TryGetValue(user, out innerInventory))
         {
             innerInventory.UseItem(itemName, user);
         }
     }
     else
     {
         if (ContainsKey(itemName))
         {
             if (--this[itemName] == 0) // not <= because negative is infinite
             {
                 Remove(itemName);
             }
             else if (this[itemName] < 0)
             {
                 this[itemName] = -1;
             }
             lastUsedItemKeys.AddOrReplace(user, itemName);
         }
     }
 }