Unstable 0.17.2.0

This commit is contained in:
Markus Isberg
2022-03-30 00:06:59 +09:00
parent 4206f6db42
commit 2968e23ae8
100 changed files with 654 additions and 1379 deletions
@@ -68,21 +68,15 @@ namespace Barotrauma
public bool IsTriggered { get; private set; }
public float Timer { get; private set; }
public float Timer { get; private set; } = -1;
public bool IsActive { get; private set; }
public bool IsPermanent { get; private set; }
public void Launch()
{
IsTriggered = true;
IsActive = true;
IsPermanent = Duration <= 0;
if (!IsPermanent)
{
Timer = Duration;
}
Timer = Duration;
}
public void Reset()
@@ -94,7 +88,6 @@ namespace Barotrauma
public void UpdateTimer(float deltaTime)
{
if (IsPermanent) { return; }
Timer -= deltaTime;
if (Timer < 0)
{
@@ -1250,27 +1243,24 @@ namespace Barotrauma
{
for (int i = 0; i < targets.Count; i++)
{
var target = targets[i];
Limb targetLimb = target as Limb;
if (targetLimb == null && target is Character character)
if (targets[i] is Character character)
{
foreach (Limb limb in character.AnimController.Limbs)
{
if (limb.body == sourceBody)
{
targetLimb = limb;
if (breakLimb)
{
character.TrySeverLimbJoints(limb, severLimbsProbability: 100, damage: 100, allowBeheading: true, attacker: user);
}
else
{
limb.HideAndDisable(hideLimbTimer);
}
break;
}
}
}
if (hideLimb)
{
targetLimb?.HideAndDisable(hideLimbTimer);
}
}
}