From 7d6867996cf6b9ee7de7060a052ed09de0c275de Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Sun, 24 Mar 2019 13:50:36 +0200 Subject: [PATCH] ece6ead...7b471b5 commit 7b471b565d49a165ef54357fe6d165bf5df6522b Author: Joonas Rikkonen Date: Sun Mar 24 13:49:53 2019 +0200 Don't apply smoothing to client cursor positions server-side commit f6a67ca31e98a353bde591789bb42a2f84d1bcc1 Author: Joonas Rikkonen Date: Sat Mar 23 22:29:01 2019 +0200 Nuclear shells and nuclear depth charges are removed after they've exploded. Closes #1316 commit 2d7b7b9643d3640f784ba5ab8e84caf55abad6b9 Author: Joonas Rikkonen Date: Sat Mar 23 22:28:26 2019 +0200 Option to configure when afflictions become visible with the health scanner. Closes #1310 --- Barotrauma/BarotraumaClient/Source/DebugConsole.cs | 2 -- .../BarotraumaClient/Source/Items/Components/StatusHUD.cs | 2 +- .../Source/Characters/AI/EnemyAIController.cs | 7 +------ Barotrauma/BarotraumaShared/Source/Characters/Character.cs | 6 ++++-- .../Characters/Health/Afflictions/AfflictionPrefab.cs | 7 ++++++- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Barotrauma/BarotraumaClient/Source/DebugConsole.cs b/Barotrauma/BarotraumaClient/Source/DebugConsole.cs index b993f7deb..b8c7f8fee 100644 --- a/Barotrauma/BarotraumaClient/Source/DebugConsole.cs +++ b/Barotrauma/BarotraumaClient/Source/DebugConsole.cs @@ -962,8 +962,6 @@ namespace Barotrauma } } } - element.Value = lines[i]; - i++; } }, isCheat: false)); #endif diff --git a/Barotrauma/BarotraumaClient/Source/Items/Components/StatusHUD.cs b/Barotrauma/BarotraumaClient/Source/Items/Components/StatusHUD.cs index 8b6b5ea03..b56dd8629 100644 --- a/Barotrauma/BarotraumaClient/Source/Items/Components/StatusHUD.cs +++ b/Barotrauma/BarotraumaClient/Source/Items/Components/StatusHUD.cs @@ -181,7 +181,7 @@ namespace Barotrauma.Items.Components Dictionary combinedAfflictionStrengths = new Dictionary(); foreach (Affliction affliction in allAfflictions) { - if (affliction.Strength < affliction.Prefab.ActivationThreshold || affliction.Strength <= 0.0f) continue; + if (affliction.Strength < affliction.Prefab.ShowInHealthScannerThreshold || affliction.Strength <= 0.0f) continue; if (combinedAfflictionStrengths.ContainsKey(affliction.Prefab)) { combinedAfflictionStrengths[affliction.Prefab] += affliction.Strength; diff --git a/Barotrauma/BarotraumaShared/Source/Characters/AI/EnemyAIController.cs b/Barotrauma/BarotraumaShared/Source/Characters/AI/EnemyAIController.cs index f085e6b07..19904cd90 100644 --- a/Barotrauma/BarotraumaShared/Source/Characters/AI/EnemyAIController.cs +++ b/Barotrauma/BarotraumaShared/Source/Characters/AI/EnemyAIController.cs @@ -940,7 +940,7 @@ namespace Barotrauma string targetingTag = null; if (targetCharacter != null) { - if (targetCharacter.Submarine != null && Character.Submarine == null) + if (targetCharacter.IsDead) { targetingTag = "dead"; if (targetCharacter.Submarine != Character.Submarine) @@ -1042,11 +1042,6 @@ namespace Barotrauma valueModifier *= targetingPriorities[targetingTag].Priority; - if (targetingTag == null) continue; - if (!targetingPriorities.ContainsKey(targetingTag)) continue; - - valueModifier *= targetingPriorities[targetingTag].Priority; - if (valueModifier == 0.0f) continue; Vector2 toTarget = target.WorldPosition - character.WorldPosition; diff --git a/Barotrauma/BarotraumaShared/Source/Characters/Character.cs b/Barotrauma/BarotraumaShared/Source/Characters/Character.cs index cb053d161..f1d72e0b4 100644 --- a/Barotrauma/BarotraumaShared/Source/Characters/Character.cs +++ b/Barotrauma/BarotraumaShared/Source/Characters/Character.cs @@ -1110,13 +1110,15 @@ namespace Barotrauma ViewTarget = null; if (!AllowInput) return; - Vector2 smoothedCursorDiff = cursorPosition - SmoothedCursorPosition; - if (Controlled == this) + if (Controlled == this || (GameMain.NetworkMember != null && GameMain.NetworkMember.IsServer)) { SmoothedCursorPosition = cursorPosition; } else { + //apply some smoothing to the cursor positions of remote players when playing as a client + //to make aiming look a little less choppy + Vector2 smoothedCursorDiff = cursorPosition - SmoothedCursorPosition; smoothedCursorDiff = NetConfig.InterpolateCursorPositionError(smoothedCursorDiff); SmoothedCursorPosition = cursorPosition - smoothedCursorDiff; } diff --git a/Barotrauma/BarotraumaShared/Source/Characters/Health/Afflictions/AfflictionPrefab.cs b/Barotrauma/BarotraumaShared/Source/Characters/Health/Afflictions/AfflictionPrefab.cs index aea153f53..708e62bee 100644 --- a/Barotrauma/BarotraumaShared/Source/Characters/Health/Afflictions/AfflictionPrefab.cs +++ b/Barotrauma/BarotraumaShared/Source/Characters/Health/Afflictions/AfflictionPrefab.cs @@ -153,7 +153,10 @@ namespace Barotrauma //how high the strength has to be for the affliction icon to be shown in the UI public readonly float ShowIconThreshold = 0.05f; public readonly float MaxStrength = 100.0f; - + + //how high the strength has to be for the affliction icon to be shown with a health scanner + public readonly float ShowInHealthScannerThreshold = 0.05f; + public float BurnOverlayAlpha; public float DamageOverlayAlpha; @@ -257,6 +260,8 @@ namespace Barotrauma ShowIconThreshold = element.GetAttributeFloat("showiconthreshold", Math.Max(ActivationThreshold, 0.05f)); MaxStrength = element.GetAttributeFloat("maxstrength", 100.0f); + ShowInHealthScannerThreshold = element.GetAttributeFloat("showinhealthscannerthreshold", Math.Max(ActivationThreshold, 0.05f)); + DamageOverlayAlpha = element.GetAttributeFloat("damageoverlayalpha", 0.0f); BurnOverlayAlpha = element.GetAttributeFloat("burnoverlayalpha", 0.0f);