From 0306c03d0005771d6b7d9a5193083adeaa5ee310 Mon Sep 17 00:00:00 2001 From: Regalis Date: Mon, 20 Feb 2017 21:33:03 +0200 Subject: [PATCH] Tutorial fixes: walls and windows outside the command room are fixed during the same frame they break (to prevent anything from flying out from the railgun room), moloch is forced above the player once the railgun is ready fire --- .../GameModes/Tutorials/BasicTutorial.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Subsurface/Source/GameSession/GameModes/Tutorials/BasicTutorial.cs b/Subsurface/Source/GameSession/GameModes/Tutorials/BasicTutorial.cs index cbfe29e10..fbd40ca05 100644 --- a/Subsurface/Source/GameSession/GameModes/Tutorials/BasicTutorial.cs +++ b/Subsurface/Source/GameSession/GameModes/Tutorials/BasicTutorial.cs @@ -303,7 +303,7 @@ namespace Barotrauma.Tutorials foreach (Structure s in Structure.WallList) { if (s.CastShadow || !s.HasBody) continue; - + if (s.Rect.Right > steering.Item.CurrentHull.Rect.Right) windows.Add(s); } @@ -332,7 +332,7 @@ namespace Barotrauma.Tutorials } if (broken) break; } - + if (broken) break; yield return CoroutineStatus.Running; } while (!broken); @@ -459,8 +459,6 @@ namespace Barotrauma.Tutorials yield return CoroutineStatus.Running; } - moloch.AnimController.SetPosition(ConvertUnits.ToSimUnits(Character.Controlled.WorldPosition + Vector2.UnitY * 600.0f)); - infoBox = CreateInfoFrame("Now we're ready to shoot! Select the railgun controller."); while (Character.Controlled.SelectedConstruction == null || Character.Controlled.SelectedConstruction.Name != "Railgun Controller") @@ -468,11 +466,18 @@ namespace Barotrauma.Tutorials yield return CoroutineStatus.Running; } + moloch.AnimController.SetPosition(ConvertUnits.ToSimUnits(Character.Controlled.WorldPosition + Vector2.UnitY * 600.0f)); + infoBox = CreateInfoFrame("Use the right mouse button to aim and wait for the creature to come closer. When you're ready to shoot, " + "press the left mouse button."); while (!moloch.IsDead) { + if (moloch.WorldPosition.Y > Character.Controlled.WorldPosition.Y + 600.0f) + { + moloch.AIController.SteeringManager.SteeringManual(CoroutineManager.DeltaTime, Character.Controlled.WorldPosition - moloch.WorldPosition); + } + moloch.AIController.SelectTarget(Character.Controlled.AiTarget); yield return CoroutineStatus.Running; }