(bcb06cc5c) Unstable v0.9.9.0
This commit is contained in:
+4
-1
@@ -91,7 +91,7 @@ namespace Barotrauma
|
||||
if (Character.Controlled.Submarine != outpost) { return null; }
|
||||
|
||||
//if there's a sub docked to the outpost, we can leave the level
|
||||
if (outpost.DockedTo.Count > 0)
|
||||
if (outpost.DockedTo.Any())
|
||||
{
|
||||
var dockedSub = outpost.DockedTo.FirstOrDefault();
|
||||
return dockedSub.DockedTo.Contains(Submarine.MainSub) ? Submarine.MainSub : dockedSub;
|
||||
@@ -277,6 +277,9 @@ namespace Barotrauma
|
||||
c.Info.InventoryData = inventoryElement;
|
||||
c.Inventory?.DeleteAllItems();
|
||||
}
|
||||
|
||||
GameMain.GameSession.SubmarineInfo = new SubmarineInfo(GameMain.GameSession.Submarine);
|
||||
|
||||
SaveUtil.SaveGame(GameMain.GameSession.SavePath);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
using Barotrauma.Tutorials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
class SubTestMode : GameMode
|
||||
{
|
||||
public SubTestMode(GameModePreset preset, object param)
|
||||
: base(preset, param)
|
||||
{
|
||||
foreach (JobPrefab jobPrefab in JobPrefab.Prefabs)
|
||||
{
|
||||
for (int i = 0; i < jobPrefab.InitialCount; i++)
|
||||
{
|
||||
var variant = Rand.Range(0, jobPrefab.Variants);
|
||||
CrewManager.AddCharacterInfo(new CharacterInfo(CharacterPrefab.HumanSpeciesName, jobPrefab: jobPrefab, variant: variant));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Start()
|
||||
{
|
||||
base.Start();
|
||||
|
||||
isRunning = true;
|
||||
CrewManager.InitSinglePlayerRound();
|
||||
|
||||
Submarine.MainSub.SetPosition(Vector2.Zero);
|
||||
}
|
||||
|
||||
public override void Draw(SpriteBatch spriteBatch)
|
||||
{
|
||||
if (!isRunning|| GUI.DisableHUD || GUI.DisableUpperHUD) return;
|
||||
|
||||
if (Submarine.MainSub == null) return;
|
||||
}
|
||||
|
||||
public override void AddToGUIUpdateList()
|
||||
{
|
||||
if (!isRunning) return;
|
||||
|
||||
base.AddToGUIUpdateList();
|
||||
CrewManager.AddToGUIUpdateList();
|
||||
}
|
||||
|
||||
public override void Update(float deltaTime)
|
||||
{
|
||||
if (!isRunning) { return; }
|
||||
|
||||
base.Update(deltaTime);
|
||||
}
|
||||
|
||||
public override void End(string endMessage = "")
|
||||
{
|
||||
isRunning = false;
|
||||
|
||||
GameMain.GameSession.EndRound("");
|
||||
|
||||
CrewManager.EndRound();
|
||||
|
||||
Submarine.Unload();
|
||||
|
||||
GameMain.SubEditorScreen.Select();
|
||||
}
|
||||
|
||||
private bool EndRound(Submarine leavingSub)
|
||||
{
|
||||
isRunning = false;
|
||||
|
||||
End("");
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-2
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using Barotrauma.Items.Components;
|
||||
using Barotrauma.Networking;
|
||||
@@ -221,7 +222,7 @@ namespace Barotrauma.Tutorials
|
||||
{
|
||||
//captain_navConsoleCustomInterface.HighlightElement(0, uiHighlightColor, duration: 1.0f, pulsateAmount: 0.0f);
|
||||
yield return new WaitForSeconds(1.0f, false);
|
||||
} while (Submarine.MainSub.DockedTo.Count > 0);
|
||||
} while (Submarine.MainSub.DockedTo.Any());
|
||||
RemoveCompletedObjective(segments[4]);
|
||||
yield return new WaitForSeconds(2f, false);
|
||||
TriggerTutorialSegment(5); // Navigate to destination
|
||||
@@ -245,7 +246,7 @@ namespace Barotrauma.Tutorials
|
||||
{
|
||||
//captain_navConsoleCustomInterface.HighlightElement(0, uiHighlightColor, duration: 1.0f, pulsateAmount: 0.0f);
|
||||
yield return new WaitForSeconds(1.0f, false);
|
||||
} while (!Submarine.MainSub.AtEndPosition || Submarine.MainSub.DockedTo.Count == 0);
|
||||
} while (!Submarine.MainSub.AtEndPosition || Submarine.MainSub.DockedTo.Any());
|
||||
RemoveCompletedObjective(segments[6]);
|
||||
yield return new WaitForSeconds(3f, false);
|
||||
GameMain.GameSession?.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.GetWithVariable("Captain.Radio.Complete", "[OUTPOSTNAME]", GameMain.GameSession.EndLocation.Name), ChatMessageType.Radio, null);
|
||||
|
||||
+8
-8
@@ -21,8 +21,8 @@ namespace Barotrauma.Tutorials
|
||||
private string levelSeed;
|
||||
private string levelParams;
|
||||
|
||||
private Submarine startOutpost = null;
|
||||
private Submarine endOutpost = null;
|
||||
private SubmarineInfo startOutpost = null;
|
||||
private SubmarineInfo endOutpost = null;
|
||||
private bool currentTutorialCompleted = false;
|
||||
private float fadeOutTime = 3f;
|
||||
protected float waitBeforeFade = 4f;
|
||||
@@ -56,13 +56,13 @@ namespace Barotrauma.Tutorials
|
||||
|
||||
private IEnumerable<object> Loading()
|
||||
{
|
||||
Submarine.MainSub = Submarine.Load(submarinePath, "", true);
|
||||
SubmarineInfo subInfo = new SubmarineInfo(submarinePath);
|
||||
|
||||
LevelGenerationParams generationParams = LevelGenerationParams.LevelParams.Find(p => p.Name == levelParams);
|
||||
|
||||
yield return CoroutineStatus.Running;
|
||||
|
||||
GameMain.GameSession = new GameSession(Submarine.MainSub, "",
|
||||
GameMain.GameSession = new GameSession(subInfo, "",
|
||||
GameModePreset.List.Find(g => g.Identifier == "tutorial"));
|
||||
(GameMain.GameSession.GameMode as TutorialMode).Tutorial = this;
|
||||
|
||||
@@ -72,12 +72,12 @@ namespace Barotrauma.Tutorials
|
||||
|
||||
if (startOutpostPath != string.Empty)
|
||||
{
|
||||
startOutpost = Submarine.Load(startOutpostPath, "", false);
|
||||
startOutpost = new SubmarineInfo(startOutpostPath);
|
||||
}
|
||||
|
||||
if (endOutpostPath != string.Empty)
|
||||
{
|
||||
endOutpost = Submarine.Load(endOutpostPath, "", false);
|
||||
endOutpost = new SubmarineInfo(endOutpostPath);
|
||||
}
|
||||
|
||||
Level tutorialLevel = new Level(levelSeed, 0, 0, generationParams, biome, startOutpost, endOutpost);
|
||||
@@ -160,11 +160,11 @@ namespace Barotrauma.Tutorials
|
||||
switch (this.spawnSub)
|
||||
{
|
||||
case "startoutpost":
|
||||
spawnSub = startOutpost;
|
||||
spawnSub = Level.Loaded.StartOutpost;
|
||||
break;
|
||||
|
||||
case "endoutpost":
|
||||
spawnSub = endOutpost;
|
||||
spawnSub = Level.Loaded.EndOutpost;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user