.NET Format Style Fixes
This commit is contained in:
@@ -193,10 +193,7 @@ public class RepeatableQuestGenerator(
|
||||
var targetPool = questTypePool.Pool.Elimination;
|
||||
targetsConfig = targetsConfig.Filter(x => targetPool.Targets.ContainsKey(x.Key));
|
||||
|
||||
if (
|
||||
targetsConfig.Count == 0
|
||||
|| targetsConfig.All(x => x.Data?.IsBoss ?? false)
|
||||
)
|
||||
if (targetsConfig.Count == 0 || targetsConfig.All(x => x.Data?.IsBoss ?? false))
|
||||
{
|
||||
// There are no more targets left for elimination; delete it as a possible quest type
|
||||
// also if only bosses are left we need to leave otherwise it's a guaranteed boss elimination
|
||||
@@ -329,8 +326,7 @@ public class RepeatableQuestGenerator(
|
||||
!eliminationConfig.DistLocationBlacklist.Contains(x.Id)
|
||||
);
|
||||
// if the boss spawns on nom-blacklisted locations and the current location is allowed we can generate a distance kill requirement
|
||||
isDistanceRequirementAllowed =
|
||||
isDistanceRequirementAllowed && allowedSpawns.Any();
|
||||
isDistanceRequirementAllowed = isDistanceRequirementAllowed && allowedSpawns.Any();
|
||||
}
|
||||
|
||||
if (
|
||||
@@ -500,10 +496,7 @@ public class RepeatableQuestGenerator(
|
||||
);
|
||||
}
|
||||
|
||||
return _randomUtil.RandInt(
|
||||
eliminationConfig.MinKills,
|
||||
eliminationConfig.MaxKills + 1
|
||||
);
|
||||
return _randomUtil.RandInt(eliminationConfig.MinKills, eliminationConfig.MaxKills + 1);
|
||||
}
|
||||
|
||||
protected double DifficultyWeighing(
|
||||
@@ -706,10 +699,7 @@ public class RepeatableQuestGenerator(
|
||||
}
|
||||
|
||||
// Store the indexes of items we are asking player to supply
|
||||
var distinctItemsToRetrieveCount = _randomUtil.GetInt(
|
||||
1,
|
||||
completionConfig.UniqueItemCount
|
||||
);
|
||||
var distinctItemsToRetrieveCount = _randomUtil.GetInt(1, completionConfig.UniqueItemCount);
|
||||
var chosenRequirementItemsTpls = new List<string>();
|
||||
var usedItemIndexes = new HashSet<int>();
|
||||
for (var i = 0; i < distinctItemsToRetrieveCount; i++)
|
||||
|
||||
@@ -130,9 +130,9 @@ public class RepeatableQuestRewardGenerator(
|
||||
}
|
||||
|
||||
if (
|
||||
traderWhitelistDetails.RewardCanBeWeapon &&
|
||||
_randomUtil.GetChance100(traderWhitelistDetails.WeaponRewardChancePercent)
|
||||
)
|
||||
traderWhitelistDetails.RewardCanBeWeapon
|
||||
&& _randomUtil.GetChance100(traderWhitelistDetails.WeaponRewardChancePercent)
|
||||
)
|
||||
{
|
||||
var chosenWeapon = GetRandomWeaponPresetWithinBudget(
|
||||
itemRewardBudget.Value,
|
||||
|
||||
@@ -613,7 +613,9 @@ public record EliminationConfig : BaseQuestConfig
|
||||
/// If a weapon category requirement is chosen, pick from these categories
|
||||
/// </summary>
|
||||
[JsonPropertyName("weaponCategoryRequirements")]
|
||||
public required List<ProbabilityObject<string, List<string>>> WeaponCategoryRequirements { get; set; }
|
||||
public required List<
|
||||
ProbabilityObject<string, List<string>>
|
||||
> WeaponCategoryRequirements { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If a weapon requirement is chosen, pick from these weapons
|
||||
@@ -639,7 +641,6 @@ public record BossInfo
|
||||
[JsonExtensionData]
|
||||
public Dictionary<string, object> ExtensionData { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Is this target a boss
|
||||
/// </summary>
|
||||
|
||||
@@ -99,7 +99,8 @@ public class MathUtil
|
||||
/// <param name="x">Support points in x (of same length as y)</param>
|
||||
/// <param name="y">Support points in y (of same length as x)</param>
|
||||
/// <returns>Interpolated value at xp, or null if xp is out of bounds</returns>
|
||||
public T? Interp1<T>(T xp, IReadOnlyList<T> x, IReadOnlyList<T> y) where T : INumber<T>
|
||||
public T? Interp1<T>(T xp, IReadOnlyList<T> x, IReadOnlyList<T> y)
|
||||
where T : INumber<T>
|
||||
{
|
||||
if (xp > x[^1]) // ^1 is the last index in C#
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user