(28c455ff7) Improve the ai repair tool usage.
This commit is contained in:
@@ -44,6 +44,7 @@
|
|||||||
<Compile Include="$(MSBuildThisFileDirectory)Source\GameSession\GameModes\SinglePlayerCampaign.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Source\GameSession\GameModes\SinglePlayerCampaign.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Source\GameSession\GameModes\Tutorials\BasicTutorial.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Source\GameSession\GameModes\Tutorials\BasicTutorial.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Source\GameSession\GameModes\Tutorials\CaptainTutorial.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Source\GameSession\GameModes\Tutorials\CaptainTutorial.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)Source\GameSession\GameModes\Tutorials\ContextualTutorial.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Source\GameSession\GameModes\Tutorials\DoctorTutorial.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Source\GameSession\GameModes\Tutorials\DoctorTutorial.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Source\GameSession\GameModes\Tutorials\EditorTutorial.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Source\GameSession\GameModes\Tutorials\EditorTutorial.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Source\GameSession\GameModes\Tutorials\EngineerTutorial.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Source\GameSession\GameModes\Tutorials\EngineerTutorial.cs" />
|
||||||
|
|||||||
@@ -1551,7 +1551,14 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
if (Tutorial.Initialized)
|
if (Tutorial.Initialized)
|
||||||
{
|
{
|
||||||
((TutorialMode)GameMain.GameSession.GameMode).Tutorial.Stop();
|
if (GameMain.GameSession.GameMode is SinglePlayerCampaign)
|
||||||
|
{
|
||||||
|
((SinglePlayerCampaign)GameMain.GameSession.GameMode).ContextualTutorial.Stop();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
((TutorialMode)GameMain.GameSession.GameMode).Tutorial.Stop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GameSettings.SendUserStatistics)
|
if (GameSettings.SendUserStatistics)
|
||||||
|
|||||||
@@ -41,19 +41,32 @@ namespace Barotrauma
|
|||||||
InnerFrame = new GUIFrame(new RectTransform(new Point(width, height), RectTransform, Anchor.Center) { IsFixedSize = false }, style: null);
|
InnerFrame = new GUIFrame(new RectTransform(new Point(width, height), RectTransform, Anchor.Center) { IsFixedSize = false }, style: null);
|
||||||
GUI.Style.Apply(InnerFrame, "", this);
|
GUI.Style.Apply(InnerFrame, "", this);
|
||||||
|
|
||||||
|
InnerFrame = new GUIFrame(new RectTransform(new Point(width, height), RectTransform, Anchor.Center) { IsFixedSize = false }, style: null);
|
||||||
|
GUI.Style.Apply(InnerFrame, "", this);
|
||||||
|
|
||||||
Content = new GUILayoutGroup(new RectTransform(new Vector2(0.9f, 0.85f), InnerFrame.RectTransform, Anchor.Center)) { AbsoluteSpacing = 5 };
|
Content = new GUILayoutGroup(new RectTransform(new Vector2(0.9f, 0.85f), InnerFrame.RectTransform, Anchor.Center)) { AbsoluteSpacing = 5 };
|
||||||
Tag = tag;
|
Tag = tag;
|
||||||
|
|
||||||
|
if (height == 0)
|
||||||
|
{
|
||||||
|
string wrappedText = ToolBox.WrapText(text, Content.Rect.Width, GUI.Font);
|
||||||
|
string[] lines = wrappedText.Split('\n');
|
||||||
|
foreach (string line in lines)
|
||||||
|
{
|
||||||
|
height += (int)GUI.Font.MeasureString(line).Y;
|
||||||
|
}
|
||||||
|
height += string.IsNullOrWhiteSpace(headerText) ? 220 : 220 - headerHeight;
|
||||||
|
}
|
||||||
|
InnerFrame.RectTransform.NonScaledSize = new Point(InnerFrame.Rect.Width, height);
|
||||||
|
|
||||||
Header = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), Content.RectTransform),
|
Header = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), Content.RectTransform),
|
||||||
headerText, textAlignment: Alignment.Center, wrap: true);
|
headerText, textAlignment: Alignment.Center, wrap: true);
|
||||||
Header.RectTransform.MinSize = new Point(0, Header.Rect.Height);
|
|
||||||
GUI.Style.Apply(Header, "", this);
|
GUI.Style.Apply(Header, "", this);
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(text))
|
if (height == 0)
|
||||||
{
|
{
|
||||||
Text = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), Content.RectTransform),
|
Text = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), Content.RectTransform),
|
||||||
text, textAlignment: textAlignment, wrap: true);
|
text, textAlignment: textAlignment, wrap: true);
|
||||||
Text.RectTransform.MinSize = new Point(0, Text.Rect.Height);
|
|
||||||
GUI.Style.Apply(Text, "", this);
|
GUI.Style.Apply(Text, "", this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,18 +76,7 @@ namespace Barotrauma
|
|||||||
AbsoluteSpacing = 5,
|
AbsoluteSpacing = 5,
|
||||||
IgnoreLayoutGroups = true
|
IgnoreLayoutGroups = true
|
||||||
};
|
};
|
||||||
buttonContainer.RectTransform.NonScaledSize = buttonContainer.RectTransform.MinSize = buttonContainer.RectTransform.MaxSize =
|
|
||||||
new Point(buttonContainer.Rect.Width, (int)(30 * GUI.Scale));
|
|
||||||
|
|
||||||
if (height == 0)
|
|
||||||
{
|
|
||||||
height += Header.Rect.Height + Content.AbsoluteSpacing;
|
|
||||||
height += (Text == null ? 0 : Text.Rect.Height) + Content.AbsoluteSpacing;
|
|
||||||
height += buttonContainer.Rect.Height;
|
|
||||||
|
|
||||||
InnerFrame.RectTransform.NonScaledSize = new Point(InnerFrame.Rect.Width, (int)(height / Content.RectTransform.RelativeSize.Y));
|
|
||||||
}
|
|
||||||
|
|
||||||
Buttons = new List<GUIButton>(buttons.Length);
|
Buttons = new List<GUIButton>(buttons.Length);
|
||||||
for (int i = 0; i < buttons.Length; i++)
|
for (int i = 0; i < buttons.Length; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -717,7 +717,7 @@ namespace Barotrauma
|
|||||||
PerformanceCounter.DrawTimeGraph.Update(sw.ElapsedTicks / (float)TimeSpan.TicksPerMillisecond);
|
PerformanceCounter.DrawTimeGraph.Update(sw.ElapsedTicks / (float)TimeSpan.TicksPerMillisecond);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowCampaignDisclaimer(Action onContinue)
|
public void ShowCampaignDisclaimer()
|
||||||
{
|
{
|
||||||
var msgBox = new GUIMessageBox(TextManager.Get("CampaignDisclaimerTitle"), TextManager.Get("CampaignDisclaimerText"),
|
var msgBox = new GUIMessageBox(TextManager.Get("CampaignDisclaimerTitle"), TextManager.Get("CampaignDisclaimerText"),
|
||||||
new string[] { TextManager.Get("CampaignRoadMapTitle"), TextManager.Get("OK") });
|
new string[] { TextManager.Get("CampaignRoadMapTitle"), TextManager.Get("OK") });
|
||||||
@@ -726,15 +726,13 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
var roadMap = new GUIMessageBox(TextManager.Get("CampaignRoadMapTitle"), TextManager.Get("CampaignRoadMapText"),
|
var roadMap = new GUIMessageBox(TextManager.Get("CampaignRoadMapTitle"), TextManager.Get("CampaignRoadMapText"),
|
||||||
new string[] { TextManager.Get("Back"), TextManager.Get("OK") });
|
new string[] { TextManager.Get("Back"), TextManager.Get("OK") });
|
||||||
|
roadMap.Buttons[0].OnClicked = (_, __) => { ShowCampaignDisclaimer(); return true; };
|
||||||
roadMap.Buttons[0].OnClicked += roadMap.Close;
|
roadMap.Buttons[0].OnClicked += roadMap.Close;
|
||||||
roadMap.Buttons[0].OnClicked += (_, __) => { ShowCampaignDisclaimer(onContinue); return true; };
|
|
||||||
roadMap.Buttons[1].OnClicked += roadMap.Close;
|
roadMap.Buttons[1].OnClicked += roadMap.Close;
|
||||||
roadMap.Buttons[1].OnClicked += (_, __) => { onContinue?.Invoke(); return true; };
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
msgBox.Buttons[0].OnClicked += msgBox.Close;
|
msgBox.Buttons[0].OnClicked += msgBox.Close;
|
||||||
msgBox.Buttons[1].OnClicked += msgBox.Close;
|
msgBox.Buttons[1].OnClicked += msgBox.Close;
|
||||||
msgBox.Buttons[1].OnClicked += (_, __) => { onContinue?.Invoke(); return true; };
|
|
||||||
|
|
||||||
Config.CampaignDisclaimerShown = true;
|
Config.CampaignDisclaimerShown = true;
|
||||||
Config.SaveNewPlayerConfig();
|
Config.SaveNewPlayerConfig();
|
||||||
|
|||||||
@@ -65,6 +65,11 @@ namespace Barotrauma
|
|||||||
endTimer = 5.0f;
|
endTimer = 5.0f;
|
||||||
isRunning = true;
|
isRunning = true;
|
||||||
CrewManager.InitSinglePlayerRound();
|
CrewManager.InitSinglePlayerRound();
|
||||||
|
|
||||||
|
if (ContextualTutorial.Initialized)
|
||||||
|
{
|
||||||
|
ContextualTutorial.Start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TryHireCharacter(Location location, CharacterInfo characterInfo)
|
public bool TryHireCharacter(Location location, CharacterInfo characterInfo)
|
||||||
@@ -170,6 +175,11 @@ namespace Barotrauma
|
|||||||
|
|
||||||
base.Update(deltaTime);
|
base.Update(deltaTime);
|
||||||
|
|
||||||
|
if (ContextualTutorial.Initialized)
|
||||||
|
{
|
||||||
|
ContextualTutorial.Update(deltaTime);
|
||||||
|
}
|
||||||
|
|
||||||
if (!GUI.DisableHUD && !GUI.DisableUpperHUD)
|
if (!GUI.DisableHUD && !GUI.DisableUpperHUD)
|
||||||
{
|
{
|
||||||
endRoundButton.UpdateManually(deltaTime);
|
endRoundButton.UpdateManually(deltaTime);
|
||||||
@@ -430,6 +440,12 @@ namespace Barotrauma
|
|||||||
new XAttribute("cheatsenabled", CheatsEnabled));
|
new XAttribute("cheatsenabled", CheatsEnabled));
|
||||||
CrewManager.Save(modeElement);
|
CrewManager.Save(modeElement);
|
||||||
Map.Save(modeElement);
|
Map.Save(modeElement);
|
||||||
|
|
||||||
|
if (ContextualTutorial.Initialized)
|
||||||
|
{
|
||||||
|
ContextualTutorial.SavePartiallyComplete(modeElement);
|
||||||
|
}
|
||||||
|
|
||||||
element.Add(modeElement);
|
element.Add(modeElement);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-7
@@ -1,4 +1,4 @@
|
|||||||
/*using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using System;
|
using System;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
@@ -9,11 +9,6 @@ namespace Barotrauma.Tutorials
|
|||||||
{
|
{
|
||||||
class ContextualTutorial : Tutorial
|
class ContextualTutorial : Tutorial
|
||||||
{
|
{
|
||||||
public ContextualTutorial(XElement element) : base(element)
|
|
||||||
{
|
|
||||||
//Name = "ContextualTutorial";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool Selected = false;
|
public static bool Selected = false;
|
||||||
|
|
||||||
private Steering navConsole;
|
private Steering navConsole;
|
||||||
@@ -37,6 +32,11 @@ namespace Barotrauma.Tutorials
|
|||||||
private float medicalTutorialTimer = 0.0f;
|
private float medicalTutorialTimer = 0.0f;
|
||||||
private const float medicalTutorialDelay = 2.0f;
|
private const float medicalTutorialDelay = 2.0f;
|
||||||
|
|
||||||
|
public ContextualTutorial(XElement element) : base(element)
|
||||||
|
{
|
||||||
|
Name = "ContextualTutorial";
|
||||||
|
}
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
@@ -517,4 +517,4 @@ namespace Barotrauma.Tutorials
|
|||||||
Stop();
|
Stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ namespace Barotrauma.Tutorials
|
|||||||
private Action infoBoxClosedCallback;
|
private Action infoBoxClosedCallback;
|
||||||
protected XElement configElement;
|
protected XElement configElement;
|
||||||
|
|
||||||
|
private enum TutorialType { None, Scenario, Contextual };
|
||||||
|
private TutorialType tutorialType = TutorialType.None;
|
||||||
|
|
||||||
protected VideoPlayer videoPlayer;
|
protected VideoPlayer videoPlayer;
|
||||||
protected enum TutorialContentTypes { None = 0, Video = 1, ManualVideo = 2, TextOnly = 3 };
|
protected enum TutorialContentTypes { None = 0, Video = 1, ManualVideo = 2, TextOnly = 3 };
|
||||||
protected string playableContentPath;
|
protected string playableContentPath;
|
||||||
@@ -161,6 +164,7 @@ namespace Barotrauma.Tutorials
|
|||||||
configElement = element;
|
configElement = element;
|
||||||
Name = element.GetAttributeString("name", "Unnamed");
|
Name = element.GetAttributeString("name", "Unnamed");
|
||||||
completed = GameMain.Config.CompletedTutorialNames.Contains(Name);
|
completed = GameMain.Config.CompletedTutorialNames.Contains(Name);
|
||||||
|
Enum.TryParse(element.GetAttributeString("tutorialtype", "Scenario"), true, out tutorialType);
|
||||||
playableContentPath = element.GetAttributeString("playablecontentpath", "");
|
playableContentPath = element.GetAttributeString("playablecontentpath", "");
|
||||||
|
|
||||||
segments = new List<TutorialSegment>();
|
segments = new List<TutorialSegment>();
|
||||||
@@ -514,12 +518,12 @@ namespace Barotrauma.Tutorials
|
|||||||
|
|
||||||
if (title.Length > 0)
|
if (title.Length > 0)
|
||||||
{
|
{
|
||||||
var titleBlock = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), infoContent.RectTransform),
|
var titleBlock = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.3f), infoContent.RectTransform),
|
||||||
title, font: GUI.VideoTitleFont, textAlignment: Alignment.Center, textColor: new Color(253, 174, 0));
|
title, font: GUI.VideoTitleFont, textAlignment: Alignment.Center, textColor: new Color(253, 174, 0));
|
||||||
titleBlock.TextScale = textScale;
|
titleBlock.TextScale = textScale;
|
||||||
}
|
}
|
||||||
|
|
||||||
var textBlock = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), infoContent.RectTransform), text, wrap: true);
|
var textBlock = new GUITextBlock(new RectTransform(new Vector2(1.0f, 1.0f), infoContent.RectTransform), text, wrap: true);
|
||||||
|
|
||||||
infoBoxClosedCallback = callback;
|
infoBoxClosedCallback = callback;
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace Barotrauma
|
|||||||
drawRect = new Rectangle(
|
drawRect = new Rectangle(
|
||||||
(int)(drawRect.X * scale) + drawArea.Center.X, -((int)((drawRect.Y - drawRect.Height) * scale) + drawArea.Center.Y),
|
(int)(drawRect.X * scale) + drawArea.Center.X, -((int)((drawRect.Y - drawRect.Height) * scale) + drawArea.Center.Y),
|
||||||
(int)(drawRect.Width * scale), (int)(drawRect.Height * scale));
|
(int)(drawRect.Width * scale), (int)(drawRect.Height * scale));
|
||||||
entity.First.DrawPlacing(spriteBatch, drawRect, entity.First.Scale * scale);
|
entity.First.DrawPlacing(spriteBatch, drawRect, scale);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
Rectangle drawRect = entity.Second;
|
Rectangle drawRect = entity.Second;
|
||||||
drawRect.Location += Submarine.MouseToWorldGrid(cam, Submarine.MainSub).ToPoint();
|
drawRect.Location += Submarine.MouseToWorldGrid(cam, Submarine.MainSub).ToPoint();
|
||||||
entity.First.DrawPlacing(spriteBatch, drawRect, entity.First.Scale);
|
entity.First.DrawPlacing(spriteBatch, drawRect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -324,6 +324,7 @@ namespace Barotrauma
|
|||||||
false, null, "");
|
false, null, "");
|
||||||
foreach (Tutorial tutorial in Tutorial.Tutorials)
|
foreach (Tutorial tutorial in Tutorial.Tutorials)
|
||||||
{
|
{
|
||||||
|
if (tutorial is ContextualTutorial) continue;
|
||||||
var tutorialText = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.15f), tutorialList.Content.RectTransform), tutorial.Name, textAlignment: Alignment.Center, font: GUI.LargeFont)
|
var tutorialText = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.15f), tutorialList.Content.RectTransform), tutorial.Name, textAlignment: Alignment.Center, font: GUI.LargeFont)
|
||||||
{
|
{
|
||||||
UserData = tutorial
|
UserData = tutorial
|
||||||
@@ -397,12 +398,6 @@ namespace Barotrauma
|
|||||||
switch (selectedTab)
|
switch (selectedTab)
|
||||||
{
|
{
|
||||||
case Tab.NewGame:
|
case Tab.NewGame:
|
||||||
if (!GameMain.Config.CampaignDisclaimerShown)
|
|
||||||
{
|
|
||||||
selectedTab = 0;
|
|
||||||
GameMain.Instance.ShowCampaignDisclaimer(() => { SelectTab(null, Tab.NewGame); });
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
campaignSetupUI.CreateDefaultSaveName();
|
campaignSetupUI.CreateDefaultSaveName();
|
||||||
campaignSetupUI.RandomizeSeed();
|
campaignSetupUI.RandomizeSeed();
|
||||||
campaignSetupUI.UpdateSubList(Submarine.SavedSubmarines);
|
campaignSetupUI.UpdateSubList(Submarine.SavedSubmarines);
|
||||||
@@ -421,12 +416,6 @@ namespace Barotrauma
|
|||||||
case Tab.HostServer:
|
case Tab.HostServer:
|
||||||
break;
|
break;
|
||||||
case Tab.Tutorials:
|
case Tab.Tutorials:
|
||||||
if (!GameMain.Config.CampaignDisclaimerShown)
|
|
||||||
{
|
|
||||||
selectedTab = 0;
|
|
||||||
GameMain.Instance.ShowCampaignDisclaimer(() => { SelectTab(null, Tab.Tutorials); });
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
UpdateTutorialList();
|
UpdateTutorialList();
|
||||||
break;
|
break;
|
||||||
case Tab.CharacterEditor:
|
case Tab.CharacterEditor:
|
||||||
|
|||||||
@@ -74,11 +74,14 @@
|
|||||||
<Character file="Content/Characters/Hammerhead/Hammerhead.xml" />
|
<Character file="Content/Characters/Hammerhead/Hammerhead.xml" />
|
||||||
<Outpost file="Content/Map/Outposts/Outpost.sub" />
|
<Outpost file="Content/Map/Outposts/Outpost.sub" />
|
||||||
<Submarine file="Submarines/Orca.sub" />
|
<Submarine file="Submarines/Orca.sub" />
|
||||||
|
<Submarine file="Submarines/Berilia.sub" />
|
||||||
<Submarine file="Submarines/Typhon.sub" />
|
<Submarine file="Submarines/Typhon.sub" />
|
||||||
<Submarine file="Submarines/Selkie.sub" />
|
<Submarine file="Submarines/Selkie.sub" />
|
||||||
<Submarine file="Submarines/Bunyip.sub" />
|
<Submarine file="Submarines/Bunyip.sub" />
|
||||||
<Submarine file="Submarines/Humpback.sub" />
|
<Submarine file="Submarines/Humpback.sub" />
|
||||||
<Submarine file="Submarines/Dugong.sub" />
|
<Submarine file="Submarines/Dugong.sub" />
|
||||||
|
<Submarine file="Submarines/Remora.sub" />
|
||||||
|
<Submarine file="Submarines/RemoraDrone.sub" />
|
||||||
<Submarine file="Submarines/Venture.sub" />
|
<Submarine file="Submarines/Venture.sub" />
|
||||||
<Text file="Content/Texts/EnglishVanilla.xml" />
|
<Text file="Content/Texts/EnglishVanilla.xml" />
|
||||||
<UIStyle file="Content/UI/style.xml"/>
|
<UIStyle file="Content/UI/style.xml"/>
|
||||||
|
|||||||
@@ -364,18 +364,9 @@
|
|||||||
<Content Include="$(MSBuildThisFileDirectory)Content\Items\Assemblies\airlock doors.xml">
|
<Content Include="$(MSBuildThisFileDirectory)Content\Items\Assemblies\airlock doors.xml">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="$(MSBuildThisFileDirectory)Content\Items\Assemblies\AutoDoor.xml">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="$(MSBuildThisFileDirectory)Content\Items\Assemblies\AutoHatch.xml">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="$(MSBuildThisFileDirectory)Content\Items\Assemblies\Automatic Bilge Pump.xml">
|
<Content Include="$(MSBuildThisFileDirectory)Content\Items\Assemblies\Automatic Bilge Pump.xml">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="$(MSBuildThisFileDirectory)Content\Items\Assemblies\WindowedAutoDoor.xml">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
<Content Include="$(MSBuildThisFileDirectory)Content\Items\Door\door2.png">
|
<Content Include="$(MSBuildThisFileDirectory)Content\Items\Door\door2.png">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
@@ -490,6 +481,33 @@
|
|||||||
<Content Include="$(MSBuildThisFileDirectory)Content\Map\OutpostWall_C.png">
|
<Content Include="$(MSBuildThisFileDirectory)Content\Map\OutpostWall_C.png">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="$(MSBuildThisFileDirectory)Content\Tutorials\ContextualTutorial\1_CommandReactor\BaroTutorial_CommandReactor.mp4">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="$(MSBuildThisFileDirectory)Content\Tutorials\ContextualTutorial\2_NavConsole\BaroTutorial_NavConsole.mp4">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="$(MSBuildThisFileDirectory)Content\Tutorials\ContextualTutorial\3_Flood\BaroTutorial_Flood.mp4">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="$(MSBuildThisFileDirectory)Content\Tutorials\ContextualTutorial\4_Reactor\BaroTutorial_Reactor.mp4">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="$(MSBuildThisFileDirectory)Content\Tutorials\ContextualTutorial\5_EnemyOnSonar\BaroTutorial_EnemyOnSonar.mp4">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="$(MSBuildThisFileDirectory)Content\Tutorials\ContextualTutorial\6_Degrading2\BaroTutorial_Degrading.mp4">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="$(MSBuildThisFileDirectory)Content\Tutorials\ContextualTutorial\7_Medical\BaroTutorial_Medical.mp4">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="$(MSBuildThisFileDirectory)Content\Tutorials\ContextualTutorial\8_Approach1\BaroTutorial_Approach.mp4">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="$(MSBuildThisFileDirectory)Content\Tutorials\ContextualTutorial\9_SwitchCharacter\BaroTutorial_SwitchCharacter.mp4">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Include="$(MSBuildThisFileDirectory)Content\Tutorials\TutorialVideos\tutorial_command.mp4">
|
<Content Include="$(MSBuildThisFileDirectory)Content\Tutorials\TutorialVideos\tutorial_command.mp4">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
@@ -2173,7 +2191,7 @@
|
|||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
<None Include="$(MSBuildThisFileDirectory)Submarines\Berilia.sub">
|
<None Include="$(MSBuildThisFileDirectory)Submarines\Berilia.sub">
|
||||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
<None Include="$(MSBuildThisFileDirectory)Submarines\Dugong_Tutorial.sub">
|
<None Include="$(MSBuildThisFileDirectory)Submarines\Dugong_Tutorial.sub">
|
||||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||||
@@ -3133,6 +3151,9 @@
|
|||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
<None Include="$(MSBuildThisFileDirectory)Content\Sounds\Water\SplashLoop.ogg" />
|
<None Include="$(MSBuildThisFileDirectory)Content\Sounds\Water\SplashLoop.ogg" />
|
||||||
|
<None Include="$(MSBuildThisFileDirectory)Content\Tutorials\TutorialSub.sub">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
<None Include="$(MSBuildThisFileDirectory)Content\Sounds\Ambient\Ambient1.ogg">
|
<None Include="$(MSBuildThisFileDirectory)Content\Sounds\Ambient\Ambient1.ogg">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
@@ -3329,10 +3350,10 @@
|
|||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
<None Include="$(MSBuildThisFileDirectory)Submarines\Remora.sub">
|
<None Include="$(MSBuildThisFileDirectory)Submarines\Remora.sub">
|
||||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
<None Include="$(MSBuildThisFileDirectory)Submarines\RemoraDrone.sub">
|
<None Include="$(MSBuildThisFileDirectory)Submarines\RemoraDrone.sub">
|
||||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
<None Include="$(MSBuildThisFileDirectory)Submarines\Selkie.sub">
|
<None Include="$(MSBuildThisFileDirectory)Submarines\Selkie.sub">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
|||||||
@@ -293,10 +293,35 @@ namespace Barotrauma.Items.Components
|
|||||||
//steer closer if almost in range
|
//steer closer if almost in range
|
||||||
if (dist > Range)
|
if (dist > Range)
|
||||||
{
|
{
|
||||||
Vector2 standPos = leak.IsHorizontal ? new Vector2(Math.Sign(-fromItemToLeak.X), 0.0f) : new Vector2(0.0f, Math.Sign(-fromItemToLeak.Y) * 0.5f);
|
Vector2 standPos = new Vector2(Math.Sign(-fromItemToLeak.X), Math.Sign(-fromItemToLeak.Y)) / 2;
|
||||||
standPos = leak.WorldPosition + standPos * Range;
|
if (!character.AnimController.InWater)
|
||||||
Vector2 dir = Vector2.Normalize(standPos - character.WorldPosition);
|
{
|
||||||
character.AIController.SteeringManager.SteeringManual(deltaTime, dir / 2);
|
if (leak.IsHorizontal)
|
||||||
|
{
|
||||||
|
standPos.X *= 2;
|
||||||
|
standPos.Y = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
standPos.X = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (character.AIController.SteeringManager is IndoorsSteeringManager indoorSteering)
|
||||||
|
{
|
||||||
|
if (indoorSteering.CurrentPath != null && !indoorSteering.IsPathDirty && indoorSteering.CurrentPath.Unreachable)
|
||||||
|
{
|
||||||
|
Vector2 dir = Vector2.Normalize(standPos - character.WorldPosition);
|
||||||
|
character.AIController.SteeringManager.SteeringManual(deltaTime, dir / 2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
character.AIController.SteeringManager.SteeringSeek(standPos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
character.AIController.SteeringManager.SteeringSeek(standPos);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -305,30 +330,29 @@ namespace Barotrauma.Items.Components
|
|||||||
// Too close -> steer away
|
// Too close -> steer away
|
||||||
character.AIController.SteeringManager.SteeringManual(deltaTime, Vector2.Normalize(character.SimPosition - leak.SimPosition) / 2);
|
character.AIController.SteeringManager.SteeringManual(deltaTime, Vector2.Normalize(character.SimPosition - leak.SimPosition) / 2);
|
||||||
}
|
}
|
||||||
else
|
else if (dist <= Range)
|
||||||
{
|
{
|
||||||
|
// In range
|
||||||
character.AIController.SteeringManager.Reset();
|
character.AIController.SteeringManager.Reset();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sinTime += deltaTime;
|
sinTime += deltaTime;
|
||||||
character.CursorPosition = leak.Position + VectorExtensions.Forward(Item.body.TransformedRotation + (float)Math.Sin(sinTime), dist);
|
character.CursorPosition = leak.Position + VectorExtensions.Forward(Item.body.TransformedRotation + (float)Math.Sin(sinTime), dist);
|
||||||
if (item.RequireAimToUse)
|
if (item.RequireAimToUse)
|
||||||
{
|
{
|
||||||
character.SetInput(InputType.Aim, false, true);
|
character.SetInput(InputType.Aim, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Press the trigger only when the tool is approximately facing the target.
|
// Press the trigger only when the tool is approximately facing the target.
|
||||||
// If the character is climbing, ignore the check, because we cannot aim while climbing.
|
var angle = VectorExtensions.Angle(VectorExtensions.Forward(item.body.TransformedRotation), fromItemToLeak);
|
||||||
if (VectorExtensions.Angle(VectorExtensions.Forward(item.body.TransformedRotation), fromItemToLeak) < MathHelper.PiOver4)
|
if (angle < MathHelper.PiOver4)
|
||||||
{
|
{
|
||||||
character.SetInput(InputType.Shoot, false, true);
|
character.SetInput(InputType.Shoot, false, true);
|
||||||
Use(deltaTime, character);
|
Use(deltaTime, character);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
sinTime -= deltaTime * 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool leakFixed = (leak.Open <= 0.0f || leak.Removed) &&
|
bool leakFixed = (leak.Open <= 0.0f || leak.Removed) &&
|
||||||
(leak.ConnectedWall == null || leak.ConnectedWall.Sections.Average(s => s.damage) < 1);
|
(leak.ConnectedWall == null || leak.ConnectedWall.Sections.Average(s => s.damage) < 1);
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user