Merge remote-tracking branch 'upstream/master' into Suka

This commit is contained in:
Jabak
2024-07-17 15:03:25 +03:00
999 changed files with 135538 additions and 27464 deletions

View File

@@ -3,6 +3,7 @@ using Content.Server.Store.Components;
using Content.Shared.FixedPoint;
using Content.Shared.Store;
using Content.Shared.Tag;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
namespace Content.Server.Store.Systems;
@@ -21,7 +22,7 @@ public sealed partial class StoreSystem
var count = _random.Next(store.Sales.MinItems, store.Sales.MaxItems + 1);
listings = listings
.Where(l => !l.SaleBlacklist && l.Cost.Any(x => x.Value > 1) && store.Categories.Overlaps(l.Categories))
.Where(l => !l.SaleBlacklist && l.Cost.Any(x => x.Value > 1) && store.Categories.Overlaps(ChangedFormatCategories(l.Categories)))
.OrderBy(_ => _random.Next()).Take(count).ToList();
foreach (var listing in listings)
@@ -41,6 +42,13 @@ public sealed partial class StoreSystem
}
}
private IEnumerable<string> ChangedFormatCategories(List<ProtoId<StoreCategoryPrototype>> categories)
{
var modified = from p in categories select p.Id;
return modified;
}
private float GetSale(float minMultiplier, float maxMultiplier)
{
return _random.NextFloat() * (maxMultiplier - minMultiplier) + minMultiplier;