Xenoarch scanning time halved (#24188)
* SALVATION * Update ArtifactAnalyzerComponent.cs * Update artifact_analyzer.yml
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
using Content.Server.Xenoarchaeology.XenoArtifacts;
|
using Content.Server.Xenoarchaeology.XenoArtifacts;
|
||||||
using Content.Shared.Construction.Prototypes;
|
using Content.Shared.Construction.Prototypes;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Serialization.TypeSerializers.Implementations;
|
using Robust.Shared.Serialization.TypeSerializers.Implementations;
|
||||||
@@ -17,26 +17,7 @@ public sealed partial class ArtifactAnalyzerComponent : Component
|
|||||||
/// How long it takes to analyze an artifact
|
/// How long it takes to analyze an artifact
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("analysisDuration", customTypeSerializer: typeof(TimespanSerializer))]
|
[DataField("analysisDuration", customTypeSerializer: typeof(TimespanSerializer))]
|
||||||
public TimeSpan AnalysisDuration = TimeSpan.FromSeconds(60);
|
public TimeSpan AnalysisDuration = TimeSpan.FromSeconds(30);
|
||||||
|
|
||||||
/// <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;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The corresponding console entity.
|
/// The corresponding console entity.
|
||||||
|
|||||||
@@ -51,8 +51,6 @@ public sealed class ArtifactAnalyzerSystem : EntitySystem
|
|||||||
SubscribeLocalEvent<ActiveArtifactAnalyzerComponent, ComponentShutdown>(OnAnalyzeEnd);
|
SubscribeLocalEvent<ActiveArtifactAnalyzerComponent, ComponentShutdown>(OnAnalyzeEnd);
|
||||||
SubscribeLocalEvent<ActiveArtifactAnalyzerComponent, PowerChangedEvent>(OnPowerChanged);
|
SubscribeLocalEvent<ActiveArtifactAnalyzerComponent, PowerChangedEvent>(OnPowerChanged);
|
||||||
|
|
||||||
SubscribeLocalEvent<ArtifactAnalyzerComponent, UpgradeExamineEvent>(OnUpgradeExamine);
|
|
||||||
SubscribeLocalEvent<ArtifactAnalyzerComponent, RefreshPartsEvent>(OnRefreshParts);
|
|
||||||
SubscribeLocalEvent<ArtifactAnalyzerComponent, ItemPlacedEvent>(OnItemPlaced);
|
SubscribeLocalEvent<ArtifactAnalyzerComponent, ItemPlacedEvent>(OnItemPlaced);
|
||||||
SubscribeLocalEvent<ArtifactAnalyzerComponent, ItemRemovedEvent>(OnItemRemoved);
|
SubscribeLocalEvent<ArtifactAnalyzerComponent, ItemRemovedEvent>(OnItemRemoved);
|
||||||
|
|
||||||
@@ -82,7 +80,7 @@ public sealed class ArtifactAnalyzerSystem : EntitySystem
|
|||||||
if (active.AnalysisPaused)
|
if (active.AnalysisPaused)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (_timing.CurTime - active.StartTime < scan.AnalysisDuration * scan.AnalysisDurationMulitplier - active.AccumulatedRunTime)
|
if (_timing.CurTime - active.StartTime < scan.AnalysisDuration - active.AccumulatedRunTime)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
FinishScan(uid, scan, active);
|
FinishScan(uid, scan, active);
|
||||||
@@ -199,7 +197,7 @@ public sealed class ArtifactAnalyzerSystem : EntitySystem
|
|||||||
{
|
{
|
||||||
artifact = analyzer.LastAnalyzedArtifact;
|
artifact = analyzer.LastAnalyzedArtifact;
|
||||||
msg = GetArtifactScanMessage(analyzer);
|
msg = GetArtifactScanMessage(analyzer);
|
||||||
totalTime = analyzer.AnalysisDuration * analyzer.AnalysisDurationMulitplier;
|
totalTime = analyzer.AnalysisDuration;
|
||||||
if (TryComp<ItemPlacerComponent>(component.AnalyzerEntity, out var placer))
|
if (TryComp<ItemPlacerComponent>(component.AnalyzerEntity, out var placer))
|
||||||
canScan = placer.PlacedEntities.Any();
|
canScan = placer.PlacedEntities.Any();
|
||||||
canPrint = analyzer.ReadyToPrint;
|
canPrint = analyzer.ReadyToPrint;
|
||||||
@@ -451,18 +449,6 @@ public sealed class ArtifactAnalyzerSystem : EntitySystem
|
|||||||
UpdateUserInterface(component.Console.Value);
|
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)
|
private void OnItemPlaced(EntityUid uid, ArtifactAnalyzerComponent component, ref ItemPlacedEvent args)
|
||||||
{
|
{
|
||||||
if (component.Console != null && Exists(component.Console))
|
if (component.Console != null && Exists(component.Console))
|
||||||
|
|||||||
@@ -42,9 +42,6 @@
|
|||||||
- type: ApcPowerReceiver
|
- type: ApcPowerReceiver
|
||||||
powerLoad: 12000
|
powerLoad: 12000
|
||||||
needsPower: false #only turns on when scanning
|
needsPower: false #only turns on when scanning
|
||||||
- type: UpgradePowerDraw
|
|
||||||
powerDrawMultiplier: 0.80
|
|
||||||
scaling: Exponential
|
|
||||||
- type: ArtifactAnalyzer
|
- type: ArtifactAnalyzer
|
||||||
- type: ItemPlacer
|
- type: ItemPlacer
|
||||||
whitelist:
|
whitelist:
|
||||||
|
|||||||
Reference in New Issue
Block a user