mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-16 21:17:39 +03:00
Artifact Analyzer and Anomaly Vessel Part Upgrading (#1729)
<!-- This is a semi-strict format, you can add/remove sections as needed but the order/format should be kept the same Remove these comments before submitting --> # 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... --- <!-- This is default collapsed, readers click to expand it and see all your media The PR media section can get very large at times, so this is a good way to keep it clean The title is written using HTML tags The title must be within the <summary> tags or you won't see it --> <details><summary><h1>Media</h1></summary> <p> i don't feel like opening up OBS today... </p> </details> --- # Changelog <!-- You can add an author after the `🆑` to change the name that appears in the changelog (ex: `🆑 Death`) Leaving it blank will default to your GitHub display name This includes all available types for the changelog --> 🆑 - 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 <evilexecutive@gmail.com> Co-authored-by: VMSolidus <evilexecutive@gmail.com> (cherry picked from commit cf6707bd67b9c2ab27bc57d91205b204ac3636de)
This commit is contained in:
@@ -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<AnomalyVesselComponent, ComponentShutdown>(OnVesselShutdown);
|
||||
SubscribeLocalEvent<AnomalyVesselComponent, MapInitEvent>(OnVesselMapInit);
|
||||
SubscribeLocalEvent<AnomalyVesselComponent, RefreshPartsEvent>(OnRefreshParts);
|
||||
SubscribeLocalEvent<AnomalyVesselComponent, UpgradeExamineEvent>(OnUpgradeExamine);
|
||||
SubscribeLocalEvent<AnomalyVesselComponent, InteractUsingEvent>(OnVesselInteractUsing);
|
||||
SubscribeLocalEvent<AnomalyVesselComponent, ExaminedEvent>(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<RadiationSourceComponent>(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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
/// <summary>
|
||||
/// The base multiplier without any frills
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public float BasePointMultiplier = 1;
|
||||
|
||||
/// <summary>
|
||||
/// The base radiation for only the experimental vessel
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public float BaseRadiation = .75f;
|
||||
|
||||
/// <summary>
|
||||
/// A multiplier applied to the amount of points generated.
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public float PointMultiplier = 1;
|
||||
|
||||
/// <summary>
|
||||
/// A multiplier applied to the amount of points generated based on the machine parts inserted.
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public float UpgradePointMultiplier = .5f;
|
||||
|
||||
/// <summary>
|
||||
/// A multipler applied to the radiation
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// no free ultra point machine 100% legit
|
||||
/// </remarks>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public float UpgradeRadiationMultiplier = .35f;
|
||||
|
||||
/// <summary>
|
||||
/// Which machine part affects the point multiplier
|
||||
/// </summary>
|
||||
[DataField(customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
|
||||
public string MachinePartPointMultiplier = "Capacitor";
|
||||
|
||||
/// <summary>
|
||||
/// The maximum time between each beep
|
||||
/// </summary>
|
||||
|
||||
@@ -16,8 +16,26 @@ public sealed partial class ArtifactAnalyzerComponent : Component
|
||||
/// <summary>
|
||||
/// How long it takes to analyze an artifact
|
||||
/// </summary>
|
||||
[DataField("analysisDuration", customTypeSerializer: typeof(TimespanSerializer))]
|
||||
public TimeSpan AnalysisDuration = TimeSpan.FromSeconds(30);
|
||||
[DataField("BaseAnalysisDuration", customTypeSerializer: typeof(TimespanSerializer))]
|
||||
public TimeSpan BaseAnalysisDuration = TimeSpan.FromSeconds(40);
|
||||
|
||||
/// <summary>
|
||||
/// How long it takes to analyze an artifact with modifiers applied
|
||||
/// </summary>
|
||||
[DataField("AnalysisDuration", customTypeSerializer: typeof(TimespanSerializer))]
|
||||
public TimeSpan AnalysisDuration = TimeSpan.FromSeconds(40);
|
||||
|
||||
/// <summary>
|
||||
/// Which machine part affects time reduction
|
||||
/// </summary>
|
||||
[DataField(customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
|
||||
public string MachinePartTimeReduction = "Manipulator";
|
||||
|
||||
/// <summary>
|
||||
/// A multiplier applied to the amount of points generated based on the machine parts inserted.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public float UpgradeTimeReductionMultiplier = 10;
|
||||
|
||||
// Nyano - Summary - Begin modified code block: tie artifacts to glimmer.
|
||||
/// <summary>
|
||||
|
||||
@@ -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<ArtifactAnalyzerComponent, ItemPlacedEvent>(OnItemPlaced);
|
||||
SubscribeLocalEvent<ArtifactAnalyzerComponent, ItemRemovedEvent>(OnItemRemoved);
|
||||
|
||||
SubscribeLocalEvent<ArtifactAnalyzerComponent, RefreshPartsEvent>(OnRefreshParts);
|
||||
SubscribeLocalEvent<ArtifactAnalyzerComponent, UpgradeExamineEvent>(OnUpgradeExamine);
|
||||
|
||||
SubscribeLocalEvent<ArtifactAnalyzerComponent, MapInitEvent>(OnMapInit);
|
||||
SubscribeLocalEvent<AnalysisConsoleComponent, NewLinkEvent>(OnNewLink);
|
||||
SubscribeLocalEvent<AnalysisConsoleComponent, PortDisconnectedEvent>(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<ArtifactAnalyzerComponent>(args.Sink, out var analyzer))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 206 B |
Reference in New Issue
Block a user