(a2943d8b7) Merge branch 'dev' into human-ai

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:04:10 +03:00
parent 60f52375e6
commit 039d07f693
76 changed files with 1407 additions and 856 deletions
@@ -193,7 +193,7 @@ namespace Barotrauma
Console.CursorLeft = 0;
Console.CursorTop -= cursorLine;
Console.Write(input);
Console.CursorLeft = input.Length % Console.WindowWidth;
Console.CursorLeft = input.Length % consoleWidth;
}
private static void AssignOnClientRequestExecute(string names, Action<Client, Vector2, string[]> onClientRequestExecute)
@@ -83,6 +83,7 @@ namespace Barotrauma
LevelGenerationParams.LoadPresets();
ScriptedEventSet.LoadPrefabs();
AfflictionPrefab.LoadAll(GetFilesOfType(ContentType.Afflictions));
StructurePrefab.LoadAll(GetFilesOfType(ContentType.Structure));
ItemPrefab.LoadAll(GetFilesOfType(ContentType.Item));
JobPrefab.LoadAll(GetFilesOfType(ContentType.Jobs));
@@ -90,7 +91,6 @@ namespace Barotrauma
NPCConversation.LoadAll(GetFilesOfType(ContentType.NPCConversations));
ItemAssemblyPrefab.LoadAll();
LevelObjectPrefab.LoadAll();
AfflictionPrefab.LoadAll(GetFilesOfType(ContentType.Afflictions));
GameModePreset.Init();
LocationType.Init();
@@ -168,6 +168,8 @@ namespace Barotrauma
msg.Write(isRunning && endWatchman != null ? endWatchman.ID : (UInt16)0);
msg.Write(Money);
msg.Write(PurchasedHullRepairs);
msg.Write(PurchasedItemRepairs);
msg.Write((UInt16)CargoManager.PurchasedItems.Count);
foreach (PurchasedItem pi in CargoManager.PurchasedItems)
@@ -192,6 +194,8 @@ namespace Barotrauma
{
UInt16 selectedLocIndex = msg.ReadUInt16();
byte selectedMissionIndex = msg.ReadByte();
bool purchasedHullRepairs = msg.ReadBoolean();
bool purchasedItemRepairs = msg.ReadBoolean();
UInt16 purchasedItemCount = msg.ReadUInt16();
List<PurchasedItem> purchasedItems = new List<PurchasedItem>();
@@ -208,6 +212,17 @@ namespace Barotrauma
return;
}
if (purchasedHullRepairs && !this.PurchasedHullRepairs && Money >= HullRepairCost)
{
this.PurchasedHullRepairs = true;
Money -= HullRepairCost;
}
if (purchasedItemRepairs && !this.PurchasedItemRepairs && Money >= ItemRepairCost)
{
this.PurchasedItemRepairs = true;
Money -= ItemRepairCost;
}
Map.SelectLocation(selectedLocIndex == UInt16.MaxValue ? -1 : selectedLocIndex);
if (Map.SelectedConnection != null)
{