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 0000000000..741a265f90 Binary files /dev/null and b/Resources/Textures/Structures/Machines/artifact_analyzer.rsi/panel.png differ