artifacts no longer rigged (#15283)
Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
@@ -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<ArtifactComponent, MapInitEvent>(OnInit);
|
||||
SubscribeLocalEvent<ArtifactComponent, PriceCalculationEvent>(GetPrice);
|
||||
SubscribeLocalEvent<RoundEndTextAppendEvent>(OnRoundEnd);
|
||||
@@ -73,7 +77,7 @@ public sealed partial class ArtifactSystem : EntitySystem
|
||||
}
|
||||
|
||||
/// <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):
|
||||
@@ -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<BiasedArtifactComponent>(uid, out var bias) &&
|
||||
TryComp<TraversalDistorterComponent>(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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user