(1762f02b3) Merge branch 'dev' into human-ai

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:08:22 +03:00
parent 4797f6b0d3
commit 454dda56c7
91 changed files with 1138 additions and 744 deletions
@@ -336,9 +336,12 @@ namespace Barotrauma
UnlockAchievement("survivereactormeltdown");
}
#endif
var charactersInSub = Character.CharacterList.FindAll(c => !c.IsDead &&
var charactersInSub = Character.CharacterList.FindAll(c =>
!c.IsDead &&
c.TeamID != Character.TeamType.FriendlyNPC &&
!(c.AIController is EnemyAIController) &&
(c.Submarine == gameSession.Submarine || (Level.Loaded?.EndOutpost != null && c.Submarine == Level.Loaded.EndOutpost)));
if (charactersInSub.Count == 1)
{
//there must be some non-enemy casualties to get the last mant standing achievement
@@ -346,7 +349,11 @@ namespace Barotrauma
{
UnlockAchievement(charactersInSub[0], "lastmanstanding");
}
else if (!Character.CharacterList.Any(c => !(c.AIController is EnemyAIController)))
//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] &&
c.TeamID == charactersInSub[0].TeamID &&
!(c.AIController is EnemyAIController)))
{
UnlockAchievement(charactersInSub[0], "lonesailor");
}