Lobbyscreen store fixes, sub name textbox & save button in sub editor, transitioncinematic on crew death, saving reactor state, radar marker position fix, minimap fix, button sounds, artifact positioning fix, better LegUp prevention method, some music clips when round ends

This commit is contained in:
Regalis
2016-01-03 01:13:32 +02:00
parent 8717a2259f
commit cb1513f5e6
32 changed files with 277 additions and 160 deletions
@@ -76,7 +76,7 @@ namespace Barotrauma
private Vector2 GetStandPosition()
{
Vector2 standPos = leak.Position;
var hull = leak.linkedTo[0];
var hull = leak.FlowTargetHull;
if (hull == null) return standPos;
@@ -243,45 +243,33 @@ namespace Barotrauma
movement = MathUtils.SmoothStep(movement, TargetMovement, movementLerp);
movement.Y = 0.0f;
bool legsUp = false;
for (int i = 0; i < 2; i++)
{
Limb leg = GetLimb((i == 0) ? LimbType.LeftLeg : LimbType.RightLeg);// : leftLeg;
Limb leg = GetLimb((i == 0) ? LimbType.LeftThigh : LimbType.RightThigh);// : leftLeg;
float shortestAngle = leg.Rotation - torso.Rotation;
if (Math.Abs(shortestAngle)<2.4f) continue;
if (Math.Abs(shortestAngle) < 2.5f) continue;
leg.body.ApplyTorque(-shortestAngle*10.0f);
if (Math.Abs(shortestAngle) > 5.0f)
{
TargetDir = TargetDir == Direction.Right ? Direction.Left : Direction.Right;
}
else
{
leg = GetLimb((i == 0) ? LimbType.LeftThigh : LimbType.RightThigh);
leg.body.ApplyTorque(-shortestAngle * 5.0f);
// float torsoRot = MathHelper.WrapAngle(torso.Rotation);
// torsoRot = MathHelper.ToDegrees(torsoRot);
leg.body.ApplyTorque(shortestAngle * 10.0f);
//float torque = Math.Sign(torso.SimPosition.X - leg.SimPosition.X) * leg.Mass * 10.0f;
//leg.body.ApplyTorque(torque);
//leg.body.ApplyTorque(torque);
// if (Math.Sign(Dir)==Math.Sign(torsoRot))
// {
//leg.body.ApplyTorque(-leg.Mass * 100.0f);
// }
// else
// {
// leg.body.ApplyTorque(leg.Mass * 100.0f);
// }
//legsUp = true;
leg = GetLimb((i == 0) ? LimbType.LeftLeg : LimbType.RightLeg);
leg.body.ApplyTorque(-shortestAngle * 10.0f);
}
}
if (legsUp || LowestLimb == null) return;
if (LowestLimb == null) return;
if (!onGround || (LowestLimb.SimPosition.Y - floorY > 0.5f && stairs == null)) return;
getUpSpeed = getUpSpeed * Math.Max(head.SimPosition.Y - colliderPos.Y, 0.1f);
getUpSpeed = getUpSpeed * Math.Max(head.SimPosition.Y - colliderPos.Y, 0.5f);
if (stairs != null)
{
@@ -590,7 +590,6 @@ namespace Barotrauma
{
DebugConsole.ThrowError("Failed to update ragdoll limb collisioncategories", e);
}
}
}
+29 -33
View File
@@ -412,6 +412,7 @@ namespace Barotrauma
if (Info.PickedItemIDs[i] == 0) continue;
Item item = FindEntityByID(Info.PickedItemIDs[i]) as Item;
System.Diagnostics.Debug.Assert(item != null);
if (item == null) continue;
item.Pick(this, true, true, true);
@@ -1100,49 +1101,44 @@ namespace Barotrauma
Kill(CauseOfDeath.Pressure, isNetworkMessage);
}
private IEnumerable<object> DeathAnim(Camera cam)
{
if (controlled != this) yield return CoroutineStatus.Success;
//private IEnumerable<object> DeathAnim(Camera cam)
//{
// if (controlled != this) yield return CoroutineStatus.Success;
Character.controlled = null;
// Character.controlled = null;
float dimDuration = 8.0f;
float timer = 0.0f;
// float dimDuration = 8.0f;
// float timer = 0.0f;
Color prevAmbientLight = GameMain.LightManager.AmbientLight;
Color darkLight = new Color(0.2f, 0.2f, 0.2f, 1.0f);
// Color prevAmbientLight = GameMain.LightManager.AmbientLight;
// Color darkLight = new Color(0.2f, 0.2f, 0.2f, 1.0f);
while (timer < dimDuration)
{
timer += CoroutineManager.DeltaTime;
// while (timer < dimDuration && Character.controlled == null)
// {
// timer += CoroutineManager.DeltaTime;
if (cam != null) cam.OffsetAmount = 0.0f;
// if (cam != null) cam.OffsetAmount = 0.0f;
cam.TargetPos = WorldPosition;
// cam.TargetPos = WorldPosition;
GameMain.LightManager.AmbientLight = Color.Lerp(prevAmbientLight, darkLight, timer / dimDuration);
// GameMain.LightManager.AmbientLight = Color.Lerp(prevAmbientLight, darkLight, timer / dimDuration);
yield return CoroutineStatus.Running;
}
// yield return CoroutineStatus.Running;
// }
// float lerpLightBack = 0.0f;
// while (lerpLightBack < 1.0f)
// {
// lerpLightBack = Math.Min(lerpLightBack + CoroutineManager.DeltaTime*5.0f, 1.0f);
while (controlled == this)
{
yield return CoroutineStatus.Running;
}
// GameMain.LightManager.AmbientLight = Color.Lerp(darkLight, prevAmbientLight, lerpLightBack);
// yield return CoroutineStatus.Running;
// }
float lerpLightBack = 0.0f;
while (lerpLightBack < 1.0f)
{
lerpLightBack = Math.Min(lerpLightBack + 0.05f, 1.0f);
// cam.TargetPos = Vector2.Zero;
GameMain.LightManager.AmbientLight = Color.Lerp(darkLight, prevAmbientLight, lerpLightBack);
yield return CoroutineStatus.Running;
}
cam.TargetPos = Vector2.Zero;
yield return CoroutineStatus.Success;
}
// yield return CoroutineStatus.Success;
//}
public void Kill(CauseOfDeath causeOfDeath, bool isNetworkMessage = false)
{
@@ -1175,7 +1171,7 @@ namespace Barotrauma
if (OnDeath != null) OnDeath(this, causeOfDeath);
CoroutineManager.StartCoroutine(DeathAnim(GameMain.GameScreen.Cam));
//CoroutineManager.StartCoroutine(DeathAnim(GameMain.GameScreen.Cam));
health = 0.0f;