Merge branch 'master' of https://github.com/Regalis11/Barotrauma into develop
This commit is contained in:
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -73,7 +73,7 @@ body:
|
||||
label: Version
|
||||
description: Which version of the game did the bug happen in? You can see the current version number in the bottom left corner of your screen in the main menu.
|
||||
options:
|
||||
- v1.2.6.0 (Winter Update)
|
||||
- v1.2.7.0 (Winter Update hotfix)
|
||||
- Other
|
||||
validations:
|
||||
required: true
|
||||
|
||||
@@ -1402,7 +1402,7 @@ namespace Barotrauma
|
||||
{
|
||||
if (!(MapEntityPrefab.Find(null, deconstructItem.ItemIdentifier, showErrorMessages: false) is ItemPrefab targetItem))
|
||||
{
|
||||
ThrowError("Error in item \"" + itemPrefab.Name + "\" - could not find deconstruct item \"" + deconstructItem.ItemIdentifier + "\"!");
|
||||
ThrowErrorLocalized("Error in item \"" + itemPrefab.Name + "\" - could not find deconstruct item \"" + deconstructItem.ItemIdentifier + "\"!");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -536,7 +536,7 @@ namespace Barotrauma
|
||||
rotation: RotationRad,
|
||||
clr: Color.White,
|
||||
depth: 0,
|
||||
thickness: 2f / Screen.Selected.Cam.Zoom);
|
||||
thickness: Math.Max(2f / Screen.Selected.Cam.Zoom, 1));
|
||||
|
||||
foreach (Rectangle t in Prefab.Triggers)
|
||||
{
|
||||
|
||||
@@ -218,6 +218,7 @@ namespace Barotrauma
|
||||
{
|
||||
if (primaryMouseButtonHeld)
|
||||
{
|
||||
ShowHulls = true;
|
||||
hull.WaterVolume += 100000.0f * deltaTime;
|
||||
hull.networkUpdatePending = true;
|
||||
hull.serverUpdateDelay = 0.5f;
|
||||
|
||||
@@ -499,6 +499,13 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
if (Hull.HullList.Any(h => h.WaterVolume > 0.0f))
|
||||
{
|
||||
errorMsgs.Add(TextManager.Get("WaterInHullsWarning").Value);
|
||||
warnings.Add(SubEditorScreen.WarningType.WaterInHulls);
|
||||
Hull.ShowHulls = true;
|
||||
}
|
||||
|
||||
if (Info.Type == SubmarineType.Player)
|
||||
{
|
||||
foreach (Item item in Item.ItemList)
|
||||
|
||||
@@ -1599,7 +1599,7 @@ namespace Barotrauma.Networking
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
DebugConsole.ThrowError("There was an error initializing the round.", e, true);
|
||||
DebugConsole.ThrowError("There was an error initializing the round.", e, createMessageBox: true);
|
||||
roundInitStatus = RoundInitStatus.Error;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -27,10 +27,9 @@ namespace Barotrauma.Particles
|
||||
get { return maxParticles; }
|
||||
set
|
||||
{
|
||||
if (maxParticles == value || value < 4) return;
|
||||
if (maxParticles == value || value < 4) { return; }
|
||||
|
||||
Particle[] newParticles = new Particle[value];
|
||||
|
||||
for (int i = 0; i < Math.Min(maxParticles, value); i++)
|
||||
{
|
||||
newParticles[i] = particles[i];
|
||||
@@ -39,6 +38,16 @@ namespace Barotrauma.Particles
|
||||
particleCount = Math.Min(particleCount, value);
|
||||
particles = newParticles;
|
||||
maxParticles = value;
|
||||
|
||||
var oldParticlesInCreationOrder = particlesInCreationOrder.ToList();
|
||||
particlesInCreationOrder.Clear();
|
||||
foreach (var particle in oldParticlesInCreationOrder)
|
||||
{
|
||||
if (particles.Contains(particle))
|
||||
{
|
||||
particlesInCreationOrder.AddLast(particle);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private Particle[] particles;
|
||||
|
||||
@@ -1219,7 +1219,7 @@ namespace Barotrauma.CharacterEditor
|
||||
{
|
||||
if (RagdollParams.Joints.Any(j => j.Limb1 == fromLimb && j.Limb2 == toLimb))
|
||||
{
|
||||
DebugConsole.ThrowError(GetCharacterEditorTranslation("ExistingJointFound").Replace("[limbid1]", fromLimb.ToString()).Replace("[limbid2]", toLimb.ToString()));
|
||||
DebugConsole.ThrowErrorLocalized(GetCharacterEditorTranslation("ExistingJointFound").Replace("[limbid1]", fromLimb.ToString()).Replace("[limbid2]", toLimb.ToString()));
|
||||
return;
|
||||
}
|
||||
if (RagdollParams.MainElement == null)
|
||||
@@ -1239,7 +1239,7 @@ namespace Barotrauma.CharacterEditor
|
||||
var lastJointElement = RagdollParams.MainElement.GetChildElements("joint").LastOrDefault() ?? RagdollParams.MainElement.GetChildElements("limb").LastOrDefault();
|
||||
if (lastJointElement == null)
|
||||
{
|
||||
DebugConsole.ThrowError(GetCharacterEditorTranslation("CantAddJointsNoLimbElements"));
|
||||
DebugConsole.ThrowErrorLocalized(GetCharacterEditorTranslation("CantAddJointsNoLimbElements"));
|
||||
return;
|
||||
}
|
||||
lastJointElement.AddAfterSelf(newJointElement);
|
||||
@@ -1271,7 +1271,7 @@ namespace Barotrauma.CharacterEditor
|
||||
{
|
||||
if (character.IsHumanoid)
|
||||
{
|
||||
DebugConsole.ThrowError(GetCharacterEditorTranslation("HumanoidLimbDeletionDisabled"));
|
||||
DebugConsole.ThrowErrorLocalized(GetCharacterEditorTranslation("HumanoidLimbDeletionDisabled"));
|
||||
break;
|
||||
}
|
||||
var limb = selectedLimbs[i];
|
||||
@@ -1675,7 +1675,7 @@ namespace Barotrauma.CharacterEditor
|
||||
if (contentPackage == null)
|
||||
{
|
||||
// This should not be possible.
|
||||
DebugConsole.ThrowError(GetCharacterEditorTranslation("NoContentPackageSelected"));
|
||||
DebugConsole.ThrowErrorLocalized(GetCharacterEditorTranslation("NoContentPackageSelected"));
|
||||
return false;
|
||||
}
|
||||
if (vanilla != null && contentPackage == vanilla)
|
||||
@@ -2898,7 +2898,7 @@ namespace Barotrauma.CharacterEditor
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
DebugConsole.ThrowError(GetCharacterEditorTranslation("CouldntOpenDirectory").Replace("[folder]", RagdollParams.Folder), e);
|
||||
DebugConsole.ThrowErrorLocalized(GetCharacterEditorTranslation("CouldntOpenDirectory").Replace("[folder]", RagdollParams.Folder), e);
|
||||
}
|
||||
}
|
||||
PopulateListBox();
|
||||
@@ -2932,7 +2932,7 @@ namespace Barotrauma.CharacterEditor
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
DebugConsole.ThrowError(TextManager.Get("DeleteFileError").Replace("[file]", selectedFile), e);
|
||||
DebugConsole.ThrowErrorLocalized(TextManager.Get("DeleteFileError").Replace("[file]", selectedFile), e);
|
||||
}
|
||||
msgBox.Close();
|
||||
listBox.ClearChildren();
|
||||
@@ -3058,7 +3058,7 @@ namespace Barotrauma.CharacterEditor
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
DebugConsole.ThrowError(GetCharacterEditorTranslation("CouldntOpenDirectory").Replace("[folder]", CurrentAnimation.Folder), e);
|
||||
DebugConsole.ThrowErrorLocalized(GetCharacterEditorTranslation("CouldntOpenDirectory").Replace("[folder]", CurrentAnimation.Folder), e);
|
||||
}
|
||||
}
|
||||
PopulateListBox();
|
||||
@@ -3092,7 +3092,7 @@ namespace Barotrauma.CharacterEditor
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
DebugConsole.ThrowError(TextManager.GetWithVariable("DeleteFileError", "[file]", selectedFile), e);
|
||||
DebugConsole.ThrowErrorLocalized(TextManager.GetWithVariable("DeleteFileError", "[file]", selectedFile), e);
|
||||
}
|
||||
msgBox.Close();
|
||||
PopulateListBox();
|
||||
@@ -3129,7 +3129,7 @@ namespace Barotrauma.CharacterEditor
|
||||
humanAnimController.SwimFastParams = HumanSwimFastParams.GetAnimParams(character, fileName);
|
||||
break;
|
||||
default:
|
||||
DebugConsole.ThrowError(GetCharacterEditorTranslation("AnimationTypeNotImplemented").Replace("[type]", selectedType.ToString()));
|
||||
DebugConsole.ThrowErrorLocalized(GetCharacterEditorTranslation("AnimationTypeNotImplemented").Replace("[type]", selectedType.ToString()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3150,7 +3150,7 @@ namespace Barotrauma.CharacterEditor
|
||||
character.AnimController.SwimFastParams = FishSwimFastParams.GetAnimParams(character, fileName);
|
||||
break;
|
||||
default:
|
||||
DebugConsole.ThrowError(GetCharacterEditorTranslation("AnimationTypeNotImplemented").Replace("[type]", selectedType.ToString()));
|
||||
DebugConsole.ThrowErrorLocalized(GetCharacterEditorTranslation("AnimationTypeNotImplemented").Replace("[type]", selectedType.ToString()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3548,7 +3548,7 @@ namespace Barotrauma.CharacterEditor
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugConsole.ThrowError(GetCharacterEditorTranslation("NoFieldForParameterFound").Replace("[parameter]", name.Value));
|
||||
DebugConsole.ThrowErrorLocalized(GetCharacterEditorTranslation("NoFieldForParameterFound").Replace("[parameter]", name.Value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,8 @@ namespace Barotrauma
|
||||
WallCount,
|
||||
ItemCount,
|
||||
LightCount,
|
||||
ShadowCastingLightCount
|
||||
ShadowCastingLightCount,
|
||||
WaterInHulls
|
||||
}
|
||||
|
||||
public static Vector2 MouseDragStart = Vector2.Zero;
|
||||
@@ -1320,7 +1321,7 @@ namespace Barotrauma
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
DebugConsole.ThrowError(TextManager.GetWithVariable("DeleteFileError", "[file]", assemblyPrefab.Name), e);
|
||||
DebugConsole.ThrowErrorLocalized(TextManager.GetWithVariable("DeleteFileError", "[file]", assemblyPrefab.Name), e);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
@@ -1560,7 +1561,9 @@ namespace Barotrauma
|
||||
if (editorSelectedTime.TryUnwrap(out DateTime selectedTime))
|
||||
{
|
||||
TimeSpan timeInEditor = DateTime.Now - selectedTime;
|
||||
if (timeInEditor.TotalSeconds > Timing.TotalTime)
|
||||
//this is intended for diagnosing why the "x hours in editor" achievement seems to sometimes trigger too soon
|
||||
//require the time in editor to be x1.5 higher to disregard any rounding errors or discrepancies in Datetime.Now and the game's own timekeeping
|
||||
if (timeInEditor.TotalSeconds > Timing.TotalTime * 1.5)
|
||||
{
|
||||
DebugConsole.ThrowErrorAndLogToGA(
|
||||
"SubEditorScreen.DeselectEditorSpecific:InvalidTimeInEditor",
|
||||
@@ -3714,7 +3717,7 @@ namespace Barotrauma
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
DebugConsole.ThrowError(TextManager.GetWithVariable("DeleteFileError", "[file]", sub.FilePath), e);
|
||||
DebugConsole.ThrowErrorLocalized(TextManager.GetWithVariable("DeleteFileError", "[file]", sub.FilePath), e);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
@@ -5202,9 +5205,7 @@ namespace Barotrauma
|
||||
SkipInventorySlotUpdate = false;
|
||||
ImageManager.Update((float)deltaTime);
|
||||
|
||||
#if DEBUG
|
||||
Hull.UpdateCheats((float)deltaTime, cam);
|
||||
#endif
|
||||
|
||||
if (GameMain.GraphicsWidth != screenResolution.X || GameMain.GraphicsHeight != screenResolution.Y)
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<RootNamespace>Barotrauma</RootNamespace>
|
||||
<Authors>FakeFish, Undertow Games</Authors>
|
||||
<Product>Barotrauma</Product>
|
||||
<Version>1.2.6.0</Version>
|
||||
<Version>1.2.7.0</Version>
|
||||
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<AssemblyName>Barotrauma</AssemblyName>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<RootNamespace>Barotrauma</RootNamespace>
|
||||
<Authors>FakeFish, Undertow Games</Authors>
|
||||
<Product>Barotrauma</Product>
|
||||
<Version>1.2.6.0</Version>
|
||||
<Version>1.2.7.0</Version>
|
||||
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<AssemblyName>Barotrauma</AssemblyName>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<RootNamespace>Barotrauma</RootNamespace>
|
||||
<Authors>FakeFish, Undertow Games</Authors>
|
||||
<Product>Barotrauma</Product>
|
||||
<Version>1.2.6.0</Version>
|
||||
<Version>1.2.7.0</Version>
|
||||
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<AssemblyName>Barotrauma</AssemblyName>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<RootNamespace>Barotrauma</RootNamespace>
|
||||
<Authors>FakeFish, Undertow Games</Authors>
|
||||
<Product>Barotrauma Dedicated Server</Product>
|
||||
<Version>1.2.6.0</Version>
|
||||
<Version>1.2.7.0</Version>
|
||||
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<AssemblyName>DedicatedServer</AssemblyName>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<RootNamespace>Barotrauma</RootNamespace>
|
||||
<Authors>FakeFish, Undertow Games</Authors>
|
||||
<Product>Barotrauma Dedicated Server</Product>
|
||||
<Version>1.2.6.0</Version>
|
||||
<Version>1.2.7.0</Version>
|
||||
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<AssemblyName>DedicatedServer</AssemblyName>
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace Barotrauma
|
||||
{
|
||||
if (Version < VanillaContent.GameVersion)
|
||||
{
|
||||
DebugConsole.ThrowError(
|
||||
DebugConsole.ThrowErrorLocalized(
|
||||
TextManager.GetWithVariables("versionmismatchwarning",
|
||||
("[gameversion]", Version.ToString()),
|
||||
("[contentversion]", VanillaContent.GameVersion.ToString())));
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<RootNamespace>Barotrauma</RootNamespace>
|
||||
<Authors>FakeFish, Undertow Games</Authors>
|
||||
<Product>Barotrauma Dedicated Server</Product>
|
||||
<Version>1.2.6.0</Version>
|
||||
<Version>1.2.7.0</Version>
|
||||
<Copyright>Copyright © FakeFish 2018-2023</Copyright>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<AssemblyName>DedicatedServer</AssemblyName>
|
||||
|
||||
@@ -454,6 +454,7 @@ namespace Barotrauma
|
||||
if (!itemInventory.Container.HasRequiredItems(character, addMessage: false)) { continue; }
|
||||
}
|
||||
float itemPriority = item.Prefab.BotPriority;
|
||||
if (itemPriority <= 0) { continue; }
|
||||
if (GetItemPriority != null)
|
||||
{
|
||||
itemPriority *= GetItemPriority(item);
|
||||
|
||||
@@ -172,6 +172,10 @@ namespace Barotrauma
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (autonomousObjective.IgnoreAtNonOutpost && !Level.IsLoadedFriendlyOutpost)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var objective = CreateObjective(order, autonomousObjective.PriorityModifier);
|
||||
if (objective != null && objective.CanBeCompleted)
|
||||
{
|
||||
|
||||
@@ -741,28 +741,32 @@ namespace Barotrauma
|
||||
{
|
||||
Stairs = character.SelectedBy.AnimController.Stairs;
|
||||
}
|
||||
|
||||
var collisionResponse = getStairCollisionResponse();
|
||||
if (collisionResponse == LimbStairCollisionResponse.ClimbWithLimbCollision)
|
||||
{
|
||||
Stairs = structure;
|
||||
}
|
||||
else
|
||||
{
|
||||
var collisionResponse = handleLimbStairCollision();
|
||||
if (collisionResponse == LimbStairCollisionResponse.ClimbWithLimbCollision)
|
||||
{
|
||||
Stairs = structure;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (collisionResponse == LimbStairCollisionResponse.DontClimbStairs) { Stairs = null; }
|
||||
if (collisionResponse == LimbStairCollisionResponse.DontClimbStairs) { Stairs = null; }
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
LimbStairCollisionResponse handleLimbStairCollision()
|
||||
LimbStairCollisionResponse getStairCollisionResponse()
|
||||
{
|
||||
//don't collide with stairs if
|
||||
|
||||
//1. bottom of the collider is at the bottom of the stairs and the character isn't trying to move upwards
|
||||
float stairBottomPos = ConvertUnits.ToSimUnits(structure.Rect.Y - structure.Rect.Height + 10);
|
||||
if (colliderBottom.Y < stairBottomPos && targetMovement.Y < 0.5f) { return LimbStairCollisionResponse.DontClimbStairs; }
|
||||
if (character.SelectedBy != null &&
|
||||
character.SelectedBy.AnimController.GetColliderBottom().Y < stairBottomPos &&
|
||||
character.SelectedBy.AnimController.targetMovement.Y < 0.5f)
|
||||
{
|
||||
return LimbStairCollisionResponse.DontClimbStairs;
|
||||
}
|
||||
|
||||
//2. bottom of the collider is at the top of the stairs and the character isn't trying to move downwards
|
||||
if (targetMovement.Y >= 0.0f && colliderBottom.Y >= ConvertUnits.ToSimUnits(structure.Rect.Y - Submarine.GridSize.Y * 5)) { return LimbStairCollisionResponse.DontClimbStairs; }
|
||||
|
||||
@@ -904,7 +904,7 @@ namespace Barotrauma
|
||||
string indicatorLimbName = element.GetAttributeString("indicatorlimb", "Torso");
|
||||
if (!Enum.TryParse(indicatorLimbName, out IndicatorLimb))
|
||||
{
|
||||
DebugConsole.ThrowError("Error in affliction prefab " + Name + " - limb type \"" + indicatorLimbName + "\" not found.");
|
||||
DebugConsole.ThrowErrorLocalized("Error in affliction prefab " + Name + " - limb type \"" + indicatorLimbName + "\" not found.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -150,11 +150,11 @@ namespace Barotrauma
|
||||
if (itemElement.Attribute("name") != null)
|
||||
{
|
||||
string itemName = itemElement.Attribute("name").Value;
|
||||
DebugConsole.ThrowError("Error in Job config (" + Name + ") - use item identifiers instead of names to configure the items.");
|
||||
DebugConsole.ThrowErrorLocalized("Error in Job config (" + Name + ") - use item identifiers instead of names to configure the items.");
|
||||
itemPrefab = MapEntityPrefab.FindByName(itemName) as ItemPrefab;
|
||||
if (itemPrefab == null)
|
||||
{
|
||||
DebugConsole.ThrowError("Tried to spawn \"" + Name + "\" with the item \"" + itemName + "\". Matching item prefab not found.");
|
||||
DebugConsole.ThrowErrorLocalized("Tried to spawn \"" + Name + "\" with the item \"" + itemName + "\". Matching item prefab not found.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -164,7 +164,7 @@ namespace Barotrauma
|
||||
itemPrefab = MapEntityPrefab.FindByIdentifier(itemIdentifier.ToIdentifier()) as ItemPrefab;
|
||||
if (itemPrefab == null)
|
||||
{
|
||||
DebugConsole.ThrowError("Tried to spawn \"" + Name + "\" with the item \"" + itemIdentifier + "\". Matching item prefab not found.");
|
||||
DebugConsole.ThrowErrorLocalized("Tried to spawn \"" + Name + "\" with the item \"" + itemIdentifier + "\". Matching item prefab not found.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,14 @@ namespace Barotrauma
|
||||
public readonly Identifier Identifier;
|
||||
public readonly Identifier Option;
|
||||
public readonly float PriorityModifier;
|
||||
/// <summary>
|
||||
/// The order is ignored in outpost levels. Doesn't apply to outpost NPCs.
|
||||
/// </summary>
|
||||
public readonly bool IgnoreAtOutpost;
|
||||
/// <summary>
|
||||
/// The order is ignored in "normal" non-outpost levels
|
||||
/// </summary>
|
||||
public readonly bool IgnoreAtNonOutpost;
|
||||
|
||||
public AutonomousObjective(XElement element)
|
||||
{
|
||||
@@ -29,6 +36,7 @@ namespace Barotrauma
|
||||
PriorityModifier = element.GetAttributeFloat("prioritymodifier", 1);
|
||||
PriorityModifier = MathHelper.Max(PriorityModifier, 0);
|
||||
IgnoreAtOutpost = element.GetAttributeBool("ignoreatoutpost", false);
|
||||
IgnoreAtNonOutpost = element.GetAttributeBool("ignoreatnonoutpost", false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,14 +252,14 @@ namespace Barotrauma
|
||||
{
|
||||
if (itemElement.Element("name") != null)
|
||||
{
|
||||
DebugConsole.ThrowError("Error in job config \"" + Name + "\" - use identifiers instead of names to configure the items.");
|
||||
DebugConsole.ThrowErrorLocalized("Error in job config \"" + Name + "\" - use identifiers instead of names to configure the items.");
|
||||
continue;
|
||||
}
|
||||
|
||||
Identifier itemIdentifier = itemElement.GetAttributeIdentifier("identifier", Identifier.Empty);
|
||||
if (itemIdentifier.IsEmpty)
|
||||
{
|
||||
DebugConsole.ThrowError("Error in job config \"" + Name + "\" - item with no identifier.");
|
||||
DebugConsole.ThrowErrorLocalized("Error in job config \"" + Name + "\" - item with no identifier.");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
using System;
|
||||
using Barotrauma.Items.Components;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Barotrauma.Abilities
|
||||
{
|
||||
@@ -25,11 +24,15 @@ namespace Barotrauma.Abilities
|
||||
private readonly Identifier[] tags;
|
||||
private readonly WeaponType weapontype;
|
||||
private readonly bool ignoreNonHarmfulAttacks;
|
||||
|
||||
private readonly bool ignoreOwnAttacks;
|
||||
|
||||
public AbilityConditionAttackData(CharacterTalent characterTalent, ContentXElement conditionElement) : base(characterTalent, conditionElement)
|
||||
{
|
||||
itemIdentifier = conditionElement.GetAttributeString("itemidentifier", string.Empty);
|
||||
tags = conditionElement.GetAttributeIdentifierArray("tags", Array.Empty<Identifier>());
|
||||
ignoreNonHarmfulAttacks = conditionElement.GetAttributeBool("ignorenonharmfulattacks", false);
|
||||
itemIdentifier = conditionElement.GetAttributeString(nameof(itemIdentifier), string.Empty);
|
||||
tags = conditionElement.GetAttributeIdentifierArray(nameof(tags), Array.Empty<Identifier>());
|
||||
ignoreNonHarmfulAttacks = conditionElement.GetAttributeBool(nameof(ignoreNonHarmfulAttacks), false);
|
||||
ignoreOwnAttacks = conditionElement.GetAttributeBool(nameof(ignoreOwnAttacks), false);
|
||||
|
||||
string weaponTypeStr = conditionElement.GetAttributeString("weapontype", "Any");
|
||||
if (!Enum.TryParse(weaponTypeStr, ignoreCase: true, out weapontype))
|
||||
@@ -43,6 +46,8 @@ namespace Barotrauma.Abilities
|
||||
{
|
||||
if (abilityObject is AbilityAttackData attackData)
|
||||
{
|
||||
if (ignoreOwnAttacks && attackData.Attacker == character) { return false; }
|
||||
|
||||
if (ignoreNonHarmfulAttacks && attackData.SourceAttack != null)
|
||||
{
|
||||
if (attackData.SourceAttack.Stun <= 0.0f && (attackData.SourceAttack.Afflictions?.All(a => a.Key.Prefab.IsBuff) ?? true))
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
#nullable enable
|
||||
|
||||
namespace Barotrauma.Abilities
|
||||
{
|
||||
internal sealed class CharacterAbilityReplaceAffliction : CharacterAbility
|
||||
{
|
||||
private readonly Identifier afflictionId;
|
||||
private readonly Identifier newAfflictionId;
|
||||
private readonly float strengthMultiplier;
|
||||
|
||||
public CharacterAbilityReplaceAffliction(CharacterAbilityGroup characterAbilityGroup, ContentXElement abilityElement) : base(characterAbilityGroup, abilityElement)
|
||||
{
|
||||
afflictionId = abilityElement.GetAttributeIdentifier("afflictionid", abilityElement.GetAttributeIdentifier("affliction", Identifier.Empty));
|
||||
newAfflictionId = abilityElement.GetAttributeIdentifier("newafflictionid", abilityElement.GetAttributeIdentifier("newaffliction", Identifier.Empty));
|
||||
|
||||
strengthMultiplier = abilityElement.GetAttributeFloat("strengthmultiplier", 1.0f);
|
||||
|
||||
if (afflictionId.IsEmpty)
|
||||
{
|
||||
DebugConsole.ThrowError($"Error in {nameof(CharacterAbilityReplaceAffliction)} - affliction identifier not set.");
|
||||
}
|
||||
}
|
||||
|
||||
protected override void ApplyEffect()
|
||||
{
|
||||
var affliction = Character.CharacterHealth.GetAffliction(afflictionId);
|
||||
if (affliction != null)
|
||||
{
|
||||
float afflictionStrength = affliction.Strength;
|
||||
Limb limb = Character.CharacterHealth.GetAfflictionLimb(affliction);
|
||||
Character.CharacterHealth.ReduceAfflictionOnAllLimbs(affliction.Identifier, afflictionStrength);
|
||||
if (!newAfflictionId.IsEmpty && AfflictionPrefab.Prefabs.TryGet(newAfflictionId, out var newAfflictionPrefab))
|
||||
{
|
||||
Character.CharacterHealth.ApplyAffliction(targetLimb: limb, newAfflictionPrefab.Instantiate(afflictionStrength * strengthMultiplier));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void VerifyState(bool conditionsMatched, float timeSinceLastUpdate)
|
||||
{
|
||||
if (conditionsMatched)
|
||||
{
|
||||
ApplyEffect();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,13 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Barotrauma.Abilities
|
||||
{
|
||||
class CharacterAbilityGroupInterval : CharacterAbilityGroup
|
||||
{
|
||||
private float interval { get; set; }
|
||||
private readonly float interval;
|
||||
public float TimeSinceLastUpdate { get; private set; }
|
||||
|
||||
private float effectDelay;
|
||||
private readonly float effectDelay;
|
||||
private float effectDelayTimer;
|
||||
|
||||
|
||||
|
||||
@@ -2562,9 +2562,9 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
public static void ThrowError(LocalizedString error, Exception e = null, bool createMessageBox = false, bool appendStackTrace = false)
|
||||
public static void ThrowErrorLocalized(LocalizedString error, Exception e = null, ContentPackage contentPackage = null, bool createMessageBox = false, bool appendStackTrace = false)
|
||||
{
|
||||
ThrowError(error.Value, e, createMessageBox, appendStackTrace);
|
||||
ThrowError(error.Value, e, contentPackage, createMessageBox, appendStackTrace);
|
||||
}
|
||||
|
||||
public static void ThrowError(string error, Exception e = null, ContentPackage contentPackage = null, bool createMessageBox = false, bool appendStackTrace = false)
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
@@ -36,8 +33,7 @@ namespace Barotrauma
|
||||
public override void Update(float deltaTime)
|
||||
{
|
||||
if (isFinished) { return; }
|
||||
var afflictionPrefab = AfflictionPrefab.List.FirstOrDefault(p => p.Identifier == Affliction);
|
||||
if (afflictionPrefab != null)
|
||||
if (AfflictionPrefab.Prefabs.TryGet(Affliction, out var afflictionPrefab))
|
||||
{
|
||||
var targets = ParentEvent.GetTargets(TargetTag);
|
||||
foreach (var target in targets)
|
||||
|
||||
@@ -364,12 +364,12 @@ namespace Barotrauma
|
||||
|
||||
if (!Enum.TryParse(missionTypeName.Value, true, out Type))
|
||||
{
|
||||
DebugConsole.ThrowError("Error in mission prefab \"" + Name + "\" - \"" + missionTypeName + "\" is not a valid mission type.");
|
||||
DebugConsole.ThrowErrorLocalized("Error in mission prefab \"" + Name + "\" - \"" + missionTypeName + "\" is not a valid mission type.");
|
||||
return;
|
||||
}
|
||||
if (Type == MissionType.None)
|
||||
{
|
||||
DebugConsole.ThrowError("Error in mission prefab \"" + Name + "\" - mission type cannot be none.");
|
||||
DebugConsole.ThrowErrorLocalized("Error in mission prefab \"" + Name + "\" - mission type cannot be none.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -383,7 +383,7 @@ namespace Barotrauma
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugConsole.ThrowError("Error in mission prefab \"" + Name + "\" - unsupported mission type \"" + Type.ToString() + "\"");
|
||||
DebugConsole.ThrowErrorLocalized("Error in mission prefab \"" + Name + "\" - unsupported mission type \"" + Type.ToString() + "\"");
|
||||
}
|
||||
if (constructor == null)
|
||||
{
|
||||
|
||||
@@ -269,7 +269,7 @@ namespace Barotrauma
|
||||
{
|
||||
if (response.ErrorException != null)
|
||||
{
|
||||
DebugConsole.ThrowError(TextManager.GetWithVariable("MasterServerErrorException", "[error]", response.ErrorException.ToString()));
|
||||
DebugConsole.ThrowErrorLocalized(TextManager.GetWithVariable("MasterServerErrorException", "[error]", response.ErrorException.ToString()));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -278,13 +278,13 @@ namespace Barotrauma
|
||||
switch (response.StatusCode)
|
||||
{
|
||||
case HttpStatusCode.NotFound:
|
||||
DebugConsole.ThrowError(TextManager.GetWithVariable("MasterServerError404", "[masterserverurl]", consentServerUrl));
|
||||
DebugConsole.ThrowErrorLocalized(TextManager.GetWithVariable("MasterServerError404", "[masterserverurl]", consentServerUrl));
|
||||
break;
|
||||
case HttpStatusCode.ServiceUnavailable:
|
||||
DebugConsole.ThrowError(TextManager.Get("MasterServerErrorUnavailable"));
|
||||
DebugConsole.ThrowErrorLocalized(TextManager.Get("MasterServerErrorUnavailable"));
|
||||
break;
|
||||
default:
|
||||
DebugConsole.ThrowError(TextManager.GetWithVariables("MasterServerErrorDefault",
|
||||
DebugConsole.ThrowErrorLocalized(TextManager.GetWithVariables("MasterServerErrorDefault",
|
||||
("[statuscode]", response.StatusCode.ToString()),
|
||||
("[statusdescription]", response.StatusDescription)));
|
||||
break;
|
||||
|
||||
@@ -557,7 +557,7 @@ namespace Barotrauma
|
||||
|
||||
if (availableTransition == TransitionType.None)
|
||||
{
|
||||
DebugConsole.ThrowError("Failed to load a new campaign level. No available level transitions " +
|
||||
DebugConsole.ThrowErrorLocalized("Failed to load a new campaign level. No available level transitions " +
|
||||
"(current location: " + (map.CurrentLocation?.DisplayName ?? "null") + ", " +
|
||||
"selected location: " + (map.SelectedLocation?.DisplayName ?? "null") + ", " +
|
||||
"leaving sub: " + (leavingSub?.Info?.Name ?? "null") + ", " +
|
||||
@@ -568,7 +568,7 @@ namespace Barotrauma
|
||||
}
|
||||
if (nextLevel == null)
|
||||
{
|
||||
DebugConsole.ThrowError("Failed to load a new campaign level. No available level transitions " +
|
||||
DebugConsole.ThrowErrorLocalized("Failed to load a new campaign level. No available level transitions " +
|
||||
"(transition type: " + availableTransition + ", " +
|
||||
"current location: " + (map.CurrentLocation?.DisplayName ?? "null") + ", " +
|
||||
"selected location: " + (map.SelectedLocation?.DisplayName ?? "null") + ", " +
|
||||
|
||||
@@ -170,7 +170,7 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
if (recipe.RequiredItems.Length > inputContainer.Capacity)
|
||||
{
|
||||
DebugConsole.ThrowError("Error in item \"" + item.Name + "\": There's not enough room in the input inventory for the ingredients of \"" + recipe.TargetItem.Name + "\"!");
|
||||
DebugConsole.ThrowErrorLocalized("Error in item \"" + item.Name + "\": There's not enough room in the input inventory for the ingredients of \"" + recipe.TargetItem.Name + "\"!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@ namespace Barotrauma
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
DebugConsole.ThrowError("Deleting item assembly \"" + Name + "\" failed.", e);
|
||||
DebugConsole.ThrowErrorLocalized("Deleting item assembly \"" + Name + "\" failed.", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -570,9 +570,9 @@ namespace Barotrauma
|
||||
if (nameIdentifier.IsEmpty)
|
||||
{
|
||||
//backwards compatibility
|
||||
rawName = element.GetAttributeString("basename", "");
|
||||
nameIdentifier = rawName.ToIdentifier();
|
||||
DisplayName = element.GetAttributeString("name", "");
|
||||
rawName = element.GetAttributeString("rawname", element.GetAttributeString("basename", DisplayName.Value));
|
||||
nameIdentifier = rawName.ToIdentifier();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1088,12 +1088,12 @@ namespace Barotrauma
|
||||
{
|
||||
if (!Type.HasHireableCharacters)
|
||||
{
|
||||
DebugConsole.ThrowError("Cannot hire a character from location \"" + DisplayName + "\" - the location has no hireable characters.\n" + Environment.StackTrace.CleanupStackTrace());
|
||||
DebugConsole.ThrowErrorLocalized("Cannot hire a character from location \"" + DisplayName + "\" - the location has no hireable characters.\n" + Environment.StackTrace.CleanupStackTrace());
|
||||
return;
|
||||
}
|
||||
if (HireManager == null)
|
||||
{
|
||||
DebugConsole.ThrowError("Cannot hire a character from location \"" + DisplayName + "\" - hire manager has not been instantiated.\n" + Environment.StackTrace.CleanupStackTrace());
|
||||
DebugConsole.ThrowErrorLocalized("Cannot hire a character from location \"" + DisplayName + "\" - hire manager has not been instantiated.\n" + Environment.StackTrace.CleanupStackTrace());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -185,7 +185,7 @@ namespace Barotrauma
|
||||
if (subElement.GetAttribute("sourcerect") == null &&
|
||||
subElement.GetAttribute("sheetindex") == null)
|
||||
{
|
||||
DebugConsole.ThrowError("Warning - sprite sourcerect not configured for structure \"" + Name + "\"!");
|
||||
DebugConsole.ThrowErrorLocalized("Warning - sprite sourcerect not configured for structure \"" + Name + "\"!");
|
||||
}
|
||||
#if CLIENT
|
||||
if (subElement.GetAttributeBool("fliphorizontal", false))
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Barotrauma.Networking
|
||||
string permissionsStr = element.GetAttributeString("permissions", "");
|
||||
if (!Enum.TryParse(permissionsStr, out Permissions))
|
||||
{
|
||||
DebugConsole.ThrowError("Error in permission preset \"" + DisplayName + "\" - " + permissionsStr + " is not a valid permission!");
|
||||
DebugConsole.ThrowErrorLocalized("Error in permission preset \"" + DisplayName + "\" - " + permissionsStr + " is not a valid permission!");
|
||||
}
|
||||
|
||||
PermittedCommands = new HashSet<DebugConsole.Command>();
|
||||
@@ -66,7 +66,7 @@ namespace Barotrauma.Networking
|
||||
if (command == null)
|
||||
{
|
||||
#if SERVER
|
||||
DebugConsole.ThrowError("Error in permission preset \"" + DisplayName + "\" - " + commandName + "\" is not a valid console command.");
|
||||
DebugConsole.ThrowErrorLocalized("Error in permission preset \"" + DisplayName + "\" - " + commandName + "\" is not a valid console command.");
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
v1.2.7.0
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
- Fixed an issue that sometimes caused the game to crash without generating a crash report (which would lead to a "pipe was broken" error if the issue happened server-side). The issue had to do with a stack overflow when throwing specific kinds of console errors: one common case was when the game failed to connect to our server to check the GameAnalytics consent, which lead to a crash on startup.
|
||||
- Fixed piezo crystals sometimes spawning right at the start of the level.
|
||||
- Fixed assistants not being able to pick all tier 1 and 2 talents.
|
||||
- Fixed location names disappearing when locations change their type in saves started in pre-1.2 versions.
|
||||
- Fixed selection rectangle disappearing from items when zoomed in by more than x2 in the sub editor.
|
||||
- Fixed "killcrawlerswarmlarge2" mission not having a description.
|
||||
- Fixed bots sometimes choosing to wear broken diving suits.
|
||||
- Fixed currently visible particles freezing when lowering the particle limit.
|
||||
- Fixed dragged characters always colliding with stairs, making it impossible to drag them past the stairs.
|
||||
- Fixed "drunken sailor" talent not nullifying the negative effects of drunkenness.
|
||||
- Fixed stun from the "lightning wizard" talent activating if you cause damage to yourself (e.g. by breaking a wall and taking damage from the shrapnel).
|
||||
- Fixed escorted security officers sometimes inspecting the crew for stolen items during escort missions.
|
||||
- Fixed basics tutorial sometimes getting stuck in the "weld leak" objective.
|
||||
- Fixed ancient weapon not flipping horizontally when aiming it to the left.
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
v1.2.6.0
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user