Unstable 0.17.9.0

This commit is contained in:
Markus Isberg
2022-04-12 03:39:02 +09:00
parent 374f03c625
commit 72328c29cb
38 changed files with 361 additions and 184 deletions
@@ -23,7 +23,7 @@ namespace Barotrauma
}
}
public void BuyBackSoldItems(Identifier storeIdentifier, List<SoldItem> itemsToBuy)
public void BuyBackSoldItems(Identifier storeIdentifier, List<SoldItem> itemsToBuy, Client client)
{
var store = Location.GetStore(storeIdentifier);
if (store == null) { return; }
@@ -35,12 +35,12 @@ namespace Barotrauma
int itemValue = sellValues[item.ItemPrefab];
if (store.Balance < itemValue || item.Removed) { continue; }
store.Balance += itemValue;
campaign.Bank.TryDeduct(itemValue);
campaign.GetWallet(client).TryDeduct(itemValue);
storeSpecificItems.Remove(item);
}
}
public void SellItems(Identifier storeIdentifier, List<SoldItem> itemsToSell)
public void SellItems(Identifier storeIdentifier, List<SoldItem> itemsToSell, Client client)
{
var store = Location.GetStore(storeIdentifier);
if (store == null) { return; }
@@ -74,7 +74,7 @@ namespace Barotrauma
}
itemsSoldAtStore?.Add(item);
store.Balance -= itemValue;
campaign.Bank.Give(itemValue);
campaign.GetWallet(client).Give(itemValue);
GameAnalyticsManager.AddMoneyGainedEvent(itemValue, GameAnalyticsManager.MoneySource.Store, item.ItemPrefab.Identifier.Value);
}
OnSoldItemsChanged?.Invoke();