Merge branch 'master' of https://bitbucket.org/Regalis11/barotrauma into multisub

Conflicts:
	Subsurface/Source/GUI/GUI.cs
This commit is contained in:
Regalis11
2016-06-09 18:39:54 +03:00
28 changed files with 346 additions and 66 deletions

View File

@@ -156,6 +156,13 @@ namespace Barotrauma
}
strongestImpact = 0.0f;
if (stunTimer > 0)
{
stunTimer -= deltaTime;
return;
}
if (character.LockHands)
{
var leftHand = GetLimb(LimbType.LeftHand);
@@ -185,15 +192,13 @@ namespace Barotrauma
//rightHand.pullJoint.Enabled = true;
//rightHand.pullJoint.WorldAnchorB = midPos;
}
if (stunTimer > 0)
else
{
stunTimer -= deltaTime;
return;
}
if (Anim != Animation.UsingConstruction) ResetPullJoints();
if (Anim != Animation.UsingConstruction) ResetPullJoints();
}
if (SimplePhysicsEnabled)
{
UpdateStandingSimple();
@@ -287,7 +292,7 @@ namespace Barotrauma
float slowdownFactor = (float)limbsInWater / (float)Limbs.Count();
float maxSpeed = Math.Max(TargetMovement.Length() - slowdownFactor, 1.0f);
if (character.SelectedCharacter!=null) maxSpeed = Math.Min(maxSpeed, 1.0f);
// if (character.SelectedCharacter!=null) maxSpeed = Math.Min(maxSpeed, 1.0f);
TargetMovement = Vector2.Normalize(TargetMovement) * maxSpeed;
}
@@ -933,10 +938,11 @@ namespace Barotrauma
{
pullLimb.pullJoint.Enabled = true;
pullLimb.pullJoint.WorldAnchorB = targetLimb.SimPosition;
pullLimb.pullJoint.MaxForce = 100.0f;
pullLimb.pullJoint.MaxForce = 10000.0f;
targetLimb.pullJoint.Enabled = true;
targetLimb.pullJoint.WorldAnchorB = pullLimb.SimPosition;
targetLimb.pullJoint.MaxForce = 10000.0f;
}
}

View File

@@ -1030,6 +1030,12 @@ namespace Barotrauma
PressureTimer = 0.0f;
}
}
if (controlled == this)
{
Lights.LightManager.ViewTarget = this;
CharacterHUD.Update(deltaTime, this);
}
if (IsUnconscious)
{
@@ -1039,8 +1045,6 @@ namespace Barotrauma
if (controlled == this)
{
Lights.LightManager.ViewTarget = this;
CharacterHUD.Update(deltaTime,this);
ControlLocalPlayer(deltaTime, cam);
}

View File

@@ -82,7 +82,7 @@ namespace Barotrauma
DrawStatusIcons(spriteBatch, character);
if (!character.IsUnconscious)
if (!character.IsUnconscious && character.Stun <= 0.0f)
{
if (character.Inventory != null && !character.LockHands &&
character.Stun >= -0.1f) character.Inventory.DrawOwn(spriteBatch, Vector2.Zero);
@@ -193,7 +193,10 @@ namespace Barotrauma
suicideButton.OnClicked = (button, userData) =>
{
character.Kill(character.CauseOfDeath);
if (Character.Controlled != null)
{
Character.Controlled.Kill(Character.Controlled.CauseOfDeath);
}
return true;
};
}