]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Handheld Mass Scanner (#25526)
authorEd <96445749+TheShuEd@users.noreply.github.com>
Mon, 26 Feb 2024 23:19:51 +0000 (02:19 +0300)
committerGitHub <noreply@github.com>
Mon, 26 Feb 2024 23:19:51 +0000 (16:19 -0700)
* handheld

* Update meta.json

* Update meta.json

* Update cargo.yml

* research

* add to borg

* bruh

* borg to T2

* fix

13 files changed:
Content.Server/Shuttles/Systems/RadarConsoleSystem.cs
Content.Shared/Shuttles/Components/RadarConsoleComponent.cs
Resources/Locale/en-US/research/technologies.ftl
Resources/Prototypes/Catalog/Fills/Crates/salvage.yml
Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml
Resources/Prototypes/Entities/Objects/Specific/Robotics/borg_modules.yml
Resources/Prototypes/Entities/Objects/Tools/handheld_mass_scanner.yml [new file with mode: 0644]
Resources/Prototypes/Entities/Structures/Machines/lathe.yml
Resources/Prototypes/Recipes/Lathes/tools.yml
Resources/Prototypes/Research/industrial.yml
Resources/Textures/Objects/Tools/handheld_mass_scanner.rsi/icon.png [new file with mode: 0644]
Resources/Textures/Objects/Tools/handheld_mass_scanner.rsi/meta.json [new file with mode: 0644]
Resources/Textures/Objects/Tools/handheld_mass_scanner.rsi/scanner.png [new file with mode: 0644]

index a8d380541b7c56622c912b70af877efb65d8ee79..fb32437c6e935255ee86c434dc92d58e7cbfd31c 100644 (file)
@@ -3,6 +3,8 @@ using Content.Server.UserInterface;
 using Content.Shared.Shuttles.BUIStates;
 using Content.Shared.Shuttles.Components;
 using Content.Shared.Shuttles.Systems;
+using Content.Shared.PowerCell;
+using Content.Shared.Movement.Components;
 using Robust.Server.GameObjects;
 using Robust.Shared.Map;
 
@@ -30,18 +32,10 @@ public sealed class RadarConsoleSystem : SharedRadarConsoleSystem
         EntityCoordinates? coordinates = onGrid ? xform.Coordinates : null;
         Angle? angle = onGrid ? xform.LocalRotation : null;
 
-        // Use ourself I guess.
-        if (TryComp<IntrinsicUIComponent>(uid, out var intrinsic))
+        if (component.FollowEntity)
         {
-            foreach (var uiKey in intrinsic.UIs)
-            {
-                if (uiKey.Key?.Equals(RadarConsoleUiKey.Key) == true)
-                {
-                    coordinates = new EntityCoordinates(uid, Vector2.Zero);
-                    angle = Angle.Zero;
-                    break;
-                }
-            }
+            coordinates = new EntityCoordinates(uid, Vector2.Zero);
+            angle = Angle.Zero;
         }
 
         if (_uiSystem.TryGetUi(uid, RadarConsoleUiKey.Key, out var bui))
index 96018480f1b5f8131e45262b3315c29e9094d19f..f4ce29e6910c4916b54a0a315304850620846b9f 100644 (file)
@@ -19,4 +19,10 @@ public sealed partial class RadarConsoleComponent : Component
 
     [DataField, AutoNetworkedField]
     public float MaxRange = 256f;
+
+    /// <summary>
+    /// If true, the radar will be centered on the entity. If not - on the grid on which it is located.
+    /// </summary>
+    [DataField]
+    public bool FollowEntity = false;
 }
index 37f0bb58824d676f5b1954bf59963b7f9340aa07..a68f9e80b4ec9e4d3a0614dc3d1834e5f6ab8ac7 100644 (file)
@@ -19,6 +19,7 @@ research-technology-advanced-tools = Advanced Tools
 research-technology-super-powercells = Super Powercells
 research-technology-bluespace-storage = Bluespace Storage
 research-technology-portable-fission = Portable Fission
+research-technology-space-scanning = Space Scanning
 
 research-technology-salvage-weapons = Salvage Weapons
 research-technology-draconic-munitions = Draconic Munitions
index 74b61d910f43ba180dee404c90542d3cb5121181..84526d46d14bd01b226e02a0261a2b46e4ebd26a 100644 (file)
@@ -12,6 +12,7 @@
       - id: OxygenTankFilled
       - id: FireExtinguisher
       - id: ClothingShoesBootsMag
+      - id: HandHeldMassScanner
       - id: Pickaxe
       - id: Welder
       - id: Wrench
index ee4a860877bfbdc6270b3f0133bd5fb52c3af93a..8e3af47416b5dec74f7f8c724c0aa7c6a2ef5a59 100644 (file)
@@ -66,6 +66,7 @@
     title: comms-console-announcement-title-centcom
     color: "#228b22"
   - type: RadarConsole
+    followEntity: true
   - type: CargoOrderConsole
   - type: CrewMonitoringConsole
     snap: false
index 2519611c684c02fdcd37c4bb34192885df5f672c..8d195a25beab876d9674bb7cf0c0813506dda9c2 100644 (file)
   - type: ItemBorgModule
     items:
     - HandheldGPSBasic
+    - HandHeldMassScannerBorg
     - HandheldStationMapUnpowered
 
 - type: entity
diff --git a/Resources/Prototypes/Entities/Objects/Tools/handheld_mass_scanner.yml b/Resources/Prototypes/Entities/Objects/Tools/handheld_mass_scanner.yml
new file mode 100644 (file)
index 0000000..5647737
--- /dev/null
@@ -0,0 +1,72 @@
+- type: entity
+  name: handheld mass scanner
+  parent: [ BaseItem, PowerCellSlotSmallItem]
+  id: HandHeldMassScanner
+  description: A hand-held mass scanner.
+  components:
+  - type: Item
+  - type: Sprite
+    sprite: Objects/Tools/handheld_mass_scanner.rsi
+    state: icon
+    layers:
+      - state: icon
+      - state: scanner
+        shader: unshaded
+        visible: true
+        map: [ "enum.PowerDeviceVisualLayers.Powered" ]
+  - type: RadarConsole
+    maxRange: 64
+    followEntity: true
+  - type: Appearance
+  - type: GenericVisualizer
+    visuals:
+      enum.PowerCellSlotVisuals.Enabled:
+        enum.PowerDeviceVisualLayers.Powered:
+          True: { visible: true }
+          False: { visible: false }
+  - type: PowerCellDraw
+    drawRate: 3
+    useRate: 100
+  - type: ActivatableUIRequiresPowerCell
+  - type: ActivatableUI
+    key: enum.RadarConsoleUiKey.Key
+    inHandsOnly: true
+    singleUser: true
+  - type: UserInterface
+    interfaces:
+      - key: enum.RadarConsoleUiKey.Key
+        type: RadarConsoleBoundUserInterface
+  - type: StaticPrice
+    price: 150
+
+- type: entity
+  id: HandHeldMassScannerEmpty
+  parent: HandHeldMassScanner
+  suffix: Empty
+  components:
+  - type: ItemSlots
+    slots:
+      cell_slot:
+        name: power-cell-slot-component-slot-name-default
+  - type: Sprite
+    sprite: Objects/Tools/handheld_mass_scanner.rsi
+    state: icon
+    layers:
+      - state: icon
+      - state: scanner
+        shader: unshaded
+        visible: false
+        map: [ "enum.PowerDeviceVisualLayers.Powered" ]
+
+- type: entity
+  id: HandHeldMassScannerBorg
+  parent: HandHeldMassScanner
+  suffix: Borg
+  components:
+  - type: ItemSlots
+    slots:
+      cell_slot:
+        name: power-cell-slot-component-slot-name-default
+        startingItem: PowerCellMicroreactor
+        disableEject: true
+        swap: false
\ No newline at end of file
index 72c5720013c8124189e3fe7cde06b29a8ebc7add..a1f00f6ffaa22698a62f9e6e720380aac91fd6d2 100644 (file)
       - SignalTrigger
       - VoiceTrigger
       - Igniter
+      - HandHeldMassScanner
       - PowerCellMicroreactor
       - PowerCellHigh
       - WeaponPistolCHIMP
     - SciFlash
     - BorgModuleCable
     - BorgModuleFireExtinguisher
-    - BorgModuleGPS
     - BorgModuleRadiationDetection
     - BorgModuleTool
     - BorgModuleAppraisal
     - BorgModuleMining
     - BorgModuleGrapplingGun
     - BorgModuleAdvancedTool
+    - BorgModuleGPS
     - BorgModuleRCD
     - BorgModuleArtifact
     - BorgModuleAnomaly
index ce3f4cda3ce4815cee43e37b55028f372b8fa10c..2b335ae6dc462cb6729a4c2af8894358294747d5 100644 (file)
     Steel: 500
     Plastic: 250
 
+- type: latheRecipe
+  id: HandHeldMassScanner
+  result: HandHeldMassScannerEmpty
+  category: Tools
+  completetime: 2
+  materials:
+    Steel: 800
+    Glass: 300
+
 - type: latheRecipe
   id: HandheldGPSBasic
   result: HandheldGPSBasic
index 19295948a4a30e846602cf288a8fb1b03407f524..fb38c8af945dbc51c6e010374ffd5c4015542b92 100644 (file)
   - WeaponGrapplingGun
   - BorgModuleGrapplingGun
 
+- type: technology
+  id: SpaceScanning
+  name: research-technology-space-scanning
+  icon:
+    sprite: Objects/Tools/handheld_mass_scanner.rsi
+    state: icon
+  discipline: Industrial
+  tier: 2
+  cost: 7500
+  recipeUnlocks:
+  - RadarConsoleCircuitboard
+  - HandHeldMassScanner
+  - BorgModuleGPS
+  
 - type: technology
   id: Shuttlecraft
   name: research-technology-shuttlecraft
   cost: 10000
   recipeUnlocks:
   - ShuttleConsoleCircuitboard
-  - RadarConsoleCircuitboard
   - ThrusterMachineCircuitboard
   - GyroscopeMachineCircuitboard
   - MiniGravityGeneratorCircuitboard
diff --git a/Resources/Textures/Objects/Tools/handheld_mass_scanner.rsi/icon.png b/Resources/Textures/Objects/Tools/handheld_mass_scanner.rsi/icon.png
new file mode 100644 (file)
index 0000000..2aea25d
Binary files /dev/null and b/Resources/Textures/Objects/Tools/handheld_mass_scanner.rsi/icon.png differ
diff --git a/Resources/Textures/Objects/Tools/handheld_mass_scanner.rsi/meta.json b/Resources/Textures/Objects/Tools/handheld_mass_scanner.rsi/meta.json
new file mode 100644 (file)
index 0000000..edae9c3
--- /dev/null
@@ -0,0 +1,25 @@
+{
+    "version": 1,
+    "size": {
+        "x": 32,
+        "y": 32
+    },
+    "license": "CC-BY-SA-3.0",
+    "copyright": "Taken from Frontier Station, created by Tem Armoff https://github.com/new-frontiers-14/frontier-station-14/pull/484/files",
+    "states": [
+        {
+            "name": "scanner",
+            "directions": 1,
+            "delays": [
+                [
+                    0.4,
+                    0.4
+                ]
+            ]
+        },
+        {
+            "name": "icon",
+            "directions": 1
+        }
+    ]
+}
diff --git a/Resources/Textures/Objects/Tools/handheld_mass_scanner.rsi/scanner.png b/Resources/Textures/Objects/Tools/handheld_mass_scanner.rsi/scanner.png
new file mode 100644 (file)
index 0000000..46d1c84
Binary files /dev/null and b/Resources/Textures/Objects/Tools/handheld_mass_scanner.rsi/scanner.png differ