Merge remote-tracking branch 'upstream/master' into develop

This commit is contained in:
EvilFactory
2024-12-11 10:44:53 -03:00
257 changed files with 4793 additions and 1653 deletions
@@ -398,7 +398,7 @@ namespace Barotrauma
public readonly float MinValue;
/// <summary>
/// Minimum value to apply
/// Maximum value to apply
/// </summary>
public readonly float MaxValue;
@@ -764,6 +764,12 @@ namespace Barotrauma
/// </summary>
public readonly float TreatmentThreshold;
/// <summary>
/// How strong the affliction needs to be for treatment suggestions to be shown in the health interface.
/// Defaults to <see cref="TreatmentThreshold"/>.
/// </summary>
public readonly float TreatmentSuggestionThreshold;
/// <summary>
/// Bots will not try to treat the affliction if the character has any of these afflictions
/// </summary>
@@ -941,6 +947,7 @@ namespace Barotrauma
ShowInHealthScannerThreshold = element.GetAttributeFloat(nameof(ShowInHealthScannerThreshold),
Math.Max(ActivationThreshold, AfflictionType == "talentbuff" ? float.MaxValue : ShowIconToOthersThreshold));
TreatmentThreshold = element.GetAttributeFloat(nameof(TreatmentThreshold), Math.Max(ActivationThreshold, 10.0f));
TreatmentSuggestionThreshold = element.GetAttributeFloat(nameof(TreatmentSuggestionThreshold), TreatmentThreshold);
DamageOverlayAlpha = element.GetAttributeFloat(nameof(DamageOverlayAlpha), 0.0f);
BurnOverlayAlpha = element.GetAttributeFloat(nameof(BurnOverlayAlpha), 0.0f);
@@ -1198,7 +1198,11 @@ namespace Barotrauma
/// </summary>
/// <param name="treatmentSuitability">A dictionary where the key is the identifier of the item and the value the suitability</param>
/// <param name="predictFutureDuration">If above 0, the method will take into account how much currently active status effects while affect the afflictions in the next x seconds.</param>
public void GetSuitableTreatments(Dictionary<Identifier, float> treatmentSuitability, Character user, Limb limb = null, bool ignoreHiddenAfflictions = false, float predictFutureDuration = 0.0f)
/// <param name="checkTreatmentThreshold">Should the method check whether the afflictions are above <see cref="AfflictionPrefab.TreatmentThreshold"/> (whether they're severe enough for AI to treat)?</param>
/// <param name="checkTreatmentSuggestionThreshold">Should the method check whether the afflictions are above <see cref="AfflictionPrefab.TreatmentSuggestionThreshold"/> (whether treatment suggestions are shown in the health interface)?</param>
public void GetSuitableTreatments(Dictionary<Identifier, float> treatmentSuitability, Character user, Limb limb = null, bool ignoreHiddenAfflictions = false,
bool checkTreatmentThreshold = true, bool checkTreatmentSuggestionThreshold = true,
float predictFutureDuration = 0.0f)
{
//key = item identifier
//float = suitability
@@ -1249,7 +1253,14 @@ namespace Barotrauma
//if this a suitable treatment, ignore it if the affliction isn't severe enough to treat
//if the suitability is negative though, we need to take it into account!
//otherwise we may end up e.g. giving too much opiates to someone already close to overdosing
if (totalAfflictionStrength < affliction.Prefab.TreatmentThreshold) { continue; }
if (checkTreatmentThreshold)
{
if (totalAfflictionStrength < affliction.Prefab.TreatmentThreshold) { continue; }
}
if (checkTreatmentSuggestionThreshold)
{
if (totalAfflictionStrength < affliction.Prefab.TreatmentSuggestionThreshold) { continue; }
}
}
if (treatment.Value > strength)
{