(3dc4135ce) v0.9.5.1

This commit is contained in:
Regalis
2019-11-21 18:22:25 +01:00
parent b39922a074
commit 5c95c53118
287 changed files with 12655 additions and 5048 deletions
@@ -250,29 +250,32 @@ namespace Barotrauma
}
case ConditionType.Affliction:
if (target == null) { return Operator == OperatorType.NotEquals; }
if (target is Character targetChar)
Character targetChar = target as Character;
if (target is Limb limb) { targetChar = limb.character; }
if (targetChar != null)
{
var health = targetChar.CharacterHealth;
if (health == null) { return false; }
var affliction = health.GetAffliction(AttributeName);
if (affliction == null) { return false; }
float afflictionStrength = affliction == null ? 0.0f : affliction.Strength;
if (FloatValue.HasValue)
{
float value = FloatValue.Value;
switch (Operator)
{
case OperatorType.Equals:
return affliction.Strength == value;
return afflictionStrength == value;
case OperatorType.GreaterThan:
return affliction.Strength > value;
return afflictionStrength > value;
case OperatorType.GreaterThanEquals:
return affliction.Strength >= value;
return afflictionStrength >= value;
case OperatorType.LessThan:
return affliction.Strength < value;
return afflictionStrength < value;
case OperatorType.LessThanEquals:
return affliction.Strength <= value;
return afflictionStrength <= value;
case OperatorType.NotEquals:
return affliction.Strength != value;
return afflictionStrength != value;
}
}
}