MP campaign additions/fixes:

- Store tab & cargo spawning
- Sub & shuttle lists and level seed box are disabled when a campaign is active.
- Campaign UI is recreated if a new campaign is started while another one is active.
This commit is contained in:
Joonas Rikkonen
2017-09-14 19:39:03 +03:00
parent 348d81a66f
commit b292a301cf
8 changed files with 98 additions and 48 deletions
@@ -21,7 +21,7 @@ namespace Barotrauma
{
WayPoint wp = WayPoint.GetRandom(SpawnType.Cargo, null, Submarine.MainSub);
if (wp==null)
if (wp == null)
{
DebugConsole.ThrowError("The submarine must have a waypoint marked as Cargo for bought items to be placed correctly!");
return;
@@ -41,7 +41,15 @@ namespace Barotrauma
Rand.Range(cargoRoom.Rect.X + 20, cargoRoom.Rect.Right - 20),
cargoRoom.Rect.Y - cargoRoom.Rect.Height + prefab.Size.Y/2);
new Item(prefab, position, wp.Submarine);
if (GameMain.Server != null)
{
Entity.Spawner.AddToSpawnQueue(prefab, position, wp.Submarine);
}
else
{
new Item(prefab, position, wp.Submarine);
}
}
purchasedItems.Clear();
@@ -111,7 +111,12 @@ namespace Barotrauma
public override void Start()
{
base.Start();
if (GameMain.Server != null)
{
CargoManager.CreateItems();
}
lastUpdateID++;
}
@@ -197,21 +197,16 @@ namespace Barotrauma
submarine.SetPosition(submarine.FindSpawnPos(level.StartPosition - new Vector2(0.0f, 2000.0f)));
}
if (GameMode.Mission != null)
{
currentMission = GameMode.Mission;
}
if (GameMode!=null) GameMode.Start();
Entity.Spawner = new EntitySpawner();
if (GameMode.Mission != null) currentMission = GameMode.Mission;
if (GameMode != null) GameMode.Start();
if (GameMode.Mission != null) Mission.Start(Level.Loaded);
EventManager.StartRound(level);
if (GameMode != null) GameMode.MsgBox();
Entity.Spawner = new EntitySpawner();
#if CLIENT
roundSummary = new RoundSummary(this);