(5a377a8ee) Unstable v0.9.1000.0

This commit is contained in:
Juan Pablo Arce
2020-05-13 12:55:42 -03:00
parent b143329701
commit a1ca41aa5d
426 changed files with 14384 additions and 5708 deletions
@@ -67,16 +67,19 @@ namespace Barotrauma
foreach (Character c in Character.CharacterList)
{
if (c.IsDead) continue;
if (c.IsDead) { continue; }
//achievement for descending below crush depth and coming back
if (c.WorldPosition.Y < SubmarineBody.DamageDepth || (c.Submarine != null && c.Submarine.WorldPosition.Y < SubmarineBody.DamageDepth))
if (Timing.TotalTime > GameMain.GameSession.RoundStartTime + 30.0f)
{
roundData.EnteredCrushDepth.Add(c);
}
else if (c.WorldPosition.Y > SubmarineBody.DamageDepth * 0.5f)
{
//all characters that have entered crush depth and are still alive get an achievement
if (roundData.EnteredCrushDepth.Contains(c)) UnlockAchievement(c, "survivecrushdepth");
if (c.WorldPosition.Y < SubmarineBody.DamageDepth || (c.Submarine != null && c.Submarine.WorldPosition.Y < SubmarineBody.DamageDepth))
{
roundData.EnteredCrushDepth.Add(c);
}
else if (c.WorldPosition.Y > SubmarineBody.DamageDepth * 0.5f)
{
//all characters that have entered crush depth and are still alive get an achievement
if (roundData.EnteredCrushDepth.Contains(c)) UnlockAchievement(c, "survivecrushdepth");
}
}
}
@@ -106,7 +109,7 @@ namespace Barotrauma
//achievement for descending ridiculously deep
float realWorldDepth = Math.Abs(sub.Position.Y - Level.Loaded.Size.Y) * Physics.DisplayToRealWorldRatio;
if (realWorldDepth > 5000.0f)
if (realWorldDepth > 5000.0f && Timing.TotalTime > GameMain.GameSession.RoundStartTime + 30.0f)
{
//all conscious characters inside the sub get an achievement
UnlockAchievement("subdeep", true, c => c != null && c.Submarine == sub && !c.IsDead && !c.IsUnconscious);
@@ -122,7 +125,10 @@ namespace Barotrauma
if (GameMain.GameSession != null)
{
#if CLIENT
if (Character.Controlled != null) { CheckMidRoundAchievements(Character.Controlled); }
if (Character.Controlled != null && !(GameMain.GameSession.GameMode is SubTestMode))
{
CheckMidRoundAchievements(Character.Controlled);
}
#else
foreach (Client client in GameMain.Server.ConnectedClients)
{
@@ -288,7 +294,7 @@ namespace Barotrauma
public static void OnRoundEnded(GameSession gameSession)
{
//made it to the destination
if (gameSession.Submarine.AtEndPosition && Level.Loaded != null)
if (gameSession?.Submarine != null && Level.Loaded != null && gameSession.Submarine.AtEndPosition)
{
float levelLengthMeters = Physics.DisplayToRealWorldRatio * Level.Loaded.Size.X;
float levelLengthKilometers = levelLengthMeters / 1000.0f;
@@ -368,10 +374,16 @@ namespace Barotrauma
if (charactersInSub.Count == 1)
{
//there must be some non-enemy casualties to get the last mant standing achievement
if (roundData.Casualties.Any(c => !(c.AIController is EnemyAIController)))
if (roundData.Casualties.Any(c => !(c.AIController is EnemyAIController) && c.TeamID == charactersInSub[0].TeamID))
{
UnlockAchievement(charactersInSub[0], "lastmanstanding");
}
#if CLIENT
else if (GameMain.GameSession.CrewManager.GetCharacters().Count() == 1)
{
UnlockAchievement(charactersInSub[0], "lonesailor");
}
#else
//lone sailor achievement if alone in the sub and there are no other characters with the same team ID
else if (!Character.CharacterList.Any(c =>
c != charactersInSub[0] &&
@@ -380,6 +392,8 @@ namespace Barotrauma
{
UnlockAchievement(charactersInSub[0], "lonesailor");
}
#endif
}
foreach (Character character in charactersInSub)
{