Unstable 0.16.2.0
This commit is contained in:
@@ -346,7 +346,12 @@ namespace Barotrauma
|
||||
|
||||
Vector2 limbDiff = attackSimPosition - mouthPos;
|
||||
float extent = Math.Max(mouthLimb.body.GetMaxExtent(), 1);
|
||||
if (limbDiff.LengthSquared() < extent * extent)
|
||||
bool tooFar = character.InWater ? limbDiff.LengthSquared() > extent * extent : limbDiff.X > extent;
|
||||
if (tooFar)
|
||||
{
|
||||
character.SelectedCharacter = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
//pull the target character to the position of the mouth
|
||||
//(+ make the force fluctuate to waggle the character a bit)
|
||||
@@ -383,7 +388,7 @@ namespace Barotrauma
|
||||
mouthLimb.body.ApplyTorque(-force * 50);
|
||||
}
|
||||
|
||||
if (Character.CanEat)
|
||||
if (Character.CanEat && target.IsDead)
|
||||
{
|
||||
var jaw = GetLimb(LimbType.Jaw);
|
||||
if (jaw != null)
|
||||
@@ -432,10 +437,6 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
character.SelectedCharacter = null;
|
||||
}
|
||||
}
|
||||
|
||||
public bool reverse;
|
||||
|
||||
+1
-1
@@ -533,7 +533,7 @@ namespace Barotrauma
|
||||
|
||||
bool onSlope = Math.Abs(movement.X) > 0.01f && Math.Abs(floorNormal.X) > 0.1f && Math.Sign(floorNormal.X) != Math.Sign(movement.X);
|
||||
|
||||
bool movingHorizontally = !MathUtils.NearlyEqual(targetMovement.X, 0.0f);
|
||||
bool movingHorizontally = !MathUtils.NearlyEqual(TargetMovement.X, 0.0f);
|
||||
|
||||
if (Stairs != null || onSlope)
|
||||
{
|
||||
|
||||
@@ -304,7 +304,27 @@ namespace Barotrauma
|
||||
public abstract float? TorsoPosition { get; }
|
||||
public abstract float? TorsoAngle { get; }
|
||||
|
||||
public float ImpactTolerance => RagdollParams.ImpactTolerance;
|
||||
float? impactTolerance;
|
||||
public float ImpactTolerance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (impactTolerance == null)
|
||||
{
|
||||
impactTolerance = RagdollParams.ImpactTolerance;
|
||||
if (character.Params.VariantFile != null)
|
||||
{
|
||||
float? tolerance = character.Params.VariantFile.Root.GetChildElement("ragdoll")?.GetAttributeFloat("impacttolerance", impactTolerance.Value);
|
||||
if (tolerance.HasValue)
|
||||
{
|
||||
impactTolerance = tolerance;
|
||||
}
|
||||
}
|
||||
}
|
||||
return impactTolerance.Value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool Draggable => RagdollParams.Draggable;
|
||||
public bool CanEnterSubmarine => RagdollParams.CanEnterSubmarine;
|
||||
|
||||
@@ -1833,7 +1853,7 @@ namespace Barotrauma
|
||||
float sin = (float)Math.Sin(mouthLimb.Rotation);
|
||||
Vector2 bodySize = mouthLimb.body.GetSize();
|
||||
Vector2 offset = new Vector2(mouthLimb.MouthPos.X * bodySize.X / 2, mouthLimb.MouthPos.Y * bodySize.Y / 2);
|
||||
return mouthLimb.SimPosition + new Vector2(offset.X * cos - offset.Y * sin, offset.X * sin + offset.Y * cos) * mouthLimb.Scale * RagdollParams.LimbScale;
|
||||
return mouthLimb.SimPosition + new Vector2(offset.X * cos - offset.Y * sin, offset.X * sin + offset.Y * cos);
|
||||
}
|
||||
|
||||
public Vector2 GetColliderBottom()
|
||||
|
||||
Reference in New Issue
Block a user