(0e668e083) Merge branch 'dev' of https://github.com/Regalis11/Barotrauma-development into dev (squashed together 20290af96..0e668e083 because the merge script shit itself due to the merges in between)

This commit is contained in:
Joonas Rikkonen
2019-05-20 20:25:12 +03:00
parent d43b3737c8
commit 97b095bd10
32 changed files with 169 additions and 27 deletions
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ShowAllFiles>true</ShowAllFiles>
</PropertyGroup>
</Project>
+58 -1
View File
@@ -274,6 +274,63 @@
<None Include="System.Xml.Linq.dll"> <None Include="System.Xml.Linq.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="libvlc.so.5">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="vlc\plugins\access\libfilesystem_plugin.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="vlc\plugins\audio_filter\libaudio_format_plugin.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="vlc\plugins\audio_filter\libugly_resampler_plugin.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="vlc\plugins\audio_output\libamem_plugin.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="vlc\plugins\codec\libavcodec_plugin.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="vlc\plugins\codec\libva.so.1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="vlc\plugins\demux\libmp4_plugin.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="vlc\plugins\packetizer\libpacketizer_mpeg4audio_plugin.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="vlc\plugins\packetizer\libpacketizer_mpeg4video_plugin.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="vlc\plugins\packetizer\libpacketizer_mpegvideo_plugin.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="vlc\plugins\video_chroma\librv32_plugin.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="vlc\plugins\video_chroma\libswscale_plugin.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="vlc\plugins\video_output\libvmem_plugin.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="libvlc.so.5.6.0">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="libvlccore.la">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="libvlccore.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="libvlccore.so.9">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="libvlccore.so.9.0.0">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup />
<ItemGroup> <ItemGroup>
@@ -304,6 +361,6 @@
<GetAssemblyIdentity AssemblyFiles="$(TargetPath)"> <GetAssemblyIdentity AssemblyFiles="$(TargetPath)">
<Output TaskParameter="Assemblies" ItemName="CurrentAssembly" /> <Output TaskParameter="Assemblies" ItemName="CurrentAssembly" />
</GetAssemblyIdentity> </GetAssemblyIdentity>
<Exec Command="echo v%(CurrentAssembly.Version) > $(TargetDir)Version.txt"></Exec> <Exec Command="echo v%(CurrentAssembly.Version) &gt; $(TargetDir)Version.txt"></Exec>
</Target> </Target>
</Project> </Project>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
</Project>
@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.9.0.1")] [assembly: AssemblyVersion("0.9.0.2")]
[assembly: AssemblyFileVersion("0.9.0.1")] [assembly: AssemblyFileVersion("0.9.0.2")]
@@ -504,7 +504,7 @@ namespace Barotrauma
foreach (Character c in CharacterList) foreach (Character c in CharacterList)
{ {
if (!CanInteractWith(c)) continue; if (!CanInteractWith(c, checkVisibility: false)) continue;
float dist = Vector2.DistanceSquared(mouseSimPos, c.SimPosition); float dist = Vector2.DistanceSquared(mouseSimPos, c.SimPosition);
if (dist < maxDist * maxDist && (closestCharacter == null || dist < closestDist)) if (dist < maxDist * maxDist && (closestCharacter == null || dist < closestDist))
Binary file not shown.
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
libvlc.so.5.6.0
Binary file not shown.
+41
View File
@@ -0,0 +1,41 @@
# libvlccore.la - a libtool library file
# Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-2.1
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname='libvlccore.so.9'
# Names of this library.
library_names='libvlccore.so.9.0.0 libvlccore.so.9 libvlccore.so'
# The name of the static archive.
old_library=''
# Linker flags that cannot go in dependency_libs.
inherited_linker_flags=''
# Libraries that this one depends upon.
dependency_libs=' -lidn -lpthread -ldl -lm -ldbus-1'
# Names of additional weak libraries provided by this library
weak_library_names=''
# Version information for libvlccore.
current=9
age=0
revision=0
# Is this an already installed library?
installed=yes
# Should we warn about portability when linking against -modules?
shouldnotlink=no
# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''
# Directory that this library needs to be installed in:
libdir='/usr/lib'
@@ -0,0 +1 @@
libvlccore.so.9.0.0
@@ -0,0 +1 @@
libvlccore.so.9.0.0
Binary file not shown.
@@ -2,6 +2,7 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using System; using System;
using System.Linq; using System.Linq;
using Barotrauma.Extensions;
namespace Barotrauma namespace Barotrauma
{ {
@@ -163,7 +164,15 @@ namespace Barotrauma
} }
var newPath = pathFinder.FindPath(pos, target, "(Character: " + character.Name + ")"); var newPath = pathFinder.FindPath(pos, target, "(Character: " + character.Name + ")");
if (currentPath == null || needsNewPath || !newPath.Unreachable && newPath.Cost < currentPath.Cost) bool useNewPath = currentPath == null || needsNewPath;
if (!useNewPath && currentPath != null && currentPath.CurrentNode != null && newPath.Nodes.Any() && !newPath.Unreachable)
{
// It's possible that the current path was calculated from a start point that is no longer valid.
// Therefore, let's accept also paths with a greater cost than the current, if the current node is much farther than the new start node.
useNewPath = newPath.Cost < currentPath.Cost ||
Vector2.DistanceSquared(character.WorldPosition, currentPath.CurrentNode.WorldPosition) > Math.Pow(Vector2.Distance(character.WorldPosition, newPath.Nodes.First().WorldPosition) * 2, 2);
}
if (useNewPath)
{ {
currentPath = newPath; currentPath = newPath;
} }
@@ -405,7 +414,7 @@ namespace Barotrauma
{ {
if (door.HasIntegratedButtons) if (door.HasIntegratedButtons)
{ {
door.Item.TryInteract(character, false, true, true); door.Item.TryInteract(character, false, true);
buttonPressCooldown = ButtonPressInterval; buttonPressCooldown = ButtonPressInterval;
break; break;
} }
@@ -413,7 +422,7 @@ namespace Barotrauma
{ {
if (Vector2.DistanceSquared(closestButton.Item.WorldPosition, character.WorldPosition) < MathUtils.Pow(closestButton.Item.InteractDistance * 2, 2)) if (Vector2.DistanceSquared(closestButton.Item.WorldPosition, character.WorldPosition) < MathUtils.Pow(closestButton.Item.InteractDistance * 2, 2))
{ {
closestButton.Item.TryInteract(character, false, true, false); closestButton.Item.TryInteract(character, false, true);
buttonPressCooldown = ButtonPressInterval; buttonPressCooldown = ButtonPressInterval;
break; break;
} }
@@ -128,7 +128,7 @@ namespace Barotrauma
if (seekAmmunition == null || !subObjectives.Contains(seekAmmunition)) if (seekAmmunition == null || !subObjectives.Contains(seekAmmunition))
{ {
Move(); Move();
if (Weapon != null) if (WeaponComponent != null)
{ {
OperateWeapon(deltaTime); OperateWeapon(deltaTime);
} }
@@ -320,7 +320,10 @@ namespace Barotrauma
{ {
retreatTarget = findSafety.FindBestHull(HumanAIController.VisibleHulls); retreatTarget = findSafety.FindBestHull(HumanAIController.VisibleHulls);
} }
TryAddSubObjective(ref retreatObjective, () => new AIObjectiveGoTo(retreatTarget, character, objectiveManager, false, true)); if (character.CurrentHull != retreatTarget)
{
TryAddSubObjective(ref retreatObjective, () => new AIObjectiveGoTo(retreatTarget, character, objectiveManager, false, true));
}
} }
private void Engage() private void Engage()
@@ -336,8 +339,7 @@ namespace Barotrauma
constructor: () => new AIObjectiveGoTo(Enemy, character, objectiveManager, repeat: true, getDivingGearIfNeeded: true) constructor: () => new AIObjectiveGoTo(Enemy, character, objectiveManager, repeat: true, getDivingGearIfNeeded: true)
{ {
AllowGoingOutside = true, AllowGoingOutside = true,
IgnoreIfTargetDead = true, IgnoreIfTargetDead = true
CheckVisibility = true
}, },
onAbandon: () => onAbandon: () =>
{ {
@@ -347,7 +349,7 @@ namespace Barotrauma
if (followTargetObjective != null && subObjectives.Contains(followTargetObjective)) if (followTargetObjective != null && subObjectives.Contains(followTargetObjective))
{ {
followTargetObjective.CloseEnough = followTargetObjective.CloseEnough =
WeaponComponent is RangedWeapon ? 3 : WeaponComponent is RangedWeapon ? 300 :
WeaponComponent is MeleeWeapon mw ? mw.Range : WeaponComponent is MeleeWeapon mw ? mw.Range :
WeaponComponent is RepairTool rt ? rt.Range : 50; WeaponComponent is RepairTool rt ? rt.Range : 50;
} }
@@ -437,7 +439,7 @@ namespace Barotrauma
float squaredDistance = Vector2.DistanceSquared(character.Position, Enemy.Position); float squaredDistance = Vector2.DistanceSquared(character.Position, Enemy.Position);
character.CursorPosition = Enemy.Position; character.CursorPosition = Enemy.Position;
float engageDistance = 500; float engageDistance = 500;
if (squaredDistance > engageDistance * engageDistance) { return; } if (character.CurrentHull != Enemy.CurrentHull && squaredDistance > engageDistance * engageDistance) { return; }
if (!character.CanSeeCharacter(Enemy)) { return; } if (!character.CanSeeCharacter(Enemy)) { return; }
if (Weapon.RequireAimToUse) if (Weapon.RequireAimToUse)
{ {
@@ -450,7 +452,7 @@ namespace Barotrauma
isOperatingButtons = door.HasIntegratedButtons || door.Item.GetConnectedComponents<Controller>(true).Any(); isOperatingButtons = door.HasIntegratedButtons || door.Item.GetConnectedComponents<Controller>(true).Any();
} }
} }
if (!isOperatingButtons && character.SelectedConstruction == null) if (!isOperatingButtons)
{ {
character.SetInput(InputType.Aim, false, true); character.SetInput(InputType.Aim, false, true);
} }
@@ -25,7 +25,6 @@ namespace Barotrauma
public float CloseEnough { get; set; } = 50; public float CloseEnough { get; set; } = 50;
public bool IgnoreIfTargetDead { get; set; } public bool IgnoreIfTargetDead { get; set; }
public bool AllowGoingOutside { get; set; } public bool AllowGoingOutside { get; set; }
public bool CheckVisibility { get; set; }
public ISpatialEntity Target { get; private set; } public ISpatialEntity Target { get; private set; }
@@ -92,11 +91,18 @@ namespace Barotrauma
{ {
abandon = true; abandon = true;
} }
else if (!repeat && waitUntilPathUnreachable < 0) else if (waitUntilPathUnreachable < 0)
{ {
if (SteeringManager == PathSteering && PathSteering.CurrentPath != null) if (SteeringManager == PathSteering && PathSteering.CurrentPath != null && PathSteering.CurrentPath.Unreachable)
{ {
abandon = PathSteering.CurrentPath.Unreachable; if (repeat)
{
SteeringManager.Reset();
}
else
{
abandon = true;
}
} }
} }
if (abandon) if (abandon)
@@ -68,6 +68,12 @@ namespace Barotrauma
{ {
if (character.CanInteractWith(target.Item, out _, checkLinked: false)) if (character.CanInteractWith(target.Item, out _, checkLinked: false))
{ {
// Don't allow to operate an item that someone already operates, unless this objective is an order
if (objectiveManager.CurrentOrder != this && Character.CharacterList.Any(c => c.SelectedConstruction == target.Item && c != character && HumanAIController.IsFriendly(c)))
{
abandon = true;
return;
}
if (character.SelectedConstruction != target.Item) if (character.SelectedConstruction != target.Item)
{ {
target.Item.TryInteract(character, false, true); target.Item.TryInteract(character, false, true);
@@ -16,8 +16,8 @@ namespace Barotrauma
private readonly Character targetCharacter; private readonly Character targetCharacter;
private AIObjectiveGoTo goToObjective; private AIObjectiveGoTo goToObjective;
private float treatmentTimer; private float treatmentTimer;
private Hull safeHull;
public AIObjectiveRescue(Character character, Character targetCharacter, AIObjectiveManager objectiveManager, float priorityModifier = 1) public AIObjectiveRescue(Character character, Character targetCharacter, AIObjectiveManager objectiveManager, float priorityModifier = 1)
: base(character, objectiveManager, priorityModifier) : base(character, objectiveManager, priorityModifier)
@@ -84,15 +84,21 @@ namespace Barotrauma
{ {
goToObjective = null; goToObjective = null;
} }
var findSafety = objectiveManager.GetObjective<AIObjectiveFindSafety>(); if (safeHull == null)
if (findSafety == null)
{ {
// Ensure that we have the find safety objective (should always be the case) var findSafety = objectiveManager.GetObjective<AIObjectiveFindSafety>();
objectiveManager.AddObjective(new AIObjectiveFindSafety(character, objectiveManager)); if (findSafety == null)
{
// Ensure that we have the find safety objective (should always be the case)
objectiveManager.AddObjective(new AIObjectiveFindSafety(character, objectiveManager));
}
safeHull = findSafety.FindBestHull(HumanAIController.VisibleHulls);
}
if (character.CurrentHull != safeHull)
{
TryAddSubObjective(ref goToObjective, () => new AIObjectiveGoTo(safeHull, character, objectiveManager));
} }
TryAddSubObjective(ref goToObjective, () => new AIObjectiveGoTo(findSafety.FindBestHull(HumanAIController.VisibleHulls), character, objectiveManager));
} }
return;
} }
if (subObjectives.Any()) { return; } if (subObjectives.Any()) { return; }
@@ -1527,7 +1527,7 @@ namespace Barotrauma
return true; return true;
} }
public bool CanInteractWith(Character c, float maxDist = 200.0f) public bool CanInteractWith(Character c, float maxDist = 200.0f, bool checkVisibility = true)
{ {
if (c == this || Removed || !c.Enabled || !c.CanBeSelected) return false; if (c == this || Removed || !c.Enabled || !c.CanBeSelected) return false;
if (!c.CharacterHealth.UseHealthWindow && !c.CanBeDragged && c.onCustomInteract == null) return false; if (!c.CharacterHealth.UseHealthWindow && !c.CanBeDragged && c.onCustomInteract == null) return false;
@@ -1535,7 +1535,7 @@ namespace Barotrauma
maxDist = ConvertUnits.ToSimUnits(maxDist); maxDist = ConvertUnits.ToSimUnits(maxDist);
if (Vector2.DistanceSquared(SimPosition, c.SimPosition) > maxDist * maxDist) return false; if (Vector2.DistanceSquared(SimPosition, c.SimPosition) > maxDist * maxDist) return false;
return true; return checkVisibility ? CanSeeCharacter(c) : true;
} }
public bool CanInteractWith(Item item) public bool CanInteractWith(Item item)