Build 0.18.13.0
This commit is contained in:
@@ -28,6 +28,7 @@ namespace Barotrauma
|
||||
var subs = sub.GetConnectedSubs().Where(s => s.TeamID == sub.TeamID);
|
||||
CreateAndPlace(subs);
|
||||
subs.ForEach(s => s.Info.InitialSuppliesSpawned = true);
|
||||
sub.CheckFuel();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -147,12 +147,12 @@ namespace Barotrauma
|
||||
|
||||
private Location Location => campaign?.Map?.CurrentLocation;
|
||||
|
||||
public Action OnItemsInBuyCrateChanged;
|
||||
public Action OnItemsInSellCrateChanged;
|
||||
public Action OnItemsInSellFromSubCrateChanged;
|
||||
public Action OnPurchasedItemsChanged;
|
||||
public Action OnSoldItemsChanged;
|
||||
|
||||
public readonly NamedEvent<CargoManager> OnItemsInBuyCrateChanged = new NamedEvent<CargoManager>();
|
||||
public readonly NamedEvent<CargoManager> OnItemsInSellCrateChanged = new NamedEvent<CargoManager>();
|
||||
public readonly NamedEvent<CargoManager> OnItemsInSellFromSubCrateChanged = new NamedEvent<CargoManager>();
|
||||
public readonly NamedEvent<CargoManager> OnPurchasedItemsChanged = new NamedEvent<CargoManager>();
|
||||
public readonly NamedEvent<CargoManager> OnSoldItemsChanged = new NamedEvent<CargoManager>();
|
||||
|
||||
public CargoManager(CampaignMode campaign)
|
||||
{
|
||||
this.campaign = campaign;
|
||||
@@ -215,19 +215,19 @@ namespace Barotrauma
|
||||
public void ClearItemsInBuyCrate()
|
||||
{
|
||||
ItemsInBuyCrate.Clear();
|
||||
OnItemsInBuyCrateChanged?.Invoke();
|
||||
OnItemsInBuyCrateChanged?.Invoke(this);
|
||||
}
|
||||
|
||||
public void ClearItemsInSellCrate()
|
||||
{
|
||||
ItemsInSellCrate.Clear();
|
||||
OnItemsInSellCrateChanged?.Invoke();
|
||||
OnItemsInSellCrateChanged?.Invoke(this);
|
||||
}
|
||||
|
||||
public void ClearItemsInSellFromSubCrate()
|
||||
{
|
||||
ItemsInSellFromSubCrate.Clear();
|
||||
OnItemsInSellFromSubCrateChanged?.Invoke();
|
||||
OnItemsInSellFromSubCrateChanged?.Invoke(this);
|
||||
}
|
||||
|
||||
public void SetPurchasedItems(Dictionary<Identifier, List<PurchasedItem>> purchasedItems)
|
||||
@@ -238,7 +238,7 @@ namespace Barotrauma
|
||||
{
|
||||
PurchasedItems.Add(entry.Key, entry.Value);
|
||||
}
|
||||
OnPurchasedItemsChanged?.Invoke();
|
||||
OnPurchasedItemsChanged?.Invoke(this);
|
||||
}
|
||||
|
||||
public void ModifyItemQuantityInBuyCrate(Identifier storeIdentifier, ItemPrefab itemPrefab, int changeInQuantity, Client client = null)
|
||||
@@ -255,7 +255,7 @@ namespace Barotrauma
|
||||
{
|
||||
GetBuyCrateItems(storeIdentifier, create: true).Add(new PurchasedItem(itemPrefab, changeInQuantity, client));
|
||||
}
|
||||
OnItemsInBuyCrateChanged?.Invoke();
|
||||
OnItemsInBuyCrateChanged?.Invoke(this);
|
||||
}
|
||||
|
||||
public void ModifyItemQuantityInSubSellCrate(Identifier storeIdentifier, ItemPrefab itemPrefab, int changeInQuantity, Client client = null)
|
||||
@@ -272,7 +272,7 @@ namespace Barotrauma
|
||||
{
|
||||
GetSubCrateItems(storeIdentifier, create: true).Add(new PurchasedItem(itemPrefab, changeInQuantity, client));
|
||||
}
|
||||
OnItemsInSellFromSubCrateChanged?.Invoke();
|
||||
OnItemsInSellFromSubCrateChanged?.Invoke(this);
|
||||
}
|
||||
|
||||
#if SERVER
|
||||
@@ -331,7 +331,7 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
}
|
||||
OnPurchasedItemsChanged?.Invoke();
|
||||
OnPurchasedItemsChanged?.Invoke(this);
|
||||
}
|
||||
|
||||
public Dictionary<ItemPrefab, int> GetBuyValuesAtCurrentLocation(Identifier storeIdentifier, IEnumerable<ItemPrefab> items)
|
||||
@@ -378,7 +378,7 @@ namespace Barotrauma
|
||||
}
|
||||
CreateItems(items, Submarine.MainSub, this);
|
||||
PurchasedItems.Clear();
|
||||
OnPurchasedItemsChanged?.Invoke();
|
||||
OnPurchasedItemsChanged?.Invoke(this);
|
||||
}
|
||||
|
||||
private Dictionary<ItemPrefab, int> UndeterminedSoldEntities { get; } = new Dictionary<ItemPrefab, int>();
|
||||
|
||||
@@ -39,8 +39,8 @@ namespace Barotrauma
|
||||
float prevValue = Value;
|
||||
|
||||
Metadata.SetValue(metaDataIdentifier, Math.Clamp(value, MinReputation, MaxReputation));
|
||||
OnReputationValueChanged?.Invoke();
|
||||
OnAnyReputationValueChanged?.Invoke();
|
||||
OnReputationValueChanged?.Invoke(this);
|
||||
OnAnyReputationValueChanged?.Invoke(this);
|
||||
#if CLIENT
|
||||
int increase = (int)Value - (int)prevValue;
|
||||
if (increase != 0 && Character.Controlled != null)
|
||||
@@ -73,8 +73,8 @@ namespace Barotrauma
|
||||
Value += reputationChange;
|
||||
}
|
||||
|
||||
public Action OnReputationValueChanged;
|
||||
public static Action OnAnyReputationValueChanged;
|
||||
public readonly NamedEvent<Reputation> OnReputationValueChanged = new NamedEvent<Reputation>();
|
||||
public static readonly NamedEvent<Reputation> OnAnyReputationValueChanged = new NamedEvent<Reputation>();
|
||||
|
||||
public readonly Faction Faction;
|
||||
public readonly Location Location;
|
||||
|
||||
@@ -1005,7 +1005,7 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
public SubmarineInfo SwitchSubs()
|
||||
public void SwitchSubs()
|
||||
{
|
||||
if (TransferItemsOnSubSwitch)
|
||||
{
|
||||
@@ -1013,7 +1013,6 @@ namespace Barotrauma
|
||||
}
|
||||
RefreshOwnedSubmarines();
|
||||
PendingSubmarineSwitch = null;
|
||||
return GameMain.GameSession.SubmarineInfo;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1039,9 +1038,12 @@ namespace Barotrauma
|
||||
if (item.HiddenInGame) { continue; }
|
||||
if (!connectedSubs.Contains(item.Submarine)) { continue; }
|
||||
if (item.Prefab.DontTransferBetweenSubs) { continue; }
|
||||
if (item.GetRootInventoryOwner() is Character) { continue; }
|
||||
if (item.GetComponent<Holdable>() == null && item.GetComponent<Wearable>() == null && item.GetComponent<Projectile>() == null) { continue; }
|
||||
if (item.Components.Any(c => c is Holdable h && h.Attached)) { continue; }
|
||||
var rootOwner = item.GetRootInventoryOwner();
|
||||
if (rootOwner is Character) { continue; }
|
||||
if (rootOwner is Item ownerItem && (ownerItem.NonInteractable || ownerItem.HiddenInGame)) { continue; }
|
||||
if (item.GetComponent<Door>() != null) { continue; }
|
||||
if (item.Components.None(c => c is Pickable)) { continue; }
|
||||
if (item.Components.Any(c => c is Pickable p && p.IsAttached)) { continue; }
|
||||
if (item.Components.Any(c => c is Wire w && w.Connections.Any(c => c != null))) { continue; }
|
||||
itemsToTransfer.Add((item, item.Container));
|
||||
item.Submarine = null;
|
||||
@@ -1054,6 +1056,7 @@ namespace Barotrauma
|
||||
item.Drop(null, createNetworkEvent: false, setTransform: false);
|
||||
}
|
||||
}
|
||||
currentSub.Info.NoItems = true;
|
||||
}
|
||||
// Serialize the current sub
|
||||
GameMain.GameSession.SubmarineInfo = new SubmarineInfo(currentSub);
|
||||
@@ -1122,6 +1125,7 @@ namespace Barotrauma
|
||||
DebugConsole.Log(msg);
|
||||
#endif
|
||||
}
|
||||
newSub.Info.NoItems = false;
|
||||
// Serialize the new sub
|
||||
PendingSubmarineSwitch = new SubmarineInfo(newSub);
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace Barotrauma
|
||||
private CampaignMetadata Metadata => Campaign.CampaignMetadata;
|
||||
private readonly CampaignMode Campaign;
|
||||
|
||||
public event Action? OnUpgradesChanged;
|
||||
public readonly NamedEvent<UpgradeManager> OnUpgradesChanged = new NamedEvent<UpgradeManager>();
|
||||
|
||||
public UpgradeManager(CampaignMode campaign)
|
||||
{
|
||||
@@ -248,7 +248,7 @@ namespace Barotrauma
|
||||
// tell the server that this item is yet to be paid for server side
|
||||
PurchasedUpgrades.Add(new PurchasedUpgrade(prefab, category));
|
||||
#endif
|
||||
OnUpgradesChanged?.Invoke();
|
||||
OnUpgradesChanged?.Invoke(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -349,7 +349,7 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
OnUpgradesChanged?.Invoke();
|
||||
OnUpgradesChanged?.Invoke(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -418,7 +418,7 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
#if CLIENT
|
||||
OnUpgradesChanged?.Invoke();
|
||||
OnUpgradesChanged?.Invoke(this);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -802,7 +802,7 @@ namespace Barotrauma
|
||||
{
|
||||
PendingUpgrades.Clear();
|
||||
PendingUpgrades.AddRange(upgrades);
|
||||
OnUpgradesChanged?.Invoke();
|
||||
OnUpgradesChanged?.Invoke(this);
|
||||
}
|
||||
|
||||
public static void DebugLog(string msg, Color? color = null)
|
||||
|
||||
Reference in New Issue
Block a user