From c44d64df1b52ad49f8c276ec7f427a2be8bbc479 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Sat, 18 May 2019 17:54:28 +0300 Subject: [PATCH] (a08a47a7f) Readded: Interval based reporting after entering the sub --- .../GameModes/Tutorials/DoctorTutorial.cs | 16 ++++++++++++---- .../Source/Screens/ServerListScreen.cs | 16 ++++++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/Barotrauma/BarotraumaClient/Source/GameSession/GameModes/Tutorials/DoctorTutorial.cs b/Barotrauma/BarotraumaClient/Source/GameSession/GameModes/Tutorials/DoctorTutorial.cs index 8d24aa16f..7a31b0c49 100644 --- a/Barotrauma/BarotraumaClient/Source/GameSession/GameModes/Tutorials/DoctorTutorial.cs +++ b/Barotrauma/BarotraumaClient/Source/GameSession/GameModes/Tutorials/DoctorTutorial.cs @@ -379,15 +379,23 @@ namespace Barotrauma.Tutorials double subEnterTime = Timing.TotalTime; - for (int i = 0; i < subPatients.Count; i++) - { - doctor.AddActiveObjectiveEntity(subPatients[i], doctor_firstAidIcon, doctor_firstAidIconColor); - } + bool[] patientCalledHelp = new bool[] { false, false, false }; while (subPatients.Any(p => p.Vitality < p.MaxVitality * 0.9f && !p.IsDead)) { for (int i = 0; i < subPatients.Count; i++) { + //make patients call for help to make sure the player finds them + //(within 1 minute intervals of entering the sub) + if (!patientCalledHelp[i] && Timing.TotalTime > subEnterTime + 60 * (i + 1)) + { + doctor.AddActiveObjectiveEntity(subPatients[i], doctor_firstAidIcon, doctor_firstAidIconColor); + newOrder = new Order(Order.PrefabList.Find(o => o.AITag == "requestfirstaid"), subPatients[i].CurrentHull, null, orderGiver: subPatients[i]); + string message = newOrder.GetChatMessage("", subPatients[i].CurrentHull?.DisplayName, givingOrderToSelf: false); + GameMain.GameSession.CrewManager.AddSinglePlayerChatMessage(subPatients[i].Name, message, ChatMessageType.Order, null); + patientCalledHelp[i] = true; + } + if (subPatients[i].ExternalHighlight && subPatients[i].Vitality >= subPatients[i].MaxVitality * 0.9f) { doctor.RemoveActiveObjectiveEntity(subPatients[i]); diff --git a/Barotrauma/BarotraumaClient/Source/Screens/ServerListScreen.cs b/Barotrauma/BarotraumaClient/Source/Screens/ServerListScreen.cs index 0344ba7c1..1f146ab06 100644 --- a/Barotrauma/BarotraumaClient/Source/Screens/ServerListScreen.cs +++ b/Barotrauma/BarotraumaClient/Source/Screens/ServerListScreen.cs @@ -218,6 +218,22 @@ namespace Barotrauma return true; } + private bool RefreshJoinButtonState(GUIComponent component, object obj) + { + if (obj == null || waitingForRefresh) { return false; } + + if (!string.IsNullOrWhiteSpace(clientNameBox.Text) && !string.IsNullOrWhiteSpace(ipBox.Text)) + { + joinButton.Enabled = true; + } + else + { + joinButton.Enabled = false; + } + + return true; + } + private bool SelectServer(GUIComponent component, object obj) { if (obj == null || waitingForRefresh) { return false; }