v1.0.13.1 (first post-1.0 patch)

This commit is contained in:
Regalis11
2023-05-10 15:07:17 +03:00
parent 96fb49ba14
commit ee1db852b1
272 changed files with 5738 additions and 2413 deletions
@@ -1,4 +1,7 @@
#if CLIENT
using System;
using System.Collections.Immutable;
using System.Xml.Linq;
#if CLIENT
using Microsoft.Xna.Framework;
#endif
@@ -12,6 +15,11 @@ namespace Barotrauma
public LocalizedString Description { get; private set; }
/// <summary>
/// When set to false the AbilityEffects of multiple of the same talent will not be checked and only the first one.
/// </summary>
public bool AbilityEffectsStackWithSameTalent;
public readonly Sprite Icon;
#if CLIENT
@@ -20,6 +28,8 @@ namespace Barotrauma
public static readonly PrefabCollection<TalentPrefab> TalentPrefabs = new PrefabCollection<TalentPrefab>();
public readonly ImmutableHashSet<TalentMigration> Migrations;
public ContentXElement ConfigElement
{
get;
@@ -32,6 +42,8 @@ namespace Barotrauma
DisplayName = TextManager.Get($"talentname.{Identifier}").Fallback(Identifier.Value);
AbilityEffectsStackWithSameTalent = element.GetAttributeBool("abilityeffectsstackwithsametalent", true);
Identifier nameIdentifier = element.GetAttributeIdentifier("nameidentifier", Identifier.Empty);
if (!nameIdentifier.IsEmpty)
{
@@ -48,6 +60,8 @@ namespace Barotrauma
: Option<Color>.None();
#endif
var migrations = ImmutableHashSet.CreateBuilder<TalentMigration>();
foreach (var subElement in element.Elements())
{
switch (subElement.Name.ToString().ToLowerInvariant())
@@ -60,9 +74,25 @@ namespace Barotrauma
TextManager.ConstructDescription(ref tempDescription, subElement);
Description = tempDescription;
break;
case "migrations":
foreach (var migrationElement in subElement.Elements())
{
try
{
var migration = TalentMigration.FromXML(migrationElement);
migrations.Add(migration);
}
catch (Exception e)
{
DebugConsole.ThrowError($"Error while loading talent migration for talent \"{Identifier}\".", e);
}
}
break;
}
}
Migrations = migrations.ToImmutable();
if (element.GetAttribute("description") != null)
{
string description = element.GetAttributeString("description", string.Empty);