Merged branch combat-mission into combat-mission

This commit is contained in:
juanjp600
2016-10-10 09:58:06 -03:00
25 changed files with 201 additions and 228 deletions

View File

@@ -5,14 +5,14 @@ namespace Barotrauma
{
class CargoManager
{
private List<MapEntityPrefab> purchasedItems;
private List<ItemPrefab> purchasedItems;
public CargoManager()
{
purchasedItems = new List<MapEntityPrefab>();
purchasedItems = new List<ItemPrefab>();
}
public void AddItem(MapEntityPrefab item)
public void AddItem(ItemPrefab item)
{
purchasedItems.Add(item);
}
@@ -35,11 +35,11 @@ namespace Barotrauma
return;
}
foreach (MapEntityPrefab prefab in purchasedItems)
foreach (ItemPrefab prefab in purchasedItems)
{
Vector2 position = new Vector2(
Rand.Range(cargoRoom.Rect.X + 20, cargoRoom.Rect.Right - 20),
Rand.Range(cargoRoom.Rect.Y - cargoRoom.Rect.Height, cargoRoom.Rect.Y));
cargoRoom.Rect.Y - cargoRoom.Rect.Height + prefab.Size.Y/2);
new Item(prefab as ItemPrefab, position, wp.Submarine);
}

View File

@@ -241,17 +241,19 @@ namespace Barotrauma
{
isRunning = false;
if (subsToLeaveBehind == null || leavingSub == null)
{
DebugConsole.ThrowError("Leaving submarine not selected -> selecting the closest one");
leavingSub = GetLeavingSub();
subsToLeaveBehind = GetSubsToLeaveBehind(leavingSub);
}
bool success = CrewManager.characters.Any(c => !c.IsDead);
if (success)
{
if (subsToLeaveBehind == null || leavingSub == null)
{
DebugConsole.ThrowError("Leaving submarine not selected -> selecting the closest one");
leavingSub = GetLeavingSub();
subsToLeaveBehind = GetSubsToLeaveBehind(leavingSub);
}
}
GameMain.GameSession.EndShift("");

View File

@@ -336,10 +336,12 @@ namespace Barotrauma
new XElement("Gamesession"));
var now = DateTime.Now;
doc.Root.Add(new XAttribute("savetime", now.Hour + ":" + now.Minute + ", " + now.ToShortDateString()));
doc.Root.Add(new XAttribute("savetime", now.ToShortTimeString() + ", " + now.ToShortDateString()));
doc.Root.Add(new XAttribute("submarine", submarine==null ? "" : submarine.Name));
doc.Root.Add(new XAttribute("mapseed", Map.Seed));
((SinglePlayerMode)gameMode).Save(doc.Root);
try