Unstable 0.17.0.0

This commit is contained in:
Markus Isberg
2022-02-26 02:43:01 +09:00
parent a83f375681
commit 3974067915
913 changed files with 32472 additions and 32364 deletions
@@ -1,25 +1,25 @@
using System;
using System.Linq;
using Barotrauma.Networking;
namespace Barotrauma.Items.Components
{
partial class Wearable
partial class Wearable : Pickable, IServerSerializable
{
private void GetDamageModifierText(ref string description, DamageModifier damageModifier, string afflictionIdentifier)
private void GetDamageModifierText(ref LocalizedString description, DamageModifier damageModifier, Identifier afflictionIdentifier)
{
int roundedValue = (int)Math.Round((1 - damageModifier.DamageMultiplier * damageModifier.ProbabilityMultiplier) * 100);
if (roundedValue == 0) { return; }
string colorStr = XMLExtensions.ColorToString(GUI.Style.Green);
string colorStr = XMLExtensions.ColorToString(GUIStyle.Green);
string afflictionName =
AfflictionPrefab.List.FirstOrDefault(ap => ap.Identifier.Equals(afflictionIdentifier, StringComparison.OrdinalIgnoreCase))?.Name ??
TextManager.Get($"afflictiontype.{afflictionIdentifier}", returnNull: true) ??
afflictionIdentifier;
LocalizedString afflictionName =
AfflictionPrefab.List.FirstOrDefault(ap => ap.Identifier == afflictionIdentifier)?.Name ??
TextManager.Get($"afflictiontype.{afflictionIdentifier}").Fallback(afflictionIdentifier.Value);
description += $"\n ‖color:{colorStr}‖{roundedValue.ToString("-0;+#")}%‖color:end‖ {afflictionName}";
}
public override void AddTooltipInfo(ref string name, ref string description)
public override void AddTooltipInfo(ref LocalizedString name, ref LocalizedString description)
{
if (damageModifiers.Any(d => !MathUtils.NearlyEqual(d.DamageMultiplier, 1f) || !MathUtils.NearlyEqual(d.ProbabilityMultiplier, 1f)) || SkillModifiers.Any())
{
@@ -35,11 +35,11 @@ namespace Barotrauma.Items.Components
continue;
}
foreach (string afflictionIdentifier in damageModifier.ParsedAfflictionIdentifiers)
foreach (Identifier afflictionIdentifier in damageModifier.ParsedAfflictionIdentifiers)
{
GetDamageModifierText(ref description, damageModifier, afflictionIdentifier);
}
foreach (string afflictionType in damageModifier.ParsedAfflictionTypes)
foreach (Identifier afflictionType in damageModifier.ParsedAfflictionTypes)
{
GetDamageModifierText(ref description, damageModifier, afflictionType);
}
@@ -49,10 +49,10 @@ namespace Barotrauma.Items.Components
{
foreach (var skillModifier in SkillModifiers)
{
string colorStr = XMLExtensions.ColorToString(GUI.Style.Green);
string colorStr = XMLExtensions.ColorToString(GUIStyle.Green);
int roundedValue = (int)Math.Round(skillModifier.Value);
if (roundedValue == 0) { continue; }
description += $"\n ‖color:{colorStr}‖{roundedValue.ToString("+0;-#")}‖color:end‖ {TextManager.Get("SkillName." + skillModifier.Key, true) ?? skillModifier.Key}";
description += $"\n ‖color:{colorStr}‖{roundedValue.ToString("+0;-#")}‖color:end‖ {TextManager.Get($"SkillName.{skillModifier.Key}").Fallback(skillModifier.Key.Value)}";
}
}
}