Recover ordinary hulls and rare drive generation
This commit is contained in:
parent
141689dd8e
commit
6504050207
10 changed files with 199 additions and 41 deletions
|
|
@ -4,8 +4,9 @@ using Random = CultMath.Random;
|
|||
|
||||
public sealed class AetheriaDaemonLoadoutGenerator
|
||||
{
|
||||
private const double RareGenerationWeight = 0.05;
|
||||
private readonly AetheriaRuntimeCatalogSnapshot _catalog;
|
||||
private readonly Random _random;
|
||||
private Random _random;
|
||||
private readonly uint _seed;
|
||||
private readonly int _zoneIndex;
|
||||
private readonly IReadOnlyDictionary<string, int> _homeZones;
|
||||
|
|
@ -274,9 +275,14 @@ public sealed class AetheriaDaemonLoadoutGenerator
|
|||
: faction.Allegiances.First(value => value.CorporationKey == item.ManufacturerKey).Weight /
|
||||
Math.Max(1, Distance(_zoneIndex, _homeZones[item.ManufacturerKey]));
|
||||
return allegiance * Math.Pow(Math.Max(1, item.OccupiedCells), sizeExponent) /
|
||||
Math.Pow(item.Price, _priceExponent);
|
||||
Math.Pow(item.Price, _priceExponent) * RarityWeight(item);
|
||||
}
|
||||
|
||||
private static double RarityWeight(AetheriaRuntimeCatalogItem item) =>
|
||||
(item.Tags ?? Array.Empty<string>()).Contains("rarity:rare", StringComparer.Ordinal)
|
||||
? RareGenerationWeight
|
||||
: 1;
|
||||
|
||||
private int Distance(int start, int target)
|
||||
{
|
||||
if (start == target) return 1;
|
||||
|
|
|
|||
Loading…
Reference in a new issue