v1.1.18.0 (Treacherous Tides Update)

This commit is contained in:
Regalis11
2023-10-19 17:18:51 +03:00
parent 12e43d95ef
commit 34ffc520cc
20 changed files with 179 additions and 43 deletions
@@ -132,6 +132,11 @@ namespace Barotrauma
/// </summary>
public readonly List<Identifier> AllowedLocationTypes = new List<Identifier>();
/// <summary>
/// The mission can only happen in locations owned by this faction. In the mission mode, the location is forced to be owned by this faction.
/// </summary>
public readonly Identifier RequiredLocationFaction;
/// <summary>
/// Show entities belonging to these sub categories when the mission starts
/// </summary>
@@ -198,6 +203,7 @@ namespace Barotrauma
RequireWreck = element.GetAttributeBool("requirewreck", false);
RequireRuin = element.GetAttributeBool("requireruin", false);
BlockLocationTypeChanges = element.GetAttributeBool(nameof(BlockLocationTypeChanges), false);
RequiredLocationFaction = element.GetAttributeIdentifier(nameof(RequiredLocationFaction), Identifier.Empty);
Commonness = element.GetAttributeInt("commonness", 1);
AllowOtherMissionsInLevel = element.GetAttributeBool("allowothermissionsinlevel", true);
if (element.GetAttribute("difficulty") != null)
@@ -378,7 +384,11 @@ namespace Barotrauma
{
if (from == to)
{
return
if (!RequiredLocationFaction.IsEmpty && from.Faction?.Prefab.Identifier != RequiredLocationFaction)
{
return false;
}
return
AllowedLocationTypes.Any(lt => lt == "any") ||
AllowedLocationTypes.Any(lt => lt == "anyoutpost" && from.HasOutpost()) ||
AllowedLocationTypes.Any(lt => lt == from.Type.Identifier);