v1.6.17.0 (Unto the Breach update)
This commit is contained in:
@@ -123,15 +123,30 @@ namespace Barotrauma
|
||||
public OutpostModuleInfo OutpostModuleInfo { get; set; }
|
||||
public BeaconStationInfo BeaconStationInfo { get; set; }
|
||||
public WreckInfo WreckInfo { get; set; }
|
||||
public EnemySubmarineInfo EnemySubmarineInfo { get; set; }
|
||||
|
||||
public ExtraSubmarineInfo GetExtraSubmarineInfo => BeaconStationInfo ?? WreckInfo as ExtraSubmarineInfo;
|
||||
|
||||
public ImmutableHashSet<Identifier> OutpostTags { get; set; } = ImmutableHashSet<Identifier>.Empty;
|
||||
|
||||
public bool IsOutpost => Type == SubmarineType.Outpost || Type == SubmarineType.OutpostModule;
|
||||
|
||||
public bool IsWreck => Type == SubmarineType.Wreck;
|
||||
public bool IsBeacon => Type == SubmarineType.BeaconStation;
|
||||
public bool IsEnemySubmarine => Type == SubmarineType.EnemySubmarine;
|
||||
public bool IsPlayer => Type == SubmarineType.Player;
|
||||
public bool IsRuin => Type == SubmarineType.Ruin;
|
||||
|
||||
/// <summary>
|
||||
/// Ruin modules are of type SubmarineType.OutpostModule, until the ruin generator (or the test game mode) sets them as ruins.
|
||||
/// This is a helper workaround check intended to be used only in the context of the sub editor and the test game mode, where ruins aren't generated.
|
||||
/// </summary>
|
||||
public bool ShouldBeRuin => Type is SubmarineType.Ruin or SubmarineType.OutpostModule &&
|
||||
(OutpostModuleInfo.ModuleFlags.Contains("ruin".ToIdentifier()) ||
|
||||
OutpostModuleInfo.ModuleFlags.Contains("ruinentrance".ToIdentifier()) ||
|
||||
OutpostModuleInfo.ModuleFlags.Contains("ruinvault".ToIdentifier()) ||
|
||||
OutpostModuleInfo.ModuleFlags.Contains("ruinworkshop".ToIdentifier()) ||
|
||||
OutpostModuleInfo.ModuleFlags.Contains("ruinshrine".ToIdentifier()));
|
||||
|
||||
public bool IsCampaignCompatible => IsPlayer && !HasTag(SubmarineTag.Shuttle) && !HasTag(SubmarineTag.HideInMenus) && SubmarineClass != SubmarineClass.Undefined;
|
||||
public bool IsCampaignCompatibleIgnoreClass => IsPlayer && !HasTag(SubmarineTag.Shuttle) && !HasTag(SubmarineTag.HideInMenus);
|
||||
@@ -325,6 +340,7 @@ namespace Barotrauma
|
||||
Tags = original.Tags;
|
||||
OutpostGenerationParams = original.OutpostGenerationParams;
|
||||
LayersHiddenByDefault = original.LayersHiddenByDefault;
|
||||
OutpostTags = original.OutpostTags;
|
||||
if (original.OutpostModuleInfo != null)
|
||||
{
|
||||
OutpostModuleInfo = new OutpostModuleInfo(original.OutpostModuleInfo);
|
||||
@@ -333,6 +349,10 @@ namespace Barotrauma
|
||||
{
|
||||
BeaconStationInfo = new BeaconStationInfo(original.BeaconStationInfo);
|
||||
}
|
||||
else if (original.EnemySubmarineInfo != null)
|
||||
{
|
||||
EnemySubmarineInfo = new EnemySubmarineInfo(original.EnemySubmarineInfo);
|
||||
}
|
||||
else if (original.WreckInfo != null)
|
||||
{
|
||||
WreckInfo = new WreckInfo(original.WreckInfo);
|
||||
@@ -416,6 +436,8 @@ namespace Barotrauma
|
||||
}
|
||||
Tier = SubmarineElement.GetAttributeInt("tier", GetDefaultTier(Price));
|
||||
|
||||
OutpostTags = SubmarineElement.GetAttributeIdentifierImmutableHashSet(nameof(OutpostTags), ImmutableHashSet<Identifier>.Empty);
|
||||
|
||||
if (SubmarineElement?.Attribute("type") != null)
|
||||
{
|
||||
if (Enum.TryParse(SubmarineElement.GetAttributeString("type", ""), out SubmarineType type))
|
||||
@@ -429,6 +451,10 @@ namespace Barotrauma
|
||||
{
|
||||
BeaconStationInfo = new BeaconStationInfo(this, SubmarineElement);
|
||||
}
|
||||
else if (Type == SubmarineType.EnemySubmarine)
|
||||
{
|
||||
EnemySubmarineInfo = new EnemySubmarineInfo(this, SubmarineElement);
|
||||
}
|
||||
else if (Type == SubmarineType.Wreck)
|
||||
{
|
||||
WreckInfo = new WreckInfo(this, SubmarineElement);
|
||||
@@ -612,6 +638,11 @@ namespace Barotrauma
|
||||
BeaconStationInfo.Save(newElement);
|
||||
BeaconStationInfo = new BeaconStationInfo(this, newElement);
|
||||
}
|
||||
else if (Type == SubmarineType.EnemySubmarine)
|
||||
{
|
||||
EnemySubmarineInfo.Save(newElement);
|
||||
EnemySubmarineInfo = new EnemySubmarineInfo(this, newElement);
|
||||
}
|
||||
else if (Type == SubmarineType.Wreck)
|
||||
{
|
||||
WreckInfo.Save(newElement);
|
||||
|
||||
Reference in New Issue
Block a user