Release 1.11.4.1 (Winter Update)
This commit is contained in:
@@ -85,6 +85,8 @@ namespace Barotrauma
|
||||
|
||||
public double AppliedAsSuccessfulTreatmentTime, AppliedAsFailedTreatmentTime;
|
||||
|
||||
public bool AffectedByAttackMultipliers => Prefab.AffectedByAttackMultipliers;
|
||||
|
||||
public float Duration;
|
||||
|
||||
/// <summary>
|
||||
|
||||
+9
-6
@@ -164,15 +164,18 @@ namespace Barotrauma
|
||||
}
|
||||
break;
|
||||
case InfectionState.Transition:
|
||||
if (character == Character.Controlled)
|
||||
if (Prefab is AfflictionPrefabHusk { CauseSpeechImpediment: true })
|
||||
{
|
||||
if (character == Character.Controlled)
|
||||
{
|
||||
#if CLIENT
|
||||
GUI.AddMessage(TextManager.Get("HuskCantSpeak"), GUIStyle.Red);
|
||||
GUI.AddMessage(TextManager.Get("HuskCantSpeak"), GUIStyle.Red);
|
||||
#endif
|
||||
}
|
||||
else if (character.IsBot)
|
||||
{
|
||||
character.Speak(TextManager.Get("dialoghuskcantspeak").Value, delay: Rand.Range(0.5f, 5.0f), identifier: "huskcantspeak".ToIdentifier());
|
||||
}
|
||||
else if (character.IsBot)
|
||||
{
|
||||
character.Speak(TextManager.Get("dialoghuskcantspeak").Value, delay: Rand.Range(0.5f, 5.0f), identifier: "huskcantspeak".ToIdentifier());
|
||||
}
|
||||
}
|
||||
break;
|
||||
case InfectionState.Active:
|
||||
|
||||
+26
-5
@@ -699,7 +699,13 @@ namespace Barotrauma
|
||||
/// and the health UI will render the affected limb in green rather than red.
|
||||
/// </summary>
|
||||
public readonly bool IsBuff;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Should the affliction be affected by damage multipliers on an attack (e.g. when the attacker has talents that boost damage).
|
||||
/// By default, afflictions defined as buffs aren't affected.
|
||||
/// </summary>
|
||||
public readonly bool AffectedByAttackMultipliers;
|
||||
|
||||
/// <summary>
|
||||
/// If set to true, this affliction can affect characters that are marked as
|
||||
/// machines, such as the Fractal Guardian.
|
||||
@@ -780,6 +786,14 @@ namespace Barotrauma
|
||||
/// </summary>
|
||||
public readonly float TreatmentSuggestionThreshold;
|
||||
|
||||
/// <summary>
|
||||
/// Does the affliction need to have caused some amount of vitality loss for bots to consider treating it?
|
||||
/// Normally bots use vitality loss as a way to determine what kind of injuries need treatment, but some afflictions (e.g. poisons, infections)
|
||||
/// might require treatment regardless of the vitality loss. If disabled, the bots will use the strength of the affliction to evaluate the severity instead of the vitality loss.
|
||||
/// Defaults to true for all afflictions that aren't of the type Paralysis, Poison or HuskInfection.
|
||||
/// </summary>
|
||||
public readonly bool VitalityLossRequiredForTreatment;
|
||||
|
||||
/// <summary>
|
||||
/// Bots will not try to treat the affliction if the character has any of these afflictions
|
||||
/// </summary>
|
||||
@@ -838,14 +852,15 @@ namespace Barotrauma
|
||||
public readonly bool DamageParticles;
|
||||
|
||||
/// <summary>
|
||||
/// An arbitrary modifier that affects how much medical skill is increased when you apply the affliction on a target.
|
||||
/// If the affliction causes damage or is of the 'poison' or 'paralysis' type, the skill is increased only when the target is hostile.
|
||||
/// If the affliction is of the 'buff' type, the skill is increased only when the target is friendly.
|
||||
/// A modifier that affects how much medical skill is increased when you apply this affliction on a target.
|
||||
/// If the affliction causes damage or is of the 'poison' or 'paralysis' type, the skill is increased only when the target is hostile, and the modifier is multiplied by the amount of vitality the enemy lost.
|
||||
/// If the affliction is of the 'buff' type, the skill is increased only when the target is friendly, and the modifier is multiplied by the strength of the affliction the target gained.
|
||||
/// </summary>
|
||||
public readonly float MedicalSkillGain;
|
||||
|
||||
/// <summary>
|
||||
/// An arbitrary modifier that affects how much weapons skill is increased when you apply the affliction on a target.
|
||||
/// A modifier that affects how much weapons skill is increased when you apply the affliction on a target.
|
||||
/// Multiplied by the amount of vitality the enemy lost.
|
||||
/// The skill is increased only when the target is hostile.
|
||||
/// </summary>
|
||||
public readonly float WeaponsSkillGain;
|
||||
@@ -925,6 +940,7 @@ namespace Barotrauma
|
||||
ShowDescriptionInTooltip = element.GetAttributeBool(nameof(ShowDescriptionInTooltip), true);
|
||||
|
||||
IsBuff = element.GetAttributeBool(nameof(IsBuff), false);
|
||||
AffectedByAttackMultipliers = element.GetAttributeBool(nameof(AffectedByAttackMultipliers), def: !IsBuff);
|
||||
AffectMachines = element.GetAttributeBool(nameof(AffectMachines), true);
|
||||
|
||||
ShowBarInHealthMenu = element.GetAttributeBool("showbarinhealthmenu", true);
|
||||
@@ -977,6 +993,11 @@ namespace Barotrauma
|
||||
TreatmentThreshold = element.GetAttributeFloat(nameof(TreatmentThreshold), Math.Max(ActivationThreshold, 10.0f));
|
||||
TreatmentSuggestionThreshold = element.GetAttributeFloat(nameof(TreatmentSuggestionThreshold), TreatmentThreshold);
|
||||
|
||||
bool alwaysRequiresTreatment = AfflictionType == ParalysisType || AfflictionType == PoisonType || this is AfflictionPrefabHusk;
|
||||
|
||||
VitalityLossRequiredForTreatment = element.GetAttributeBool(nameof(VitalityLossRequiredForTreatment),
|
||||
def: !alwaysRequiresTreatment);
|
||||
|
||||
DamageOverlayAlpha = element.GetAttributeFloat(nameof(DamageOverlayAlpha), 0.0f);
|
||||
BurnOverlayAlpha = element.GetAttributeFloat(nameof(BurnOverlayAlpha), 0.0f);
|
||||
|
||||
|
||||
@@ -304,6 +304,19 @@ namespace Barotrauma
|
||||
InitProjSpecific(element, character);
|
||||
}
|
||||
|
||||
public void CheckForErrors()
|
||||
{
|
||||
for (int i = 0; i < limbHealths.Count; i++)
|
||||
{
|
||||
if (Character.AnimController.Limbs.None(l => l.HealthIndex == i))
|
||||
{
|
||||
DebugConsole.AddWarning(
|
||||
$"Potential error in character {Character.DisplayName}: none of the limbs have been set to use the LimbHealth #{i}, and it will do nothing. "
|
||||
+ "Did you forget to set the HealthIndex values of the limbs?", contentPackage: Character.ContentPackage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void InitIrremovableAfflictions()
|
||||
{
|
||||
irremovableAfflictions.Add(bloodlossAffliction = new Affliction(AfflictionPrefab.Bloodloss, 0.0f));
|
||||
@@ -1118,20 +1131,38 @@ namespace Barotrauma
|
||||
|
||||
// We need to use another list of the afflictions when we call the status effects triggered by afflictions,
|
||||
// because those status effects may add or remove other afflictions while iterating the collection.
|
||||
private readonly List<Affliction> afflictionsCopy = new List<Affliction>();
|
||||
private readonly List<Affliction> afflictionsCopy = [];
|
||||
|
||||
private bool isApplyingAfflictionStatusEffects;
|
||||
public void ApplyAfflictionStatusEffects(ActionType type)
|
||||
{
|
||||
afflictionsCopy.Clear();
|
||||
afflictionsCopy.AddRange(afflictions.Keys);
|
||||
foreach (Affliction affliction in afflictionsCopy)
|
||||
if (isApplyingAfflictionStatusEffects)
|
||||
{
|
||||
affliction.ApplyStatusEffects(type, 1.0f, this, targetLimb: GetAfflictionLimb(affliction));
|
||||
//pretty hacky: if we're already in the process of applying afflictions' status effects
|
||||
//(i.e. calling this method caused some additional afflictions to appear and trigger status effects)
|
||||
//let's instantiate a new list so we don't end up modifying afflictionsCopy while enumerating it
|
||||
foreach (Affliction affliction in afflictions.Keys.ToList())
|
||||
{
|
||||
affliction.ApplyStatusEffects(type, 1.0f, this, targetLimb: GetAfflictionLimb(affliction));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
isApplyingAfflictionStatusEffects = true;
|
||||
afflictionsCopy.Clear();
|
||||
afflictionsCopy.AddRange(afflictions.Keys);
|
||||
isApplyingAfflictionStatusEffects = true;
|
||||
foreach (Affliction affliction in afflictionsCopy)
|
||||
{
|
||||
affliction.ApplyStatusEffects(type, 1.0f, this, targetLimb: GetAfflictionLimb(affliction));
|
||||
}
|
||||
isApplyingAfflictionStatusEffects = false;
|
||||
}
|
||||
}
|
||||
|
||||
public (CauseOfDeathType type, Affliction affliction) GetCauseOfDeath()
|
||||
{
|
||||
List<Affliction> currentAfflictions = GetAllAfflictions(true);
|
||||
IEnumerable<Affliction> currentAfflictions = GetAllAfflictions(true);
|
||||
|
||||
Affliction strongestAffliction = null;
|
||||
float largestStrength = 0.0f;
|
||||
@@ -1154,7 +1185,7 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
private readonly List<Affliction> allAfflictions = new List<Affliction>();
|
||||
private List<Affliction> GetAllAfflictions(bool mergeSameAfflictions, Func<Affliction, bool> predicate = null)
|
||||
private IEnumerable<Affliction> GetAllAfflictions(bool mergeSameAfflictions, Func<Affliction, bool> predicate = null)
|
||||
{
|
||||
allAfflictions.Clear();
|
||||
if (!mergeSameAfflictions)
|
||||
|
||||
Reference in New Issue
Block a user