Started refactoring the submarine class in order to make it possible to add multiple submarines (or other movable structures)
This commit is contained in:
@@ -143,14 +143,14 @@ namespace Barotrauma
|
||||
|
||||
CrewManager.Draw(spriteBatch);
|
||||
|
||||
if (Submarine.Loaded == null) return;
|
||||
if (Submarine.MainSub == null) return;
|
||||
|
||||
if (Submarine.Loaded.AtEndPosition)
|
||||
if (Submarine.MainSub.AtEndPosition)
|
||||
{
|
||||
endShiftButton.Text = "Enter " + Map.SelectedLocation.Name;
|
||||
endShiftButton.Draw(spriteBatch);
|
||||
}
|
||||
else if (Submarine.Loaded.AtStartPosition)
|
||||
else if (Submarine.MainSub.AtStartPosition)
|
||||
{
|
||||
endShiftButton.Text = "Enter " + Map.CurrentLocation.Name;
|
||||
endShiftButton.Draw(spriteBatch);
|
||||
@@ -199,7 +199,7 @@ namespace Barotrauma
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (Submarine.Loaded.AtEndPosition)
|
||||
if (Submarine.MainSub.AtEndPosition)
|
||||
{
|
||||
Map.MoveToNextLocation();
|
||||
}
|
||||
@@ -240,7 +240,7 @@ namespace Barotrauma
|
||||
{
|
||||
isRunning = false;
|
||||
|
||||
var cinematic = new TransitionCinematic(Submarine.Loaded, GameMain.GameScreen.Cam, 5.0f);
|
||||
var cinematic = new TransitionCinematic(Submarine.MainSub, GameMain.GameScreen.Cam, 5.0f);
|
||||
|
||||
SoundPlayer.OverrideMusicType = CrewManager.characters.Any(c => !c.IsDead) ? "endshift" : "crewdead";
|
||||
|
||||
@@ -253,12 +253,12 @@ namespace Barotrauma
|
||||
{
|
||||
while (cinematic.Running)
|
||||
{
|
||||
if (Submarine.Loaded == null) yield return CoroutineStatus.Success;
|
||||
if (Submarine.MainSub == null) yield return CoroutineStatus.Success;
|
||||
|
||||
yield return CoroutineStatus.Running;
|
||||
}
|
||||
|
||||
if (Submarine.Loaded == null) yield return CoroutineStatus.Success;
|
||||
if (Submarine.MainSub == null) yield return CoroutineStatus.Success;
|
||||
|
||||
End("");
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace Barotrauma
|
||||
endMessage = traitorCharacter.Name + " was a traitor! ";
|
||||
endMessage += (traitorCharacter.Info.Gender == Gender.Male) ? "His" : "Her";
|
||||
endMessage += " task was to assassinate " + targetCharacter.Name + ". ";
|
||||
endMessage += (Submarine.Loaded.AtEndPosition) ?
|
||||
endMessage += (Submarine.MainSub.AtEndPosition) ?
|
||||
"The task was unsuccessful - the has submarine reached its destination." :
|
||||
"The task was unsuccessful.";
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Barotrauma.Tutorials
|
||||
|
||||
//spawn some fish next to the player
|
||||
GameMain.GameScreen.BackgroundCreatureManager.SpawnSprites(2,
|
||||
Submarine.Loaded.Position + Character.Controlled.Position);
|
||||
Submarine.MainSub.Position + Character.Controlled.Position);
|
||||
|
||||
yield return new WaitForSeconds(4.0f);
|
||||
|
||||
@@ -276,7 +276,7 @@ namespace Barotrauma.Tutorials
|
||||
|
||||
infoBox = CreateInfoFrame("Steer the submarine downwards, heading further into the cavern.");
|
||||
|
||||
while (Submarine.Loaded.WorldPosition.Y > 24600.0f)
|
||||
while (Submarine.MainSub.WorldPosition.Y > 24600.0f)
|
||||
{
|
||||
yield return CoroutineStatus.Running;
|
||||
}
|
||||
@@ -300,7 +300,7 @@ namespace Barotrauma.Tutorials
|
||||
bool broken = false;
|
||||
do
|
||||
{
|
||||
Submarine.Loaded.Velocity = Vector2.Zero;
|
||||
Submarine.MainSub.Velocity = Vector2.Zero;
|
||||
|
||||
moloch.AIController.SelectTarget(steering.Item.CurrentHull.AiTarget);
|
||||
Vector2 steeringDir = windows[0].WorldPosition - moloch.WorldPosition;
|
||||
@@ -349,7 +349,7 @@ namespace Barotrauma.Tutorials
|
||||
}
|
||||
}
|
||||
|
||||
Submarine.Loaded.GodMode = true;
|
||||
Submarine.MainSub.GodMode = true;
|
||||
|
||||
var capacitor1 = Item.ItemList.Find(i => i.HasTag("capacitor1")).GetComponent<PowerContainer>();
|
||||
var capacitor2 = Item.ItemList.Find(i => i.HasTag("capacitor1")).GetComponent<PowerContainer>();
|
||||
@@ -462,7 +462,7 @@ namespace Barotrauma.Tutorials
|
||||
yield return CoroutineStatus.Running;
|
||||
}
|
||||
|
||||
Submarine.Loaded.GodMode = false;
|
||||
Submarine.MainSub.GodMode = false;
|
||||
|
||||
infoBox = CreateInfoFrame("The creature has died. Now you should fix the damages in the control room: " +
|
||||
"Grab a welding tool from the closet in the railgun room.");
|
||||
@@ -588,7 +588,7 @@ namespace Barotrauma.Tutorials
|
||||
GameMain.GameScreen.Cam.TargetPos = Vector2.Zero;
|
||||
GameMain.LightManager.LosEnabled = false;
|
||||
|
||||
var cinematic = new TransitionCinematic(Submarine.Loaded, GameMain.GameScreen.Cam, 5.0f);
|
||||
var cinematic = new TransitionCinematic(Submarine.MainSub, GameMain.GameScreen.Cam, 5.0f);
|
||||
|
||||
while (cinematic.Running)
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Barotrauma.Tutorials
|
||||
public virtual void Initialize()
|
||||
{
|
||||
|
||||
GameMain.GameSession = new GameSession(Submarine.Loaded, "", GameModePreset.list.Find(gm => gm.Name.ToLowerInvariant() == "tutorial"));
|
||||
GameMain.GameSession = new GameSession(Submarine.MainSub, "", GameModePreset.list.Find(gm => gm.Name.ToLowerInvariant() == "tutorial"));
|
||||
(GameMain.GameSession.gameMode as TutorialMode).tutorialType = this;
|
||||
|
||||
GameMain.GameSession.StartShift("tuto1");
|
||||
|
||||
Reference in New Issue
Block a user