Unstable 0.14.5.0

This commit is contained in:
Markus Isberg
2021-06-14 17:53:42 +03:00
parent 1f3e588fcd
commit 23a7c37eee
25 changed files with 254 additions and 259 deletions
@@ -752,8 +752,9 @@ namespace Barotrauma
float radialDistortStrength = 0.0f;
float chromaticAberrationStrength = 0.0f;
float grainStrength = 0.0f;
Color grainColor = Color.White;
Color grainColor = Color.Transparent;
float oxygenLowStrength = 0.0f;
if (Character.IsUnconscious)
{
blurStrength = 1.0f;
@@ -761,14 +762,13 @@ namespace Barotrauma
}
else if (OxygenAmount < 100.0f)
{
// TODO disable some of these?
blurStrength = MathHelper.Lerp(0.5f, 1.0f, 1.0f - Vitality / MaxVitality);
distortStrength = blurStrength;
distortSpeed = (blurStrength + 1.0f);
oxygenLowStrength = Math.Min(1.0f - (OxygenAmount - LowOxygenThreshold) / LowOxygenThreshold, 1.0f);
blurStrength = MathHelper.Lerp(0.5f, 1.0f, 1.0f - Vitality / MaxVitality) * oxygenLowStrength;
distortStrength = blurStrength * oxygenLowStrength;
distortSpeed = blurStrength + 1.0f;
distortSpeed *= distortSpeed * distortSpeed * distortSpeed;
grainStrength = MathHelper.Lerp(0.5f, 10.0f, 1.0f - (OxygenAmount - LowOxygenThreshold) / LowOxygenThreshold);
grainStrength = MathHelper.Lerp(0.5f, 10.0f, oxygenLowStrength);
grainColor = oxygenLowGrainColor;
}
@@ -778,7 +778,12 @@ namespace Barotrauma
blurStrength = Math.Max(blurStrength, affliction.GetScreenBlurStrength());
radialDistortStrength = Math.Max(radialDistortStrength, affliction.GetRadialDistortStrength());
chromaticAberrationStrength = Math.Max(chromaticAberrationStrength, affliction.GetChromaticAberrationStrength());
grainStrength = Math.Max(grainStrength, affliction.GetScreenGrainStrength());
float afflictionGrainStrength = affliction.GetScreenGrainStrength();
if (afflictionGrainStrength > 0.0f)
{
grainStrength = Math.Max(grainStrength, affliction.GetScreenGrainStrength());
grainColor = Color.Lerp(grainColor, Color.White, (float)Math.Pow(1.0f - oxygenLowStrength, 2));
}
}
foreach (LimbHealth limbHealth in limbHealths)
{
@@ -822,7 +822,7 @@ namespace Barotrauma
{
parent.Content.ClearChildren();
currentUpgradeCategory = category;
var entitiesOnSub = submarine.GetItems(true).Where(i => submarine.IsEntityFoundOnThisSub(i, true) && !i.HiddenInGame && i.AllowSwapping && category.ItemTags.Any(t => i.HasTag(t))).ToList();
var entitiesOnSub = submarine.GetItems(true).Where(i => submarine.IsEntityFoundOnThisSub(i, true) && !i.HiddenInGame && i.AllowSwapping && i.Prefab.SwappableItem != null && category.ItemTags.Any(t => i.HasTag(t))).ToList();
int slotIndex = 0;
foreach (Item item in entitiesOnSub)
@@ -872,7 +872,7 @@ namespace Barotrauma
{
bool canUninstall = item.PendingItemSwap != null || !string.IsNullOrEmpty(currentOrPending.SwappableItem?.ReplacementOnUninstall);
bool isUninstallPending = item.PendingItemSwap?.Identifier == item.Prefab.SwappableItem.ReplacementOnUninstall;
bool isUninstallPending = item.Prefab.SwappableItem != null && item.PendingItemSwap?.Identifier == item.Prefab.SwappableItem.ReplacementOnUninstall;
if (isUninstallPending) { canUninstall = false; }
frames.Add(CreateUpgradeEntry(rectT(1f, 0.25f, parent.Content), currentOrPending.UpgradePreviewSprite,
@@ -297,11 +297,11 @@ namespace Barotrauma
SlotSize = !isFourByThree ? (SlotSpriteSmall.size * UIScale).ToPoint() : (SlotSpriteSmall.size * UIScale * .925f).ToPoint();
int bottomOffset = SlotSize.Y + Spacing * 2 + ContainedIndicatorHeight;
hideButton.Visible = false;
if (visualSlots == null) { CreateSlots(); }
if (visualSlots.None()) { return; }
hideButton.Visible = false;
switch (layout)
{
case Layout.Default:
@@ -1103,6 +1103,7 @@ namespace Barotrauma
public void DrawOwn(SpriteBatch spriteBatch)
{
if (!AccessibleWhenAlive && !character.IsDead) { return; }
if (capacity == 0) { return; }
if (visualSlots == null) { CreateSlots(); }
if (GameMain.GraphicsWidth != screenResolution.X ||
GameMain.GraphicsHeight != screenResolution.Y ||
@@ -421,21 +421,32 @@ namespace Barotrauma.Particles
private void ApplyDrag(float dragCoefficient, float deltaTime)
{
Vector2 relativeVel = velocity;
if (currentHull?.Submarine != null)
{
relativeVel = velocity - ConvertUnits.ToDisplayUnits(currentHull.Submarine.Velocity);
}
float speed = velocity.Length();
velocity /= speed;
float speed = relativeVel.Length();
relativeVel /= speed;
float drag = speed * speed * dragCoefficient * 0.01f * deltaTime;
if (drag > speed)
{
velocity = Vector2.Zero;
relativeVel = Vector2.Zero;
}
else
{
speed -= drag;
velocity *= speed;
relativeVel *= speed;
}
velocity = relativeVel;
if (currentHull?.Submarine != null)
{
velocity += ConvertUnits.ToDisplayUnits(currentHull.Submarine.Velocity);
}
}
@@ -607,7 +607,8 @@ namespace Barotrauma
missionList.UpdateScrollBarSize();
}
}
UpdateMaxMissions(connection.OtherLocation(currentDisplayLocation));
var destination = connection.OtherLocation(currentDisplayLocation);
UpdateMaxMissions(destination);
var buttonArea = new GUILayoutGroup(new RectTransform(new Vector2(1.0f, 0.05f), content.RectTransform), isHorizontal: true);
@@ -615,7 +616,7 @@ namespace Barotrauma
{
TextGetter = () =>
{
return TextManager.AddPunctuation(':', TextManager.Get("Missions"), $"{Campaign.NumberOfMissionsAtLocation(Campaign.GetCurrentDisplayLocation())}/{Campaign.Settings.MaxMissionCount}");
return TextManager.AddPunctuation(':', TextManager.Get("Missions"), $"{Campaign.NumberOfMissionsAtLocation(destination)}/{Campaign.Settings.MaxMissionCount}");
}
};