v1.4.4.1 (Blood in the Water Update)
This commit is contained in:
@@ -3,16 +3,19 @@ using Barotrauma.Networking;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
abstract partial class CampaignMode : GameMode
|
||||
internal abstract partial class CampaignMode : GameMode
|
||||
{
|
||||
protected bool crewDead;
|
||||
public bool CrewDead
|
||||
{
|
||||
get;
|
||||
protected set;
|
||||
}
|
||||
|
||||
protected Color overlayColor;
|
||||
protected Sprite overlaySprite;
|
||||
|
||||
+8
-6
@@ -67,10 +67,11 @@ namespace Barotrauma
|
||||
|
||||
var buttonContainer = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.07f), layout.RectTransform) { RelativeOffset = new Vector2(0.0f, 0.1f) }, isHorizontal: true)
|
||||
{
|
||||
Stretch = true,
|
||||
RelativeSpacing = 0.02f
|
||||
};
|
||||
|
||||
var campaignContainer = new GUIFrame(new RectTransform(new Vector2(1.0f, 0.9f), layout.RectTransform, Anchor.BottomLeft), style: "InnerFrame")
|
||||
var campaignContainer = new GUIFrame(new RectTransform(new Vector2(1.0f, 0.9f), layout.RectTransform, Anchor.BottomLeft), style: "GUIFrameListBox")
|
||||
{
|
||||
CanBeFocused = false
|
||||
};
|
||||
@@ -95,6 +96,7 @@ namespace Barotrauma
|
||||
loadCampaignButton.Selected = false;
|
||||
newCampaignContainer.Visible = true;
|
||||
loadCampaignContainer.Visible = false;
|
||||
GameMain.NetLobbyScreen?.RefreshStartButtonVisibility();
|
||||
return true;
|
||||
};
|
||||
loadCampaignButton.OnClicked = (btn, obj) =>
|
||||
@@ -103,6 +105,7 @@ namespace Barotrauma
|
||||
loadCampaignButton.Selected = true;
|
||||
newCampaignContainer.Visible = false;
|
||||
loadCampaignContainer.Visible = true;
|
||||
GameMain.NetLobbyScreen?.RefreshStartButtonVisibility();
|
||||
return true;
|
||||
};
|
||||
loadCampaignContainer.Visible = false;
|
||||
@@ -297,7 +300,7 @@ namespace Barotrauma
|
||||
Level prevLevel = Level.Loaded;
|
||||
|
||||
bool success = CrewManager.GetCharacters().Any(c => !c.IsDead);
|
||||
crewDead = false;
|
||||
CrewDead = false;
|
||||
|
||||
var continueButton = GameMain.GameSession.RoundSummary?.ContinueButton;
|
||||
if (continueButton != null)
|
||||
@@ -480,7 +483,6 @@ namespace Barotrauma
|
||||
GameMain.CampaignEndScreen.OnFinished = () =>
|
||||
{
|
||||
GameMain.NetLobbyScreen.Select();
|
||||
if (GameMain.NetLobbyScreen.ContinueCampaignButton != null) { GameMain.NetLobbyScreen.ContinueCampaignButton.Enabled = false; }
|
||||
if (GameMain.NetLobbyScreen.QuitCampaignButton != null) { GameMain.NetLobbyScreen.QuitCampaignButton.Enabled = false; }
|
||||
};
|
||||
}
|
||||
@@ -934,7 +936,7 @@ namespace Barotrauma
|
||||
{
|
||||
int renamedIdentifier = msg.ReadInt32();
|
||||
string newName = msg.ReadString();
|
||||
CharacterInfo renamedCharacter = CrewManager.CharacterInfos.FirstOrDefault(info => info.GetIdentifierUsingOriginalName() == renamedIdentifier);
|
||||
CharacterInfo renamedCharacter = CrewManager.GetCharacterInfos().FirstOrDefault(info => info.GetIdentifierUsingOriginalName() == renamedIdentifier);
|
||||
if (renamedCharacter != null) { CrewManager.RenameCharacter(renamedCharacter, newName); }
|
||||
}
|
||||
|
||||
@@ -942,7 +944,7 @@ namespace Barotrauma
|
||||
if (fireCharacter)
|
||||
{
|
||||
int firedIdentifier = msg.ReadInt32();
|
||||
CharacterInfo firedCharacter = CrewManager.CharacterInfos.FirstOrDefault(info => info.GetIdentifier() == firedIdentifier);
|
||||
CharacterInfo firedCharacter = CrewManager.GetCharacterInfos().FirstOrDefault(info => info.GetIdentifier() == firedIdentifier);
|
||||
// this one might and is allowed to be null since the character is already fired on the original sender's game
|
||||
if (firedCharacter != null) { CrewManager.FireCharacter(firedCharacter); }
|
||||
}
|
||||
@@ -952,7 +954,7 @@ namespace Barotrauma
|
||||
!NetIdUtils.IdMoreRecent(pendingSaveID, LastSaveID))
|
||||
{
|
||||
CampaignUI.CrewManagement.SetHireables(map.CurrentLocation, availableHires);
|
||||
if (hiredCharacters.Any()) { CampaignUI.CrewManagement.ValidateHires(hiredCharacters); }
|
||||
if (hiredCharacters.Any()) { CampaignUI.CrewManagement.ValidateHires(hiredCharacters, takeMoney: false); }
|
||||
CampaignUI.CrewManagement.SetPendingHires(pendingHires, map.CurrentLocation);
|
||||
if (renameCrewMember || fireCharacter) { CampaignUI.CrewManagement.UpdateCrew(); }
|
||||
}
|
||||
|
||||
+9
-5
@@ -1,4 +1,5 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Barotrauma.Extensions;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -243,7 +244,7 @@ namespace Barotrauma
|
||||
savedOnStart = true;
|
||||
}
|
||||
|
||||
crewDead = false;
|
||||
CrewDead = false;
|
||||
endTimer = 5.0f;
|
||||
CrewManager.InitSinglePlayerRound();
|
||||
LoadPets();
|
||||
@@ -373,7 +374,7 @@ namespace Barotrauma
|
||||
SoundPlayer.OverrideMusicType = (success ? "endround" : "crewdead").ToIdentifier();
|
||||
SoundPlayer.OverrideMusicDuration = 18.0f;
|
||||
GUI.SetSavingIndicatorState(success);
|
||||
crewDead = false;
|
||||
CrewDead = false;
|
||||
|
||||
if (success)
|
||||
{
|
||||
@@ -582,9 +583,12 @@ namespace Barotrauma
|
||||
HintManager.OnAvailableTransition(transitionType);
|
||||
}
|
||||
|
||||
if (!crewDead)
|
||||
if (!CrewDead)
|
||||
{
|
||||
if (!CrewManager.GetCharacters().Any(c => !c.IsDead)) { crewDead = true; }
|
||||
if (CrewManager.GetCharacters().None(c => !c.IsDead && !CrewManager.IsFired(c)))
|
||||
{
|
||||
CrewDead = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -42,6 +42,15 @@ namespace Barotrauma
|
||||
foreach (Submarine submarine in Submarine.Loaded)
|
||||
{
|
||||
submarine.NeutralizeBallast();
|
||||
//normally the body would be made static during level generation,
|
||||
//but in the test mode we load the outpost/wreck/beacon as if it was a normal sub and need to do this manually
|
||||
if (submarine.Info.Type == SubmarineType.Outpost ||
|
||||
submarine.Info.Type == SubmarineType.OutpostModule ||
|
||||
submarine.Info.Type == SubmarineType.Wreck ||
|
||||
submarine.Info.Type == SubmarineType.BeaconStation)
|
||||
{
|
||||
submarine.PhysicsBody.BodyType = FarseerPhysics.BodyType.Static;
|
||||
}
|
||||
}
|
||||
|
||||
if (SpawnOutpost)
|
||||
@@ -51,14 +60,14 @@ namespace Barotrauma
|
||||
|
||||
if (TriggeredEvent != null)
|
||||
{
|
||||
scriptedEvent = new List<Event> { TriggeredEvent.CreateInstance() };
|
||||
scriptedEvent = new List<Event> { TriggeredEvent.CreateInstance(GameMain.GameSession.EventManager.RandomSeed) };
|
||||
GameMain.GameSession.EventManager.PinnedEvent = scriptedEvent.Last();
|
||||
|
||||
createEventButton = new GUIButton(new RectTransform(new Point(128, 64), GUI.Canvas, Anchor.TopCenter) { ScreenSpaceOffset = new Point(0, 32) }, TextManager.Get("create"))
|
||||
{
|
||||
OnClicked = delegate
|
||||
{
|
||||
scriptedEvent.Add(TriggeredEvent.CreateInstance());
|
||||
scriptedEvent.Add(TriggeredEvent.CreateInstance(GameMain.GameSession.EventManager.RandomSeed));
|
||||
GameMain.GameSession.EventManager.PinnedEvent = scriptedEvent.Last();
|
||||
return true;
|
||||
}
|
||||
|
||||
+3
-3
@@ -188,9 +188,9 @@ namespace Barotrauma.Tutorials
|
||||
var door = item.GetComponent<Door>();
|
||||
if (door != null)
|
||||
{
|
||||
if (door.requiredItems.Values.None(ris => ris.None(ri => ri.Identifiers.None(i => i == "locked"))))
|
||||
if (door.RequiredItems.Values.None(ris => ris.None(ri => ri.Identifiers.None(i => i == "locked"))))
|
||||
{
|
||||
door.requiredItems.Clear();
|
||||
door.RequiredItems.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -262,7 +262,7 @@ namespace Barotrauma.Tutorials
|
||||
yield return CoroutineStatus.Failure;
|
||||
}
|
||||
|
||||
if (eventPrefab.CreateInstance() is Event eventInstance)
|
||||
if (eventPrefab.CreateInstance(GameMain.GameSession.EventManager.RandomSeed) is Event eventInstance)
|
||||
{
|
||||
GameMain.GameSession.EventManager.QueuedEvents.Enqueue(eventInstance);
|
||||
while (!eventInstance.IsFinished)
|
||||
|
||||
Reference in New Issue
Block a user