Unstable 0.16.5.0

This commit is contained in:
Markus Isberg
2022-02-17 00:03:08 +09:00
parent 2190fe08ef
commit a0696ecb74
51 changed files with 197 additions and 96 deletions

View File

@@ -406,6 +406,7 @@ namespace Barotrauma
if (npc.CampaignInteractionType == CampaignMode.InteractionType.None || npc.Submarine != character.Submarine || npc.IsDead || npc.IsIncapacitated) { continue; }
var iconStyle = GUI.Style.GetComponentStyle("CampaignInteractionIcon." + npc.CampaignInteractionType);
if (iconStyle == null) { continue; }
Range<float> visibleRange = new Range<float>(npc.CurrentHull == Character.Controlled.CurrentHull ? 500.0f : 100.0f, float.PositiveInfinity);
if (npc.CampaignInteractionType == CampaignMode.InteractionType.Examine)
{

View File

@@ -956,7 +956,7 @@ namespace Barotrauma
public void DrawHUD(SpriteBatch spriteBatch)
{
if (GUI.DisableHUD) { return; }
if (GUI.DisableHUD || Character.Removed) { return; }
if (GameMain.GraphicsWidth != screenResolution.X ||
GameMain.GraphicsHeight != screenResolution.Y ||
Math.Abs(inventoryScale - Inventory.UIScale) > 0.01f ||
@@ -997,14 +997,16 @@ namespace Barotrauma
{
healthBar.RectTransform.ScreenSpaceOffset = healthBarShadow.RectTransform.ScreenSpaceOffset = Point.Zero;
}
// If manning a turret the portrait doesn't get rendered so we push the health bar to remove the empty gap
healthBarHolder.RectTransform.ScreenSpaceOffset = Character.ShouldLockHud() ? new Point(0, HUDLayoutSettings.PortraitArea.Height) : Point.Zero;
if (healthBarHolder != null)
{
// If manning a turret the portrait doesn't get rendered so we push the health bar to remove the empty gap
healthBarHolder.RectTransform.ScreenSpaceOffset = Character.ShouldLockHud() ? new Point(0, HUDLayoutSettings.PortraitArea.Height) : Point.Zero;
}
DrawStatusHUD(spriteBatch);
}
private (Affliction affliction, string text)? highlightedAfflictionIcon;
public void DrawStatusHUD(SpriteBatch spriteBatch)
{

View File

@@ -21,8 +21,8 @@ namespace Barotrauma
}
}
public override bool IsAtCompletionState => State > 0 && requireRescue.None();
public override bool IsAtFailureState => State == HostagesKilledState;
public override bool DisplayAsCompleted => State > 0 && requireRescue.None();
public override bool DisplayAsFailed => State == HostagesKilledState;
public override void ClientReadInitial(IReadMessage msg)
{

View File

@@ -4,8 +4,8 @@ namespace Barotrauma
{
partial class AlienRuinMission : Mission
{
public override bool IsAtCompletionState => State > 0;
public override bool IsAtFailureState => false;
public override bool DisplayAsCompleted => State > 0;
public override bool DisplayAsFailed => false;
public override void ClientReadInitial(IReadMessage msg)
{

View File

@@ -2,7 +2,7 @@
{
partial class BeaconMission : Mission
{
public override bool IsAtCompletionState => false;
public override bool IsAtFailureState => false;
public override bool DisplayAsCompleted => State > 0;
public override bool DisplayAsFailed => false;
}
}

View File

@@ -5,8 +5,8 @@ namespace Barotrauma
{
partial class CargoMission : Mission
{
public override bool IsAtCompletionState => false;
public override bool IsAtFailureState => false;
public override bool DisplayAsCompleted => false;
public override bool DisplayAsFailed => false;
public override string GetMissionRewardText(Submarine sub)
{

View File

@@ -21,7 +21,7 @@ namespace Barotrauma
}
}
public override bool IsAtCompletionState => false;
public override bool IsAtFailureState => false;
public override bool DisplayAsCompleted => false;
public override bool DisplayAsFailed => false;
}
}

View File

@@ -4,8 +4,8 @@ namespace Barotrauma
{
partial class EscortMission : Mission
{
public override bool IsAtCompletionState => false;
public override bool IsAtFailureState => State == 1;
public override bool DisplayAsCompleted => false;
public override bool DisplayAsFailed => State == 1;
public override void ClientReadInitial(IReadMessage msg)
{

View File

@@ -2,7 +2,7 @@
{
partial class GoToMission : Mission
{
public override bool IsAtCompletionState => false;
public override bool IsAtFailureState => false;
public override bool DisplayAsCompleted => false;
public override bool DisplayAsFailed => false;
}
}

View File

@@ -6,8 +6,8 @@ namespace Barotrauma
{
partial class MineralMission : Mission
{
public override bool IsAtCompletionState => false;
public override bool IsAtFailureState => false;
public override bool DisplayAsCompleted => false;
public override bool DisplayAsFailed => false;
public override void ClientReadInitial(IReadMessage msg)
{

View File

@@ -20,13 +20,13 @@ namespace Barotrauma
public virtual IEnumerable<Entity> HudIconTargets => Enumerable.Empty<Entity>();
/// <summary>
/// State at which the only thing left to do is to reach the end of the level. Use for UI references.
/// Is the mission at a state at which the only thing left to do is to reach the end of the level?
/// </summary>
public abstract bool IsAtCompletionState { get; }
public abstract bool DisplayAsCompleted { get; }
/// <summary>
/// State at which the mission cannot be completed anymore. Use for UI references.
/// Is the mission at a state at which the mission cannot be completed anymore?
/// </summary>
public abstract bool IsAtFailureState { get; }
public abstract bool DisplayAsFailed { get; }
public Color GetDifficultyColor()
{

View File

@@ -4,8 +4,8 @@ namespace Barotrauma
{
partial class MonsterMission : Mission
{
public override bool IsAtCompletionState => State > 0;
public override bool IsAtFailureState => false;
public override bool DisplayAsCompleted => State > 0;
public override bool DisplayAsFailed => false;
public override void ClientReadInitial(IReadMessage msg)
{

View File

@@ -6,8 +6,8 @@ namespace Barotrauma
{
partial class NestMission : Mission
{
public override bool IsAtCompletionState => State > 0 && !requireDelivery;
public override bool IsAtFailureState => false;
public override bool DisplayAsCompleted => State > 0 && !requireDelivery;
public override bool DisplayAsFailed => false;
public override void ClientReadInitial(IReadMessage msg)
{

View File

@@ -4,8 +4,8 @@ namespace Barotrauma
{
partial class PirateMission : Mission
{
public override bool IsAtCompletionState => State > 1;
public override bool IsAtFailureState => false;
public override bool DisplayAsCompleted => State > 1;
public override bool DisplayAsFailed => false;
public override void ClientReadInitial(IReadMessage msg)
{

View File

@@ -5,8 +5,8 @@ namespace Barotrauma
{
partial class SalvageMission : Mission
{
public override bool IsAtCompletionState => false;
public override bool IsAtFailureState => false;
public override bool DisplayAsCompleted => false;
public override bool DisplayAsFailed => false;
public override void ClientReadInitial(IReadMessage msg)
{

View File

@@ -22,8 +22,8 @@ namespace Barotrauma
}
}
public override bool IsAtCompletionState => false;
public override bool IsAtFailureState => false;
public override bool DisplayAsCompleted => false;
public override bool DisplayAsFailed => false;
public override void ClientReadInitial(IReadMessage msg)
{

View File

@@ -629,7 +629,10 @@ namespace Barotrauma
CharacterInfo? healInfo = crewMember.FindCharacterInfo(MedicalClinic.GetCrewCharacters());
if (healInfo is null) { return; }
GUIFrame pendingHealBackground = new GUIFrame(new RectTransform(new Vector2(1f, 0.25f), parent.RectTransform));
GUIFrame pendingHealBackground = new GUIFrame(new RectTransform(new Vector2(1f, 0.25f), parent.RectTransform), style: "ListBoxElement")
{
CanBeFocused = false
};
GUILayoutGroup pendingHealLayout = new GUILayoutGroup(new RectTransform(new Vector2(0.95f), pendingHealBackground.RectTransform, Anchor.Center));
GUILayoutGroup topHeaderLayout = new GUILayoutGroup(new RectTransform(new Vector2(1f, 0.3f), pendingHealLayout.RectTransform), isHorizontal: true, Anchor.CenterLeft) { Stretch = true };
@@ -658,7 +661,10 @@ namespace Barotrauma
private void CreatePendingAffliction(GUIListBox parent, MedicalClinic.NetCrewMember crewMember, MedicalClinic.NetAffliction affliction, PendingHealElement healElement)
{
GUIFrame backgroundFrame = new GUIFrame(new RectTransform(new Vector2(1f, 0.33f), parent.Content.RectTransform), style: "ListBoxElement");
GUIFrame backgroundFrame = new GUIFrame(new RectTransform(new Vector2(1f, 0.33f), parent.Content.RectTransform), style: "ListBoxElement")
{
CanBeFocused = false
};
GUILayoutGroup parentLayout = new GUILayoutGroup(new RectTransform(Vector2.One, backgroundFrame.RectTransform), isHorizontal: true) { Stretch = true };
if (!(affliction.Prefab is { } prefab)) { return; }
@@ -760,7 +766,7 @@ namespace Barotrauma
mainFrame.RectTransform.ScreenSpaceOffset = new Point((int)location.X, GameMain.GraphicsHeight - mainFrame.Rect.Height);
}
GUITextBlock feedbackBlock = new GUITextBlock(new RectTransform(Vector2.One, mainFrame.RectTransform), TextManager.Get("pleasewaitupnp"), textAlignment: Alignment.Center, font: GUI.LargeFont)
GUITextBlock feedbackBlock = new GUITextBlock(new RectTransform(Vector2.One, mainFrame.RectTransform), TextManager.Get("pleasewaitupnp"), textAlignment: Alignment.Center, font: GUI.LargeFont, wrap: true)
{
Visible = true
};

View File

@@ -1069,11 +1069,11 @@ namespace Barotrauma
{
if (mission == null || missionIcon == null) { return; }
string style = string.Empty;
if (mission.IsAtFailureState)
if (mission.DisplayAsFailed)
{
style = "MissionFailedIcon";
}
else if (mission.IsAtCompletionState)
else if (mission.DisplayAsCompleted)
{
style = "MissionCompletedIcon";
}

View File

@@ -1218,11 +1218,7 @@ namespace Barotrauma
new GUIButton(new RectTransform(new Vector2(1.0f, 1.0f), linkHolder.RectTransform), TextManager.Get("bugreportgithubform"), style: "MainMenuGUIButton", textAlignment: Alignment.Left)
{
#if UNSTABLE
UserData = "https://barotraumagame.com/unstable-3rf3w5t4ter/",
#else
UserData = "https://github.com/Regalis11/Barotrauma/issues/new?template=bug_report.md",
#endif
OnClicked = (btn, userdata) =>
{
ShowOpenUrlInWebBrowserPrompt(userdata as string);

View File

@@ -153,12 +153,6 @@ namespace Barotrauma
return container.Inventory;
}
protected override void PutItem(Item item, int i, Character user, bool removeItem = true, bool createNetworkEvent = true)
{
base.PutItem(item, i, user, removeItem, createNetworkEvent);
CreateSlots();
}
public override void CreateSlots()
{
visualSlots ??= new VisualSlot[capacity];

View File

@@ -3557,6 +3557,11 @@ namespace Barotrauma.Networking
case ClientNetError.MISSING_ENTITY:
outMsg.Write(eventID);
outMsg.Write(entityID);
outMsg.Write((byte)Submarine.Loaded.Count);
foreach (Submarine sub in Submarine.Loaded)
{
outMsg.Write(sub.Info.Name);
}
break;
}
clientPeer.Send(outMsg, DeliveryMethod.Reliable);

View File

@@ -1,20 +1,16 @@
using Barotrauma.Extensions;
using Barotrauma.Networking;
using Barotrauma.Steam;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using Barotrauma.IO;
using System.Linq;
using System.Xml.Linq;
using Barotrauma.Steam;
namespace Barotrauma
{
partial class NetLobbyScreen : Screen
{
//private readonly List<Sprite> jobPreferenceSprites = new List<Sprite>();
private readonly GUIFrame infoFrame, modeFrame;
private readonly GUILayoutGroup infoFrameContent;
private readonly GUIFrame myCharacterFrame;
@@ -1346,9 +1342,9 @@ namespace Barotrauma
StartButton.Visible = GameMain.Client.HasPermission(ClientPermissions.ManageRound) && !GameMain.Client.GameStarted && !CampaignSetupFrame.Visible && !CampaignFrame.Visible;
ServerName.Readonly = !GameMain.Client.HasPermission(ClientPermissions.ManageSettings);
ServerMessage.Readonly = !GameMain.Client.HasPermission(ClientPermissions.ManageSettings);
shuttleTickBox.Enabled = GameMain.Client.HasPermission(ClientPermissions.ManageSettings);
shuttleTickBox.Enabled = GameMain.Client.HasPermission(ClientPermissions.ManageSettings) && !GameMain.Client.GameStarted;
SubList.Enabled = !CampaignFrame.Visible && (GameMain.Client.ServerSettings.Voting.AllowSubVoting || GameMain.Client.HasPermission(ClientPermissions.SelectSub));
ShuttleList.Enabled = ShuttleList.ButtonEnabled = GameMain.Client.HasPermission(ClientPermissions.SelectSub);
ShuttleList.Enabled = ShuttleList.ButtonEnabled = GameMain.Client.HasPermission(ClientPermissions.SelectSub) && !GameMain.Client.GameStarted;
ModeList.Enabled = GameMain.Client.ServerSettings.Voting.AllowModeVoting || GameMain.Client.HasPermission(ClientPermissions.SelectMode);
LogButtons.Visible = GameMain.Client.HasPermission(ClientPermissions.ServerLog);
GameMain.Client.ShowLogButton.Visible = GameMain.Client.HasPermission(ClientPermissions.ServerLog);

View File

@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product>
<Version>0.16.3.0</Version>
<Version>0.16.4.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName>

View File

@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product>
<Version>0.16.3.0</Version>
<Version>0.16.4.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName>

View File

@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product>
<Version>0.16.3.0</Version>
<Version>0.16.4.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName>

View File

@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product>
<Version>0.16.3.0</Version>
<Version>0.16.4.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName>

View File

@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product>
<Version>0.16.3.0</Version>
<Version>0.16.4.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName>

View File

@@ -430,11 +430,14 @@ namespace Barotrauma
if (avgUpdateRate < Timing.FixedUpdateRate * 0.98 && GameSession != null && Timing.TotalTime > GameSession.RoundStartTime + 1.0)
{
DebugConsole.AddWarning($"Running slowly ({avgUpdateRate} updates/s)!");
foreach (Client c in Server.ConnectedClients)
if (Server != null)
{
if (c.Connection == Server.OwnerConnection || c.Permissions != ClientPermissions.None)
foreach (Client c in Server.ConnectedClients)
{
Server.SendConsoleMessage($"Server running slowly ({avgUpdateRate} updates/s)!", c, Color.Orange);
if (c.Connection == Server.OwnerConnection || c.Permissions != ClientPermissions.None)
{
Server.SendConsoleMessage($"Server running slowly ({avgUpdateRate} updates/s)!", c, Color.Orange);
}
}
}
}

View File

@@ -212,7 +212,14 @@ namespace Barotrauma
}
//use the info of the character the client is currently controlling
// or the previously saved info if not (e.g. if the client has been spectating or died)
var characterInfo = c.Character?.Info ?? characterData.Find(d => d.MatchesClient(c))?.CharacterInfo;
var characterInfo = c.Character?.Info;
var matchingCharacterData = characterData.Find(d => d.MatchesClient(c));
if (matchingCharacterData != null)
{
//hasn't spawned this round -> don't touch the data
if (!matchingCharacterData.HasSpawned) { continue; }
characterInfo ??= matchingCharacterData.CharacterInfo;
}
if (characterInfo == null) { continue; }
//reduce skills if the character has died
if (characterInfo.CauseOfDeath != null && characterInfo.CauseOfDeath.Type != CauseOfDeathType.Disconnected)

View File

@@ -117,8 +117,14 @@ namespace Barotrauma.Networking
{
GameMain.Server.VoipServer.UnregisterQueue(VoipQueue);
VoipQueue.Dispose();
characterInfo?.Remove();
characterInfo = null;
if (characterInfo != null)
{
if (characterInfo.Character == null || characterInfo.Character.Removed)
{
characterInfo?.Remove();
characterInfo = null;
}
}
}
public void InitClientSync()

View File

@@ -857,6 +857,12 @@ namespace Barotrauma.Networking
case ClientNetError.MISSING_ENTITY:
UInt16 eventID = inc.ReadUInt16();
UInt16 entityID = inc.ReadUInt16();
byte subCount = inc.ReadByte();
List<string> subNames = new List<string>();
for (int i = 0; i < subCount; i++)
{
subNames.Add(inc.ReadString());
}
Entity entity = Entity.FindEntityByID(entityID);
if (entity == null)
{
@@ -875,6 +881,13 @@ namespace Barotrauma.Networking
{
errorStr = errorStrNoName = $"Missing entity {entity}, sub: {entity.Submarine?.Info?.Name ?? "none"} (event id {eventID}, entity id {entityID}).";
}
var serverSubNames = Submarine.Loaded.Select(s => s.Info.Name);
if (subCount != Submarine.Loaded.Count || !subNames.SequenceEqual(serverSubNames))
{
string subErrorStr = $" Loaded submarines don't match (client: {string.Join(", ", subNames)}, server: {string.Join(", ", serverSubNames)}).";
errorStr += subErrorStr;
errorStrNoName += subErrorStr;
}
break;
}
@@ -1850,9 +1863,10 @@ namespace Barotrauma.Networking
}
outmsg.Write(GameMain.NetLobbyScreen.SelectedSub.Name);
outmsg.Write(GameMain.NetLobbyScreen.SelectedSub.MD5Hash.ToString());
outmsg.Write(serverSettings.UseRespawnShuttle);
outmsg.Write(GameMain.NetLobbyScreen.SelectedShuttle.Name);
outmsg.Write(GameMain.NetLobbyScreen.SelectedShuttle.MD5Hash.ToString());
outmsg.Write(serverSettings.UseRespawnShuttle || (gameStarted && respawnManager.UsingShuttle));
var selectedShuttle = gameStarted && respawnManager.UsingShuttle ? respawnManager.RespawnShuttle.Info : GameMain.NetLobbyScreen.SelectedShuttle;
outmsg.Write(selectedShuttle.Name);
outmsg.Write(selectedShuttle.MD5Hash.ToString());
outmsg.Write(serverSettings.Voting.AllowSubVoting);
outmsg.Write(serverSettings.Voting.AllowModeVoting);
@@ -2031,7 +2045,7 @@ namespace Barotrauma.Networking
msg.Write(selectedSub.Name);
msg.Write(selectedSub.MD5Hash.Hash);
msg.Write(serverSettings.UseRespawnShuttle);
msg.Write(serverSettings.UseRespawnShuttle || (gameStarted && respawnManager.UsingShuttle));
msg.Write(selectedShuttle.Name);
msg.Write(selectedShuttle.MD5Hash.Hash);
@@ -2468,8 +2482,9 @@ namespace Barotrauma.Networking
msg.Write(serverSettings.SelectedLevelDifficulty);
msg.Write(gameSession.SubmarineInfo.Name);
msg.Write(gameSession.SubmarineInfo.MD5Hash.Hash);
msg.Write(GameMain.NetLobbyScreen.SelectedShuttle.Name);
msg.Write(GameMain.NetLobbyScreen.SelectedShuttle.MD5Hash.Hash);
var selectedShuttle = gameStarted && respawnManager.UsingShuttle ? respawnManager.RespawnShuttle.Info : GameMain.NetLobbyScreen.SelectedShuttle;
msg.Write(selectedShuttle.Name);
msg.Write(selectedShuttle.MD5Hash.Hash);
msg.Write((byte)GameMain.GameSession.GameMode.Missions.Count());
foreach (Mission mission in GameMain.GameSession.GameMode.Missions)
{

View File

@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma Dedicated Server</Product>
<Version>0.16.3.0</Version>
<Version>0.16.4.0</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>DedicatedServer</AssemblyName>

View File

@@ -632,6 +632,7 @@ namespace Barotrauma
{
divingSuit.Drop(Character);
HandleRelocation(divingSuit);
ReequipUnequipped();
}
else if (findItemState == FindItemState.None || findItemState == FindItemState.DivingSuit)
{
@@ -659,6 +660,7 @@ namespace Barotrauma
{
divingSuit.Drop(Character);
HandleRelocation(divingSuit);
ReequipUnequipped();
}
}
}
@@ -677,6 +679,7 @@ namespace Barotrauma
{
mask.Drop(Character);
HandleRelocation(mask);
ReequipUnequipped();
}
else if (findItemState == FindItemState.None || findItemState == FindItemState.DivingMask)
{
@@ -701,6 +704,7 @@ namespace Barotrauma
{
mask.Drop(Character);
HandleRelocation(mask);
ReequipUnequipped();
}
}
}
@@ -2075,10 +2079,12 @@ namespace Barotrauma
public static bool IsItemTargetedBySomeone(ItemComponent target, CharacterTeamType team, out Character operatingCharacter)
{
operatingCharacter = null;
if (target?.Item == null) { return false; }
float highestPriority = -1.0f;
float highestPriorityModifier = -1.0f;
foreach (Character c in Character.CharacterList)
{
if (c == null) { continue; }
if (c.Removed) { continue; }
if (c.TeamID != team) { continue; }
if (c.IsIncapacitated) { continue; }
@@ -2087,12 +2093,12 @@ namespace Barotrauma
operatingCharacter = c;
return true;
}
if (c.AIController is HumanAIController humanAI)
if (c.AIController is HumanAIController humanAI && humanAI.ObjectiveManager is AIObjectiveManager objectiveManager)
{
foreach (var objective in humanAI.ObjectiveManager.Objectives)
foreach (var objective in objectiveManager.Objectives)
{
if (!(objective is AIObjectiveOperateItem operateObjective)) { continue; }
if (operateObjective.Component.Item != target.Item) { continue; }
if (operateObjective.Component?.Item != target.Item) { continue; }
if (operateObjective.Priority < highestPriority) { continue; }
if (operateObjective.PriorityModifier < highestPriorityModifier) { continue; }
operatingCharacter = c;

View File

@@ -457,12 +457,20 @@ namespace Barotrauma
// Cannot use the head position, because not all characters have head or it can be below the total height of the character
float characterHeight = Math.Max(colliderSize.Y + character.AnimController.ColliderHeightFromFloor, minHeight);
float horizontalDistance = Math.Abs(collider.SimPosition.X - currentPath.CurrentNode.SimPosition.X);
bool isAboveFeet = currentPath.CurrentNode.SimPosition.Y > colliderBottom.Y;
bool isNotTooHigh = currentPath.CurrentNode.SimPosition.Y < colliderBottom.Y + characterHeight;
bool isTargetTooHigh = currentPath.CurrentNode.SimPosition.Y > colliderBottom.Y + characterHeight;
bool isTargetTooLow = currentPath.CurrentNode.SimPosition.Y < colliderBottom.Y;
var door = currentPath.CurrentNode.ConnectedDoor;
float margin = MathHelper.Lerp(1, 10, MathHelper.Clamp(Math.Abs(velocity.X) / 5, 0, 1));
if (currentPath.CurrentNode.Stairs != null && currentPath.NextNode?.Stairs == null)
{
margin = 1;
if (currentPath.CurrentNode.SimPosition.Y < colliderBottom.Y + character.AnimController.ColliderHeightFromFloor * 0.25f)
{
isTargetTooLow = true;
}
}
float targetDistance = Math.Max(colliderSize.X / 2 * margin, minWidth / 2);
if (horizontalDistance < targetDistance && isAboveFeet && isNotTooHigh && (door == null || door.CanBeTraversed))
if (horizontalDistance < targetDistance && !isTargetTooHigh && !isTargetTooLow && (door == null || door.CanBeTraversed))
{
NextNode(!doorsChecked);
}

View File

@@ -3759,10 +3759,6 @@ namespace Barotrauma
if (!wasDead)
{
TryAdjustAttackerSkill(attacker, CharacterHealth.Vitality - prevVitality);
if (IsDead)
{
attacker?.RecordKill(this);
}
}
};
if (attackResult.Damage > 0)
@@ -4027,6 +4023,7 @@ namespace Barotrauma
var abilityCharacterKiller = new AbilityCharacterKiller(CauseOfDeath.Killer);
CheckTalents(AbilityEffectType.OnDieToCharacter, abilityCharacterKiller);
CauseOfDeath.Killer?.RecordKill(this);
if (GameMain.GameSession != null && Screen.Selected == GameMain.GameScreen)
{
@@ -4035,7 +4032,7 @@ namespace Barotrauma
KillProjSpecific(causeOfDeath, causeOfDeathAffliction, log);
if (info != null)
if (info != null)
{
info.CauseOfDeath = CauseOfDeath;
info.MissionsCompletedSinceDeath = 0;
@@ -4549,6 +4546,8 @@ namespace Barotrauma
if (addingFirstTime)
{
OnTalentGiven(talentPrefab);
GameAnalyticsManager.AddDesignEvent("TalentUnlocked:" + (info.Job?.Prefab.Identifier ?? "None") + ":" + talentPrefab.Identifier,
GameMain.GameSession?.Campaign?.TotalPlayTime ?? 0.0);
}
return true;
}

View File

@@ -202,7 +202,7 @@ namespace Barotrauma
get { return pressureAffliction; }
}
public Character Character { get; private set; }
public readonly Character Character;
public CharacterHealth(Character character)
{

View File

@@ -478,5 +478,18 @@ namespace Barotrauma
return TryPutItem(item, user, new List<InvSlotType>() { placeToSlots }, createNetworkEvent, ignoreCondition);
}
protected override void PutItem(Item item, int i, Character user, bool removeItem = true, bool createNetworkEvent = true)
{
base.PutItem(item, i, user, removeItem, createNetworkEvent);
#if CLIENT
CreateSlots();
#endif
if (item.CampaignInteractionType == CampaignMode.InteractionType.Cargo)
{
item.CampaignInteractionType = CampaignMode.InteractionType.None;
}
}
}
}

View File

@@ -130,11 +130,6 @@ namespace Barotrauma.Items.Components
}
if (picker.Inventory.TryPutItemWithAutoEquipCheck(item, picker, allowedSlots))
{
if (item.CampaignInteractionType == CampaignMode.InteractionType.Cargo)
{
item.CampaignInteractionType = CampaignMode.InteractionType.None;
}
if (!picker.HeldItems.Contains(item) && item.body != null) { item.body.Enabled = false; }
this.picker = picker;

View File

@@ -541,7 +541,9 @@ namespace Barotrauma
}
}
}
RemoveInActiveTriggerers(PhysicsBody, triggerers);
if (stayTriggeredDelay > 0.0f)
{
if (triggerers.Count == 0)

View File

@@ -472,7 +472,7 @@ namespace Barotrauma
cloneWire.Connect((clones[itemIndex] as Item).Connections[connectionIndex], false);
}
if (cloneWire.Connections[0] == null || cloneWire.Connections[1] == null)
if ((cloneWire.Connections[0] == null || cloneWire.Connections[1] == null) && cloneItem.GetComponent<DockingPort>() == null)
{
if (!clones.Any(c => (c as Item)?.GetComponent<ConnectionPanel>()?.DisconnectedWires.Contains(cloneWire) ?? false))
{

View File

@@ -1624,7 +1624,7 @@ namespace Barotrauma
DebugConsole.ShowError("Random rotation is not supported for Projectiles.");
break;
default:
throw new NotImplementedException("Not implemented: " + chosenItemSpawnInfo.RotationType);
throw new NotImplementedException("Projectile spawn rotation type not implemented: " + chosenItemSpawnInfo.RotationType);
}
rotation += MathHelper.ToRadians(chosenItemSpawnInfo.Rotation * user.AnimController.Dir);
projectile.Shoot(user, ConvertUnits.ToSimUnits(worldPos), ConvertUnits.ToSimUnits(worldPos), rotation + spread, ignoredBodies: user.AnimController.Limbs.Where(l => !l.IsSevered).Select(l => l.body.FarseerBody).ToList(), createNetworkEvent: true);
@@ -1664,8 +1664,10 @@ namespace Barotrauma
case ItemSpawnInfo.SpawnRotationType.Random:
rotation = Rand.Range(0f, MathHelper.TwoPi, Rand.RandSync.Unsynced);
break;
case ItemSpawnInfo.SpawnRotationType.Target:
break;
default:
throw new NotImplementedException("Not implemented: " + chosenItemSpawnInfo.RotationType);
throw new NotImplementedException("Spawn rotation type not implemented: " + chosenItemSpawnInfo.RotationType);
}
body.SetTransform(newItem.SimPosition, rotation);
body.ApplyLinearImpulse(Rand.Vector(1) * chosenItemSpawnInfo.Speed);

View File

@@ -1,3 +1,48 @@
---------------------------------------------------------------------------------------------------------
v0.16.5.0
---------------------------------------------------------------------------------------------------------
- Misc fixes to Herja, Winterhalter, and Barsuk (unstable only).
- Fixed certain talents (e.g. Bounty Hunter) not working if the target is killed "indirectly" (e.g. bloodloss caused by severing a limb).
- Increased bandit and pirate aim speeds (unstable only).
- Fixes character resetting in MP campaign if you join mid-round and don't get to spawn in before the next round in a campaign you've previously played in.
- Increased handcannon round's max stack size to 12 (unstable only).
- Fixed error in the medical clinic UI when trying to heal a character whose owner has disconnected (even if the character is still alive). Unstable only.
---------------------------------------------------------------------------------------------------------
v0.16.4.0
---------------------------------------------------------------------------------------------------------
Changes and additions:
- Sounds for the new monster variants.
- Adjusted animations ragdolls and animations for the variants.
- Decreased the initial recharge rate of Dugong's supercapacitors a bit and slightly increased the reactor output (the supercapacitors were a bit too much for the reactor to handle).
- Husked Crawler: Reduced the gunshotwound and stun resistances from 60% to 40%. Decreased the cooldown time when attacking walls.
- Crawler Broodmother is resistant to stuns, like all the other bigger monsters.
- Slightly adjusted the combat strengths of Hammerhead Matriarch, Mudraptor Hatchling and Mudraptor Veteran.
- Increased Crawler Broodmother's health from 800 to 1000.
- Increased Crawler's health from 65 to 80.
- Increased Crawler Hatchling's health from 32 to 40.
- Add vitality multipliers for all Crawlers: more damage at head, less at tail or legs/arms.
- Increased revolver dmg from 30 to 35 and decreased bleeding from 40 to 30.
- Handcannon: increase bleeding from 50 to 70 (unstable only).
Fixes:
- Fixed the Depleted Fuel SMG Magazine using the recycle recipe of the regular SMG Magazine.
- Fixed SMG magazine recyle recipes not requiring the talent.
- Fixed beacon missions not being displayed as completed mid-round in the tab menu after the beacon's been activated (unstable only).
- Fixed bots not re-equipping body armor/ballistic helmet/something else when they drop the diving gear.
- Waypoint fixes to Herja, Humpback, Orca, Orca2, R-29, and Remora.
- Fixes to Herja, Winterhalter, and Barsuk (unstable only).
- Fixed a nullref exception in CharacterHUD.Draw when an icon can't be found for a campaign interaction.
- Upgrade supercapacitor max recharge speed in subs saved prior to v0.16.3.0 (unstable only).
- Remove store icon from items when they're picked up by a bot (unstable only).
- Fixed colliders being off on clothing items and ballistic helmets having a different scale when not worn (unstable only).
- Fixed bots having issues with some stairs. Note: these changes might require alterations on stair waypoints. Currently the generator doesn't do perfect job there. Look for the examples on how to fix them manually in the vanilla subs.
- Fixed inability to clone docking ports in the sub editor (unstable only).
- Fixed LevelTriggers with multiple fixtures not deactivating when the triggerer leaves them (e.g. slowdown from spiky bushes not going away, unstable only).
- Fixed crashing when a status effect tries to spawn a non-projectile using the "Target" rotation type (e.g. when a watcher emits acid, unstable only).
---------------------------------------------------------------------------------------------------------
v0.16.3.0
---------------------------------------------------------------------------------------------------------