Xenoarch scanning time halved (#24188)

* SALVATION

* Update ArtifactAnalyzerComponent.cs

* Update artifact_analyzer.yml
This commit is contained in:
Boaz1111
2024-01-17 17:45:18 +01:00
committed by GitHub
parent 9383ad548d
commit 0c78c34653
3 changed files with 4 additions and 40 deletions

View File

@@ -51,8 +51,6 @@ public sealed class ArtifactAnalyzerSystem : EntitySystem
SubscribeLocalEvent<ActiveArtifactAnalyzerComponent, ComponentShutdown>(OnAnalyzeEnd);
SubscribeLocalEvent<ActiveArtifactAnalyzerComponent, PowerChangedEvent>(OnPowerChanged);
SubscribeLocalEvent<ArtifactAnalyzerComponent, UpgradeExamineEvent>(OnUpgradeExamine);
SubscribeLocalEvent<ArtifactAnalyzerComponent, RefreshPartsEvent>(OnRefreshParts);
SubscribeLocalEvent<ArtifactAnalyzerComponent, ItemPlacedEvent>(OnItemPlaced);
SubscribeLocalEvent<ArtifactAnalyzerComponent, ItemRemovedEvent>(OnItemRemoved);
@@ -82,7 +80,7 @@ public sealed class ArtifactAnalyzerSystem : EntitySystem
if (active.AnalysisPaused)
continue;
if (_timing.CurTime - active.StartTime < scan.AnalysisDuration * scan.AnalysisDurationMulitplier - active.AccumulatedRunTime)
if (_timing.CurTime - active.StartTime < scan.AnalysisDuration - active.AccumulatedRunTime)
continue;
FinishScan(uid, scan, active);
@@ -199,7 +197,7 @@ public sealed class ArtifactAnalyzerSystem : EntitySystem
{
artifact = analyzer.LastAnalyzedArtifact;
msg = GetArtifactScanMessage(analyzer);
totalTime = analyzer.AnalysisDuration * analyzer.AnalysisDurationMulitplier;
totalTime = analyzer.AnalysisDuration;
if (TryComp<ItemPlacerComponent>(component.AnalyzerEntity, out var placer))
canScan = placer.PlacedEntities.Any();
canPrint = analyzer.ReadyToPrint;
@@ -451,18 +449,6 @@ public sealed class ArtifactAnalyzerSystem : EntitySystem
UpdateUserInterface(component.Console.Value);
}
private void OnRefreshParts(EntityUid uid, ArtifactAnalyzerComponent component, RefreshPartsEvent args)
{
var analysisRating = args.PartRatings[component.MachinePartAnalysisDuration];
component.AnalysisDurationMulitplier = MathF.Pow(component.PartRatingAnalysisDurationMultiplier, analysisRating - 1);
}
private void OnUpgradeExamine(EntityUid uid, ArtifactAnalyzerComponent component, UpgradeExamineEvent args)
{
args.AddPercentageUpgrade("analyzer-artifact-component-upgrade-analysis", component.AnalysisDurationMulitplier);
}
private void OnItemPlaced(EntityUid uid, ArtifactAnalyzerComponent component, ref ItemPlacedEvent args)
{
if (component.Console != null && Exists(component.Console))