v1.1.18.0 (Treacherous Tides Update)
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
@@ -18,7 +17,7 @@ namespace Barotrauma
|
||||
public Reputation Reputation { get; }
|
||||
public FactionPrefab Prefab { get; }
|
||||
|
||||
public Faction(CampaignMetadata metadata, FactionPrefab prefab)
|
||||
public Faction(CampaignMetadata? metadata, FactionPrefab prefab)
|
||||
{
|
||||
Prefab = prefab;
|
||||
Reputation = new Reputation(metadata, this, prefab.MinReputation, prefab.MaxReputation, prefab.InitialReputation);
|
||||
|
||||
@@ -42,10 +42,10 @@ namespace Barotrauma
|
||||
|
||||
public float Value
|
||||
{
|
||||
get => Math.Min(MaxReputation, Metadata.GetFloat(metaDataIdentifier, InitialReputation));
|
||||
get => Metadata == null ? 0 : Math.Min(MaxReputation, Metadata.GetFloat(metaDataIdentifier, InitialReputation));
|
||||
private set
|
||||
{
|
||||
if (MathUtils.NearlyEqual(Value, value)) { return; }
|
||||
if (MathUtils.NearlyEqual(Value, value) || Metadata == null) { return; }
|
||||
|
||||
float prevValue = Value;
|
||||
|
||||
@@ -137,7 +137,6 @@ namespace Barotrauma
|
||||
|
||||
private Reputation(CampaignMetadata metadata, Faction faction, Location location, Identifier identifier, int minReputation, int maxReputation, int initialReputation)
|
||||
{
|
||||
System.Diagnostics.Debug.Assert(metadata != null);
|
||||
System.Diagnostics.Debug.Assert(faction != null || location != null);
|
||||
Metadata = metadata;
|
||||
Identifier = identifier;
|
||||
|
||||
@@ -388,6 +388,11 @@ namespace Barotrauma
|
||||
.Where(lt => missionPrefab.AllowedLocationTypes.Any(m => m == lt.Identifier))
|
||||
.GetRandom(rand);
|
||||
dummyLocations = CreateDummyLocations(levelSeed, locationType);
|
||||
if (!mission.Prefab.RequiredLocationFaction.IsEmpty &&
|
||||
FactionPrefab.Prefabs.TryGet(mission.Prefab.RequiredLocationFaction, out var factionPrefab))
|
||||
{
|
||||
dummyLocations[0].Faction = dummyLocations[1].Faction = new Faction(metadata: null, factionPrefab);
|
||||
}
|
||||
randomLevel = LevelData.CreateRandom(levelSeed, difficulty, levelGenerationParams, requireOutpost: true);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user