(2e0e45e1f) Updated: Localization

This commit is contained in:
Joonas Rikkonen
2019-05-20 20:41:52 +03:00
parent 5e77ed6507
commit b71adc7589
48 changed files with 389 additions and 587 deletions
@@ -132,7 +132,7 @@ namespace Barotrauma.Tutorials
{
shakeTimer -= 0.1f;
GameMain.GameScreen.Cam.Shake = shakeAmount;
yield return new WaitForSeconds(0.1f, false);
yield return new WaitForSeconds(0.1f);
}
// Room 2
@@ -142,7 +142,7 @@ namespace Barotrauma.Tutorials
// Room 3
do { yield return null; } while (!captain_medicObjectiveSensor.MotionDetected);
GameMain.GameSession?.CrewManager.AddSinglePlayerChatMessage(captain_medic.Info.DisplayName, TextManager.Get("Captain.Radio.Medic"), ChatMessageType.Radio, null);
yield return new WaitForSeconds(2f, false);
yield return new WaitForSeconds(2f);
GameMain.GameSession.CrewManager.ToggleCrewAreaOpen = true;
GameMain.GameSession.CrewManager.AddCharacter(captain_medic);
TriggerTutorialSegment(0);
@@ -157,7 +157,7 @@ namespace Barotrauma.Tutorials
// Submarine
do { yield return null; } while (!captain_enteredSubmarineSensor.MotionDetected);
yield return new WaitForSeconds(3f, false);
yield return new WaitForSeconds(3f);
captain_mechanic.AIController.Enabled = captain_security.AIController.Enabled = captain_engineer.AIController.Enabled = true;
TriggerTutorialSegment(1);
GameMain.GameSession.CrewManager.AddCharacter(captain_mechanic);
@@ -169,7 +169,7 @@ namespace Barotrauma.Tutorials
}
while (!HasOrder(captain_mechanic, "repairsystems", "jobspecific"));
RemoveCompletedObjective(segments[1]);
yield return new WaitForSeconds(2f, false);
yield return new WaitForSeconds(2f);
TriggerTutorialSegment(2);
GameMain.GameSession.CrewManager.AddCharacter(captain_security);
do
@@ -180,7 +180,7 @@ namespace Barotrauma.Tutorials
}
while (!HasOrder(captain_security, "operateweapons", "fireatwill"));
RemoveCompletedObjective(segments[2]);
yield return new WaitForSeconds(4f, false);
yield return new WaitForSeconds(4f);
TriggerTutorialSegment(3);
GameMain.GameSession.CrewManager.AddCharacter(captain_engineer);
do
@@ -202,10 +202,10 @@ namespace Barotrauma.Tutorials
do
{
//captain_navConsoleCustomInterface.HighlightElement(0, uiHighlightColor, duration: 1.0f, pulsateAmount: 0.0f);
yield return new WaitForSeconds(1.0f, false);
yield return new WaitForSeconds(1.0f);
} while (Submarine.MainSub.DockedTo.Count > 0);
RemoveCompletedObjective(segments[4]);
yield return new WaitForSeconds(2f, false);
yield return new WaitForSeconds(2f);
TriggerTutorialSegment(5); // Navigate to destination
do
{
@@ -221,15 +221,15 @@ namespace Barotrauma.Tutorials
} while (!captain_sonar.IsActive);
do { yield return null; } while (Vector2.Distance(Submarine.MainSub.WorldPosition, Level.Loaded.EndPosition) > 4000f);
RemoveCompletedObjective(segments[5]);
yield return new WaitForSeconds(4f, false);
yield return new WaitForSeconds(4f);
TriggerTutorialSegment(6); // Docking
do
{
//captain_navConsoleCustomInterface.HighlightElement(0, uiHighlightColor, duration: 1.0f, pulsateAmount: 0.0f);
yield return new WaitForSeconds(1.0f, false);
yield return new WaitForSeconds(1.0f);
} while (!Submarine.MainSub.AtEndPosition || Submarine.MainSub.DockedTo.Count == 0);
RemoveCompletedObjective(segments[6]);
yield return new WaitForSeconds(3f, false);
yield return new WaitForSeconds(3f);
GameMain.GameSession?.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.Get("Captain.Radio.Complete").Replace("[OUTPOSTNAME]", GameMain.GameSession.EndLocation.Name), ChatMessageType.Radio, null);
SetHighlight(captain_navConsole.Item, false);
SetHighlight(captain_sonar.Item, false);
@@ -21,7 +21,7 @@ namespace Barotrauma.Tutorials
private ItemContainer doctor_suppliesCabinet;
private ItemContainer doctor_medBayCabinet;
private Character patient1, patient2;
private List<Character> subPatients;
private List<Character> subPatients = new List<Character>();
private Hull startRoom;
private Hull medBay;
@@ -38,8 +38,7 @@ namespace Barotrauma.Tutorials
private LightComponent tutorial_submarineDoorLight;
// Variables
private Sprite doctor_firstAidIcon;
private Color doctor_firstAidIconColor;
private Color doctor_iconColor = new Color(178, 118, 139);
public DoctorTutorial(XElement element) : base(element)
{
@@ -48,11 +47,6 @@ namespace Barotrauma.Tutorials
{
base.Start();
var firstAidOrder = Order.PrefabList.Find(order => order.AITag == "requestfirstaid");
doctor_firstAidIcon = firstAidOrder.SymbolSprite;
doctor_firstAidIconColor = firstAidOrder.Color;
subPatients = new List<Character>();
radioSpeakerName = TextManager.Get("Tutorial.Radio.Speaker");
doctor = Character.Controlled;
@@ -125,7 +119,7 @@ namespace Barotrauma.Tutorials
// explosions and radio messages ------------------------------------------------------
yield return new WaitForSeconds(3.0f, false);
yield return new WaitForSeconds(3.0f);
//SoundPlayer.PlayDamageSound("StructureBlunt", 10, Character.Controlled.WorldPosition);
//// Room 1
@@ -147,7 +141,7 @@ namespace Barotrauma.Tutorials
explosion.Explode(Character.Controlled.WorldPosition - Vector2.UnitX * 25, null);
SoundPlayer.PlayDamageSound("StructureBlunt", 10, Character.Controlled.WorldPosition - Vector2.UnitX * 25);
yield return new WaitForSeconds(0.5f, false);
yield return new WaitForSeconds(0.5f);
doctor.DamageLimb(
Character.Controlled.WorldPosition,
@@ -160,15 +154,15 @@ namespace Barotrauma.Tutorials
{
shakeTimer -= 0.1f;
GameMain.GameScreen.Cam.Shake = shakeAmount;
yield return new WaitForSeconds(0.1f, false);
yield return new WaitForSeconds(0.1f);
}
yield return new WaitForSeconds(3.0f, false);
yield return new WaitForSeconds(3.0f);
GameMain.GameSession?.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.Get("Doctor.Radio.KnockedDown"), ChatMessageType.Radio, null);
// first tutorial segment, get medical supplies ------------------------------------------------------
yield return new WaitForSeconds(1.5f, false);
yield return new WaitForSeconds(1.5f);
SetHighlight(doctor_suppliesCabinet.Item, true);
/*while (doctor.CurrentHull != doctor_suppliesCabinet.Item.CurrentHull)
@@ -196,24 +190,22 @@ namespace Barotrauma.Tutorials
}
yield return null;
} while (doctor.Inventory.FindItemByIdentifier("antidama1") == null); // Wait until looted
yield return new WaitForSeconds(1.0f, false);
yield return new WaitForSeconds(1.0f);
SetHighlight(doctor_suppliesCabinet.Item, false);
RemoveCompletedObjective(segments[0]);
yield return new WaitForSeconds(1.0f, false);
yield return new WaitForSeconds(1.0f);
// 2nd tutorial segment, treat self -------------------------------------------------------------------------
TriggerTutorialSegment(1, GameMain.Config.KeyBind(InputType.Health)); // Open health interface
while (CharacterHealth.OpenHealthWindow == null)
{
doctor.CharacterHealth.HealthBarPulsateTimer = 1.0f;
yield return null;
yield return new WaitForSeconds(1.0f);
}
yield return null;
RemoveCompletedObjective(segments[1]);
yield return new WaitForSeconds(1.0f, false);
TriggerTutorialSegment(2); //Treat self
while (doctor.CharacterHealth.GetAfflictionStrength("damage") > 0.01f)
{
@@ -234,22 +226,23 @@ namespace Barotrauma.Tutorials
while (CharacterHealth.OpenHealthWindow != null)
{
yield return new WaitForSeconds(1.0f, false);
yield return new WaitForSeconds(1.0f);
}
// treat patient --------------------------------------------------------------------------------------------
//patient 1 requests first aid
patient1.CanSpeak = true;
var newOrder = new Order(Order.PrefabList.Find(o => o.AITag == "requestfirstaid"), patient1.CurrentHull, null, orderGiver: patient1);
doctor.AddActiveObjectiveEntity(patient1, doctor_firstAidIcon, doctor_firstAidIconColor);
//GameMain.GameSession.CrewManager.AddOrder(newOrder, newOrder.FadeOutTime);
GameMain.GameSession.CrewManager.AddSinglePlayerChatMessage(patient1.Name, newOrder.GetChatMessage("", patient1.CurrentHull?.DisplayName, givingOrderToSelf: false), ChatMessageType.Order, null);
GameMain.GameSession.CrewManager.AddOrder(newOrder, newOrder.FadeOutTime);
patient1.Speak(newOrder.GetChatMessage("", patient1.CurrentHull?.DisplayName, givingOrderToSelf: false), ChatMessageType.Order);
patient1.AIController.Enabled = true;
while (doctor.CurrentHull != patient1.CurrentHull)
{
yield return new WaitForSeconds(1.0f, false);
yield return new WaitForSeconds(1.0f);
}
yield return new WaitForSeconds(0.0f, false);
yield return new WaitForSeconds(0.0f);
GameMain.GameSession.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.Get("Doctor.Radio.AssistantBurns"), ChatMessageType.Radio, null);
GameMain.GameSession.CrewManager.AllowCharacterSwitch = false;
@@ -257,9 +250,7 @@ namespace Barotrauma.Tutorials
GameMain.GameSession.CrewManager.AddCharacter(patient1);
GameMain.GameSession.CrewManager.ToggleCrewAreaOpen = true;
yield return new WaitForSeconds(3.0f, false);
patient1.AIController.Enabled = true;
doctor.RemoveActiveObjectiveEntity(patient1);
yield return new WaitForSeconds(3.0f);
TriggerTutorialSegment(3); // Get the patient to medbay
while (patient1.CurrentOrder == null || patient1.CurrentOrder.AITag != "follow")
@@ -272,13 +263,13 @@ namespace Barotrauma.Tutorials
while (patient1.CurrentHull != medBay)
{
yield return new WaitForSeconds(1.0f, false);
yield return new WaitForSeconds(1.0f);
}
RemoveCompletedObjective(segments[3]);
SetHighlight(doctor_medBayCabinet.Item, true);
SetDoorAccess(doctor_thirdDoor, doctor_thirdDoorLight, true);
yield return new WaitForSeconds(2.0f, false);
yield return new WaitForSeconds(2.0f);
TriggerTutorialSegment(4, GameMain.Config.KeyBind(InputType.Health)); // treat burns
@@ -318,19 +309,17 @@ namespace Barotrauma.Tutorials
}
RemoveCompletedObjective(segments[4]);
SetHighlight(patient1, false);
yield return new WaitForSeconds(1.0f, false);
yield return new WaitForSeconds(1.0f);
GameMain.GameSession.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.Get("Doctor.Radio.AssistantBurnsHealed"), ChatMessageType.Radio, null);
// treat unconscious patient ------------------------------------------------------
//patient calls for help
//patient2.CanSpeak = true;
yield return new WaitForSeconds(2.0f, false);
patient2.CanSpeak = true;
newOrder = new Order(Order.PrefabList.Find(o => o.AITag == "requestfirstaid"), patient2.CurrentHull, null, orderGiver: patient2);
doctor.AddActiveObjectiveEntity(patient2, doctor_firstAidIcon, doctor_firstAidIconColor);
//GameMain.GameSession.CrewManager.AddOrder(newOrder, newOrder.FadeOutTime);
GameMain.GameSession.CrewManager.AddSinglePlayerChatMessage(patient2.Name, newOrder.GetChatMessage("", patient1.CurrentHull?.DisplayName, givingOrderToSelf: false), ChatMessageType.Order, null);
GameMain.GameSession.CrewManager.AddOrder(newOrder, newOrder.FadeOutTime);
patient2.Speak(newOrder.GetChatMessage("", patient1.CurrentHull?.DisplayName, givingOrderToSelf: false), ChatMessageType.Order);
patient2.AIController.Enabled = true;
patient2.Oxygen = -50;
CoroutineManager.StartCoroutine(KeepPatientAlive(patient2), "KeepPatient2Alive");
@@ -340,7 +329,7 @@ namespace Barotrauma.Tutorials
yield return new WaitForSeconds(1.0f);
}*/
do { yield return null; } while (!tutorial_upperFinalDoor.IsOpen);
yield return new WaitForSeconds(2.0f, false);
yield return new WaitForSeconds(2.0f);
TriggerTutorialSegment(5, GameMain.Config.KeyBind(InputType.Health)); // perform CPR
SetHighlight(patient2, true);
@@ -355,24 +344,23 @@ namespace Barotrauma.Tutorials
}
RemoveCompletedObjective(segments[5]);
SetHighlight(patient2, false);
doctor.RemoveActiveObjectiveEntity(patient2);
CoroutineManager.StopCoroutines("KeepPatient2Alive");
SetDoorAccess(tutorial_submarineDoor, tutorial_submarineDoorLight, true);
while (doctor.Submarine != Submarine.MainSub)
{
yield return new WaitForSeconds(1.0f, false);
yield return new WaitForSeconds(1.0f);
}
yield return new WaitForSeconds(5.0f, false);
yield return new WaitForSeconds(5.0f);
GameMain.GameSession.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.Get("Doctor.Radio.EnteredSub"), ChatMessageType.Radio, null);
yield return new WaitForSeconds(3.0f, false);
yield return new WaitForSeconds(3.0f);
TriggerTutorialSegment(6, GameMain.Config.KeyBind(InputType.Health)); // give treatment to anyone in need
foreach (var patient in subPatients)
{
//patient.CanSpeak = true;
patient.CanSpeak = true;
patient.AIController.Enabled = true;
SetHighlight(patient, true);
}
@@ -381,8 +369,7 @@ namespace Barotrauma.Tutorials
double subEnterTime = Timing.TotalTime;
bool[] patientCalledHelp = new bool[] { false, false, false };
bool[] patientCalledHelp = new bool[] { false, false, false, false, false, false };
while (subPatients.Any(p => p.Vitality < p.MaxVitality * 0.9f && !p.IsDead))
{
for (int i = 0; i < subPatients.Count; i++)
@@ -391,26 +378,32 @@ namespace Barotrauma.Tutorials
//(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]);
GameMain.GameSession.CrewManager.AddOrder(newOrder, newOrder.FadeOutTime);
string message = newOrder.GetChatMessage("", subPatients[i].CurrentHull?.DisplayName, givingOrderToSelf: false);
GameMain.GameSession.CrewManager.AddSinglePlayerChatMessage(subPatients[i].Name, message, ChatMessageType.Order, null);
if (subPatients[i].CanSpeak)
{
subPatients[i].Speak(message, ChatMessageType.Order);
}
else
{
GameMain.GameSession.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, message, ChatMessageType.Radio, null);
}
patientCalledHelp[i] = true;
}
if (subPatients[i].ExternalHighlight && subPatients[i].Vitality >= subPatients[i].MaxVitality * 0.9f)
{
doctor.RemoveActiveObjectiveEntity(subPatients[i]);
SetHighlight(subPatients[i], false);
}
}
yield return new WaitForSeconds(1.0f, false);
yield return new WaitForSeconds(1.0f);
}
RemoveCompletedObjective(segments[6]);
foreach (var patient in subPatients)
{
SetHighlight(patient, false);
doctor.RemoveActiveObjectiveEntity(patient);
}
// END TUTORIAL
@@ -213,7 +213,7 @@ namespace Barotrauma.Tutorials
{
shakeTimer -= 0.1f;
GameMain.GameScreen.Cam.Shake = shakeAmount;
yield return new WaitForSeconds(0.1f, false);
yield return new WaitForSeconds(0.1f);
}
//// Remove
@@ -231,7 +231,7 @@ namespace Barotrauma.Tutorials
// Room 2
do { yield return null; } while (!engineer_equipmentObjectiveSensor.MotionDetected);
GameMain.GameSession.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.Get("Engineer.Radio.Equipment"), ChatMessageType.Radio, null);
yield return new WaitForSeconds(0.5f, false);
yield return new WaitForSeconds(0.5f);
TriggerTutorialSegment(0, GameMain.Config.KeyBind(InputType.Select), GameMain.Config.KeyBind(InputType.Deselect)); // Retrieve equipment
bool firstSlotRemoved = false;
bool secondSlotRemoved = false;
@@ -280,7 +280,7 @@ namespace Barotrauma.Tutorials
// Room 3
do { yield return null; } while (!IsSelectedItem(engineer_reactor.Item));
yield return new WaitForSeconds(0.5f, false);
yield return new WaitForSeconds(0.5f);
TriggerTutorialSegment(1);
do
{
@@ -326,7 +326,7 @@ namespace Barotrauma.Tutorials
}
yield return null;
} while (!reactorOperatedProperly);
yield return new WaitForSeconds(2f, false);
yield return new WaitForSeconds(2f);
GameMain.GameSession.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.Get("Engineer.Radio.ReactorStable"), ChatMessageType.Radio, null);
do
{
@@ -343,7 +343,7 @@ namespace Barotrauma.Tutorials
float wait = 1.5f;
do
{
yield return new WaitForSeconds(0.1f, false);
yield return new WaitForSeconds(0.1f);
wait -= 0.1f;
engineer_reactor.AutoTempSlider.BarScrollValue = 0.0f;
} while (wait > 0.0f);
@@ -356,24 +356,9 @@ namespace Barotrauma.Tutorials
// Room 4
do { yield return null; } while (!engineer_secondDoor.IsOpen);
yield return new WaitForSeconds(1f, false);
Repairable repairableJunctionBoxComponent = engineer_brokenJunctionBox.GetComponent<Repairable>();
yield return new WaitForSeconds(1f);
TriggerTutorialSegment(2, GameMain.Config.KeyBind(InputType.Select)); // Repair the junction box
do
{
if (!engineer.HasEquippedItem("screwdriver"))
{
HighlightInventorySlot(engineer.Inventory, "screwdriver", highlightColor, .5f, .5f, 0f);
}
else if (IsSelectedItem(engineer_brokenJunctionBox) && repairableJunctionBoxComponent.CurrentFixer == null)
{
if (repairableJunctionBoxComponent.RepairButton.Frame.FlashTimer <= 0)
{
repairableJunctionBoxComponent.RepairButton.Frame.Flash();
}
}
yield return null;
} while (!engineer_brokenJunctionBox.IsFullCondition); // Wait until repaired
do { yield return null; } while (!engineer_brokenJunctionBox.IsFullCondition); // Wait until repaired
SetHighlight(engineer_brokenJunctionBox, false);
RemoveCompletedObjective(segments[2]);
SetDoorAccess(engineer_thirdDoor, engineer_thirdDoorLight, true);
@@ -385,7 +370,7 @@ namespace Barotrauma.Tutorials
// Room 5
do { yield return null; } while (!engineer_thirdDoor.IsOpen);
GameMain.GameSession.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.Get("Engineer.Radio.FaultyWiring"), ChatMessageType.Radio, null);
yield return new WaitForSeconds(2f, false);
yield return new WaitForSeconds(2f);
TriggerTutorialSegment(3, GameMain.Config.KeyBind(InputType.Use), GameMain.Config.KeyBind(InputType.Deselect)); // Connect the junction boxes
do { CheckGhostWires(); HandleJunctionBoxWiringHighlights(); yield return null; } while (engineer_workingPump.Voltage < engineer_workingPump.MinVoltage); // Wait until connected all the way to the pump
CheckGhostWires();
@@ -402,7 +387,7 @@ namespace Barotrauma.Tutorials
// Submarine
do { yield return null; } while (!tutorial_enteredSubmarineSensor.MotionDetected);
GameMain.GameSession.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.Get("Engineer.Radio.Submarine"), ChatMessageType.Radio, null);
yield return new WaitForSeconds(2f, false);
yield return new WaitForSeconds(2f);
TriggerTutorialSegment(4); // Repair junction box
while (ContentRunning) yield return null;
SetHighlight(engineer_submarineJunctionBox_1, true);
@@ -458,7 +443,7 @@ namespace Barotrauma.Tutorials
tutorial_oxygenGenerator.PowerConsumption = reactorLoads[i];
while (timer > 0)
{
yield return new WaitForSeconds(0.1f, false);
yield return new WaitForSeconds(0.1f);
if (IsReactorPoweredUp(engineer_reactor))
{
timer -= 0.1f;
@@ -230,25 +230,25 @@ namespace Barotrauma.Tutorials
{
shakeTimer -= 0.1f;
GameMain.GameScreen.Cam.Shake = shakeAmount;
yield return new WaitForSeconds(0.1f, false);
yield return new WaitForSeconds(0.1f);
}
yield return new WaitForSeconds(2.5f, false);
yield return new WaitForSeconds(2.5f);
mechanic_fabricator.RemoveFabricationRecipes(new List<string>() { "extinguisher", "wrench", "weldingtool", "weldingfuel", "divingmask", "railgunshell", "nuclearshell", "uex", "harpoongun" });
GameMain.GameSession?.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.Get("Mechanic.Radio.WakeUp"), ChatMessageType.Radio, null);
yield return new WaitForSeconds(2.5f, false);
yield return new WaitForSeconds(2.5f);
TriggerTutorialSegment(0, GameMain.Config.KeyBind(InputType.Up), GameMain.Config.KeyBind(InputType.Left), GameMain.Config.KeyBind(InputType.Down), GameMain.Config.KeyBind(InputType.Right), GameMain.Config.KeyBind(InputType.Select), GameMain.Config.KeyBind(InputType.Select)); // Open door objective
yield return new WaitForSeconds(0.0f, false);
yield return new WaitForSeconds(0.0f);
SetDoorAccess(mechanic_firstDoor, mechanic_firstDoorLight, true);
SetHighlight(mechanic_firstDoor.Item, true);
do { yield return null; } while (!mechanic_firstDoor.IsOpen);
SetHighlight(mechanic_firstDoor.Item, false);
yield return new WaitForSeconds(1.5f, false);
yield return new WaitForSeconds(1.5f);
RemoveCompletedObjective(segments[0]);
// Room 2
yield return new WaitForSeconds(0.0f, false);
yield return new WaitForSeconds(0.0f);
GameMain.GameSession?.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.Get("Mechanic.Radio.Equipment"), ChatMessageType.Radio, null);
do { yield return null; } while (!mechanic_equipmentObjectiveSensor.MotionDetected);
TriggerTutorialSegment(1, GameMain.Config.KeyBind(InputType.Select), GameMain.Config.KeyBind(InputType.Deselect)); // Equipment & inventory objective
@@ -287,7 +287,7 @@ namespace Barotrauma.Tutorials
yield return null;
} while (mechanic.Inventory.FindItemByIdentifier("divingmask") == null || mechanic.Inventory.FindItemByIdentifier("weldingtool") == null || mechanic.Inventory.FindItemByIdentifier("wrench") == null); // Wait until looted
SetHighlight(mechanic_equipmentCabinet.Item, false);
yield return new WaitForSeconds(1.5f, false);
yield return new WaitForSeconds(1.5f);
RemoveCompletedObjective(segments[1]);
GameMain.GameSession?.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.Get("Mechanic.Radio.Breach"), ChatMessageType.Radio, null);
@@ -312,13 +312,13 @@ namespace Barotrauma.Tutorials
do { yield return null; } while (WallHasDamagedSections(mechanic_brokenWall_1)); // Highlight until repaired
mechanic.RemoveActiveObjectiveEntity(mechanic_brokenWall_1);
RemoveCompletedObjective(segments[2]);
yield return new WaitForSeconds(1f, false);
yield return new WaitForSeconds(1f);
TriggerTutorialSegment(3, GameMain.Config.KeyBind(InputType.Select)); // Pump objective
SetHighlight(mechanic_workingPump.Item, true);
do
{
yield return null;
if (IsSelectedItem(mechanic_workingPump.Item))
if (IsSelectedItem(mechanic_brokenPump.Item))
{
if (mechanic_workingPump.IsActiveSlider.FlashTimer <= 0)
{
@@ -330,17 +330,17 @@ namespace Barotrauma.Tutorials
do { yield return null; } while (mechanic_brokenhull_1.WaterPercentage > waterVolumeBeforeOpening); // Unlock door once drained
RemoveCompletedObjective(segments[3]);
SetDoorAccess(mechanic_thirdDoor, mechanic_thirdDoorLight, true);
yield return new WaitForSeconds(1.5f, false);
yield return new WaitForSeconds(1.5f);
//TriggerTutorialSegment(11, GameMain.Config.KeyBind(InputType.Select), GameMain.Config.KeyBind(InputType.Up), GameMain.Config.KeyBind(InputType.Down), GameMain.Config.KeyBind(InputType.Select)); // Ladder objective
//do { yield return null; } while (!mechanic_ladderSensor.MotionDetected);
//RemoveCompletedObjective(segments[11]);
GameMain.GameSession?.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.Get("Mechanic.Radio.News"), ChatMessageType.Radio, null);
yield return new WaitForSeconds(1f, false);
yield return new WaitForSeconds(1f);
GameMain.GameSession?.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.Get("Mechanic.Radio.Fire"), ChatMessageType.Radio, null);
// Room 4
do { yield return null; } while (!mechanic_thirdDoor.IsOpen);
yield return new WaitForSeconds(1f, false);
yield return new WaitForSeconds(1f);
mechanic_fire = new DummyFireSource(new Vector2(20f, 2f), Item.ItemList.Find(i => i.HasTag("mechanic_fire")).WorldPosition);
//do { yield return null; } while (!mechanic_craftingObjectiveSensor.MotionDetected);
TriggerTutorialSegment(4); // Deconstruct
@@ -364,7 +364,7 @@ namespace Barotrauma.Tutorials
}
yield return null;
} while (mechanic.Inventory.FindItemByIdentifier("oxygentank") == null || mechanic.Inventory.FindItemByIdentifier("sodium") == null); // Wait until looted
yield return new WaitForSeconds(1.0f, false);
yield return new WaitForSeconds(1.0f);
SetHighlight(mechanic_craftingCabinet.Item, false);
SetHighlight(mechanic_deconstructor.Item, true);
@@ -409,7 +409,7 @@ namespace Barotrauma.Tutorials
SetHighlight(mechanic_deconstructor.Item, false);
RemoveCompletedObjective(segments[4]);
yield return new WaitForSeconds(1f, false);
yield return new WaitForSeconds(1f);
TriggerTutorialSegment(5); // Fabricate
SetHighlight(mechanic_fabricator.Item, true);
do
@@ -465,7 +465,7 @@ namespace Barotrauma.Tutorials
do { yield return null; } while (!mechanic_fireSensor.MotionDetected);
TriggerTutorialSegment(6, GameMain.Config.KeyBind(InputType.Aim), GameMain.Config.KeyBind(InputType.Shoot)); // Using the extinguisher
do { yield return null; } while (!mechanic_fire.Removed); // Wait until extinguished
yield return new WaitForSeconds(3f, false);
yield return new WaitForSeconds(3f);
RemoveCompletedObjective(segments[6]);
if (mechanic.HasEquippedItem("extinguisher")) // do not trigger if dropped already
@@ -527,16 +527,6 @@ namespace Barotrauma.Tutorials
}
}
}
else
{
if (IsSelectedItem(mechanic_brokenPump.Item))
{
if (mechanic_brokenPump.IsActiveSlider.FlashTimer <= 0)
{
mechanic_brokenPump.IsActiveSlider.Flash(uiHighlightColor, 1.5f, true);
}
}
}
} while (!mechanic_brokenPump.Item.IsFullCondition || mechanic_brokenPump.FlowPercentage >= 0 || !mechanic_brokenPump.IsActive);
RemoveCompletedObjective(segments[9]);
SetHighlight(mechanic_brokenPump.Item, false);
@@ -197,7 +197,7 @@ namespace Barotrauma.Tutorials
{
shakeTimer -= 0.1f;
GameMain.GameScreen.Cam.Shake = shakeAmount;
yield return new WaitForSeconds(0.1f, false);
yield return new WaitForSeconds(0.1f);
}
GameMain.GameSession?.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.Get("Officer.Radio.WakeUp"), ChatMessageType.Radio, null);
@@ -205,7 +205,7 @@ namespace Barotrauma.Tutorials
// Room 2
do { yield return null; } while (!officer_equipmentObjectiveSensor.MotionDetected);
GameMain.GameSession?.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.Get("Officer.Radio.Equipment"), ChatMessageType.Radio, null);
yield return new WaitForSeconds(3f, false);
yield return new WaitForSeconds(3f);
//TriggerTutorialSegment(0, GameMain.Config.KeyBind(InputType.Select), GameMain.Config.KeyBind(InputType.Deselect)); // Retrieve equipment
SetHighlight(officer_equipmentCabinet.Item, true);
bool firstSlotRemoved = false;
@@ -259,7 +259,7 @@ namespace Barotrauma.Tutorials
{
HighlightInventorySlot(officer.Inventory, "ballistichelmet", highlightColor, .5f, .5f, 0f);
}
yield return new WaitForSeconds(1f, false);
yield return new WaitForSeconds(1f);
} while (!officer.HasEquippedItem("stunbaton") || !officer.HasEquippedItem("bodyarmor") || !officer.HasEquippedItem("ballistichelmet"));
RemoveCompletedObjective(segments[1]);
SetDoorAccess(officer_firstDoor, officer_firstDoorLight, true);
@@ -271,7 +271,7 @@ namespace Barotrauma.Tutorials
do { yield return null; } while (!officer_crawler.IsDead);
RemoveCompletedObjective(segments[2]);
Heal(officer);
yield return new WaitForSeconds(1f, false);
yield return new WaitForSeconds(1f);
GameMain.GameSession?.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.Get("Officer.Radio.CrawlerDead"), ChatMessageType.Radio, null);
SetDoorAccess(officer_secondDoor, officer_secondDoorLight, true);
@@ -296,7 +296,7 @@ namespace Barotrauma.Tutorials
SetHighlight(officer_ammoShelf_1.Item, false);
SetHighlight(officer_ammoShelf_2.Item, false);
RemoveCompletedObjective(segments[3]);
yield return new WaitForSeconds(2f, false);
yield return new WaitForSeconds(2f);
TriggerTutorialSegment(4, GameMain.Config.KeyBind(InputType.Select), GameMain.Config.KeyBind(InputType.Shoot), GameMain.Config.KeyBind(InputType.Deselect)); // Kill hammerhead
officer_hammerhead = SpawnMonster(hammerheadCharacterFile, officer_hammerheadSpawnPos);
officer_hammerhead.AIController.SelectTarget(officer.AiTarget);
@@ -316,14 +316,14 @@ namespace Barotrauma.Tutorials
Heal(officer);
SetHighlight(officer_coilgunPeriscope, false);
RemoveCompletedObjective(segments[4]);
yield return new WaitForSeconds(1f, false);
yield return new WaitForSeconds(1f);
GameMain.GameSession?.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.Get("Officer.Radio.HammerheadDead"), ChatMessageType.Radio, null);
SetDoorAccess(officer_thirdDoor, officer_thirdDoorLight, true);
// Room 5
//do { yield return null; } while (!officer_rangedWeaponSensor.MotionDetected);
do { yield return null; } while (!officer_thirdDoor.IsOpen);
yield return new WaitForSeconds(3f, false);
yield return new WaitForSeconds(3f);
TriggerTutorialSegment(5, GameMain.Config.KeyBind(InputType.Aim), GameMain.Config.KeyBind(InputType.Shoot)); // Ranged weapons
SetHighlight(officer_rangedWeaponHolder.Item, true);
do { yield return null; } while (!officer_rangedWeaponHolder.Inventory.IsEmpty()); // Wait until looted
@@ -387,9 +387,8 @@ namespace Barotrauma.Tutorials
officer.AddActiveObjectiveEntity(officer_subAmmoBox_1, officer_gunIcon, officer_gunIconColor);
officer.AddActiveObjectiveEntity(officer_subAmmoBox_2, officer_gunIcon, officer_gunIconColor);
officer.AddActiveObjectiveEntity(officer_subSuperCapacitor_1.Item, officer_gunIcon, officer_gunIconColor);
officer.AddActiveObjectiveEntity(officer_subSuperCapacitor_1.Item, officer_gunIcon, officer_gunIconColor);
officer.AddActiveObjectiveEntity(officer_subSuperCapacitor_2.Item, officer_gunIcon, officer_gunIconColor);
SetHighlight(officer_subSuperCapacitor_1.Item, true);
SetHighlight(officer_subSuperCapacitor_2.Item, true);
GameMain.GameSession?.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.Get("Officer.Radio.Submarine"), ChatMessageType.Radio, null);
do
{
@@ -410,8 +409,8 @@ namespace Barotrauma.Tutorials
officer.RemoveActiveObjectiveEntity(officer_subSuperCapacitor_2.Item);
}
SetHighlight(officer_subAmmoBox_1, officer_subAmmoBox_1.ParentInventory != officer_subLoader_1.Inventory && officer_subAmmoBox_1.ParentInventory != officer_subLoader_2.Inventory);
SetHighlight(officer_subAmmoBox_2, officer_subAmmoBox_2.ParentInventory != officer_subLoader_1.Inventory && officer_subAmmoBox_2.ParentInventory != officer_subLoader_2.Inventory);
SetHighlight(officer_subAmmoBox_1, officer_subLoader_1.Item.ExternalHighlight || officer_subLoader_2.Item.ExternalHighlight);
SetHighlight(officer_subAmmoBox_2, officer_subLoader_1.Item.ExternalHighlight || officer_subLoader_2.Item.ExternalHighlight);
SetHighlight(officer_subAmmoShelf.Item, officer_subLoader_1.Item.ExternalHighlight || officer_subLoader_2.Item.ExternalHighlight);
if (officer_subAmmoBox_1.ParentInventory == officer_subLoader_1.Inventory || officer_subAmmoBox_1.ParentInventory == officer_subLoader_2.Inventory) officer.RemoveActiveObjectiveEntity(officer_subAmmoBox_1);
if (officer_subAmmoBox_2.ParentInventory == officer_subLoader_1.Inventory || officer_subAmmoBox_2.ParentInventory == officer_subLoader_2.Inventory) officer.RemoveActiveObjectiveEntity(officer_subAmmoBox_2);
@@ -431,7 +430,7 @@ namespace Barotrauma.Tutorials
RemoveCompletedObjective(segments[7]);
GameMain.GameSession?.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.Get("Officer.Radio.Complete"), ChatMessageType.Radio, null);
yield return new WaitForSeconds(4f, false);
yield return new WaitForSeconds(4f);
CoroutineManager.StartCoroutine(TutorialCompleted());
}