From 2d67d13fa192cb945e3cd9c6df1450145c73c33e Mon Sep 17 00:00:00 2001 From: dootythefrooty <137359445+dootythefrooty@users.noreply.github.com> Date: Fri, 7 Feb 2025 08:45:58 -0800 Subject: [PATCH] Artifact Analyzer and Anomaly Vessel Part Upgrading (#1729) # Description It's simple as it sounds, really. Adds part upgrading to these machines. The experimental anomaly vessel becomes a stronger demon core every time you upgrade it because I wanted to keep the "More Good but Dangerous" motif and to keep it somewhat balanced... ---

Media

i don't feel like opening up OBS today...

--- # Changelog :cl: - add: Added part upgrading to the artifact analysis machine. - tweak: Tweaked default artifact analysis scan time to 40 seconds. - fix: Fixed anomaly vessels not actually upgrading. --------- Signed-off-by: VMSolidus Co-authored-by: VMSolidus (cherry picked from commit cf6707bd67b9c2ab27bc57d91205b204ac3636de) --- .../Anomaly/AnomalySystem.Vessel.cs | 16 +++++++- .../Components/AnomalyVesselComponent.cs | 36 ++++++++++++++++++ .../Components/ArtifactAnalyzerComponent.cs | 22 ++++++++++- .../Systems/ArtifactAnalyzerSystem.cs | 15 ++++++++ .../Structures/Machines/anomaly_equipment.yml | 3 +- .../Structures/Machines/artifact_analyzer.yml | 4 ++ .../Machines/artifact_analyzer.rsi/meta.json | 5 ++- .../Machines/artifact_analyzer.rsi/panel.png | Bin 0 -> 206 bytes 8 files changed, 95 insertions(+), 6 deletions(-) create mode 100644 Resources/Textures/Structures/Machines/artifact_analyzer.rsi/panel.png diff --git a/Content.Server/Anomaly/AnomalySystem.Vessel.cs b/Content.Server/Anomaly/AnomalySystem.Vessel.cs index 9a6c99f820..b9e8729c14 100644 --- a/Content.Server/Anomaly/AnomalySystem.Vessel.cs +++ b/Content.Server/Anomaly/AnomalySystem.Vessel.cs @@ -7,6 +7,8 @@ using Content.Shared.Examine; using Content.Shared.Interaction; using Content.Shared.Research.Components; using Content.Server.Psionics.Glimmer; +using Content.Shared.Radiation.Components; + namespace Content.Server.Anomaly; @@ -21,6 +23,7 @@ public sealed partial class AnomalySystem { SubscribeLocalEvent(OnVesselShutdown); SubscribeLocalEvent(OnVesselMapInit); + SubscribeLocalEvent(OnRefreshParts); SubscribeLocalEvent(OnUpgradeExamine); SubscribeLocalEvent(OnVesselInteractUsing); SubscribeLocalEvent(OnExamined); @@ -67,9 +70,20 @@ public sealed partial class AnomalySystem UpdateVesselAppearance(uid, component); } + private void OnRefreshParts(EntityUid uid, AnomalyVesselComponent component, RefreshPartsEvent args) + { + var pointRating = args.PartRatings[component.MachinePartPointMultiplier]; + var radRating = args.PartRatings[component.MachinePartPointMultiplier]; + + component.PointMultiplier = component.BasePointMultiplier * (component.UpgradePointMultiplier * pointRating); + + if (TryComp(uid, out var radiation)) + radiation.Intensity = component.BaseRadiation * radRating; + } + private void OnUpgradeExamine(EntityUid uid, AnomalyVesselComponent component, UpgradeExamineEvent args) { - args.AddPercentageUpgrade("anomaly-vessel-component-upgrade-output", component.PointMultiplier); + args.AddPercentageUpgrade("anomaly-vessel-component-upgrade-output", component.PointMultiplier / component.BasePointMultiplier); } private void OnVesselInteractUsing(EntityUid uid, AnomalyVesselComponent component, InteractUsingEvent args) diff --git a/Content.Server/Anomaly/Components/AnomalyVesselComponent.cs b/Content.Server/Anomaly/Components/AnomalyVesselComponent.cs index 1225cbf116..d6dc86004e 100644 --- a/Content.Server/Anomaly/Components/AnomalyVesselComponent.cs +++ b/Content.Server/Anomaly/Components/AnomalyVesselComponent.cs @@ -1,6 +1,9 @@ using Content.Shared.Anomaly; +using Content.Shared.Construction.Prototypes; using Robust.Shared.Audio; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; + namespace Content.Server.Anomaly.Components; @@ -20,12 +23,45 @@ public sealed partial class AnomalyVesselComponent : Component [ViewVariables] public EntityUid? Anomaly; + /// + /// The base multiplier without any frills + /// + [DataField, ViewVariables(VVAccess.ReadWrite)] + public float BasePointMultiplier = 1; + + /// + /// The base radiation for only the experimental vessel + /// + [DataField, ViewVariables(VVAccess.ReadWrite)] + public float BaseRadiation = .75f; + /// /// A multiplier applied to the amount of points generated. /// [DataField, ViewVariables(VVAccess.ReadWrite)] public float PointMultiplier = 1; + /// + /// A multiplier applied to the amount of points generated based on the machine parts inserted. + /// + [DataField, ViewVariables(VVAccess.ReadWrite)] + public float UpgradePointMultiplier = .5f; + + /// + /// A multipler applied to the radiation + /// + /// + /// no free ultra point machine 100% legit + /// + [DataField, ViewVariables(VVAccess.ReadWrite)] + public float UpgradeRadiationMultiplier = .35f; + + /// + /// Which machine part affects the point multiplier + /// + [DataField(customTypeSerializer: typeof(PrototypeIdSerializer))] + public string MachinePartPointMultiplier = "Capacitor"; + /// /// The maximum time between each beep /// diff --git a/Content.Server/Xenoarchaeology/Equipment/Components/ArtifactAnalyzerComponent.cs b/Content.Server/Xenoarchaeology/Equipment/Components/ArtifactAnalyzerComponent.cs index caada22bd4..c10fda599b 100644 --- a/Content.Server/Xenoarchaeology/Equipment/Components/ArtifactAnalyzerComponent.cs +++ b/Content.Server/Xenoarchaeology/Equipment/Components/ArtifactAnalyzerComponent.cs @@ -16,8 +16,26 @@ public sealed partial class ArtifactAnalyzerComponent : Component /// /// How long it takes to analyze an artifact /// - [DataField("analysisDuration", customTypeSerializer: typeof(TimespanSerializer))] - public TimeSpan AnalysisDuration = TimeSpan.FromSeconds(30); + [DataField("BaseAnalysisDuration", customTypeSerializer: typeof(TimespanSerializer))] + public TimeSpan BaseAnalysisDuration = TimeSpan.FromSeconds(40); + + /// + /// How long it takes to analyze an artifact with modifiers applied + /// + [DataField("AnalysisDuration", customTypeSerializer: typeof(TimespanSerializer))] + public TimeSpan AnalysisDuration = TimeSpan.FromSeconds(40); + + /// + /// Which machine part affects time reduction + /// + [DataField(customTypeSerializer: typeof(PrototypeIdSerializer))] + public string MachinePartTimeReduction = "Manipulator"; + + /// + /// A multiplier applied to the amount of points generated based on the machine parts inserted. + /// + [DataField] + public float UpgradeTimeReductionMultiplier = 10; // Nyano - Summary - Begin modified code block: tie artifacts to glimmer. /// diff --git a/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs b/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs index 567a8060c4..413487d56c 100644 --- a/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs +++ b/Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs @@ -1,4 +1,5 @@ using System.Linq; +using Content.Server.Construction; using Content.Server.Paper; using Content.Server.Power.Components; using Content.Server.Research.Systems; @@ -57,6 +58,9 @@ public sealed class ArtifactAnalyzerSystem : EntitySystem SubscribeLocalEvent(OnItemPlaced); SubscribeLocalEvent(OnItemRemoved); + SubscribeLocalEvent(OnRefreshParts); + SubscribeLocalEvent(OnUpgradeExamine); + SubscribeLocalEvent(OnMapInit); SubscribeLocalEvent(OnNewLink); SubscribeLocalEvent(OnPortDisconnected); @@ -163,6 +167,17 @@ public sealed class ArtifactAnalyzerSystem : EntitySystem } } + private void OnRefreshParts(EntityUid uid, ArtifactAnalyzerComponent component, RefreshPartsEvent args) + { + var rating = args.PartRatings[component.MachinePartTimeReduction]; + component.AnalysisDuration = component.BaseAnalysisDuration - TimeSpan.FromSeconds(component.UpgradeTimeReductionMultiplier * (rating - 1)); + } + + private void OnUpgradeExamine(EntityUid uid, ArtifactAnalyzerComponent component, UpgradeExamineEvent args) + { + args.AddPercentageUpgrade("analyzer-artifact-component-upgrade-analysis", component.UpgradeTimeReductionMultiplier); // this is broken and i have no clue how to fix it + } + private void OnNewLink(EntityUid uid, AnalysisConsoleComponent component, NewLinkEvent args) { if (!TryComp(args.Sink, out var analyzer)) diff --git a/Resources/Prototypes/Entities/Structures/Machines/anomaly_equipment.yml b/Resources/Prototypes/Entities/Structures/Machines/anomaly_equipment.yml index 18169728c6..03f753a1d6 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/anomaly_equipment.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/anomaly_equipment.yml @@ -100,9 +100,8 @@ drawdepth: Mobs - type: SpriteFade - type: AnomalyVessel - pointMultiplier: 2 + basePointMultiplier: 2 - type: RadiationSource - intensity: 0.75 slope: 0.1 enabled: false - type: Machine diff --git a/Resources/Prototypes/Entities/Structures/Machines/artifact_analyzer.yml b/Resources/Prototypes/Entities/Structures/Machines/artifact_analyzer.yml index 747b927e2f..5984160911 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/artifact_analyzer.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/artifact_analyzer.yml @@ -13,6 +13,8 @@ - state: unshaded shader: unshaded map: ["enum.PowerDeviceVisualLayers.Powered"] + - state: panel + map: [ "enum.WiresVisualLayers.MaintenancePanel" ] - type: Physics bodyType: Static canCollide: true @@ -49,6 +51,8 @@ whitelist: components: - Artifact + - type: WiresPanel + - type: WiresVisuals - type: DeviceNetwork deviceNetId: Wired receiveFrequencyId: BasicDevice diff --git a/Resources/Textures/Structures/Machines/artifact_analyzer.rsi/meta.json b/Resources/Textures/Structures/Machines/artifact_analyzer.rsi/meta.json index 48fe81cafc..a8c8e7a480 100644 --- a/Resources/Textures/Structures/Machines/artifact_analyzer.rsi/meta.json +++ b/Resources/Textures/Structures/Machines/artifact_analyzer.rsi/meta.json @@ -1,7 +1,7 @@ { "version": 1, "license": "CC-BY-SA-3.0", - "copyright": "Created by EmoGarbage404", + "copyright": "Created by EmoGarbage404, modified by dootythefrooty", "size": { "x": 32, "y": 32 @@ -15,6 +15,9 @@ }, { "name": "unshaded" + }, + { + "name": "panel" } ] } diff --git a/Resources/Textures/Structures/Machines/artifact_analyzer.rsi/panel.png b/Resources/Textures/Structures/Machines/artifact_analyzer.rsi/panel.png new file mode 100644 index 0000000000000000000000000000000000000000..741a265f905ecd27fe7325b7ded31a2e489ac839 GIT binary patch literal 206 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}9iA?ZArY-_ z&l&PHIS8~qyzjBUb8ll7_b%J6rMBrG1m+#QFiFCqd+$}D=*Z3N1_7R~JST7c+*fw* zjE#UG2u!Ts?rFP0zw4sJXH((iClCKVTCcP9z-pNlt9!m%vOlQUe=)-R{PyMZ4yQ8g z-!nhv!D3#n58PTLD~6N9I#pUXO@geCx3 CR8m&} literal 0 HcmV?d00001