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

@@ -1,4 +1,4 @@
using Content.Server.Xenoarchaeology.XenoArtifacts;
using Content.Server.Xenoarchaeology.XenoArtifacts;
using Content.Shared.Construction.Prototypes;
using Robust.Shared.Audio;
using Robust.Shared.Serialization.TypeSerializers.Implementations;
@@ -17,26 +17,7 @@ public sealed partial class ArtifactAnalyzerComponent : Component
/// How long it takes to analyze an artifact
/// </summary>
[DataField("analysisDuration", customTypeSerializer: typeof(TimespanSerializer))]
public TimeSpan AnalysisDuration = TimeSpan.FromSeconds(60);
/// <summary>
/// A mulitplier on the duration of analysis.
/// Used for machine upgrading.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public float AnalysisDurationMulitplier = 1;
/// <summary>
/// The machine part that modifies analysis duration.
/// </summary>
[DataField("machinePartAnalysisDuration", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
public string MachinePartAnalysisDuration = "Manipulator";
/// <summary>
/// The modifier raised to the part rating to determine the duration multiplier.
/// </summary>
[DataField("partRatingAnalysisDurationMultiplier")]
public float PartRatingAnalysisDurationMultiplier = 0.75f;
public TimeSpan AnalysisDuration = TimeSpan.FromSeconds(30);
/// <summary>
/// The corresponding console entity.

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))

View File

@@ -42,9 +42,6 @@
- type: ApcPowerReceiver
powerLoad: 12000
needsPower: false #only turns on when scanning
- type: UpgradePowerDraw
powerDrawMultiplier: 0.80
scaling: Exponential
- type: ArtifactAnalyzer
- type: ItemPlacer
whitelist: