diff --git a/Content.Server/Anomaly/AnomalySystem.Vessel.cs b/Content.Server/Anomaly/AnomalySystem.Vessel.cs index 02c435d242..e1394ec448 100644 --- a/Content.Server/Anomaly/AnomalySystem.Vessel.cs +++ b/Content.Server/Anomaly/AnomalySystem.Vessel.cs @@ -20,7 +20,6 @@ public sealed partial class AnomalySystem { SubscribeLocalEvent(OnVesselShutdown); SubscribeLocalEvent(OnVesselMapInit); - SubscribeLocalEvent(OnRefreshParts); SubscribeLocalEvent(OnUpgradeExamine); SubscribeLocalEvent(OnVesselInteractUsing); SubscribeLocalEvent(OnExamined); @@ -68,12 +67,6 @@ public sealed partial class AnomalySystem UpdateVesselAppearance(uid, component); } - private void OnRefreshParts(EntityUid uid, AnomalyVesselComponent component, RefreshPartsEvent args) - { - var modifierRating = args.PartRatings[component.MachinePartPointModifier] - 1; - component.PointMultiplier = MathF.Pow(component.PartRatingPointModifier, modifierRating); - } - private void OnUpgradeExamine(EntityUid uid, AnomalyVesselComponent component, UpgradeExamineEvent args) { args.AddPercentageUpgrade("anomaly-vessel-component-upgrade-output", component.PointMultiplier); @@ -93,6 +86,7 @@ public sealed partial class AnomalySystem component.Anomaly = scanner.ScannedAnomaly; anomalyComponent.ConnectedVessel = uid; + _radiation.SetSourceEnabled(uid, true); UpdateVesselAppearance(uid, component); Popup.PopupEntity(Loc.GetString("anomaly-vessel-component-anomaly-assigned"), uid); } @@ -120,6 +114,7 @@ public sealed partial class AnomalySystem component.Anomaly = null; UpdateVesselAppearance(ent, component); + _radiation.SetSourceEnabled(ent, false); if (!args.Supercritical) continue; diff --git a/Content.Server/Anomaly/AnomalySystem.cs b/Content.Server/Anomaly/AnomalySystem.cs index bb7a7304d9..c3f19aa177 100644 --- a/Content.Server/Anomaly/AnomalySystem.cs +++ b/Content.Server/Anomaly/AnomalySystem.cs @@ -3,13 +3,13 @@ using Content.Server.Atmos.EntitySystems; using Content.Server.Audio; using Content.Server.Explosion.EntitySystems; using Content.Server.Materials; +using Content.Server.Radiation.Systems; using Content.Server.Radio.EntitySystems; using Content.Server.Station.Systems; using Content.Shared.Anomaly; using Content.Shared.Anomaly.Components; using Content.Shared.DoAfter; using Robust.Server.GameObjects; -using Robust.Shared.Audio; using Robust.Shared.Audio.Systems; using Robust.Shared.Configuration; using Robust.Shared.Physics.Events; @@ -33,6 +33,7 @@ public sealed partial class AnomalySystem : SharedAnomalySystem [Dependency] private readonly SharedPointLightSystem _pointLight = default!; [Dependency] private readonly StationSystem _station = default!; [Dependency] private readonly RadioSystem _radio = default!; + [Dependency] private readonly RadiationSystem _radiation = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly UserInterfaceSystem _ui = default!; diff --git a/Content.Server/Anomaly/Components/AnomalyVesselComponent.cs b/Content.Server/Anomaly/Components/AnomalyVesselComponent.cs index 426e1d97d5..74c5e3e9ed 100644 --- a/Content.Server/Anomaly/Components/AnomalyVesselComponent.cs +++ b/Content.Server/Anomaly/Components/AnomalyVesselComponent.cs @@ -1,8 +1,6 @@ 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; @@ -25,22 +23,9 @@ public sealed partial class AnomalyVesselComponent : Component /// /// A multiplier applied to the amount of points generated. /// - [ViewVariables(VVAccess.ReadWrite)] + [DataField, ViewVariables(VVAccess.ReadWrite)] public float PointMultiplier = 1; - /// - /// The machine part that affects the point multiplier of the vessel - /// - [DataField("machinePartPointModifier", customTypeSerializer: typeof(PrototypeIdSerializer))] - public string MachinePartPointModifier = "Capacitor"; - - /// - /// A value used to scale the point multiplier - /// with the corresponding part rating. - /// - [DataField("partRatingPointModifier")] - public float PartRatingPointModifier = 1.25f; - /// /// The maximum time between each beep /// diff --git a/Content.Server/Radiation/Systems/RadiationSystem.GridCast.cs b/Content.Server/Radiation/Systems/RadiationSystem.GridCast.cs index 1be8f0fb04..b8193c4d2f 100644 --- a/Content.Server/Radiation/Systems/RadiationSystem.GridCast.cs +++ b/Content.Server/Radiation/Systems/RadiationSystem.GridCast.cs @@ -44,6 +44,9 @@ public partial class RadiationSystem var sourcesData = new ValueList<(EntityUid, RadiationSourceComponent, TransformComponent, Vector2)>(); while (sources.MoveNext(out var uid, out var source, out var sourceTrs)) { + if (!source.Enabled) + continue; + var worldPos = _transform.GetWorldPosition(sourceTrs, transformQuery); var data = (uid, source, sourceTrs, worldPos); sourcesData.Add(data); diff --git a/Content.Server/Radiation/Systems/RadiationSystem.cs b/Content.Server/Radiation/Systems/RadiationSystem.cs index 8e774c788d..ffb7ab1a11 100644 --- a/Content.Server/Radiation/Systems/RadiationSystem.cs +++ b/Content.Server/Radiation/Systems/RadiationSystem.cs @@ -1,4 +1,5 @@ using Content.Server.Radiation.Components; +using Content.Shared.Radiation.Components; using Content.Shared.Radiation.Events; using Robust.Shared.Configuration; using Robust.Shared.Map; @@ -45,6 +46,14 @@ public sealed partial class RadiationSystem : EntitySystem RaiseLocalEvent(uid, msg); } + public void SetSourceEnabled(Entity entity, bool val) + { + if (!Resolve(entity, ref entity.Comp, false)) + return; + + entity.Comp.Enabled = val; + } + /// /// Marks entity to receive/ignore radiation rays. /// diff --git a/Content.Shared/Radiation/Components/RadiationSourceComponent.cs b/Content.Shared/Radiation/Components/RadiationSourceComponent.cs index 9d2106f993..fa6b839935 100644 --- a/Content.Shared/Radiation/Components/RadiationSourceComponent.cs +++ b/Content.Shared/Radiation/Components/RadiationSourceComponent.cs @@ -23,4 +23,7 @@ public sealed partial class RadiationSourceComponent : Component [ViewVariables(VVAccess.ReadWrite)] [DataField("slope")] public float Slope = 0.5f; + + [DataField, ViewVariables(VVAccess.ReadWrite)] + public bool Enabled; } diff --git a/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/production.yml b/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/production.yml index 8e7c3aeb27..b47e286bda 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/production.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/production.yml @@ -228,11 +228,28 @@ - type: MachineBoard prototype: MachineAnomalyVessel requirements: - Capacitor: 5 + Capacitor: 3 materialRequirements: Cable: 1 PlasmaGlass: 10 +- type: entity + parent: BaseMachineCircuitboard + id: AnomalyVesselExperimentalCircuitboard + name: experimental anomaly vessel machine board + description: A machine printed circuit board for an experimental anomaly vessel. + components: + - type: Sprite + state: science + - type: MachineBoard + prototype: MachineAnomalyVesselExperimental + requirements: + Capacitor: 3 + materialRequirements: + Cable: 5 + PlasmaGlass: 15 + MetalRod: 4 + - type: entity parent: BaseMachineCircuitboard id: AnomalySynchronizerCircuitboard diff --git a/Resources/Prototypes/Entities/Structures/Machines/anomaly_equipment.yml b/Resources/Prototypes/Entities/Structures/Machines/anomaly_equipment.yml index dc2b5c6678..3fad77648f 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/anomaly_equipment.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/anomaly_equipment.yml @@ -2,7 +2,7 @@ id: MachineAnomalyVessel parent: [ BaseMachinePowered, ConstructibleMachine ] name: anomaly vessel - description: A container able to harness a scan of an anomaly and turn it into research points. + description: A container able to harness a scan of an anomaly and turn it into research data. components: - type: Sprite noRot: true @@ -77,12 +77,6 @@ canCreateVacuum: false - type: Destructible thresholds: - - trigger: - !type:DamageTrigger - damage: 300 - behaviors: - - !type:DoActsBehavior - acts: [ "Destruction" ] - trigger: !type:DamageTrigger damage: 150 @@ -97,6 +91,32 @@ guides: - ScannersAndVessels +- type: entity + id: MachineAnomalyVesselExperimental + parent: MachineAnomalyVessel + name: experimental anomaly vessel + description: An advanced anomaly vessel capable of greater research potential at the cost of increased volatility and low-level radioactive decay into the environment. + components: + - type: Sprite + sprite: Structures/Machines/Anomaly/adv_anomaly_vessel.rsi + offset: 0,0.5 + drawdepth: Mobs + - type: SpriteFade + - type: AnomalyVessel + pointMultiplier: 2 + - type: RadiationSource + intensity: 0.75 + slope: 0.1 + enabled: false + - type: Machine + board: AnomalyVesselExperimentalCircuitboard + - type: Explosive + explosionType: Default + maxIntensity: 50 + intensitySlope: 7.5 + totalIntensity: 500 + canCreateVacuum: true + - type: entity id: MachineAPE parent: [ BaseMachinePowered, ConstructibleMachine ] diff --git a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml index 57de6f9a57..73c094bcb7 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml @@ -370,6 +370,7 @@ - AnalysisComputerCircuitboard - ExosuitFabricatorMachineCircuitboard - AnomalyVesselCircuitboard + - AnomalyVesselExperimentalCircuitboard - AnomalySynchronizerCircuitboard - APECircuitboard - ArtifactAnalyzerMachineCircuitboard diff --git a/Resources/Prototypes/Recipes/Lathes/electronics.yml b/Resources/Prototypes/Recipes/Lathes/electronics.yml index 88b655644f..df031864cf 100644 --- a/Resources/Prototypes/Recipes/Lathes/electronics.yml +++ b/Resources/Prototypes/Recipes/Lathes/electronics.yml @@ -248,6 +248,15 @@ Steel: 100 Glass: 900 +- type: latheRecipe + id: AnomalyVesselExperimentalCircuitboard + result: AnomalyVesselExperimentalCircuitboard + completetime: 4 + materials: + Steel: 100 + Glass: 900 + Gold: 100 + - type: latheRecipe id: AnomalySynchronizerCircuitboard result: AnomalySynchronizerCircuitboard @@ -695,4 +704,4 @@ materials: Steel: 100 Glass: 900 - Gold: 100 + Gold: 100 diff --git a/Resources/Prototypes/Research/experimental.yml b/Resources/Prototypes/Research/experimental.yml index 363dee815e..9eed5e5994 100644 --- a/Resources/Prototypes/Research/experimental.yml +++ b/Resources/Prototypes/Research/experimental.yml @@ -110,6 +110,7 @@ recipeUnlocks: - WeaponPistolCHIMP - AnomalySynchronizerCircuitboard + - AnomalyVesselExperimentalCircuitboard technologyPrerequisites: - BasicAnomalousResearch diff --git a/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/anomaly-1.png b/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/anomaly-1.png new file mode 100644 index 0000000000..75b33a1d8d Binary files /dev/null and b/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/anomaly-1.png differ diff --git a/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/anomaly-2.png b/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/anomaly-2.png new file mode 100644 index 0000000000..ffa6efd144 Binary files /dev/null and b/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/anomaly-2.png differ diff --git a/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/anomaly-3.png b/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/anomaly-3.png new file mode 100644 index 0000000000..4f17e843d5 Binary files /dev/null and b/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/anomaly-3.png differ diff --git a/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/base.png b/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/base.png new file mode 100644 index 0000000000..a69b856d65 Binary files /dev/null and b/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/base.png differ diff --git a/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/meta.json b/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/meta.json new file mode 100644 index 0000000000..e7fe21e79a --- /dev/null +++ b/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/meta.json @@ -0,0 +1,35 @@ +{ + "version": 1, + "license": "CC0-1.0", + "copyright": "Created by EmoGarbage404 (github)", + "size": { + "x": 32, + "y": 64 + }, + "states": [ + { + "name": "anomaly-1" + }, + { + "name": "anomaly-2" + }, + { + "name": "anomaly-3" + }, + { + "name": "base" + }, + { + "name": "panel" + }, + { + "name": "powered-1" + }, + { + "name": "powered-2" + }, + { + "name": "powered-3" + } + ] +} diff --git a/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/panel.png b/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/panel.png new file mode 100644 index 0000000000..5c11431bd7 Binary files /dev/null and b/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/panel.png differ diff --git a/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/powered-1.png b/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/powered-1.png new file mode 100644 index 0000000000..504857312a Binary files /dev/null and b/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/powered-1.png differ diff --git a/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/powered-2.png b/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/powered-2.png new file mode 100644 index 0000000000..e9ec8a60d7 Binary files /dev/null and b/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/powered-2.png differ diff --git a/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/powered-3.png b/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/powered-3.png new file mode 100644 index 0000000000..2c93f720c9 Binary files /dev/null and b/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/powered-3.png differ