Подкрутка

This commit is contained in:
BIGZi0348
2025-01-05 16:53:02 +03:00
parent 07cec43638
commit 2068296208
2 changed files with 4 additions and 4 deletions

View File

@@ -23,7 +23,7 @@ public sealed class RandomArtifactsSystem : EntitySystem
[Dependency] private readonly StationSystem _station = default!; [Dependency] private readonly StationSystem _station = default!;
[Dependency] private readonly IComponentFactory _componentFactory = default!; [Dependency] private readonly IComponentFactory _componentFactory = default!;
private float _itemToArtifactRatio; // from 0 to 100. In % percents. Default is 0.4% private float _itemToArtifactRatio; // from 0 to 100. In % percents. Default is 0.5%
private bool _artifactsEnabled; private bool _artifactsEnabled;
public override void Initialize() public override void Initialize()
@@ -76,7 +76,7 @@ public sealed class RandomArtifactsSystem : EntitySystem
continue; continue;
// var artifactComponent = EnsureComp<ArtifactComponent>(entity); // var artifactComponent = EnsureComp<ArtifactComponent>(entity);
var comp = (ArtifactComponent) _componentFactory.GetComponent("Artifact"); var comp = (ArtifactComponent)_componentFactory.GetComponent("Artifact");
comp.Owner = entity; comp.Owner = entity;
_artifactsSystem.SafeRandomizeArtifact(entity, ref comp); _artifactsSystem.SafeRandomizeArtifact(entity, ref comp);
AddComp(entity, comp); AddComp(entity, comp);
@@ -88,7 +88,7 @@ public sealed class RandomArtifactsSystem : EntitySystem
private HashSet<ItemComponent> GetPercentageOfHashSet(List<ItemComponent> sourceList, float percentage) private HashSet<ItemComponent> GetPercentageOfHashSet(List<ItemComponent> sourceList, float percentage)
{ {
var countToAdd = (int) Math.Round((double) sourceList.Count * percentage / 100); var countToAdd = (int)Math.Round((double)sourceList.Count * percentage / 100);
return sourceList.Where(x => !Transform(x.Owner).Anchored).Take(countToAdd).ToHashSet(); return sourceList.Where(x => !Transform(x.Owner).Anchored).Take(countToAdd).ToHashSet();
} }

View File

@@ -418,7 +418,7 @@ public sealed class WhiteCVars
CVarDef.Create("white.random_artifacts_enabled", true, CVar.SERVERONLY); CVarDef.Create("white.random_artifacts_enabled", true, CVar.SERVERONLY);
public static readonly CVarDef<float> ItemToArtifactRatio = public static readonly CVarDef<float> ItemToArtifactRatio =
CVarDef.Create("white.random_artifacts_ratio", 0.4f, CVar.SERVERONLY); CVarDef.Create("white.random_artifacts_ratio", 0.5f, CVar.SERVERONLY);
public static readonly CVarDef<string> ACWebhook = public static readonly CVarDef<string> ACWebhook =
CVarDef.Create("ac.webhook", "", CVar.SERVERONLY); CVarDef.Create("ac.webhook", "", CVar.SERVERONLY);