From e7e7974a24d03e3da788cd55ff4987d278148927 Mon Sep 17 00:00:00 2001 From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Fri, 8 Dec 2023 13:50:41 -0500 Subject: [PATCH] Experimental Anomaly Vessel (#22233) * experimental anomaly vessel * sprote changes --- .../Anomaly/AnomalySystem.Vessel.cs | 9 +---- Content.Server/Anomaly/AnomalySystem.cs | 3 +- .../Components/AnomalyVesselComponent.cs | 17 +-------- .../Systems/RadiationSystem.GridCast.cs | 3 ++ .../Radiation/Systems/RadiationSystem.cs | 9 +++++ .../Components/RadiationSourceComponent.cs | 3 ++ .../Circuitboards/Machine/production.yml | 19 +++++++++- .../Structures/Machines/anomaly_equipment.yml | 34 +++++++++++++---- .../Entities/Structures/Machines/lathe.yml | 1 + .../Prototypes/Recipes/Lathes/electronics.yml | 11 +++++- .../Prototypes/Research/experimental.yml | 1 + .../adv_anomaly_vessel.rsi/anomaly-1.png | Bin 0 -> 273 bytes .../adv_anomaly_vessel.rsi/anomaly-2.png | Bin 0 -> 259 bytes .../adv_anomaly_vessel.rsi/anomaly-3.png | Bin 0 -> 250 bytes .../Anomaly/adv_anomaly_vessel.rsi/base.png | Bin 0 -> 1075 bytes .../Anomaly/adv_anomaly_vessel.rsi/meta.json | 35 ++++++++++++++++++ .../Anomaly/adv_anomaly_vessel.rsi/panel.png | Bin 0 -> 223 bytes .../adv_anomaly_vessel.rsi/powered-1.png | Bin 0 -> 159 bytes .../adv_anomaly_vessel.rsi/powered-2.png | Bin 0 -> 176 bytes .../adv_anomaly_vessel.rsi/powered-3.png | Bin 0 -> 177 bytes 20 files changed, 112 insertions(+), 33 deletions(-) create mode 100644 Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/anomaly-1.png create mode 100644 Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/anomaly-2.png create mode 100644 Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/anomaly-3.png create mode 100644 Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/base.png create mode 100644 Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/meta.json create mode 100644 Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/panel.png create mode 100644 Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/powered-1.png create mode 100644 Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/powered-2.png create mode 100644 Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/powered-3.png 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 0000000000000000000000000000000000000000..75b33a1d8d29cc15cd8f5368175dff89f11b8327 GIT binary patch literal 273 zcmeAS@N?(olHy`uVBq!ia0vp^3P9|@!3HF&`%2dVDaPU;cPEB*=VV?2Ij22c978f1 z-(E4~JES1d_RzmxJSWNdlCfo_Fn>T_1N#eKt4a=kCntkU>%=(*zRR0-z4(6S!X5`k z1tlo>RX+O;XY%#!3A&XBWs+Oj z`W37b>bNhRntGzJ;NPq~N6!;lFL^7<&&0g*ulRjo#v=xxQ-0a{Ge3&|eEYICGtgTM Mp00i_>zopr0E^^j-~a#s literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..ffa6efd144ff3c0c4aa0e48b9e0e94a9200f1a12 GIT binary patch literal 259 zcmeAS@N?(olHy`uVBq!ia0vp^3P9|@!3HF&`%2dVDaPU;cPEB*=VV?2IeR@_978f1 z-(IojI%FWi_QC(YUR}$4UlZsN22WQ%mvv4FO#qsj BXYv35 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..4f17e843d53fd34954c5ce5a28d531319336d517 GIT binary patch literal 250 zcmeAS@N?(olHy`uVBq!ia0vp^3P9|@!3HF&`%2dVDaPU;cPEB*=VV?2Ia@qk978f1 z-(E4~I^-bG`fz#2(+t67f|s6Z#3gP&b5qAW{Da0zrc5V+xtFwh4=w85EyZ0MKQ+nh z=gme27Z~`TH?eBL`nk*u(mEYndFKU0`5AUQUp^yt;rh9o2@h*_E?UEt-^|J&AbNjm z@{PP}0;2PUHhOV(*xqqCQR`pSu%hDP^Zsd}5BCdwIK`F5+u^*UDTDR*I@x|pZI7b= r?0c+*qt(pj*qKb0bpYD9Kb=YNe&qfuZ;EaL-Ou3Z>gTe~DWM4fp|xPP literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..a69b856d65426a81cbc60d3d5fcbc4bf33b3bb8f GIT binary patch literal 1075 zcmV-31kC%1P)Px&?MXyIRA_qx$gQyjX5fW%}=$D}iCB;J#JO)Af3rc^2 z2SMl$sCX#!kV4y|DG~gDT1dd0RO}@b2?Vj3t>&5@(phJA=WAnZd+>pns0eET%()3cMFfh# zRlrI>GL>rfbVuRTsnOP{Q}lF4t)pNRz??5EW^MQY01Jy*YY|2PJ>5}cW;52#88WjO z^mIp!c3J^!1d&L8U;(U;DGEvfEcES+o`FR{CqgNJIgdp8QLCK%3Mw!Fi)%bb8*X2u@8Rx>Ps#8UTRuUKwYN2An#@ z=x`FF!%5$ia_SUkjRwklWyB_9E{{%xQ~>Y1yjK?PnI6kaORrtQ01%suxgx9u@S|p+ z)bZU{38&NnAz_z;kA_wN%b(0KBeVe_VWA%%4R0L@Mac5UJ0~P8bhCV1Q0?n-PFYOydkKoAbpSwmY7WIxUf_{IS%l{V8uztvW1OPmI^uS}U=lP)$5Htd+6#TUas8VpH5n%ItWo6fA2ehVP z;0Rnqn!B zUrt3BEpMX&?<>%YNns-=gm7$R42MUDoG2=+f;I@W5T&Q)-1An5!$`!VzWb&Z?;C#cR%96Y2EVAG2~GT0WPjzcS;^)?iBrx!ai$EF3VSXwu7NCoiw zdfg~(|FE#-2m!5U!PDuq6>+EVC11eW>T;+H01ozdtX{P`iG%$e0Dn?&T&+qsmsbh) t-6;eBxBB`5f9>i7ex9C&{)JxwzX4oxO#q(RC4v9|002ovPDHLkV1i#M>2Lr5 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..5c11431bd78217437ebb1f9cff6e5e824f703f68 GIT binary patch literal 223 zcmeAS@N?(olHy`uVBq!ia0vp^3P9|@!3HF&`%2dVDaPU;cPEB*=VV?2IWs+7978f1 z-(Jz?YjzN6eHa}S{EeZsH1tg~%W16$t|r|Jr`EMEIjCT0!J?8N=sWWvpW}!6ym`-O zND2aV1HpqgdfV7PJ^1=_`#jUkP0@{ye(KeqZU4JCw(oKNl$rNl-V`z5++X=Gp*Swo zL3*9m1Erc`#_)%;xpwe~3+}v?Be(nH`lY+FnL@AqW4LVV{VIJ$X$2z#L%|NoeczQn Tr5=dL0$Jke>gTe~DWM4f?kHD4 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..504857312a4e86fcddfad61fb7e946e76765ee35 GIT binary patch literal 159 zcmeAS@N?(olHy`uVBq!ia0vp^3P9|@!3HF&`%2dVDaPU;cPEB*=VV?2Igy?&jv*P1 zZ!a72HW&!BU1Xb*(6mI`$e_`TM}a}uLo;|XpU#s8gFV~tl-&QeoCT&HVZ?E3}?GsG)9Cw<_4AcY$1{#)L zvFaO3dZrb4+`GCqQmf%V@2w3_H2$`KFODnw`floO*;i8YniYSl=kLG9_&}Il#95Pf SPqy=ZkZw;`KbLh*2~7aE%{z7g literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..2c93f720c9bfba36dee1cf2c549685d0365c9c1d GIT binary patch literal 177 zcmeAS@N?(olHy`uVBq!ia0vp^3P9|@!3HF&`%2dVDaPU;cPEB*=VV?2IoX~rjv*P1 zZ!d4;ZBP(seR#P^QX`*7`1`^lrSFOSQo`vA4t5=z)A_8&?Em!%F%|u7!i+#&U{G+v zaBFVVtmVmHT0)zr1lfun_|KL-BRT7D`}g8|;h*14-7Wh}YF_iIhbM2ZFJ<^~gt3iT UBZlXcRyIhtr>mdKI;Vst0Gf9}FaQ7m literal 0 HcmV?d00001