From: deltanedas <39013340+deltanedas@users.noreply.github.com> Date: Mon, 10 Apr 2023 22:35:42 +0000 (+0000) Subject: artifacts no longer rigged (#15283) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=7c8f4054f399551f9661eeb08b5d792d0f2d16fe;p=space-station-14.git artifacts no longer rigged (#15283) Co-authored-by: deltanedas <@deltanedas:kde.org> --- diff --git a/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs b/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs index d11f835079..039cc3423c 100644 --- a/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs +++ b/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs @@ -18,10 +18,14 @@ public sealed partial class ArtifactSystem : EntitySystem [Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly IRobustRandom _random = default!; + private ISawmill _sawmill = default!; + public override void Initialize() { base.Initialize(); + _sawmill = Logger.GetSawmill("artifact"); + SubscribeLocalEvent(OnInit); SubscribeLocalEvent(GetPrice); SubscribeLocalEvent(OnRoundEnd); @@ -73,7 +77,7 @@ public sealed partial class ArtifactSystem : EntitySystem } /// - /// Calculates how many research points the artifact is worht + /// Calculates how many research points the artifact is worth /// /// /// General balancing (for fully unlocked artifacts): @@ -197,12 +201,8 @@ public sealed partial class ArtifactSystem : EntitySystem var currentNode = GetNodeFromId(component.CurrentNodeId.Value, component); var allNodes = currentNode.Edges; - Logger.Debug($"our node: {currentNode.Id}"); - Logger.Debug("other nodes:"); - foreach (var other in allNodes) - { - Logger.Debug($"{other}"); - } + _sawmill.Debug("artifact", $"our node: {currentNode.Id}"); + _sawmill.Debug("artifact", $"other nodes: {string.Join(", ", allNodes)}"); if (TryComp(uid, out var bias) && TryComp(bias.Provider, out var trav) && @@ -224,13 +224,15 @@ public sealed partial class ArtifactSystem : EntitySystem } } - var undiscoveredNodes = allNodes.Where(x => GetNodeFromId(x, component).Discovered).ToList(); + var undiscoveredNodes = allNodes.Where(x => !GetNodeFromId(x, component).Discovered).ToList(); + _sawmill.Debug("artifact", $"Undiscovered nodes: {string.Join(", ", undiscoveredNodes)}"); var newNode = _random.Pick(allNodes); if (undiscoveredNodes.Any() && _random.Prob(0.75f)) { newNode = _random.Pick(undiscoveredNodes); } + _sawmill.Debug("artifact", $"Going to node {newNode}"); return GetNodeFromId(newNode, component); }