Release 1.11.4.1 (Winter Update)
This commit is contained in:
@@ -378,7 +378,14 @@ namespace Barotrauma
|
||||
if (characters.Any())
|
||||
{
|
||||
price *= 1f + characters.Max(static c => c.GetStatValue(StatTypes.StoreSellMultiplier, includeSaved: false));
|
||||
price *= 1f + characters.Max(c => item.Tags.Sum(tag => c.Info.GetSavedStatValueWithAll(StatTypes.StoreSellMultiplier, tag)));
|
||||
price *= 1f + characters.Max(c => GetMultiplierForItem(c, item));
|
||||
|
||||
float GetMultiplierForItem(Character character, ItemPrefab item)
|
||||
{
|
||||
return
|
||||
item.Tags.Sum(tag => character.Info.GetSavedStatValue(StatTypes.StoreSellMultiplier, tag)) +
|
||||
character.Info.GetSavedStatValue(StatTypes.StoreSellMultiplier, Tags.StatIdentifierTargetAll);
|
||||
}
|
||||
}
|
||||
|
||||
// Price should never go below 1 mk
|
||||
@@ -588,7 +595,7 @@ namespace Barotrauma
|
||||
public Location(Vector2 mapPosition, int? zone, Identifier? biomeId, Random rand, bool requireOutpost = false, LocationType forceLocationType = null, IEnumerable<Location> existingLocations = null)
|
||||
{
|
||||
Type = OriginalType = forceLocationType ?? LocationType.Random(rand, zone, biomeId, requireOutpost);
|
||||
CreateRandomName(Type, rand, existingLocations);
|
||||
AssignRandomName(Type, rand, existingLocations);
|
||||
MapPosition = mapPosition;
|
||||
PortraitId = ToolBox.StringToInt(nameIdentifier.Value);
|
||||
Connections = new List<LocationConnection>();
|
||||
@@ -1210,7 +1217,7 @@ namespace Barotrauma
|
||||
HireManager.AvailableCharacters = hireableCharacters.ToList();
|
||||
}
|
||||
|
||||
private void CreateRandomName(LocationType type, Random rand, IEnumerable<Location> existingLocations)
|
||||
public void AssignRandomName(LocationType type, Random rand, IEnumerable<Location> existingLocations)
|
||||
{
|
||||
if (!type.ForceLocationName.IsEmpty)
|
||||
{
|
||||
|
||||
@@ -735,7 +735,7 @@ namespace Barotrauma
|
||||
Location startLocation = Locations.MinBy(l => l.MapPosition.X);
|
||||
if (LocationType.Prefabs.TryGet("outpost", out LocationType startLocationType))
|
||||
{
|
||||
startLocation.ChangeType(campaign, startLocationType, createStores: false);
|
||||
mapLocationTypeGenerator.ChangeLocationTypeAndName(campaign, startLocation, startLocationType);
|
||||
mapLocationTypeGenerator.AddToFilled(startLocation);
|
||||
}
|
||||
|
||||
|
||||
@@ -155,13 +155,17 @@ namespace Barotrauma
|
||||
return filledLocations.Contains(location);
|
||||
}
|
||||
|
||||
public static void ChangeLocationTypeAndName(CampaignMode campaign, Location location, LocationType suitableLocationType)
|
||||
public void ChangeLocationTypeAndName(CampaignMode campaign, Location location, LocationType suitableLocationType)
|
||||
{
|
||||
location.ChangeType(campaign, suitableLocationType, createStores: false, unlockInitialMissions: false);
|
||||
if (!suitableLocationType.ForceLocationName.IsEmpty)
|
||||
{
|
||||
location.ForceName(suitableLocationType.ForceLocationName);
|
||||
}
|
||||
else
|
||||
{
|
||||
location.AssignRandomName(location.Type, Rand.GetRNG(Rand.RandSync.ServerAndClient), existingLocations: map.Locations);
|
||||
}
|
||||
}
|
||||
|
||||
public void AssignForcedBiomeGateTypes(IEnumerable<Location> gateLocations)
|
||||
|
||||
Reference in New Issue
Block a user