]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Xenoarch scanning time halved (#24188)
authorBoaz1111 <149967078+Boaz1111@users.noreply.github.com>
Wed, 17 Jan 2024 16:45:18 +0000 (17:45 +0100)
committerGitHub <noreply@github.com>
Wed, 17 Jan 2024 16:45:18 +0000 (11:45 -0500)
* SALVATION

* Update ArtifactAnalyzerComponent.cs

* Update artifact_analyzer.yml

Content.Server/Xenoarchaeology/Equipment/Components/ArtifactAnalyzerComponent.cs
Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs
Resources/Prototypes/Entities/Structures/Machines/artifact_analyzer.yml

index 07096c59af613bb6e8e47b355f4ef020409025d4..949717676fca2ad564a2fc55522938ce8c045136 100644 (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.
index abb14fbc8d0f70b6f5fcf3eafc185494c2b6a98f..2f0b5459d91e36c8f846463702cea9ebdcf6e097 100644 (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))
index 7c147d5275df80fe7c5e2a8518c4f2dc2093bb83..815c3247ee9c68a7b8283c9d65a081e6dbba3fd6 100644 (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: