Build 0.18.13.0

This commit is contained in:
Markus Isberg
2022-07-01 12:16:36 +09:00
parent 8e6c601162
commit 497045de7e
79 changed files with 717 additions and 361 deletions
@@ -405,13 +405,13 @@ namespace Barotrauma.Items.Components
float newVolume;
try
{
newVolume = Math.Min(property.GetFloatValue(this), 1.0f);
newVolume = property.GetFloatValue(this);
}
catch
{
return 0.0f;
}
newVolume *= sound.VolumeMultiplier;
newVolume = Math.Min(newVolume * sound.VolumeMultiplier, 1.0f);
if (!MathUtils.IsValid(newVolume))
{
@@ -89,7 +89,8 @@ namespace Barotrauma.Items.Components
if (Light?.LightSprite != null && item.Prefab.CanSpriteFlipX && item.body == null)
{
Light.LightSpriteEffect = Light.LightSpriteEffect == SpriteEffects.None ?
SpriteEffects.FlipHorizontally : SpriteEffects.None;
SpriteEffects.FlipHorizontally : SpriteEffects.None;
SetLightSourceTransformProjSpecific();
}
}
@@ -985,7 +985,8 @@ namespace Barotrauma.Items.Components
missionIndex++;
}
if (AllowUsingMineralScanner && useMineralScanner && CurrentMode == Mode.Active && MineralClusters != null)
if (AllowUsingMineralScanner && useMineralScanner && CurrentMode == Mode.Active && MineralClusters != null &&
(item.CurrentHull == null || !DetectSubmarineWalls))
{
foreach (var c in MineralClusters)
{
@@ -1,11 +1,9 @@
using Barotrauma.Networking;
using Barotrauma.Particles;
using FarseerPhysics;
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
namespace Barotrauma.Items.Components
{
@@ -10,22 +10,18 @@ namespace Barotrauma.Items.Components
{
int roundedValue = (int)Math.Round((1 - damageModifier.DamageMultiplier * damageModifier.ProbabilityMultiplier) * 100);
if (roundedValue == 0) { return; }
string colorStr = XMLExtensions.ColorToString(GUIStyle.Green);
string colorStr = XMLExtensions.ToStringHex(GUIStyle.Green);
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}";
if (!description.IsNullOrWhiteSpace()) { description += '\n'; }
description += $" ‖color:{colorStr}‖{roundedValue.ToString("-0;+#")}%‖color:end‖ {afflictionName}";
}
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())
{
description += "\n";
}
if (damageModifiers.Any())
{
foreach (DamageModifier damageModifier in damageModifiers)
@@ -49,10 +45,11 @@ namespace Barotrauma.Items.Components
{
foreach (var skillModifier in SkillModifiers)
{
string colorStr = XMLExtensions.ColorToString(GUIStyle.Green);
string colorStr = XMLExtensions.ToStringHex(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}").Fallback(skillModifier.Key.Value)}";
if (!description.IsNullOrWhiteSpace()) { description += '\n'; }
description += $" ‖color:{colorStr}‖{roundedValue.ToString("+0;-#")}‖color:end‖ {TextManager.Get($"SkillName.{skillModifier.Key}").Fallback(skillModifier.Key.Value)}";
}
}
}