[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<ArtifactComponent, MapInitEvent>(OnInit);
SubscribeLocalEvent<ArtifactComponent, PriceCalculationEvent>(GetPrice);
SubscribeLocalEvent<RoundEndTextAppendEvent>(OnRoundEnd);
}
/// <summary>
- /// Calculates how many research points the artifact is worht
+ /// Calculates how many research points the artifact is worth
/// </summary>
/// <remarks>
/// General balancing (for fully unlocked artifacts):
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<BiasedArtifactComponent>(uid, out var bias) &&
TryComp<TraversalDistorterComponent>(bias.Provider, out var trav) &&
}
}
- 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);
}