From b2d5704f7ebf659bb44f9046421b75b45673a0fe Mon Sep 17 00:00:00 2001 From: Regalis11 Date: Wed, 23 Dec 2015 22:18:02 +0200 Subject: [PATCH] Round summary screen, GUIMessageBoxes disable other UI elements, renamed quests as missions --- .vs/Subsurface_Solution/v14/.suo | Bin 757760 -> 733696 bytes Subsurface/Barotrauma.csproj | 7 +- Subsurface/Content/InfoTexts.xml | 22 +++ .../Content/{Quests.xml => Missions.xml} | 24 ++-- Subsurface/Source/Characters/Character.cs | 19 +-- .../Source/Events/Quests/MonsterQuest.cs | 19 +-- Subsurface/Source/Events/Quests/Quest.cs | 49 ++++--- .../Source/Events/Quests/SalvageQuest.cs | 12 +- Subsurface/Source/GUI/GUIMessageBox.cs | 22 +-- .../Source/GameSession/GameModes/GameMode.cs | 2 +- .../GameSession/GameModes/GameModePreset.cs | 2 +- .../Source/GameSession/GameModes/QuestMode.cs | 14 +- .../GameSession/GameModes/SinglePlayerMode.cs | 52 ++++--- Subsurface/Source/GameSession/GameSession.cs | 19 +-- .../Source/GameSession/InfoTextManager.cs | 69 ++++++++++ Subsurface/Source/GameSession/ShiftSummary.cs | 129 ++++++++++++++++++ .../Source/Items/Components/Machines/Radar.cs | 10 +- Subsurface/Source/Map/Map.cs | 18 +-- Subsurface/Source/Map/Submarine.cs | 1 + Subsurface/Source/Screens/LobbyScreen.cs | 10 +- Subsurface/Source/Screens/MainMenuScreen.cs | 8 +- Subsurface/Source/Screens/ServerListScreen.cs | 2 +- 22 files changed, 357 insertions(+), 153 deletions(-) create mode 100644 Subsurface/Content/InfoTexts.xml rename Subsurface/Content/{Quests.xml => Missions.xml} (93%) create mode 100644 Subsurface/Source/GameSession/InfoTextManager.cs create mode 100644 Subsurface/Source/GameSession/ShiftSummary.cs diff --git a/.vs/Subsurface_Solution/v14/.suo b/.vs/Subsurface_Solution/v14/.suo index 7351f4633f5a56af9727443c2c82cbedf8e51778..33c17251cc68a1c9a4c101047d9a1dc2a7f4ef1e 100644 GIT binary patch delta 18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47rrqpy4A46*s ztt|{8;mbLi`z)V9Ig6C!;G*z8Pd9E^ySTGH;_n~sIzaC)g6k)!oJY~TN+ps_C)SyD pbsvX3kB!A=x{!1{y-=bzrp~RcNya8-ZbW(4VP{vQwgGgtrs diff --git a/Subsurface/Barotrauma.csproj b/Subsurface/Barotrauma.csproj index b86e05d78..b6028af16 100644 --- a/Subsurface/Barotrauma.csproj +++ b/Subsurface/Barotrauma.csproj @@ -102,6 +102,8 @@ + + @@ -391,6 +393,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest @@ -831,7 +836,7 @@ PreserveNewest Designer - + PreserveNewest diff --git a/Subsurface/Content/InfoTexts.xml b/Subsurface/Content/InfoTexts.xml new file mode 100644 index 000000000..f22898e21 --- /dev/null +++ b/Subsurface/Content/InfoTexts.xml @@ -0,0 +1,22 @@ + + + [sub] has made its way from [location1] to [location2]. + [sub] has arrived at [location2]. + [sub] has returned to [location1]. + The ocean has claimed [sub] and its crew. + + Succumbed to their injuries + Bled out + Drowned + Suffocated + Crushed by water pressure + Burned to death + + You have succumbed to your injuries. + You have bled out. + You have drowned. + You have suffocated. + You have been crushed by water pressure. + You have burned to death. + + \ No newline at end of file diff --git a/Subsurface/Content/Quests.xml b/Subsurface/Content/Missions.xml similarity index 93% rename from Subsurface/Content/Quests.xml rename to Subsurface/Content/Missions.xml index 281ca49a1..8d15fabde 100644 --- a/Subsurface/Content/Quests.xml +++ b/Subsurface/Content/Missions.xml @@ -1,6 +1,6 @@  - - + - + - - + - - + - - + - - - \ No newline at end of file + + \ No newline at end of file diff --git a/Subsurface/Source/Characters/Character.cs b/Subsurface/Source/Characters/Character.cs index 2ea2b63b8..e45b57d38 100644 --- a/Subsurface/Source/Characters/Character.cs +++ b/Subsurface/Source/Characters/Character.cs @@ -17,8 +17,6 @@ namespace Barotrauma class Character : Entity, IDamageable, IPropertyObject { - public static string[] DeathMsg = new string[Enum.GetNames(typeof(CauseOfDeath)).Length]; - public static List CharacterList = new List(); public static Queue NewCharacterQueue = new Queue(); @@ -282,16 +280,9 @@ namespace Barotrauma { get { return AnimController.RefLimb.Position; } } - - static Character() - { - DeathMsg[(int)CauseOfDeath.Damage] = "succumbed to your injuries"; - DeathMsg[(int)CauseOfDeath.Bloodloss] = "bled out"; - DeathMsg[(int)CauseOfDeath.Drowning] = "drowned"; - DeathMsg[(int)CauseOfDeath.Suffocation] = "suffocated"; - DeathMsg[(int)CauseOfDeath.Pressure] = "been crushed by water pressure"; - DeathMsg[(int)CauseOfDeath.Burn] = "burnt to death"; - } + + public delegate void OnDeathHandler(Character character, CauseOfDeath causeOfDeath); + public OnDeathHandler OnDeath; public static Character Create(string file, Vector2 position) { @@ -1159,7 +1150,7 @@ namespace Barotrauma //if the Character is controlled by this client/server, let others know that the Character has died if (Character.controlled == this) { - string chatMessage = "You have " + DeathMsg[(int)causeOfDeath] + "."; + string chatMessage = InfoTextManager.GetInfoText("Self_CauseOfDeath." + causeOfDeath.ToString()); if (GameMain.Client!=null) chatMessage += " Your chat messages will only be visible to other dead players."; GameMain.NetworkMember.AddChatMessage(chatMessage, ChatMessageType.Dead); @@ -1179,6 +1170,8 @@ namespace Barotrauma } } + if (OnDeath != null) OnDeath(this, causeOfDeath); + CoroutineManager.StartCoroutine(DeathAnim(GameMain.GameScreen.Cam)); health = 0.0f; diff --git a/Subsurface/Source/Events/Quests/MonsterQuest.cs b/Subsurface/Source/Events/Quests/MonsterQuest.cs index 7693d0a97..22cfd873d 100644 --- a/Subsurface/Source/Events/Quests/MonsterQuest.cs +++ b/Subsurface/Source/Events/Quests/MonsterQuest.cs @@ -1,14 +1,9 @@ -using FarseerPhysics; -using Microsoft.Xna.Framework; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using Microsoft.Xna.Framework; using System.Xml.Linq; namespace Barotrauma { - class MonsterQuest : Quest + class MonsterMission : Mission { private string monsterFile; @@ -21,7 +16,7 @@ namespace Barotrauma get { return monster.Position; } } - public MonsterQuest(XElement element) + public MonsterMission(XElement element) : base(element) { monsterFile = ToolBox.GetAttributeString(element, "monsterfile", ""); @@ -48,12 +43,8 @@ namespace Barotrauma public override void End() { - if (!monster.IsDead) - { - new GUIMessageBox("Quest failed", failureMessage); - return; - } - + if (!monster.IsDead) return; + GiveReward(); completed = true; diff --git a/Subsurface/Source/Events/Quests/Quest.cs b/Subsurface/Source/Events/Quests/Quest.cs index 5ee6c592a..fdd956b9a 100644 --- a/Subsurface/Source/Events/Quests/Quest.cs +++ b/Subsurface/Source/Events/Quests/Quest.cs @@ -3,16 +3,15 @@ using System; using System.Collections.Generic; using System.Linq; using System.Reflection; -using System.Text; using System.Xml.Linq; namespace Barotrauma { - class Quest + class Mission { - private static List list = new List(); + private static List list = new List(); - private static string configFile = "Content/Quests.xml"; + private static string configFile = "Content/Missions.xml"; private string name; @@ -60,7 +59,17 @@ namespace Barotrauma get { return Vector2.Zero; } } - public Quest(XElement element) + public string SuccessMessage + { + get { return successMessage; } + } + + public string FailureMessage + { + get { return failureMessage; } + } + + public Mission(XElement element) { name = ToolBox.GetAttributeString(element, "name", ""); @@ -68,8 +77,10 @@ namespace Barotrauma reward = ToolBox.GetAttributeInt(element, "reward", 1); - successMessage = ToolBox.GetAttributeString(element, "successmessage", ""); - failureMessage = ToolBox.GetAttributeString(element, "failuremessage", ""); + successMessage = ToolBox.GetAttributeString(element, "successmessage", + "Mission completed successfully"); + failureMessage = ToolBox.GetAttributeString(element, "failuremessage", + "Mission failed"); radarLabel = ToolBox.GetAttributeString(element, "radarlabel", ""); @@ -83,7 +94,7 @@ namespace Barotrauma } } - public static Quest LoadRandom(Location[] locations, Random rand) + public static Mission LoadRandom(Location[] locations, Random rand) { XDocument doc = ToolBox.TryLoadXml(configFile); if (doc == null) return null; @@ -119,32 +130,32 @@ namespace Barotrauma t = Type.GetType("Barotrauma." + type, true, true); if (t == null) { - DebugConsole.ThrowError("Error in " + configFile + "! Could not find a quest class of the type ''" + type + "''."); + DebugConsole.ThrowError("Error in " + configFile + "! Could not find a mission class of the type ''" + type + "''."); continue; } } catch { - DebugConsole.ThrowError("Error in " + configFile + "! Could not find a an event class of the type ''" + type + "''."); + DebugConsole.ThrowError("Error in " + configFile + "! Could not find a mission class of the type ''" + type + "''."); continue; } ConstructorInfo constructor = t.GetConstructor(new[] { typeof(XElement) }); object instance = constructor.Invoke(new object[] { element }); - Quest quest = (Quest)instance; + Mission mission = (Mission)instance; for (int n = 0; n<2; n++) { - quest.description = quest.description.Replace("[location"+(n+1)+"]", locations[n].Name); + mission.description = mission.description.Replace("[location"+(n+1)+"]", locations[n].Name); - quest.successMessage = quest.successMessage.Replace("[location" + (n + 1) + "]", locations[n].Name); - quest.failureMessage = quest.failureMessage.Replace("[location" + (n + 1) + "]", locations[n].Name); + mission.successMessage = mission.successMessage.Replace("[location" + (n + 1) + "]", locations[n].Name); + mission.failureMessage = mission.failureMessage.Replace("[location" + (n + 1) + "]", locations[n].Name); } - return quest; + return mission; } randomNumber -= eventProbability[i]; @@ -168,9 +179,8 @@ namespace Barotrauma } /// - /// End the quest and give a reward if it was completed successfully + /// End the mission and give a reward if it was completed successfully /// - /// whether the quest was completed or not public virtual void End() { completed = true; @@ -180,11 +190,6 @@ namespace Barotrauma public void GiveReward() { - if (!string.IsNullOrWhiteSpace(successMessage)) - { - new GUIMessageBox("Quest completed successfully", successMessage); - } - var mode = GameMain.GameSession.gameMode as SinglePlayerMode; if (mode == null) return; diff --git a/Subsurface/Source/Events/Quests/SalvageQuest.cs b/Subsurface/Source/Events/Quests/SalvageQuest.cs index c0ce3ab6e..1ca5938a4 100644 --- a/Subsurface/Source/Events/Quests/SalvageQuest.cs +++ b/Subsurface/Source/Events/Quests/SalvageQuest.cs @@ -8,7 +8,7 @@ using System.Xml.Linq; namespace Barotrauma { - class SalvageQuest : Quest + class SalvageMission : Mission { private ItemPrefab itemPrefab; @@ -24,7 +24,7 @@ namespace Barotrauma } } - public SalvageQuest(XElement element) + public SalvageMission(XElement element) : base(element) { string itemName = ToolBox.GetAttributeString(element, "itemname", ""); @@ -33,7 +33,7 @@ namespace Barotrauma if (itemPrefab == null) { - DebugConsole.ThrowError("Error in salvagequest: couldn't find an item prefab with the name "+itemName); + DebugConsole.ThrowError("Error in SalvageMission: couldn't find an item prefab with the name "+itemName); } } @@ -91,11 +91,7 @@ namespace Barotrauma public override void End() { item.Remove(); - if (item.CurrentHull == null) - { - new GUIMessageBox("Quest failed", failureMessage); - return; - } + if (item.CurrentHull == null) return; GiveReward(); diff --git a/Subsurface/Source/GUI/GUIMessageBox.cs b/Subsurface/Source/GUI/GUIMessageBox.cs index a47b7fa4b..545eb9409 100644 --- a/Subsurface/Source/GUI/GUIMessageBox.cs +++ b/Subsurface/Source/GUI/GUIMessageBox.cs @@ -5,7 +5,7 @@ namespace Barotrauma { public class GUIMessageBox : GUIFrame { - public static Queue MessageBoxes = new Queue(); + public static Queue MessageBoxes = new Queue(); const int DefaultWidth=400, DefaultHeight=200; @@ -15,15 +15,15 @@ namespace Barotrauma //GUIFrame frame; public GUIButton[] Buttons; - public static GUIMessageBox VisibleBox + public static GUIComponent VisibleBox { get { return MessageBoxes.Count==0 ? null : MessageBoxes.Peek(); } } public string Text { - get { return (children[1] as GUITextBlock).Text; } - set { (children[1] as GUITextBlock).Text = value; } + get { return (children[0].children[1] as GUITextBlock).Text; } + set { (children[0].children[1] as GUITextBlock).Text = value; } } public GUIMessageBox(string header, string text) @@ -39,17 +39,19 @@ namespace Barotrauma } public GUIMessageBox(string header, string text, string[] buttons, int width=DefaultWidth, int height=DefaultHeight, Alignment textAlignment = Alignment.TopLeft, GUIComponent parent = null) - : base(new Rectangle(0,0, width, height), - null, Alignment.Center, GUI.Style, parent) + : base(new Rectangle(0,0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), + Color.Black*0.5f, Alignment.TopLeft, null, parent) { - new GUITextBlock(new Rectangle(0, 0, 0, 30), header, Color.Transparent, Color.White, textAlignment, GUI.Style, this, true); - new GUITextBlock(new Rectangle(0, 30, 0, height - 70), text, Color.Transparent, Color.White, textAlignment, GUI.Style, this, true); + var frame = new GUIFrame(new Rectangle(0,0,width,height), null, Alignment.Center, GUI.Style, this); + + new GUITextBlock(new Rectangle(0, 0, 0, 30), header, Color.Transparent, Color.White, textAlignment, GUI.Style, frame, true); + new GUITextBlock(new Rectangle(0, 30, 0, height - 70), text, Color.Transparent, Color.White, textAlignment, GUI.Style, frame, true); int x = 0; this.Buttons = new GUIButton[buttons.Length]; for (int i = 0; i < buttons.Length; i++) { - this.Buttons[i] = new GUIButton(new Rectangle(x, 0, 150, 30), buttons[i], Alignment.Left | Alignment.Bottom, GUI.Style, this); + this.Buttons[i] = new GUIButton(new Rectangle(x, 0, 150, 30), buttons[i], Alignment.Left | Alignment.Bottom, GUI.Style, frame); x += this.Buttons[i].Rect.Width + 20; } @@ -57,6 +59,8 @@ namespace Barotrauma MessageBoxes.Enqueue(this); } + + public bool Close(GUIButton button, object obj) { if (parent != null) parent.RemoveChild(this); diff --git a/Subsurface/Source/GameSession/GameModes/GameMode.cs b/Subsurface/Source/GameSession/GameModes/GameMode.cs index 169d28285..bc29bb920 100644 --- a/Subsurface/Source/GameSession/GameModes/GameMode.cs +++ b/Subsurface/Source/GameSession/GameModes/GameMode.cs @@ -22,7 +22,7 @@ namespace Barotrauma private string endMessage; - public virtual Quest Quest + public virtual Mission Mission { get { return null; } } diff --git a/Subsurface/Source/GameSession/GameModes/GameModePreset.cs b/Subsurface/Source/GameSession/GameModes/GameModePreset.cs index a0efba237..5acdf3392 100644 --- a/Subsurface/Source/GameSession/GameModes/GameModePreset.cs +++ b/Subsurface/Source/GameSession/GameModes/GameModePreset.cs @@ -48,7 +48,7 @@ namespace Barotrauma + "The rest of the crew will win if they reach the end of the level or kill the traitor " + "before the objective is completed."; - mode = new GameModePreset("Quest", typeof(QuestMode), false); + mode = new GameModePreset("Mission", typeof(MissionMode), false); mode.Description = "The crew must work together to complete a specific task, such as retrieving " + "an alien artifact or killing a creature that's terrorizing nearby outposts. The game ends " + "when the task is completed or everyone in the crew has died."; diff --git a/Subsurface/Source/GameSession/GameModes/QuestMode.cs b/Subsurface/Source/GameSession/GameModes/QuestMode.cs index acdac5151..1bfce67a2 100644 --- a/Subsurface/Source/GameSession/GameModes/QuestMode.cs +++ b/Subsurface/Source/GameSession/GameModes/QuestMode.cs @@ -6,19 +6,19 @@ using System.Text; namespace Barotrauma { - class QuestMode : GameMode + class MissionMode : GameMode { - Quest quest; + Mission mission; - public override Quest Quest + public override Mission Mission { get { - return quest; + return mission; } } - public QuestMode(GameModePreset preset) + public MissionMode(GameModePreset preset) : base(preset) { Location[] locations = new Location[2]; @@ -29,14 +29,14 @@ namespace Barotrauma { locations[i] = Location.CreateRandom(new Vector2((float)rand.NextDouble() * 10000.0f, (float)rand.NextDouble() * 10000.0f)); } - quest = Quest.LoadRandom(locations, rand); + mission = Mission.LoadRandom(locations, rand); } public override void Start() { base.Start(); - new GUIMessageBox(quest.Name, quest.Description, 400, 400); + new GUIMessageBox(mission.Name, mission.Description, 400, 400); //quest.Start(Level.Loaded); } diff --git a/Subsurface/Source/GameSession/GameModes/SinglePlayerMode.cs b/Subsurface/Source/GameSession/GameModes/SinglePlayerMode.cs index 58c41493d..46928b823 100644 --- a/Subsurface/Source/GameSession/GameModes/SinglePlayerMode.cs +++ b/Subsurface/Source/GameSession/GameModes/SinglePlayerMode.cs @@ -18,6 +18,8 @@ namespace Barotrauma private GUIButton endShiftButton; public readonly CargoManager CargoManager; + + private ShiftSummary shiftSummary; public Map Map; @@ -26,11 +28,11 @@ namespace Barotrauma private bool savedOnStart; - public override Quest Quest + public override Mission Mission { get { - return Map.SelectedConnection.Quest; + return Map.SelectedConnection.Mission; } } @@ -115,6 +117,8 @@ namespace Barotrauma endTimer = 5.0f; CrewManager.StartShift(); + + shiftSummary = new ShiftSummary(GameMain.GameSession); } public bool TryHireCharacter(HireManager hireManager, CharacterInfo characterInfo) @@ -192,41 +196,31 @@ namespace Barotrauma //if (endMessage != "" || this.endMessage == null) this.endMessage = endMessage; + GUIFrame summaryFrame = shiftSummary.CreateSummaryFrame(); + GUIMessageBox.MessageBoxes.Enqueue(summaryFrame); + var okButton = new GUIButton(new Rectangle(0,0,100,30), "Ok", Alignment.BottomRight, GUI.Style, summaryFrame.children[0]); + okButton.OnClicked = (GUIButton button, object obj) => { GUIMessageBox.MessageBoxes.Dequeue(); return true; }; - StringBuilder sb = new StringBuilder(); - List casualties = CrewManager.characters.FindAll(c => c.IsDead); - - if (casualties.Count == CrewManager.characters.Count) + bool success = CrewManager.characters.Any(c => !c.IsDead); + + if (success) { - sb.Append("Your entire crew has died!"); - - var msgBox = new GUIMessageBox("", sb.ToString(), new string[] { "Load game", "Quit" }); - msgBox.Buttons[0].OnClicked += GameMain.GameSession.LoadPrevious; - msgBox.Buttons[0].OnClicked += msgBox.Close; - msgBox.Buttons[1].OnClicked = GameMain.LobbyScreen.QuitToMainMenu; - msgBox.Buttons[1].OnClicked += msgBox.Close; - } - else - { - if (casualties.Any()) - { - sb.Append("Casualties: \n"); - foreach (Character c in casualties) - { - sb.Append(" - " + c.Info.Name + "\n"); - } - } - else - { - sb.Append("No casualties!"); - } - if (Submarine.Loaded.AtEndPosition) { Map.MoveToNextLocation(); } SaveUtil.SaveGame(GameMain.GameSession.SaveFile); + + + } + else + { + var msgBox = new GUIMessageBox("Game over", "Your entire crew has died!", new string[] { "Load game", "Quit" }); + msgBox.Buttons[0].OnClicked += GameMain.GameSession.LoadPrevious; + msgBox.Buttons[0].OnClicked += msgBox.Close; + msgBox.Buttons[1].OnClicked = GameMain.LobbyScreen.QuitToMainMenu; + msgBox.Buttons[1].OnClicked += msgBox.Close; } CrewManager.EndShift(); diff --git a/Subsurface/Source/GameSession/GameSession.cs b/Subsurface/Source/GameSession/GameSession.cs index a39764afe..34311a5af 100644 --- a/Subsurface/Source/GameSession/GameSession.cs +++ b/Subsurface/Source/GameSession/GameSession.cs @@ -1,11 +1,6 @@ using System; -using System.IO; -using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Microsoft.Xna.Framework.Input; -using System.Text; -using System.Collections.Generic; using System.Xml.Linq; namespace Barotrauma @@ -24,11 +19,11 @@ namespace Barotrauma public CrewManager CrewManager; - public Quest Quest + public Mission Mission { get { - if (gameMode != null) return gameMode.Quest; + if (gameMode != null) return gameMode.Mission; return null; } } @@ -71,7 +66,7 @@ namespace Barotrauma guiRoot = new GUIFrame(new Rectangle(0,0,GameMain.GraphicsWidth,GameMain.GraphicsWidth), Color.Transparent); - if (gameModePreset!=null) this.gameMode = gameModePreset.Instantiate(); + if (gameModePreset!=null) gameMode = gameModePreset.Instantiate(); this.submarine = submarine; } @@ -122,7 +117,7 @@ namespace Barotrauma GameMain.GameScreen.BackgroundCreatureManager.SpawnSprites(80); } - if (Quest!=null) Quest.Start(Level.Loaded); + if (Mission!=null) Mission.Start(Level.Loaded); if (gameMode!=null) gameMode.Start(); @@ -131,7 +126,7 @@ namespace Barotrauma public void EndShift(string endMessage) { - if (Quest != null) Quest.End(); + if (Mission != null) Mission.End(); if (GameMain.Server!=null) { @@ -172,7 +167,7 @@ namespace Barotrauma guiRoot.Update(deltaTime); if (gameMode != null) gameMode.Update(deltaTime); - if (Quest != null) Quest.Update(deltaTime); + if (Mission != null) Mission.Update(deltaTime); } public void Draw(SpriteBatch spriteBatch) @@ -185,7 +180,7 @@ namespace Barotrauma public void Save(string filePath) { XDocument doc = new XDocument( - new XElement((XName)"Gamesession")); + new XElement("Gamesession")); var now = DateTime.Now; doc.Root.Add(new XAttribute("savetime", now.Hour + ":" + now.Minute + ", " + now.ToShortDateString())); diff --git a/Subsurface/Source/GameSession/InfoTextManager.cs b/Subsurface/Source/GameSession/InfoTextManager.cs new file mode 100644 index 000000000..6571baefa --- /dev/null +++ b/Subsurface/Source/GameSession/InfoTextManager.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Xml.Linq; + +namespace Barotrauma +{ + static class InfoTextManager + { + + private static Dictionary> infoTexts; + + static InfoTextManager() + { + LoadInfoTexts(Path.Combine("Content", "InfoTexts.xml")); + } + + + private static void LoadInfoTexts(string file) + { + infoTexts = new Dictionary>(); + + XDocument doc = ToolBox.TryLoadXml(file); + if (doc == null) return; + + foreach (XElement subElement in doc.Root.Elements()) + { + string infoName = subElement.Name.ToString().ToLower(); + List infoList = null; + if (!infoTexts.TryGetValue(infoName, out infoList)) + { + infoList = new List(); + infoTexts.Add(infoName, infoList); + } + + infoList.Add(subElement.ElementInnerText()); + } + } + + public static string GetInfoText(string infoName) + { + List infoList = null; + if (!infoTexts.TryGetValue(infoName.ToLower(), out infoList) || !infoList.Any()) + { +#if DEBUG + return "Info text ''" + infoName + "'' not found"; +#else + return ""; +#endif + } + + string text = infoList[Rand.Int(infoList.Count)]; + + if (Submarine.Loaded!=null) text = text.Replace("[sub]", Submarine.Loaded.Name); + if (GameMain.GameSession != null && GameMain.GameSession.Map != null) + { + if (GameMain.GameSession.Map.CurrentLocation!=null) + text = text.Replace("[location1]", GameMain.GameSession.Map.CurrentLocation.Name); + + if (GameMain.GameSession.Map.SelectedLocation!= null) + text = text.Replace("[location2]", GameMain.GameSession.Map.SelectedLocation.Name); + } + + return text; + } + } +} diff --git a/Subsurface/Source/GameSession/ShiftSummary.cs b/Subsurface/Source/GameSession/ShiftSummary.cs new file mode 100644 index 000000000..5b3329789 --- /dev/null +++ b/Subsurface/Source/GameSession/ShiftSummary.cs @@ -0,0 +1,129 @@ +using Microsoft.Xna.Framework; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Xml.Linq; + +namespace Barotrauma +{ + class ShiftSummary + { + class Casualty + { + public readonly CharacterInfo character; + public readonly CauseOfDeath causeOfDeath; + + public readonly string description; + + public Casualty(CharacterInfo characterInfo, CauseOfDeath causeOfDeath, string description) + { + this.character = characterInfo; + this.causeOfDeath = causeOfDeath; + this.description = description; + } + } + + private Location startLocation, endLocation; + + private GameSession gameSession; + + private List casualties; + + private Mission selectedMission; + + public ShiftSummary(GameSession gameSession) + { + this.gameSession = gameSession; + + startLocation = gameSession.Map.CurrentLocation; + endLocation = gameSession.Map.SelectedLocation; + + casualties = new List(); + + foreach (Character character in gameSession.CrewManager.characters) + { + character.OnDeath = AddCasualty; + } + + selectedMission = gameSession.Mission; + + } + + + public void AddCasualty(Character character, CauseOfDeath causeOfDeath) + { + casualties.Add(new Casualty(character.Info, causeOfDeath, "")); + } + + public GUIFrame CreateSummaryFrame() + { + bool gameOver = !gameSession.CrewManager.characters.Any(c => !c.IsDead); + bool progress = Submarine.Loaded.AtEndPosition; + + GUIFrame frame = new GUIFrame(new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), Color.Black * 0.8f); + + int width = 700, height = 400; + GUIFrame innerFrame = new GUIFrame(new Rectangle(0,0,width,height), null, Alignment.Center, GUI.Style, frame); + + int y = 0; + string summaryText = InfoTextManager.GetInfoText(gameOver ? "gameover" : + (progress ? "progress" : "return")); + + var infoText = new GUITextBlock(new Rectangle(0,y,0,50), summaryText, GUI.Style, innerFrame, true); + y += infoText.Rect.Height; + + new GUITextBlock(new Rectangle(0,y,0,20), "Crew status:", GUI.Style, innerFrame, GUI.LargeFont); + y += 30; + + int x = 0; + foreach (Character character in gameSession.CrewManager.characters) + { + var characterFrame = new GUIFrame(new Rectangle(x,y,170,70), character.IsDead ? Color.DarkRed*0.7f : Color.Transparent, GUI.Style, innerFrame); + characterFrame.Padding = new Vector4(5.0f,5.0f,5.0f,5.0f); + character.Info.CreateCharacterFrame(characterFrame, + character.Info.Job!=null ? (character.Info.Name + '\n'+"("+character.Info.Job.Name+")") : character.Info.Name, null); + + string statusText; + + var casualty = casualties.Find(c => c.character == character.Info); + + if (casualty != null) + { + statusText = InfoTextManager.GetInfoText("CauseOfDeath." + casualty.causeOfDeath.ToString()); + } + else + { + statusText = (character.Health / character.MaxHealth > 0.8f) ? "OK" : "Injured"; + } + + new GUITextBlock(new Rectangle(0,0,0,20), statusText, + GUI.Style, Alignment.BottomLeft, Alignment.TopCenter, characterFrame, true, GUI.SmallFont).Color = Color.Black*0.7f; + + + x += characterFrame.Rect.Width + 10; + } + + y += 80; + + if (GameMain.GameSession.Mission != null) + { + new GUITextBlock(new Rectangle(0, y, 0, 20), "Mission: "+GameMain.GameSession.Mission.Name, GUI.Style, innerFrame, GUI.LargeFont); + y += 30; + + new GUITextBlock(new Rectangle(0,y,0,30), + (GameMain.GameSession.Mission.Completed) ? GameMain.GameSession.Mission.SuccessMessage : GameMain.GameSession.Mission.FailureMessage, + GUI.Style, innerFrame); + + if (GameMain.GameSession.Mission.Completed) + { + new GUITextBlock(new Rectangle(0, y+40, 0, 30), "Reward: "+GameMain.GameSession.Mission.Reward, GUI.Style, innerFrame); + } + + } + + return frame; + } + } +} diff --git a/Subsurface/Source/Items/Components/Machines/Radar.cs b/Subsurface/Source/Items/Components/Machines/Radar.cs index 78b0b2a7a..3f647db3c 100644 --- a/Subsurface/Source/Items/Components/Machines/Radar.cs +++ b/Subsurface/Source/Items/Components/Machines/Radar.cs @@ -236,15 +236,15 @@ namespace Barotrauma.Items.Components (GameMain.GameSession.Map == null) ? "End" : GameMain.GameSession.Map.SelectedLocation.Name, (Level.Loaded.EndPosition), displayScale, center, (rect.Width * 0.55f)); - if (GameMain.GameSession.Quest != null) + if (GameMain.GameSession.Mission != null) { - var quest = GameMain.GameSession.Quest; + var mission = GameMain.GameSession.Mission; - if (!string.IsNullOrWhiteSpace(quest.RadarLabel)) + if (!string.IsNullOrWhiteSpace(mission.RadarLabel)) { DrawMarker(spriteBatch, - quest.RadarLabel, - quest.RadarPosition, displayScale, center, (rect.Width * 0.55f)); + mission.RadarLabel, + mission.RadarPosition, displayScale, center, (rect.Width * 0.55f)); } } diff --git a/Subsurface/Source/Map/Map.cs b/Subsurface/Source/Map/Map.cs index 29848b186..077b48cc6 100644 --- a/Subsurface/Source/Map/Map.cs +++ b/Subsurface/Source/Map/Map.cs @@ -402,28 +402,28 @@ namespace Barotrauma public List CrackSegments; - private int questsCompleted; + private int missionsCompleted; - private Quest quest; - public Quest Quest + private Mission mission; + public Mission Mission { get { - if (quest==null || quest.Completed) + if (mission==null || mission.Completed) { - if (quest !=null && quest.Completed) questsCompleted++; + if (mission !=null && mission.Completed) missionsCompleted++; int seed = (int)locations[0].MapPosition.X + (int)locations[0].MapPosition.Y * 100; seed += (int)locations[1].MapPosition.X*10000 + (int)locations[1].MapPosition.Y * 1000000; - Random rand = new Random(seed + questsCompleted); + Random rand = new Random(seed + missionsCompleted); if (rand.NextDouble() < 0.3f) return null; - quest = Quest.LoadRandom(locations, rand); + mission = Mission.LoadRandom(locations, rand); } - return quest; + return mission; } } @@ -444,7 +444,7 @@ namespace Barotrauma { locations = new Location[] { location1, location2 }; - questsCompleted = 0; + missionsCompleted = 0; } public Location OtherLocation(Location location) diff --git a/Subsurface/Source/Map/Submarine.cs b/Subsurface/Source/Map/Submarine.cs index 9eaa1f72d..e2868a5d5 100644 --- a/Subsurface/Source/Map/Submarine.cs +++ b/Subsurface/Source/Map/Submarine.cs @@ -618,6 +618,7 @@ namespace Barotrauma XDocument doc = OpenDoc(filePath); if (doc == null) return; + name = ToolBox.GetAttributeString(doc.Root, "name", name); foreach (XElement element in doc.Root.Elements()) { diff --git a/Subsurface/Source/Screens/LobbyScreen.cs b/Subsurface/Source/Screens/LobbyScreen.cs index 5393f7f3d..30c984d72 100644 --- a/Subsurface/Source/Screens/LobbyScreen.cs +++ b/Subsurface/Source/Screens/LobbyScreen.cs @@ -230,15 +230,15 @@ namespace Barotrauma new GUITextBlock(new Rectangle(0, 0, 250, 0), location.Name, GUI.Style, Alignment.TopLeft, Alignment.TopCenter, locationPanel, true, GUI.LargeFont); - if (GameMain.GameSession.Map.SelectedConnection != null && GameMain.GameSession.Map.SelectedConnection.Quest != null) + if (GameMain.GameSession.Map.SelectedConnection != null && GameMain.GameSession.Map.SelectedConnection.Mission != null) { - var quest = GameMain.GameSession.Map.SelectedConnection.Quest; + var mission = GameMain.GameSession.Map.SelectedConnection.Mission; - new GUITextBlock(new Rectangle(0, 80, 0, 20), "Quest: "+quest.Name, Color.Black*0.8f, Color.White, Alignment.TopLeft, null, locationPanel); + new GUITextBlock(new Rectangle(0, 80, 0, 20), "Mission: "+mission.Name, Color.Black*0.8f, Color.White, Alignment.TopLeft, null, locationPanel); - new GUITextBlock(new Rectangle(0, 100, 0, 20), "Reward: " + quest.Reward+" credits", Color.Black * 0.8f, Color.White, Alignment.TopLeft, null, locationPanel); + new GUITextBlock(new Rectangle(0, 100, 0, 20), "Reward: " + mission.Reward+" credits", Color.Black * 0.8f, Color.White, Alignment.TopLeft, null, locationPanel); - new GUITextBlock(new Rectangle(0, 120, 0, 0), quest.Description, Color.Black * 0.8f, Color.White, Alignment.TopLeft, null, locationPanel, true); + new GUITextBlock(new Rectangle(0, 120, 0, 0), mission.Description, Color.Black * 0.8f, Color.White, Alignment.TopLeft, null, locationPanel, true); } diff --git a/Subsurface/Source/Screens/MainMenuScreen.cs b/Subsurface/Source/Screens/MainMenuScreen.cs index 897da2c8d..1cf348360 100644 --- a/Subsurface/Source/Screens/MainMenuScreen.cs +++ b/Subsurface/Source/Screens/MainMenuScreen.cs @@ -476,10 +476,10 @@ namespace Barotrauma GameMain.LobbyScreen.Select(); - new GUIMessageBox("Welcome to Barotrauma!", "Please note that the single player mode is very unfinished at the moment; "+ - "for example, the NPCs don't have an AI yet and there are only a couple of different quests to complete. The multiplayer "+ - "mode should be much more enjoyable to play at the moment, so my recommendation is to try out and get a hang of the game mechanics "+ - "in the single player mode and then move on to multiplayer. Have fun!\n - Regalis, the main dev of Subsurface", 400, 350); + //new GUIMessageBox("Welcome to Barotrauma!", "Please note that the single player mode is very unfinished at the moment; "+ + //"for example, the NPCs don't have an AI yet and there are only a couple of different quests to complete. The multiplayer "+ + //"mode should be much more enjoyable to play at the moment, so my recommendation is to try out and get a hang of the game mechanics "+ + //"in the single player mode and then move on to multiplayer. Have fun!\n - Regalis, the main dev of Subsurface", 400, 350); return true; } diff --git a/Subsurface/Source/Screens/ServerListScreen.cs b/Subsurface/Source/Screens/ServerListScreen.cs index e3acdaddc..15db9d5a9 100644 --- a/Subsurface/Source/Screens/ServerListScreen.cs +++ b/Subsurface/Source/Screens/ServerListScreen.cs @@ -65,7 +65,7 @@ namespace Barotrauma if (n > 0) columnX[n] += columnX[n - 1]; } - SpriteFont font = serverList.Rect.Width < 400 ? GUI.SmallFont : GUI.Font; + SpriteFont font = GUI.SmallFont; // serverList.Rect.Width < 400 ? GUI.SmallFont : GUI.Font; new GUITextBlock(new Rectangle(middleX, 30, 0, 30), "Password", GUI.Style, menu).Font = font;