Blood in the Water Hotfix 2 - 1.4.6.0
This commit is contained in:
+1
-1
@@ -123,7 +123,7 @@ namespace Barotrauma
|
||||
{
|
||||
Abandon = true;
|
||||
}
|
||||
else if (item.ParentInventory != null)
|
||||
else if (item.ParentInventory != null && item.GetRootInventoryOwner() != character)
|
||||
{
|
||||
if (!objectiveManager.HasOrder<AIObjectiveCleanupItems>())
|
||||
{
|
||||
|
||||
+1
-1
@@ -368,7 +368,7 @@ namespace Barotrauma
|
||||
return new AIObjectiveGoTo(moveToTarget, character, objectiveManager, repeat: false, getDivingGearIfNeeded: AllowToFindDivingGear, closeEnough: DefaultReach)
|
||||
{
|
||||
// If the root container changes, the item is no longer where it was (taken by someone -> need to find another item)
|
||||
AbortCondition = obj => targetItem == null || targetItem.GetRootInventoryOwner() != moveToTarget,
|
||||
AbortCondition = obj => targetItem == null || (targetItem.GetRootInventoryOwner() is Entity owner && owner != moveToTarget && owner != character),
|
||||
SpeakIfFails = false,
|
||||
endNodeFilter = CreateEndNodeFilter(moveToTarget)
|
||||
};
|
||||
|
||||
@@ -272,6 +272,7 @@ namespace Barotrauma
|
||||
CumulativeMonsterStrengthRuins = 0;
|
||||
CumulativeMonsterStrengthWrecks = 0;
|
||||
CumulativeMonsterStrengthCaves = 0;
|
||||
distanceTraveled = 0;
|
||||
}
|
||||
|
||||
public void ActivateEvent(Event newEvent)
|
||||
@@ -726,14 +727,12 @@ namespace Barotrauma
|
||||
|
||||
private bool CanStartEventSet(EventSet eventSet)
|
||||
{
|
||||
ISpatialEntity refEntity = GetRefEntity();
|
||||
float distFromStart = (float)Math.Sqrt(MathUtils.LineSegmentToPointDistanceSquared(level.StartExitPosition.ToPoint(), level.StartPosition.ToPoint(), refEntity.WorldPosition.ToPoint()));
|
||||
float distFromEnd = (float)Math.Sqrt(MathUtils.LineSegmentToPointDistanceSquared(level.EndExitPosition.ToPoint(), level.EndPosition.ToPoint(), refEntity.WorldPosition.ToPoint()));
|
||||
|
||||
if (!eventSet.AllowAtStart)
|
||||
{
|
||||
if (distFromStart * Physics.DisplayToRealWorldRatio < 50.0f ||
|
||||
distFromEnd * Physics.DisplayToRealWorldRatio < 50.0f)
|
||||
ISpatialEntity refEntity = GetRefEntity();
|
||||
float distFromStart = (float)Math.Sqrt(MathUtils.LineSegmentToPointDistanceSquared(level.StartExitPosition.ToPoint(), level.StartPosition.ToPoint(), refEntity.WorldPosition.ToPoint()));
|
||||
float distFromEnd = (float)Math.Sqrt(MathUtils.LineSegmentToPointDistanceSquared(level.EndExitPosition.ToPoint(), level.EndPosition.ToPoint(), refEntity.WorldPosition.ToPoint()));
|
||||
if (distFromStart * Physics.DisplayToRealWorldRatio < 50.0f || distFromEnd * Physics.DisplayToRealWorldRatio < 50.0f)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -182,7 +182,6 @@ namespace Barotrauma.Items.Components
|
||||
if (source == null || target == null || target.Removed ||
|
||||
source is Entity { Removed: true } ||
|
||||
source is Limb { Removed: true } ||
|
||||
user is null ||
|
||||
user is { Removed: true })
|
||||
{
|
||||
ResetSource();
|
||||
@@ -312,82 +311,87 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
targetMass = float.MaxValue;
|
||||
}
|
||||
if (!snapped)
|
||||
// Currently can only apply pull forces to the source, when it's a character, not e.g. when the item would be auto-operated by an AI. Might have to change this.
|
||||
if (user != null)
|
||||
{
|
||||
user.AnimController.HoldToRope();
|
||||
if (targetCharacter != null)
|
||||
if (!snapped)
|
||||
{
|
||||
targetCharacter.AnimController.DragWithRope();
|
||||
}
|
||||
if (user.InWater)
|
||||
{
|
||||
user.AnimController.HangWithRope();
|
||||
}
|
||||
}
|
||||
if (Math.Abs(SourcePullForce) > 0.001f && targetMass > TargetMinMass)
|
||||
{
|
||||
// This should be the main collider.
|
||||
var sourceBody = GetBodyToPull(source);
|
||||
if (sourceBody != null)
|
||||
{
|
||||
isReelingIn = user.InWater && user.IsRagdolled || !user.InWater && targetCharacter is { IsIncapacitated: false };
|
||||
if (isReelingIn)
|
||||
user.AnimController.HoldToRope();
|
||||
if (targetCharacter != null)
|
||||
{
|
||||
float pullForce = SourcePullForce;
|
||||
if (!user.InWater)
|
||||
targetCharacter.AnimController.DragWithRope();
|
||||
}
|
||||
if (user.InWater)
|
||||
{
|
||||
user.AnimController.HangWithRope();
|
||||
}
|
||||
}
|
||||
if (Math.Abs(SourcePullForce) > 0.001f && targetMass > TargetMinMass)
|
||||
{
|
||||
// This should be the main collider.
|
||||
var sourceBody = GetBodyToPull(source);
|
||||
if (sourceBody != null)
|
||||
{
|
||||
isReelingIn = user.InWater && user.IsRagdolled || !user.InWater && targetCharacter is { IsIncapacitated: false };
|
||||
if (isReelingIn)
|
||||
{
|
||||
// Apply a tiny amount to the character holding the rope, so that the connection "feels" more real.
|
||||
pullForce *= 0.1f;
|
||||
}
|
||||
float lengthFactor = MathUtils.InverseLerp(0, MaxLength / 2, currentRopeLength);
|
||||
float force = LerpForces ? MathHelper.Lerp(0, pullForce, lengthFactor) : pullForce;
|
||||
sourceBody.ApplyForce(forceDir * force);
|
||||
// Take the target velocity into account.
|
||||
PhysicsBody targetBody = GetBodyToPull(target);
|
||||
if (targetBody != null)
|
||||
{
|
||||
if (targetCharacter != null)
|
||||
float pullForce = SourcePullForce;
|
||||
if (!user.InWater)
|
||||
{
|
||||
if (targetBody.LinearVelocity != Vector2.Zero && sourceBody.LinearVelocity != Vector2.Zero)
|
||||
// Apply a tiny amount to the character holding the rope, so that the connection "feels" more real.
|
||||
pullForce *= 0.1f;
|
||||
}
|
||||
float lengthFactor = MathUtils.InverseLerp(0, MaxLength / 2, currentRopeLength);
|
||||
float force = LerpForces ? MathHelper.Lerp(0, pullForce, lengthFactor) : pullForce;
|
||||
sourceBody.ApplyForce(forceDir * force);
|
||||
// Take the target velocity into account.
|
||||
PhysicsBody targetBody = GetBodyToPull(target);
|
||||
if (targetBody != null)
|
||||
{
|
||||
if (targetCharacter != null)
|
||||
{
|
||||
Vector2 targetDir = Vector2.Normalize(targetBody.LinearVelocity);
|
||||
float movementDot = Vector2.Dot(Vector2.Normalize(sourceBody.LinearVelocity), targetDir);
|
||||
if (movementDot < 0)
|
||||
if (targetBody.LinearVelocity != Vector2.Zero && sourceBody.LinearVelocity != Vector2.Zero)
|
||||
{
|
||||
// Pushing to a different dir -> add some counter force
|
||||
const float multiplier = 5;
|
||||
float inverseLengthFactor = MathHelper.Lerp(1, 0, lengthFactor);
|
||||
sourceBody.ApplyForce(targetBody.LinearVelocity * Math.Min(targetBody.Mass * multiplier, 250) * sourceBody.Mass * -movementDot * inverseLengthFactor);
|
||||
}
|
||||
float forceDot = Vector2.Dot(forceDir, targetDir);
|
||||
if (forceDot > 0)
|
||||
{
|
||||
// Pulling to the same dir -> add extra force
|
||||
float targetSpeed = targetBody.LinearVelocity.Length();
|
||||
const float multiplier = 25;
|
||||
sourceBody.ApplyForce(forceDir * targetSpeed * sourceBody.Mass * multiplier * forceDot * lengthFactor);
|
||||
}
|
||||
float colliderMainLimbDistance = Vector2.Distance(sourceBody.SimPosition, user.AnimController.MainLimb.SimPosition);
|
||||
const float minDist = 1;
|
||||
const float maxDist = 10;
|
||||
if (colliderMainLimbDistance > minDist)
|
||||
{
|
||||
// Move the ragdoll closer to the collider, if it's too far (the correction force in HumanAnimController is not enough -> the ragdoll would lag behind and get teleported).
|
||||
float correctionForce = MathHelper.Lerp(10.0f, NetConfig.MaxPhysicsBodyVelocity, MathUtils.InverseLerp(minDist, maxDist, colliderMainLimbDistance));
|
||||
Vector2 targetPos = sourceBody.SimPosition + new Vector2((float)Math.Sin(-sourceBody.Rotation), (float)Math.Cos(-sourceBody.Rotation)) * 0.4f;
|
||||
user.AnimController.MainLimb.MoveToPos(targetPos, correctionForce);
|
||||
Vector2 targetDir = Vector2.Normalize(targetBody.LinearVelocity);
|
||||
float movementDot = Vector2.Dot(Vector2.Normalize(sourceBody.LinearVelocity), targetDir);
|
||||
if (movementDot < 0)
|
||||
{
|
||||
// Pushing to a different dir -> add some counter force
|
||||
const float multiplier = 5;
|
||||
float inverseLengthFactor = MathHelper.Lerp(1, 0, lengthFactor);
|
||||
sourceBody.ApplyForce(targetBody.LinearVelocity * Math.Min(targetBody.Mass * multiplier, 250) * sourceBody.Mass * -movementDot * inverseLengthFactor);
|
||||
}
|
||||
float forceDot = Vector2.Dot(forceDir, targetDir);
|
||||
if (forceDot > 0)
|
||||
{
|
||||
// Pulling to the same dir -> add extra force
|
||||
float targetSpeed = targetBody.LinearVelocity.Length();
|
||||
const float multiplier = 25;
|
||||
sourceBody.ApplyForce(forceDir * targetSpeed * sourceBody.Mass * multiplier * forceDot * lengthFactor);
|
||||
}
|
||||
float colliderMainLimbDistance = Vector2.Distance(sourceBody.SimPosition, user.AnimController.MainLimb.SimPosition);
|
||||
const float minDist = 1;
|
||||
const float maxDist = 10;
|
||||
if (colliderMainLimbDistance > minDist)
|
||||
{
|
||||
// Move the ragdoll closer to the collider, if it's too far (the correction force in HumanAnimController is not enough -> the ragdoll would lag behind and get teleported).
|
||||
float correctionForce = MathHelper.Lerp(10.0f, NetConfig.MaxPhysicsBodyVelocity, MathUtils.InverseLerp(minDist, maxDist, colliderMainLimbDistance));
|
||||
Vector2 targetPos = sourceBody.SimPosition + new Vector2((float)Math.Sin(-sourceBody.Rotation), (float)Math.Cos(-sourceBody.Rotation)) * 0.4f;
|
||||
user.AnimController.MainLimb.MoveToPos(targetPos, correctionForce);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sourceBody.ApplyForce(targetBody.LinearVelocity * sourceBody.Mass);
|
||||
else
|
||||
{
|
||||
sourceBody.ApplyForce(targetBody.LinearVelocity * sourceBody.Mass);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Math.Abs(TargetPullForce) > 0.001f && !user.IsRagdolled)
|
||||
|
||||
if (Math.Abs(TargetPullForce) > 0.001f && user is not { IsRagdolled: true})
|
||||
{
|
||||
PhysicsBody targetBody = GetBodyToPull(target);
|
||||
if (targetBody == null) { return; }
|
||||
|
||||
@@ -3452,6 +3452,30 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns this item and all the other items in the stack (either in the same inventory slot, or the same dropped stack).
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public IEnumerable<Item> GetStackedItems()
|
||||
{
|
||||
yield return this;
|
||||
foreach (var stackedItem in DroppedStack)
|
||||
{
|
||||
if (stackedItem == this) { continue; }
|
||||
yield return stackedItem;
|
||||
}
|
||||
if (ParentInventory != null)
|
||||
{
|
||||
int slotIndex = ParentInventory.FindIndex(this);
|
||||
foreach (var stackedItem in ParentInventory.GetItemsAt(slotIndex))
|
||||
{
|
||||
if (stackedItem == this) { continue; }
|
||||
yield return stackedItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Equip(Character character)
|
||||
{
|
||||
if (Removed)
|
||||
|
||||
@@ -348,6 +348,12 @@ namespace Barotrauma.Networking
|
||||
if (serverMessageText == val) { return; }
|
||||
#if SERVER
|
||||
GameMain.Server?.SendChatMessage(TextManager.AddPunctuation(':', TextManager.Get("servermotd"), val).Value, ChatMessageType.Server);
|
||||
#elif CLIENT
|
||||
if (GameMain.NetLobbyScreen.ServerMessageButton is { } serverMessageButton)
|
||||
{
|
||||
serverMessageButton.Flash(GUIStyle.Green);
|
||||
serverMessageButton.Pulsate(Vector2.One, Vector2.One * 1.2f, 1.0f);
|
||||
}
|
||||
#endif
|
||||
serverMessageText = val;
|
||||
ServerDetailsChanged = true;
|
||||
|
||||
@@ -1122,16 +1122,16 @@ namespace Barotrauma
|
||||
{
|
||||
if (!file.TryGet(out ContentPath _) || (file.TryGet(out ContentPath contentPath) && contentPath.IsNullOrWhiteSpace()))
|
||||
{
|
||||
DebugConsole.ThrowError($"Error in a <TriggerAnimation> element of {subElement.ParseContentPathFromUri()}: neither path nor filename defined!");
|
||||
DebugConsole.ThrowError($"Error in a <TriggerAnimation> element of {subElement.ParseContentPathFromUri()}: neither path nor filename defined!",
|
||||
contentPackage: subElement.ContentPackage);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
float priority = subElement.GetAttributeFloat("priority", def: 0f);
|
||||
Identifier[] expectedSpeciesNames = subElement.GetAttributeIdentifierArray("expectedspecies", Array.Empty<Identifier>());
|
||||
animationsToTrigger ??= new List<AnimLoadInfo>();
|
||||
animationsToTrigger.Add(new AnimLoadInfo(animType, file, priority, expectedSpeciesNames.ToImmutableArray()));
|
||||
}
|
||||
float priority = subElement.GetAttributeFloat("priority", def: 0f);
|
||||
Identifier[] expectedSpeciesNames = subElement.GetAttributeIdentifierArray("expectedspecies", Array.Empty<Identifier>());
|
||||
animationsToTrigger ??= new List<AnimLoadInfo>();
|
||||
animationsToTrigger.Add(new AnimLoadInfo(animType, file, priority, expectedSpeciesNames.ToImmutableArray()));
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,34 @@
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
v1.4.6.0
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
- Fixed monsters sometimes spawning immediately after the round starts (Often happened between levels, when there was no outpost between them).
|
||||
- The 'Art of Submarine Warfare' book granted by the 'War Stories' talent is now a separate item and the original book has been reverted to its original state.
|
||||
- Fixed Thalamus' fleshgun ropes not being able to stick to a submarine anymore.
|
||||
- Fixed Thalamus' flesh spike crashing the game in the multiplayer game mode.
|
||||
- Added a scrollbar to the submarine warning list. Fixes the list not fitting on the screen, when there were multiple, long errors.
|
||||
- Fixed sever list filters not saving properly.
|
||||
- Fixed marking a stack of items to be ignored or deconstructed only taking into account the first item of the stack, instead applying to all items of the stack.
|
||||
- Removed duplicate localization lines that caused old versions of text to show up in some places.
|
||||
- Fixes to the Chinese localization.
|
||||
- Fixed the inability to edit tags that contained the same word as one of the predefined tags.
|
||||
- Fixed a crash on opening the contextual order menu for an item of another character's inventory while the health interface is open.
|
||||
- Fixed a crash when editing and resizing the circuit box label texts.
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
v1.4.5.0
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
- Fixed crew remaining dead, mission remaining completed/failed, etc when you return to the lobby an restart the round. The issue was that the server did not properly load the previous save when opting to continue the ongoing campaign.
|
||||
- Added a button to the server lobby which opens the server description in a popup to make it easier for players to find. We are still thinking of the best way to handle the description/MOTD, this is more of a quick band-aid solution for the description being too easy to miss / difficult to find at the moment.
|
||||
- Fixed descriptions being outdated on some of the modified XP talents. Currently only fixed in English, the descriptions in other languages are still outdated.
|
||||
- Fixed "command not found" error when trying to use the new "converttowreck" console command.
|
||||
- Fixed items in a container in the submarine not being counted in the "owned items" count in the store interface.
|
||||
- Fixed bots being unable to properly clean up some items, just taking them into their inventory and leaving them there.
|
||||
- Fixed drinkable items (such as ethanol) giving the full effect with just a tiny sip.
|
||||
- Fixed effect from the "revenge squad" talent only lasting 60 seconds.
|
||||
- Fixed combat diving suit being slower than intended when using an underwater scooter.
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
v1.4.4.1
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user