v1.4.4.1 (Blood in the Water Update)
This commit is contained in:
@@ -504,7 +504,10 @@ namespace Barotrauma
|
||||
|
||||
foreach (Character c in Character.CharacterList)
|
||||
{
|
||||
if (c.AnimController.CurrentHull != null && c.AnimController.CanEnterSubmarine) { continue; }
|
||||
if (c.AnimController.CurrentHull != null && c.AnimController.CanEnterSubmarine != CanEnterSubmarine.True)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach (Limb limb in c.AnimController.Limbs)
|
||||
{
|
||||
@@ -567,7 +570,7 @@ namespace Barotrauma
|
||||
{
|
||||
buoyancy = MathHelper.Lerp(buoyancy, 0.1f, forceUpwardsTimer / ForceUpwardsDelay);
|
||||
}
|
||||
return new Vector2(0.0f, buoyancy * Body.Mass * 10.0f) * massRatio;
|
||||
return new Vector2(0.0f, buoyancy * totalMass * 10.0f) * massRatio;
|
||||
}
|
||||
|
||||
public void ApplyForce(Vector2 force)
|
||||
@@ -684,9 +687,26 @@ namespace Barotrauma
|
||||
|
||||
private bool CheckCharacterCollision(Contact contact, Character character)
|
||||
{
|
||||
//characters that can't enter the sub always collide regardless of gaps
|
||||
if (!character.AnimController.CanEnterSubmarine) { return true; }
|
||||
if (character.Submarine != null) { return false; }
|
||||
switch (character.AnimController.CanEnterSubmarine)
|
||||
{
|
||||
case CanEnterSubmarine.False:
|
||||
//characters that can't enter the sub always collide regardless of gaps
|
||||
return true;
|
||||
case CanEnterSubmarine.Partial:
|
||||
//characters that can partially enter the sub can poke their limbs inside, but not the collider
|
||||
if (contact.FixtureB.Body ==
|
||||
character.AnimController.Collider.FarseerBody)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (contact.FixtureB.Body.UserData is Limb limb &&
|
||||
!limb.Params.CanEnterSubmarine)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
contact.GetWorldManifold(out Vector2 contactNormal, out FixedArray2<Vector2> points);
|
||||
|
||||
@@ -717,17 +737,23 @@ namespace Barotrauma
|
||||
if (adjacentGap == null) { return true; }
|
||||
}
|
||||
|
||||
if (newHull != null)
|
||||
{
|
||||
CoroutineManager.Invoke(() =>
|
||||
{
|
||||
if (character != null && !character.Removed)
|
||||
{
|
||||
character.AnimController.FindHull(newHull.WorldPosition, setSubmarine: true);
|
||||
}
|
||||
});
|
||||
if (character.AnimController.CanEnterSubmarine == CanEnterSubmarine.Partial)
|
||||
{
|
||||
return contact.FixtureB.Body == character.AnimController.Collider.FarseerBody;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (newHull != null)
|
||||
{
|
||||
CoroutineManager.Invoke(() =>
|
||||
{
|
||||
if (character != null && !character.Removed)
|
||||
{
|
||||
character.AnimController.FindHull(newHull.WorldPosition, setSubmarine: true);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -880,17 +906,12 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
#if CLIENT
|
||||
int particleAmount = (int)Math.Min(wallImpact * 10.0f, 50);
|
||||
for (int i = 0; i < particleAmount; i++)
|
||||
{
|
||||
GameMain.ParticleManager.CreateParticle("iceshards",
|
||||
ConvertUnits.ToDisplayUnits(impact.ImpactPos) + Rand.Vector(Rand.Range(1.0f, 50.0f)),
|
||||
Rand.Vector(Rand.Range(50.0f, 500.0f)) + impact.Velocity);
|
||||
}
|
||||
#endif
|
||||
HandleLevelCollisionProjSpecific(impact);
|
||||
}
|
||||
|
||||
|
||||
partial void HandleLevelCollisionProjSpecific(Impact impact);
|
||||
|
||||
private void HandleSubCollision(Impact impact, Submarine otherSub)
|
||||
{
|
||||
Debug.Assert(otherSub != submarine);
|
||||
|
||||
Reference in New Issue
Block a user