Build 1.1.4.0

This commit is contained in:
Markus Isberg
2023-03-31 18:40:44 +03:00
parent efba17e0ff
commit 9470edead3
483 changed files with 17487 additions and 8548 deletions
@@ -13,7 +13,7 @@ namespace Barotrauma
{
private const float UpdateInterval = 1.0f;
private static HashSet<Identifier> unlockedAchievements = new HashSet<Identifier>();
private static readonly HashSet<Identifier> unlockedAchievements = new HashSet<Identifier>();
public static bool CheatsEnabled = false;
@@ -219,10 +219,10 @@ namespace Barotrauma
UnlockAchievement($"discover{biome.Identifier.Value.Replace(" ", "")}".ToIdentifier());
}
public static void OnCampaignMetadataSet(Identifier identifier, object value)
public static void OnCampaignMetadataSet(Identifier identifier, object value, bool unlockClients = false)
{
if (identifier.IsEmpty || value is null) { return; }
UnlockAchievement($"campaignmetadata_{identifier}_{value}".ToIdentifier());
UnlockAchievement($"campaignmetadata_{identifier}_{value}".ToIdentifier(), unlockClients);
}
public static void OnItemRepaired(Item item, Character fixer)
@@ -236,6 +236,15 @@ namespace Barotrauma
UnlockAchievement(fixer, $"repair{item.Prefab.Identifier}".ToIdentifier());
}
public static void OnAfflictionReceived(Affliction affliction, Character character)
{
if (affliction.Prefab.AchievementOnReceived.IsEmpty) { return; }
#if CLIENT
if (GameMain.Client != null) { return; }
#endif
UnlockAchievement(character, affliction.Prefab.AchievementOnReceived);
}
public static void OnAfflictionRemoved(Affliction affliction, Character character)
{
if (affliction.Prefab.AchievementOnRemoved.IsEmpty) { return; }
@@ -433,7 +442,7 @@ namespace Barotrauma
var charactersInSub = Character.CharacterList.FindAll(c =>
!c.IsDead &&
c.TeamID != CharacterTeamType.FriendlyNPC &&
!(c.AIController is EnemyAIController) &&
c.AIController is not EnemyAIController &&
(c.Submarine == gameSession.Submarine || gameSession.Submarine.GetConnectedSubs().Contains(c.Submarine) || (Level.Loaded?.EndOutpost != null && c.Submarine == Level.Loaded.EndOutpost)));
if (charactersInSub.Count == 1)
@@ -515,7 +524,10 @@ namespace Barotrauma
public static void UnlockAchievement(Identifier identifier, bool unlockClients = false, Func<Character, bool> conditions = null)
{
if (CheatsEnabled) { return; }
if (Screen.Selected is { IsEditor: true }) { return; }
#if CLIENT
if (GameMain.GameSession?.GameMode is TestGameMode) { return; }
#endif
#if SERVER
if (unlockClients && GameMain.Server != null)
{