diff --git a/Barotrauma/BarotraumaClient/ClientSource/Characters/CharacterHUD.cs b/Barotrauma/BarotraumaClient/ClientSource/Characters/CharacterHUD.cs
index c4b648ed1..dfd7fc7b6 100644
--- a/Barotrauma/BarotraumaClient/ClientSource/Characters/CharacterHUD.cs
+++ b/Barotrauma/BarotraumaClient/ClientSource/Characters/CharacterHUD.cs
@@ -617,7 +617,7 @@ namespace Barotrauma
}
else if (bossHealthBar.Character.AIController is EnemyAIController enemyAI && !enemyAI.IsTargetingPlayerTeam)
{
- bossHealthBar.FadeTimer = Math.Min(bossHealthBar.FadeTimer, 10.0f);
+ bossHealthBar.FadeTimer = Math.Min(bossHealthBar.FadeTimer, 60.0f);
}
bossHealthBar.FadeTimer -= deltaTime;
}
diff --git a/Barotrauma/BarotraumaClient/ClientSource/GameSession/HintManager.cs b/Barotrauma/BarotraumaClient/ClientSource/GameSession/HintManager.cs
index ba8a256a9..8e94e385d 100644
--- a/Barotrauma/BarotraumaClient/ClientSource/GameSession/HintManager.cs
+++ b/Barotrauma/BarotraumaClient/ClientSource/GameSession/HintManager.cs
@@ -138,7 +138,7 @@ namespace Barotrauma
// onstartedinteracting.lootingisstealing
if (item.Submarine?.Info?.Type == SubmarineType.Outpost &&
- item.ContainedItems.Any(i => i.SpawnedInOutpost))
+ item.ContainedItems.Any(i => !i.AllowStealing))
{
if (DisplayHint($"{hintIdentifierBase}.lootingisstealing")) { return; }
}
@@ -379,7 +379,7 @@ namespace Barotrauma
{
if (!CanDisplayHints()) { return; }
if (character != Character.Controlled) { return; }
- if (item == null || !item.SpawnedInOutpost || !item.StolenDuringRound) { return; }
+ if (item == null || item.AllowStealing || !item.StolenDuringRound) { return; }
DisplayHint("onstoleitem", onUpdate: () =>
{
if (item == null || item.Removed || item.GetRootInventoryOwner() != character)
diff --git a/Barotrauma/BarotraumaClient/ClientSource/Items/Components/Holdable/Holdable.cs b/Barotrauma/BarotraumaClient/ClientSource/Items/Components/Holdable/Holdable.cs
index 6c3249dc0..4ee0d2b1f 100644
--- a/Barotrauma/BarotraumaClient/ClientSource/Items/Components/Holdable/Holdable.cs
+++ b/Barotrauma/BarotraumaClient/ClientSource/Items/Components/Holdable/Holdable.cs
@@ -70,17 +70,15 @@ namespace Barotrauma.Items.Components
public override void ClientRead(ServerNetObject type, IReadMessage msg, float sendingTime)
{
base.ClientRead(type, msg, sendingTime);
+
+ bool readAttachData = msg.ReadBoolean();
+ if (!readAttachData) { return; }
+
bool shouldBeAttached = msg.ReadBoolean();
Vector2 simPosition = new Vector2(msg.ReadSingle(), msg.ReadSingle());
UInt16 submarineID = msg.ReadUInt16();
Submarine sub = Entity.FindEntityByID(submarineID) as Submarine;
- if (!attachable)
- {
- DebugConsole.ThrowError("Received an attachment event for an item that's not attachable.");
- return;
- }
-
if (shouldBeAttached)
{
if (!attached)
@@ -96,7 +94,6 @@ namespace Barotrauma.Items.Components
if (attached)
{
DropConnectedWires(null);
-
if (body != null)
{
item.body = body;
diff --git a/Barotrauma/BarotraumaClient/ClientSource/Items/Inventory.cs b/Barotrauma/BarotraumaClient/ClientSource/Items/Inventory.cs
index 58a858865..8fbf5a636 100644
--- a/Barotrauma/BarotraumaClient/ClientSource/Items/Inventory.cs
+++ b/Barotrauma/BarotraumaClient/ClientSource/Items/Inventory.cs
@@ -288,7 +288,7 @@ namespace Barotrauma
}
}
- string colorStr = XMLExtensions.ColorToString(item.SpawnedInOutpost ? GUI.Style.Red : Color.White);
+ string colorStr = XMLExtensions.ColorToString(!item.AllowStealing ? GUI.Style.Red : Color.White);
toolTip = $"‖color:{colorStr}‖{item.Name}‖color:end‖";
if (itemsInSlot.All(it => it.NonInteractable || it.NonPlayerTeamInteractable))
@@ -1552,7 +1552,7 @@ namespace Barotrauma
}
sprite.Draw(spriteBatch, itemPos, spriteColor, rotation, scale);
- if (item.SpawnedInOutpost && CharacterInventory.LimbSlotIcons.ContainsKey(InvSlotType.LeftHand))
+ if (!item.AllowStealing && CharacterInventory.LimbSlotIcons.ContainsKey(InvSlotType.LeftHand))
{
var stealIcon = CharacterInventory.LimbSlotIcons[InvSlotType.LeftHand];
Vector2 iconSize = new Vector2(25 * GUI.Scale);
diff --git a/Barotrauma/BarotraumaClient/ClientSource/Items/Item.cs b/Barotrauma/BarotraumaClient/ClientSource/Items/Item.cs
index 3ddfdf3f5..9735fabb0 100644
--- a/Barotrauma/BarotraumaClient/ClientSource/Items/Item.cs
+++ b/Barotrauma/BarotraumaClient/ClientSource/Items/Item.cs
@@ -1464,6 +1464,7 @@ namespace Barotrauma
byte bodyType = msg.ReadByte();
bool spawnedInOutpost = msg.ReadBoolean();
+ bool allowStealing = msg.ReadBoolean();
byte teamID = msg.ReadByte();
bool tagsChanged = msg.ReadBoolean();
string tags = "";
@@ -1535,7 +1536,8 @@ namespace Barotrauma
var item = new Item(itemPrefab, pos, sub, id: itemId)
{
- SpawnedInOutpost = spawnedInOutpost
+ SpawnedInOutpost = spawnedInOutpost,
+ AllowStealing = allowStealing
};
if (item.body != null)
diff --git a/Barotrauma/BarotraumaClient/ClientSource/Screens/CampaignUI.cs b/Barotrauma/BarotraumaClient/ClientSource/Screens/CampaignUI.cs
index d57aaba8f..7bc5bd0eb 100644
--- a/Barotrauma/BarotraumaClient/ClientSource/Screens/CampaignUI.cs
+++ b/Barotrauma/BarotraumaClient/ClientSource/Screens/CampaignUI.cs
@@ -53,7 +53,7 @@ namespace Barotrauma
campaign.Map.OnLocationSelected += SelectLocation;
campaign.Map.OnMissionSelected += (connection, mission) =>
{
- missionList.Select(mission);
+ missionList?.Select(mission);
};
}
diff --git a/Barotrauma/BarotraumaClient/LinuxClient.csproj b/Barotrauma/BarotraumaClient/LinuxClient.csproj
index ae68bea09..745e39e43 100644
--- a/Barotrauma/BarotraumaClient/LinuxClient.csproj
+++ b/Barotrauma/BarotraumaClient/LinuxClient.csproj
@@ -6,7 +6,7 @@
Barotrauma
FakeFish, Undertow Games
Barotrauma
- 0.1300.0.7
+ 0.1300.0.8
Copyright © FakeFish 2018-2020
AnyCPU;x64
Barotrauma
diff --git a/Barotrauma/BarotraumaClient/MacClient.csproj b/Barotrauma/BarotraumaClient/MacClient.csproj
index 3075445f0..78c7c9186 100644
--- a/Barotrauma/BarotraumaClient/MacClient.csproj
+++ b/Barotrauma/BarotraumaClient/MacClient.csproj
@@ -6,7 +6,7 @@
Barotrauma
FakeFish, Undertow Games
Barotrauma
- 0.1300.0.7
+ 0.1300.0.8
Copyright © FakeFish 2018-2020
AnyCPU;x64
Barotrauma
diff --git a/Barotrauma/BarotraumaClient/WindowsClient.csproj b/Barotrauma/BarotraumaClient/WindowsClient.csproj
index d49271552..ed9694508 100644
--- a/Barotrauma/BarotraumaClient/WindowsClient.csproj
+++ b/Barotrauma/BarotraumaClient/WindowsClient.csproj
@@ -6,7 +6,7 @@
Barotrauma
FakeFish, Undertow Games
Barotrauma
- 0.1300.0.7
+ 0.1300.0.8
Copyright © FakeFish 2018-2020
AnyCPU;x64
Barotrauma
diff --git a/Barotrauma/BarotraumaServer/DedicatedServer.exe b/Barotrauma/BarotraumaServer/DedicatedServer.exe
index 8808709d4..13b1d7b32 100644
--- a/Barotrauma/BarotraumaServer/DedicatedServer.exe
+++ b/Barotrauma/BarotraumaServer/DedicatedServer.exe
@@ -1 +1,2 @@
+export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PWD/linux64"
./DedicatedServer
diff --git a/Barotrauma/BarotraumaServer/LinuxServer.csproj b/Barotrauma/BarotraumaServer/LinuxServer.csproj
index 33795219b..3e96d3a1b 100644
--- a/Barotrauma/BarotraumaServer/LinuxServer.csproj
+++ b/Barotrauma/BarotraumaServer/LinuxServer.csproj
@@ -6,7 +6,7 @@
Barotrauma
FakeFish, Undertow Games
Barotrauma Dedicated Server
- 0.1300.0.7
+ 0.1300.0.8
Copyright © FakeFish 2018-2020
AnyCPU;x64
DedicatedServer
diff --git a/Barotrauma/BarotraumaServer/MacServer.csproj b/Barotrauma/BarotraumaServer/MacServer.csproj
index 94a2bef25..06c270aeb 100644
--- a/Barotrauma/BarotraumaServer/MacServer.csproj
+++ b/Barotrauma/BarotraumaServer/MacServer.csproj
@@ -6,7 +6,7 @@
Barotrauma
FakeFish, Undertow Games
Barotrauma Dedicated Server
- 0.1300.0.7
+ 0.1300.0.8
Copyright © FakeFish 2018-2020
AnyCPU;x64
DedicatedServer
diff --git a/Barotrauma/BarotraumaServer/ServerSource/Items/Components/Holdable/Holdable.cs b/Barotrauma/BarotraumaServer/ServerSource/Items/Components/Holdable/Holdable.cs
index b0a85019a..a30115996 100644
--- a/Barotrauma/BarotraumaServer/ServerSource/Items/Components/Holdable/Holdable.cs
+++ b/Barotrauma/BarotraumaServer/ServerSource/Items/Components/Holdable/Holdable.cs
@@ -8,7 +8,10 @@ namespace Barotrauma.Items.Components
public override void ServerWrite(IWriteMessage msg, Client c, object[] extraData = null)
{
base.ServerWrite(msg, c, extraData);
- if (!attachable || body == null) { return; }
+
+ bool writeAttachData = attachable && body != null;
+ msg.Write(writeAttachData);
+ if (!writeAttachData) { return; }
msg.Write(Attached);
msg.Write(body.SimPosition.X);
diff --git a/Barotrauma/BarotraumaServer/ServerSource/Items/Item.cs b/Barotrauma/BarotraumaServer/ServerSource/Items/Item.cs
index be554ba94..609cc2e0b 100644
--- a/Barotrauma/BarotraumaServer/ServerSource/Items/Item.cs
+++ b/Barotrauma/BarotraumaServer/ServerSource/Items/Item.cs
@@ -269,6 +269,7 @@ namespace Barotrauma
msg.Write(body == null ? (byte)0 : (byte)body.BodyType);
msg.Write(SpawnedInOutpost);
+ msg.Write(AllowStealing);
byte teamID = 0;
foreach (WifiComponent wifiComponent in GetComponents())
diff --git a/Barotrauma/BarotraumaServer/ServerSource/Networking/GameServer.cs b/Barotrauma/BarotraumaServer/ServerSource/Networking/GameServer.cs
index a22805f97..fa62c76bf 100644
--- a/Barotrauma/BarotraumaServer/ServerSource/Networking/GameServer.cs
+++ b/Barotrauma/BarotraumaServer/ServerSource/Networking/GameServer.cs
@@ -3752,11 +3752,11 @@ namespace Barotrauma.Networking
private Client FindClientWithJobPreference(List clients, JobPrefab job, bool forceAssign = false)
{
- int bestPreference = 0;
+ int bestPreference = int.MaxValue;
Client preferredClient = null;
foreach (Client c in clients)
{
- if (c.Karma < job.MinKarma) { continue; }
+ if (ServerSettings.KarmaEnabled && c.Karma < job.MinKarma) { continue; }
int index = c.JobPreferences.IndexOf(c.JobPreferences.Find(j => j.First == job));
if (index > -1 && index < bestPreference)
{
diff --git a/Barotrauma/BarotraumaServer/ServerSource/Networking/RespawnManager.cs b/Barotrauma/BarotraumaServer/ServerSource/Networking/RespawnManager.cs
index c4fe108c1..295f9eb90 100644
--- a/Barotrauma/BarotraumaServer/ServerSource/Networking/RespawnManager.cs
+++ b/Barotrauma/BarotraumaServer/ServerSource/Networking/RespawnManager.cs
@@ -18,10 +18,17 @@ namespace Barotrauma.Networking
if (!c.InGame) { continue; }
if (c.SpectateOnly && (GameMain.Server.ServerSettings.AllowSpectating || GameMain.Server.OwnerConnection == c.Connection)) { continue; }
if (c.Character != null && !c.Character.IsDead) { continue; }
-
+
+ //don't allow respawn if the client already has a character (they'll regain control once they're in sync)
+ var matchingData = campaign?.GetClientCharacterData(c);
+ if (matchingData != null && matchingData.HasSpawned &&
+ Character.CharacterList.Any(c => c.Info == matchingData.CharacterInfo && !c.IsDead))
+ {
+ continue;
+ }
+
if (UseRespawnPrompt)
{
- var matchingData = campaign?.GetClientCharacterData(c);
if (matchingData != null && matchingData.HasSpawned)
{
if (!c.WaitForNextRoundRespawn.HasValue || c.WaitForNextRoundRespawn.Value) { continue; }
diff --git a/Barotrauma/BarotraumaServer/WindowsServer.csproj b/Barotrauma/BarotraumaServer/WindowsServer.csproj
index fa532bfbe..5096d88cb 100644
--- a/Barotrauma/BarotraumaServer/WindowsServer.csproj
+++ b/Barotrauma/BarotraumaServer/WindowsServer.csproj
@@ -6,7 +6,7 @@
Barotrauma
FakeFish, Undertow Games
Barotrauma Dedicated Server
- 0.1300.0.7
+ 0.1300.0.8
Copyright © FakeFish 2018-2020
AnyCPU;x64
DedicatedServer
diff --git a/Barotrauma/BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs b/Barotrauma/BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs
index b0c793796..6ba9ae846 100644
--- a/Barotrauma/BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs
+++ b/Barotrauma/BarotraumaShared/SharedSource/Characters/AI/HumanAIController.cs
@@ -1401,7 +1401,7 @@ namespace Barotrauma
Character thief = character;
bool someoneSpoke = false;
- if (item.SpawnedInOutpost && thief.TeamID != CharacterTeamType.FriendlyNPC && !item.HasTag("handlocker"))
+ if (item.SpawnedInOutpost && !item.AllowStealing && thief.TeamID != CharacterTeamType.FriendlyNPC && !item.HasTag("handlocker"))
{
foreach (Character otherCharacter in Character.CharacterList)
{
@@ -1453,7 +1453,7 @@ namespace Barotrauma
}
}
}
- else if (item.OwnInventory?.FindItem(it => it.SpawnedInOutpost, true) is { } foundItem)
+ else if (item.OwnInventory?.FindItem(it => it.SpawnedInOutpost && !item.AllowStealing, true) is { } foundItem)
{
ItemTaken(foundItem, character);
}
diff --git a/Barotrauma/BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjectiveManager.cs b/Barotrauma/BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjectiveManager.cs
index 99d2d2cfd..5a98de2e8 100644
--- a/Barotrauma/BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjectiveManager.cs
+++ b/Barotrauma/BarotraumaShared/SharedSource/Characters/AI/Objectives/AIObjectiveManager.cs
@@ -320,6 +320,7 @@ namespace Barotrauma
public void ClearForcedOrder()
{
ForcedOrder = null;
+ SortObjectives();
}
private CoroutineHandle speakRoutine;
diff --git a/Barotrauma/BarotraumaShared/SharedSource/Characters/Animation/FishAnimController.cs b/Barotrauma/BarotraumaShared/SharedSource/Characters/Animation/FishAnimController.cs
index 3e940af24..0ca3c9c1c 100644
--- a/Barotrauma/BarotraumaShared/SharedSource/Characters/Animation/FishAnimController.cs
+++ b/Barotrauma/BarotraumaShared/SharedSource/Characters/Animation/FishAnimController.cs
@@ -429,8 +429,7 @@ namespace Barotrauma
float t = 0.5f;
if (!SimplePhysicsEnabled && CurrentSwimParams.RotateTowardsMovement)
{
- float offset = mainLimb.Params.GetSpriteOrientation() - MathHelper.PiOver2;
- Vector2 forward = VectorExtensions.Forward(mainLimb.body.TransformedRotation - offset * Character.AnimController.Dir);
+ Vector2 forward = VectorExtensions.Forward(Collider.Rotation + MathHelper.PiOver2);
float dot = Vector2.Dot(forward, Vector2.Normalize(movement));
if (dot < 0)
{
diff --git a/Barotrauma/BarotraumaShared/SharedSource/Characters/Character.cs b/Barotrauma/BarotraumaShared/SharedSource/Characters/Character.cs
index 5276666c7..6b4fbbf31 100644
--- a/Barotrauma/BarotraumaShared/SharedSource/Characters/Character.cs
+++ b/Barotrauma/BarotraumaShared/SharedSource/Characters/Character.cs
@@ -3440,7 +3440,10 @@ namespace Barotrauma
if (statusEffect.type != actionType) { continue; }
if (statusEffect.type == ActionType.OnDamaged)
{
- if (LastDamage.Afflictions == null || LastDamage.Afflictions.None(a => a.Prefab.AfflictionType == "damage")) { continue; }
+ if (statusEffect.AllowedAfflictions != null && (LastDamage.Afflictions == null || LastDamage.Afflictions.None(a => statusEffect.AllowedAfflictions.Contains(a.Prefab.AfflictionType) || statusEffect.AllowedAfflictions.Contains(a.Prefab.Identifier))))
+ {
+ continue;
+ }
if (statusEffect.OnlyPlayerTriggered)
{
if (LastAttacker == null || !LastAttacker.IsPlayer)
diff --git a/Barotrauma/BarotraumaShared/SharedSource/Characters/Limb.cs b/Barotrauma/BarotraumaShared/SharedSource/Characters/Limb.cs
index 310c2fec9..c16563dd1 100644
--- a/Barotrauma/BarotraumaShared/SharedSource/Characters/Limb.cs
+++ b/Barotrauma/BarotraumaShared/SharedSource/Characters/Limb.cs
@@ -1127,7 +1127,10 @@ namespace Barotrauma
if (statusEffect.type != actionType) { continue; }
if (statusEffect.type == ActionType.OnDamaged)
{
- if (character.LastDamage.Afflictions == null || character.LastDamage.Afflictions.None(a => a.Prefab.AfflictionType == "damage")) { continue; }
+ if (statusEffect.AllowedAfflictions != null && (character.LastDamage.Afflictions == null || character.LastDamage.Afflictions.None(a => statusEffect.AllowedAfflictions.Contains(a.Prefab.AfflictionType) || statusEffect.AllowedAfflictions.Contains(a.Prefab.Identifier))))
+ {
+ continue;
+ }
if (statusEffect.OnlyPlayerTriggered)
{
if (character.LastAttacker == null || !character.LastAttacker.IsPlayer)
diff --git a/Barotrauma/BarotraumaShared/SharedSource/Events/EventActions/CheckAfflictionAction.cs b/Barotrauma/BarotraumaShared/SharedSource/Events/EventActions/CheckAfflictionAction.cs
index 658c70d5c..b5ff3c16a 100644
--- a/Barotrauma/BarotraumaShared/SharedSource/Events/EventActions/CheckAfflictionAction.cs
+++ b/Barotrauma/BarotraumaShared/SharedSource/Events/EventActions/CheckAfflictionAction.cs
@@ -27,25 +27,24 @@ namespace Barotrauma
if (string.IsNullOrWhiteSpace(Identifier) || string.IsNullOrWhiteSpace(TargetTag)) { return false; }
List targets = ParentEvent.GetTargets(TargetTag).OfType().ToList();
- if (!(targets.FirstOrDefault() is { } target)) { return false; }
-
- if (TargetLimb == LimbType.None)
+ foreach (var target in targets)
{
- Affliction? affliction = target.CharacterHealth?.GetAffliction(Identifier, AllowLimbAfflictions);
- return affliction != null;
+ if (target.CharacterHealth == null) { continue; }
+ if (TargetLimb == LimbType.None)
+ {
+ if (target.CharacterHealth.GetAffliction(Identifier, AllowLimbAfflictions) != null) { return true; }
+ }
+ IEnumerable afflictions = target.CharacterHealth.GetAllAfflictions().Where(affliction =>
+ {
+ LimbType? limbType = target.CharacterHealth.GetAfflictionLimb(affliction)?.type;
+ if (limbType == null) { return false; }
+
+ return limbType == TargetLimb || true;
+ });
+
+ if (afflictions.Any(a => a.Identifier.Equals(Identifier, StringComparison.OrdinalIgnoreCase))) { return true; }
}
-
- if (target.CharacterHealth == null) { return false; }
-
- IEnumerable afflictions = target.CharacterHealth.GetAllAfflictions().Where(affliction =>
- {
- LimbType? limbType = target.CharacterHealth.GetAfflictionLimb(affliction)?.type;
- if (limbType == null) { return false; }
-
- return limbType == TargetLimb || true;
- });
-
- return afflictions.Any(a => a.Identifier.Equals(Identifier, StringComparison.OrdinalIgnoreCase));
+ return false;
}
public override string ToDebugString()
diff --git a/Barotrauma/BarotraumaShared/SharedSource/Events/EventActions/ConversationAction.cs b/Barotrauma/BarotraumaShared/SharedSource/Events/EventActions/ConversationAction.cs
index dd213330b..3e12045f1 100644
--- a/Barotrauma/BarotraumaShared/SharedSource/Events/EventActions/ConversationAction.cs
+++ b/Barotrauma/BarotraumaShared/SharedSource/Events/EventActions/ConversationAction.cs
@@ -190,6 +190,7 @@ namespace Barotrauma
humanAI.ClearForcedOrder();
if (prevIdleObjective != null) { humanAI.ObjectiveManager.AddObjective(prevIdleObjective); }
if (prevGotoObjective != null) { humanAI.ObjectiveManager.AddObjective(prevGotoObjective); }
+ humanAI.ObjectiveManager.SortObjectives();
}
}
diff --git a/Barotrauma/BarotraumaShared/SharedSource/Events/EventActions/SpawnAction.cs b/Barotrauma/BarotraumaShared/SharedSource/Events/EventActions/SpawnAction.cs
index 4b92ac0b8..66b9f360a 100644
--- a/Barotrauma/BarotraumaShared/SharedSource/Events/EventActions/SpawnAction.cs
+++ b/Barotrauma/BarotraumaShared/SharedSource/Events/EventActions/SpawnAction.cs
@@ -117,6 +117,7 @@ namespace Barotrauma
foreach (Item item in newCharacter.Inventory.AllItems)
{
item.SpawnedInOutpost = true;
+ item.AllowStealing = false;
}
}
humanPrefab.InitializeCharacter(newCharacter, spawnPos);
diff --git a/Barotrauma/BarotraumaShared/SharedSource/Events/EventActions/TagAction.cs b/Barotrauma/BarotraumaShared/SharedSource/Events/EventActions/TagAction.cs
index 090a19fb5..ef22c7638 100644
--- a/Barotrauma/BarotraumaShared/SharedSource/Events/EventActions/TagAction.cs
+++ b/Barotrauma/BarotraumaShared/SharedSource/Events/EventActions/TagAction.cs
@@ -45,15 +45,15 @@ namespace Barotrauma
}
}
- private void TagBots()
+ private void TagBots(bool playerCrewOnly)
{
if (IgnoreIncapacitatedCharacters)
{
- ParentEvent.AddTargetPredicate(Tag, e => e is Character c && c.IsBot && !c.IsIncapacitated);
+ ParentEvent.AddTargetPredicate(Tag, e => e is Character c && c.IsBot && !c.IsIncapacitated && (!playerCrewOnly || c.TeamID == CharacterTeamType.Team1));
}
else
{
- ParentEvent.AddTargetPredicate(Tag, e => e is Character c && c.IsBot);
+ ParentEvent.AddTargetPredicate(Tag, e => e is Character c && c.IsBot && (!playerCrewOnly || c.TeamID == CharacterTeamType.Team1));
}
}
@@ -62,7 +62,8 @@ namespace Barotrauma
#if CLIENT
GameMain.GameSession.CrewManager.GetCharacters().ForEach(c => ParentEvent.AddTarget(Tag, c));
#else
- TagPlayers(); TagBots(); //TODO: this seems like it would tag more than it should, fix
+ TagPlayers();
+ TagBots(playerCrewOnly: true);
#endif
}
@@ -116,7 +117,7 @@ namespace Barotrauma
TagPlayers();
break;
case "bot":
- TagBots();
+ TagBots(playerCrewOnly: false);
break;
case "crew":
TagCrew();
diff --git a/Barotrauma/BarotraumaShared/SharedSource/Events/EventManager.cs b/Barotrauma/BarotraumaShared/SharedSource/Events/EventManager.cs
index 94784bb08..32b7481af 100644
--- a/Barotrauma/BarotraumaShared/SharedSource/Events/EventManager.cs
+++ b/Barotrauma/BarotraumaShared/SharedSource/Events/EventManager.cs
@@ -321,14 +321,23 @@ namespace Barotrauma
}
}
RagdollParams ragdollParams;
- if (humanoid)
+ try
{
- ragdollParams = RagdollParams.GetRagdollParams(speciesName);
+ if (humanoid)
+ {
+ ragdollParams = RagdollParams.GetRagdollParams(characterPrefab.VariantOf ?? speciesName);
+ }
+ else
+ {
+ ragdollParams = RagdollParams.GetRagdollParams(characterPrefab.VariantOf ?? speciesName);
+ }
}
- else
+ catch (Exception e)
{
- ragdollParams = RagdollParams.GetRagdollParams(speciesName);
+ DebugConsole.ThrowError($"Failed to preload a ragdoll file for the character \"{characterPrefab.Name}\"", e);
+ continue;
}
+
if (ragdollParams != null)
{
HashSet texturePaths = new HashSet
diff --git a/Barotrauma/BarotraumaShared/SharedSource/Events/Missions/CargoMission.cs b/Barotrauma/BarotraumaShared/SharedSource/Events/Missions/CargoMission.cs
index 7478dbe7a..2e1419d80 100644
--- a/Barotrauma/BarotraumaShared/SharedSource/Events/Missions/CargoMission.cs
+++ b/Barotrauma/BarotraumaShared/SharedSource/Events/Missions/CargoMission.cs
@@ -96,7 +96,8 @@ namespace Barotrauma
var item = new Item(itemPrefab, position, cargoRoom.Submarine)
{
- SpawnedInOutpost = true
+ SpawnedInOutpost = true,
+ AllowStealing = false
};
item.FindHull();
items.Add(item);
diff --git a/Barotrauma/BarotraumaShared/SharedSource/GameSession/AutoItemPlacer.cs b/Barotrauma/BarotraumaShared/SharedSource/GameSession/AutoItemPlacer.cs
index 5453f987a..f2e62e40d 100644
--- a/Barotrauma/BarotraumaShared/SharedSource/GameSession/AutoItemPlacer.cs
+++ b/Barotrauma/BarotraumaShared/SharedSource/GameSession/AutoItemPlacer.cs
@@ -205,6 +205,7 @@ namespace Barotrauma
var item = new Item(itemPrefab, validContainer.Key.Item.Position, validContainer.Key.Item.Submarine)
{
SpawnedInOutpost = validContainer.Key.Item.SpawnedInOutpost,
+ AllowStealing = validContainer.Key.Item.AllowStealing,
OriginalModuleIndex = validContainer.Key.Item.OriginalModuleIndex,
OriginalContainerID = validContainer.Key.Item.ID
};
diff --git a/Barotrauma/BarotraumaShared/SharedSource/GameSession/GameModes/CampaignMode.cs b/Barotrauma/BarotraumaShared/SharedSource/GameSession/GameModes/CampaignMode.cs
index 6e96753f0..6f59f085c 100644
--- a/Barotrauma/BarotraumaShared/SharedSource/GameSession/GameModes/CampaignMode.cs
+++ b/Barotrauma/BarotraumaShared/SharedSource/GameSession/GameModes/CampaignMode.cs
@@ -461,12 +461,15 @@ namespace Barotrauma
leavingSubAtStart ??= Submarine.MainSub;
leavingSubAtEnd ??= Submarine.MainSub;
}
- int playersInSubAtStart = leavingSubAtStart == null ? 0 :
+ int playersInSubAtStart = leavingSubAtStart == null || !leavingSubAtStart.AtStartExit ? 0 :
leavingPlayers.Count(c => c.Submarine == leavingSubAtStart || leavingSubAtStart.DockedTo.Contains(c.Submarine) || (Level.Loaded.StartOutpost != null && c.Submarine == Level.Loaded.StartOutpost));
- int playersInSubAtEnd = leavingSubAtEnd == null ? 0 :
+ int playersInSubAtEnd = leavingSubAtEnd == null || !leavingSubAtStart.AtEndExit ? 0 :
leavingPlayers.Count(c => c.Submarine == leavingSubAtEnd || leavingSubAtEnd.DockedTo.Contains(c.Submarine) || (Level.Loaded.EndOutpost != null && c.Submarine == Level.Loaded.EndOutpost));
- if (playersInSubAtStart == 0 && playersInSubAtEnd == 0) { return null; }
+ if (playersInSubAtStart == 0 && playersInSubAtEnd == 0)
+ {
+ return null;
+ }
return playersInSubAtStart > playersInSubAtEnd ? leavingSubAtStart : leavingSubAtEnd;
@@ -474,7 +477,7 @@ namespace Barotrauma
{
if (Level.Loaded.StartOutpost == null)
{
- Submarine closestSub = Submarine.FindClosest(Level.Loaded.StartExitPosition, ignoreOutposts: true, ignoreRespawnShuttle: true);
+ Submarine closestSub = Submarine.FindClosest(Level.Loaded.StartExitPosition, ignoreOutposts: true, ignoreRespawnShuttle: true, teamType: leavingPlayers.FirstOrDefault()?.TeamID);
return closestSub.DockedTo.Contains(Submarine.MainSub) ? Submarine.MainSub : closestSub;
}
else
@@ -488,7 +491,7 @@ namespace Barotrauma
//nothing docked, check if there's a sub close enough to the outpost and someone inside the outpost
if (Level.Loaded.Type == LevelData.LevelType.LocationConnection && !leavingPlayers.Any(s => s.Submarine == Level.Loaded.StartOutpost)) { return null; }
- Submarine closestSub = Submarine.FindClosest(Level.Loaded.StartOutpost.WorldPosition, ignoreOutposts: true, ignoreRespawnShuttle: true);
+ Submarine closestSub = Submarine.FindClosest(Level.Loaded.StartOutpost.WorldPosition, ignoreOutposts: true, ignoreRespawnShuttle: true, teamType: leavingPlayers.FirstOrDefault()?.TeamID);
if (closestSub == null || !closestSub.AtStartExit) { return null; }
return closestSub.DockedTo.Contains(Submarine.MainSub) ? Submarine.MainSub : closestSub;
}
@@ -501,7 +504,7 @@ namespace Barotrauma
if (Level.Loaded.EndOutpost == null)
{
- Submarine closestSub = Submarine.FindClosest(Level.Loaded.EndPosition, ignoreOutposts: true, ignoreRespawnShuttle: true);
+ Submarine closestSub = Submarine.FindClosest(Level.Loaded.EndExitPosition, ignoreOutposts: true, ignoreRespawnShuttle: true, teamType: leavingPlayers.FirstOrDefault()?.TeamID);
return closestSub.DockedTo.Contains(Submarine.MainSub) ? Submarine.MainSub : closestSub;
}
else
@@ -515,7 +518,7 @@ namespace Barotrauma
//nothing docked, check if there's a sub close enough to the outpost and someone inside the outpost
if (Level.Loaded.Type == LevelData.LevelType.LocationConnection && !leavingPlayers.Any(s => s.Submarine == Level.Loaded.EndOutpost)) { return null; }
- Submarine closestSub = Submarine.FindClosest(Level.Loaded.EndOutpost.WorldPosition, ignoreOutposts: true, ignoreRespawnShuttle: true);
+ Submarine closestSub = Submarine.FindClosest(Level.Loaded.EndOutpost.WorldPosition, ignoreOutposts: true, ignoreRespawnShuttle: true, teamType: leavingPlayers.FirstOrDefault()?.TeamID);
if (closestSub == null || !closestSub.AtEndExit) { return null; }
return closestSub.DockedTo.Contains(Submarine.MainSub) ? Submarine.MainSub : closestSub;
}
@@ -528,7 +531,8 @@ namespace Barotrauma
foreach (Item item in Item.ItemList)
{
if (!item.SpawnedInOutpost || item.OriginalModuleIndex < 0) { continue; }
- if ((!(item.GetRootInventoryOwner()?.Submarine?.Info?.IsOutpost ?? false)) || item.Submarine == null || !item.Submarine.Info.IsOutpost)
+ var owner = item.GetRootInventoryOwner();
+ if ((!(owner?.Submarine?.Info?.IsOutpost ?? false)) || (owner is Character character && character.TeamID == CharacterTeamType.Team1) || item.Submarine == null || !item.Submarine.Info.IsOutpost)
{
takenItems.Add(item);
}
diff --git a/Barotrauma/BarotraumaShared/SharedSource/Items/Components/Signal/MemoryComponent.cs b/Barotrauma/BarotraumaShared/SharedSource/Items/Components/Signal/MemoryComponent.cs
index c7d2b4ac0..33a769f92 100644
--- a/Barotrauma/BarotraumaShared/SharedSource/Items/Components/Signal/MemoryComponent.cs
+++ b/Barotrauma/BarotraumaShared/SharedSource/Items/Components/Signal/MemoryComponent.cs
@@ -1,13 +1,11 @@
using Barotrauma.Networking;
+using System;
using System.Xml.Linq;
namespace Barotrauma.Items.Components
{
partial class MemoryComponent : ItemComponent, IServerSerializable
{
- const int MaxValueLength = ChatMessage.MaxLength;
-
-
private string value;
[InGameEditable, Serialize("", true, description: "The currently stored signal the item outputs.", alwaysUseInstanceValues: true)]
@@ -17,10 +15,25 @@ namespace Barotrauma.Items.Components
set
{
if (value == null) { return; }
- this.value = value.Length <= MaxValueLength ? value : value.Substring(0, MaxValueLength);
+ this.value = value;
+ if (this.value.Length > MaxValueLength && (item.Submarine == null || !item.Submarine.Loading))
+ {
+ this.value = this.value.Substring(0, MaxValueLength);
+ }
}
}
-
+
+ private int maxValueLength;
+ [Editable, Serialize(200, false, description: "The maximum length of the stored value. Warning: Large values can lead to large memory usage or networking issues.")]
+ public int MaxValueLength
+ {
+ get { return maxValueLength; }
+ set
+ {
+ maxValueLength = Math.Max(value, 0);
+ }
+ }
+
protected bool writeable = true;
public MemoryComponent(Item item, XElement element)
@@ -43,9 +56,12 @@ namespace Barotrauma.Items.Components
case "signal_in":
if (writeable)
{
- if (Value == signal.value) { return; }
+ string prevValue = Value;
Value = signal.value;
- OnStateChanged();
+ if (Value != prevValue)
+ {
+ OnStateChanged();
+ }
}
break;
case "signal_store":
diff --git a/Barotrauma/BarotraumaShared/SharedSource/Items/Item.cs b/Barotrauma/BarotraumaShared/SharedSource/Items/Item.cs
index 144b6e8dd..b0b666faf 100644
--- a/Barotrauma/BarotraumaShared/SharedSource/Items/Item.cs
+++ b/Barotrauma/BarotraumaShared/SharedSource/Items/Item.cs
@@ -527,6 +527,8 @@ namespace Barotrauma
}
}
+ public bool AllowStealing = true;
+
private string originalOutpost;
[Serialize("", true, alwaysUseInstanceValues: true)]
public string OriginalOutpost
diff --git a/Barotrauma/BarotraumaShared/SharedSource/Map/Map/Map.cs b/Barotrauma/BarotraumaShared/SharedSource/Map/Map/Map.cs
index da547ecb3..5758239f9 100644
--- a/Barotrauma/BarotraumaShared/SharedSource/Map/Map/Map.cs
+++ b/Barotrauma/BarotraumaShared/SharedSource/Map/Map/Map.cs
@@ -1066,6 +1066,7 @@ namespace Barotrauma
case "connection":
int connectionIndex = subElement.GetAttributeInt("i", 0);
Connections[connectionIndex].Passed = subElement.GetAttributeBool("passed", false);
+ Connections[connectionIndex].Locked = subElement.GetAttributeBool("locked", false);
break;
case "radiation":
Radiation = new Radiation(this, generationParams.RadiationParams, subElement);
diff --git a/Barotrauma/BarotraumaShared/SharedSource/Map/Outposts/OutpostGenerator.cs b/Barotrauma/BarotraumaShared/SharedSource/Map/Outposts/OutpostGenerator.cs
index 47c589c0b..39b06e020 100644
--- a/Barotrauma/BarotraumaShared/SharedSource/Map/Outposts/OutpostGenerator.cs
+++ b/Barotrauma/BarotraumaShared/SharedSource/Map/Outposts/OutpostGenerator.cs
@@ -1425,7 +1425,8 @@ namespace Barotrauma
humanPrefab.GiveItems(npc, outpost, Rand.RandSync.Server);
foreach (Item item in npc.Inventory.FindAllItems(it => it != null, recursive: true))
{
- item.SpawnedInOutpost = !outpost.Info.OutpostGenerationParams.AllowStealing;
+ item.AllowStealing = outpost.Info.OutpostGenerationParams.AllowStealing;
+ item.SpawnedInOutpost = true;
}
npc.GiveIdCardTags(gotoTarget as WayPoint);
humanPrefab.InitializeCharacter(npc, gotoTarget);
diff --git a/Barotrauma/BarotraumaShared/SharedSource/Map/Submarine.cs b/Barotrauma/BarotraumaShared/SharedSource/Map/Submarine.cs
index 0305c2315..becbec2ad 100644
--- a/Barotrauma/BarotraumaShared/SharedSource/Map/Submarine.cs
+++ b/Barotrauma/BarotraumaShared/SharedSource/Map/Submarine.cs
@@ -1175,7 +1175,8 @@ namespace Barotrauma
subBody.SetPosition(subBody.Position + amount);
}
- public static Submarine FindClosest(Vector2 worldPosition, bool ignoreOutposts = false, bool ignoreOutsideLevel = true, bool ignoreRespawnShuttle = false)
+ /// If has value, the sub must match the team type.
+ public static Submarine FindClosest(Vector2 worldPosition, bool ignoreOutposts = false, bool ignoreOutsideLevel = true, bool ignoreRespawnShuttle = false, CharacterTeamType? teamType = null)
{
Submarine closest = null;
float closestDist = 0.0f;
@@ -1187,6 +1188,7 @@ namespace Barotrauma
{
if (sub == GameMain.NetworkMember?.RespawnManager?.RespawnShuttle) { continue; }
}
+ if (teamType.HasValue && sub.TeamID != teamType) { continue; }
float dist = Vector2.DistanceSquared(worldPosition, sub.WorldPosition);
if (closest == null || dist < closestDist)
{
@@ -1359,7 +1361,8 @@ namespace Barotrauma
if (me.Submarine != this) { continue; }
if (me is Item item)
{
- item.SpawnedInOutpost = info.OutpostGenerationParams != null && !info.OutpostGenerationParams.AllowStealing;
+ item.SpawnedInOutpost = info.OutpostGenerationParams != null;
+ item.AllowStealing = info.OutpostGenerationParams?.AllowStealing ?? true;
if (item.GetComponent() != null && indestructible)
{
item.Indestructible = true;
diff --git a/Barotrauma/BarotraumaShared/SharedSource/StatusEffects/StatusEffect.cs b/Barotrauma/BarotraumaShared/SharedSource/StatusEffects/StatusEffect.cs
index 931bf9748..52a1e2aa7 100644
--- a/Barotrauma/BarotraumaShared/SharedSource/StatusEffects/StatusEffect.cs
+++ b/Barotrauma/BarotraumaShared/SharedSource/StatusEffects/StatusEffect.cs
@@ -289,6 +289,8 @@ namespace Barotrauma
get { return targetIdentifiers; }
}
+ public HashSet AllowedAfflictions { get; private set; }
+
public List Afflictions
{
get;
@@ -421,6 +423,14 @@ namespace Barotrauma
targetIdentifiers.Add(identifiers[i].Trim().ToLowerInvariant());
}
break;
+ case "allowedafflictions":
+ string[] types = attribute.Value.Split(',');
+ AllowedAfflictions = new HashSet();
+ for (int i = 0; i < types.Length; i++)
+ {
+ AllowedAfflictions.Add(types[i].Trim().ToLowerInvariant());
+ }
+ break;
case "duration":
duration = attribute.GetAttributeFloat(0.0f);
break;
diff --git a/Barotrauma/BarotraumaShared/changelog.txt b/Barotrauma/BarotraumaShared/changelog.txt
index 8a18e401c..74a5e5b6b 100644
--- a/Barotrauma/BarotraumaShared/changelog.txt
+++ b/Barotrauma/BarotraumaShared/changelog.txt
@@ -1,3 +1,22 @@
+---------------------------------------------------------------------------------------------------------
+v0.1300.0.8 (unstable)
+---------------------------------------------------------------------------------------------------------
+
+Changes:
+- Increased the delay with which the boss health bar is faded from 10 to 60 seconds.
+- Modding: Allow to define afflictions (types or identifiers) to trigger the OnDamaged status effects only from certain afflictions and not all that do the damage. If the afflictions property is not defined, no restrictions are used (works as it used to).
+- Added MaxValueLength property to memory component.
+
+Fixes:
+- Fixed networking errors when the server tries to send an update for a Holdable component that's not attachable, leading to various issues (disconnects, "failed to read ..." errors).
+- Fixed "enter location" button not appearing in some levels where there's no outpost at the destination and a beacon station near the exit.
+- Fixed event to heal Reaper's Tax not triggering in outposts.
+- Fixed server starting the respawn countdown when a disconnected client whose character is still alive rejoins.
+- Removed outdated steamclient.so file from the dedicated server (no longer needed because it's automatically installed by Steamworks). Should fix inability to host dedicated servers on Linux.
+- Fixed job preferences not having an effect on who gets assigned as the captain.
+- Fixed items taken from abandoned outposts reappearing when you leave and re-enter the outpost.
+- Fixed crashing/disconnects when preloading content at the start of a round if random events contain character variants. In practice, mods that used character variants in random events occasionally prevented rounds from starting.
+
---------------------------------------------------------------------------------------------------------
v0.1300.0.7 (unstable)
---------------------------------------------------------------------------------------------------------
diff --git a/Barotrauma/BarotraumaShared/steamclient.so b/Barotrauma/BarotraumaShared/steamclient.so
deleted file mode 100644
index 214fabf4d..000000000
Binary files a/Barotrauma/BarotraumaShared/steamclient.so and /dev/null differ