]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Experimental Anomaly Vessel (#22233)
authorNemanja <98561806+EmoGarbage404@users.noreply.github.com>
Fri, 8 Dec 2023 18:50:41 +0000 (13:50 -0500)
committerGitHub <noreply@github.com>
Fri, 8 Dec 2023 18:50:41 +0000 (12:50 -0600)
* experimental anomaly vessel

* sprote changes

20 files changed:
Content.Server/Anomaly/AnomalySystem.Vessel.cs
Content.Server/Anomaly/AnomalySystem.cs
Content.Server/Anomaly/Components/AnomalyVesselComponent.cs
Content.Server/Radiation/Systems/RadiationSystem.GridCast.cs
Content.Server/Radiation/Systems/RadiationSystem.cs
Content.Shared/Radiation/Components/RadiationSourceComponent.cs
Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/production.yml
Resources/Prototypes/Entities/Structures/Machines/anomaly_equipment.yml
Resources/Prototypes/Entities/Structures/Machines/lathe.yml
Resources/Prototypes/Recipes/Lathes/electronics.yml
Resources/Prototypes/Research/experimental.yml
Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/anomaly-1.png [new file with mode: 0644]
Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/anomaly-2.png [new file with mode: 0644]
Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/anomaly-3.png [new file with mode: 0644]
Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/base.png [new file with mode: 0644]
Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/meta.json [new file with mode: 0644]
Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/panel.png [new file with mode: 0644]
Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/powered-1.png [new file with mode: 0644]
Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/powered-2.png [new file with mode: 0644]
Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/powered-3.png [new file with mode: 0644]

index 02c435d242508453342f10688d5a5e0bd31254b8..e1394ec44875d0fde2eb9d1e22f9856a6cf45298 100644 (file)
@@ -20,7 +20,6 @@ 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);
@@ -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;
index bb7a7304d9bb450b528cf40b0a48ba64fa5e9fbc..c3f19aa1777a717c8f1e1b9b10119838c96d9281 100644 (file)
@@ -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!;
 
index 426e1d97d55d118143e87a0f15e29d3b64e87b12..74c5e3e9ed2c1e29bf587d9ee60d7eefb693781e 100644 (file)
@@ -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
     /// <summary>
     /// A multiplier applied to the amount of points generated.
     /// </summary>
-    [ViewVariables(VVAccess.ReadWrite)]
+    [DataField, ViewVariables(VVAccess.ReadWrite)]
     public float PointMultiplier = 1;
 
-    /// <summary>
-    /// The machine part that affects the point multiplier of the vessel
-    /// </summary>
-    [DataField("machinePartPointModifier", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
-    public string MachinePartPointModifier = "Capacitor";
-
-    /// <summary>
-    /// A value used to scale the point multiplier
-    /// with the corresponding part rating.
-    /// </summary>
-    [DataField("partRatingPointModifier")]
-    public float PartRatingPointModifier = 1.25f;
-
     /// <summary>
     /// The maximum time between each beep
     /// </summary>
index 1be8f0fb0400f0c32f482ebc761dd219908e5c4f..b8193c4d2f397229d61380630b5934efd3cb9693 100644 (file)
@@ -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);
index 8e774c788dff247e377bcc2c34bd4762c9054e62..ffb7ab1a11f5bff8633a2f179bc3552b0d2f14ca 100644 (file)
@@ -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<RadiationSourceComponent?> entity, bool val)
+    {
+        if (!Resolve(entity, ref entity.Comp, false))
+            return;
+
+        entity.Comp.Enabled = val;
+    }
+
     /// <summary>
     ///     Marks entity to receive/ignore radiation rays.
     /// </summary>
index 9d2106f99361934d807f6cce0ef5b26e77c93833..fa6b83993529ec3caa3b140377758b15d7fa2c15 100644 (file)
@@ -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;
 }
index 8e7c3aeb27426d3118dc725a2a8bdf4c0bfb5543..b47e286bda03e22698a767b3f13149ea4a37db59 100644 (file)
     - 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
index dc2b5c66781ae1adf2b46ada5ba6df34888df31c..3fad77648f3c29dc6522633e965ab9dcf027ba1d 100644 (file)
@@ -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
     canCreateVacuum: false
   - type: Destructible
     thresholds:
-    - trigger:
-        !type:DamageTrigger
-        damage: 300
-      behaviors:
-        - !type:DoActsBehavior
-          acts: [ "Destruction" ]
     - trigger:
         !type:DamageTrigger
         damage: 150
     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 ]
index 57de6f9a57411e7c6cac26ab1750decf7b57e11b..73c094bcb7fd2514bfd49fa5cd3a429f9768fd9c 100644 (file)
       - AnalysisComputerCircuitboard
       - ExosuitFabricatorMachineCircuitboard
       - AnomalyVesselCircuitboard
+      - AnomalyVesselExperimentalCircuitboard
       - AnomalySynchronizerCircuitboard
       - APECircuitboard
       - ArtifactAnalyzerMachineCircuitboard
index 88b655644feabede5af84265242ef2302749218b..df031864cf16f52cf1a0fd6d7ad96e93e3d1ceb1 100644 (file)
      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
   materials:
      Steel: 100
      Glass: 900
-     Gold: 100     
+     Gold: 100
index 363dee815e3f395bb7e25f08644c0cbbc2715649..9eed5e59942b7898b160b3e0f22b42b992df56bc 100644 (file)
   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 (file)
index 0000000..75b33a1
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 (file)
index 0000000..ffa6efd
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 (file)
index 0000000..4f17e84
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 (file)
index 0000000..a69b856
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 (file)
index 0000000..e7fe21e
--- /dev/null
@@ -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 (file)
index 0000000..5c11431
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 (file)
index 0000000..5048573
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 (file)
index 0000000..e9ec8a6
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 (file)
index 0000000..2c93f72
Binary files /dev/null and b/Resources/Textures/Structures/Machines/Anomaly/adv_anomaly_vessel.rsi/powered-3.png differ