From 7a5f81ddb46e47078b983bfc9ba015ee67752ee3 Mon Sep 17 00:00:00 2001 From: Ed <96445749+TheShuEd@users.noreply.github.com> Date: Tue, 27 Feb 2024 02:19:51 +0300 Subject: [PATCH] Handheld Mass Scanner (#25526) * handheld * Update meta.json * Update meta.json * Update cargo.yml * research * add to borg * bruh * borg to T2 * fix --- .../Shuttles/Systems/RadarConsoleSystem.cs | 16 ++-- .../Components/RadarConsoleComponent.cs | 6 ++ .../Locale/en-US/research/technologies.ftl | 1 + .../Catalog/Fills/Crates/salvage.yml | 1 + .../Entities/Mobs/Player/admin_ghost.yml | 1 + .../Specific/Robotics/borg_modules.yml | 1 + .../Objects/Tools/handheld_mass_scanner.yml | 72 ++++++++++++++++++ .../Entities/Structures/Machines/lathe.yml | 3 +- Resources/Prototypes/Recipes/Lathes/tools.yml | 9 +++ Resources/Prototypes/Research/industrial.yml | 15 +++- .../Tools/handheld_mass_scanner.rsi/icon.png | Bin 0 -> 2357 bytes .../Tools/handheld_mass_scanner.rsi/meta.json | 25 ++++++ .../handheld_mass_scanner.rsi/scanner.png | Bin 0 -> 248 bytes 13 files changed, 137 insertions(+), 13 deletions(-) create mode 100644 Resources/Prototypes/Entities/Objects/Tools/handheld_mass_scanner.yml create mode 100644 Resources/Textures/Objects/Tools/handheld_mass_scanner.rsi/icon.png create mode 100644 Resources/Textures/Objects/Tools/handheld_mass_scanner.rsi/meta.json create mode 100644 Resources/Textures/Objects/Tools/handheld_mass_scanner.rsi/scanner.png diff --git a/Content.Server/Shuttles/Systems/RadarConsoleSystem.cs b/Content.Server/Shuttles/Systems/RadarConsoleSystem.cs index a8d380541b..fb32437c6e 100644 --- a/Content.Server/Shuttles/Systems/RadarConsoleSystem.cs +++ b/Content.Server/Shuttles/Systems/RadarConsoleSystem.cs @@ -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(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)) diff --git a/Content.Shared/Shuttles/Components/RadarConsoleComponent.cs b/Content.Shared/Shuttles/Components/RadarConsoleComponent.cs index 96018480f1..f4ce29e691 100644 --- a/Content.Shared/Shuttles/Components/RadarConsoleComponent.cs +++ b/Content.Shared/Shuttles/Components/RadarConsoleComponent.cs @@ -19,4 +19,10 @@ public sealed partial class RadarConsoleComponent : Component [DataField, AutoNetworkedField] public float MaxRange = 256f; + + /// + /// If true, the radar will be centered on the entity. If not - on the grid on which it is located. + /// + [DataField] + public bool FollowEntity = false; } diff --git a/Resources/Locale/en-US/research/technologies.ftl b/Resources/Locale/en-US/research/technologies.ftl index 37f0bb5882..a68f9e80b4 100644 --- a/Resources/Locale/en-US/research/technologies.ftl +++ b/Resources/Locale/en-US/research/technologies.ftl @@ -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 diff --git a/Resources/Prototypes/Catalog/Fills/Crates/salvage.yml b/Resources/Prototypes/Catalog/Fills/Crates/salvage.yml index 74b61d910f..84526d46d1 100644 --- a/Resources/Prototypes/Catalog/Fills/Crates/salvage.yml +++ b/Resources/Prototypes/Catalog/Fills/Crates/salvage.yml @@ -12,6 +12,7 @@ - id: OxygenTankFilled - id: FireExtinguisher - id: ClothingShoesBootsMag + - id: HandHeldMassScanner - id: Pickaxe - id: Welder - id: Wrench diff --git a/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml b/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml index ee4a860877..8e3af47416 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml @@ -66,6 +66,7 @@ title: comms-console-announcement-title-centcom color: "#228b22" - type: RadarConsole + followEntity: true - type: CargoOrderConsole - type: CrewMonitoringConsole snap: false diff --git a/Resources/Prototypes/Entities/Objects/Specific/Robotics/borg_modules.yml b/Resources/Prototypes/Entities/Objects/Specific/Robotics/borg_modules.yml index 2519611c68..8d195a25be 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Robotics/borg_modules.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Robotics/borg_modules.yml @@ -145,6 +145,7 @@ - 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 index 0000000000..5647737219 --- /dev/null +++ b/Resources/Prototypes/Entities/Objects/Tools/handheld_mass_scanner.yml @@ -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 diff --git a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml index 72c5720013..a1f00f6ffa 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml @@ -293,6 +293,7 @@ - SignalTrigger - VoiceTrigger - Igniter + - HandHeldMassScanner - PowerCellMicroreactor - PowerCellHigh - WeaponPistolCHIMP @@ -486,7 +487,6 @@ - SciFlash - BorgModuleCable - BorgModuleFireExtinguisher - - BorgModuleGPS - BorgModuleRadiationDetection - BorgModuleTool - BorgModuleAppraisal @@ -536,6 +536,7 @@ - BorgModuleMining - BorgModuleGrapplingGun - BorgModuleAdvancedTool + - BorgModuleGPS - BorgModuleRCD - BorgModuleArtifact - BorgModuleAnomaly diff --git a/Resources/Prototypes/Recipes/Lathes/tools.yml b/Resources/Prototypes/Recipes/Lathes/tools.yml index ce3f4cda3c..2b335ae6dc 100644 --- a/Resources/Prototypes/Recipes/Lathes/tools.yml +++ b/Resources/Prototypes/Recipes/Lathes/tools.yml @@ -133,6 +133,15 @@ 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 diff --git a/Resources/Prototypes/Research/industrial.yml b/Resources/Prototypes/Research/industrial.yml index 19295948a4..fb38c8af94 100644 --- a/Resources/Prototypes/Research/industrial.yml +++ b/Resources/Prototypes/Research/industrial.yml @@ -119,6 +119,20 @@ - 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 @@ -130,7 +144,6 @@ 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 index 0000000000000000000000000000000000000000..2aea25dd6848b53dc086cecd6ac89bd63d65572d GIT binary patch literal 2357 zcmcIleQeZZ9PT0;xWV`o28wni${g#p*N?kv-8r`1#*T2?v0cW%Y1V7s-kM#nx3=3I ziv%TG5TZdq6mg0l^P9{_06~EPpt8JXAf zs;AesH#J4?8qs~YPiT;Tm+>z0A>N4mz;)_%l*vD;6jq-`Ai)pL&?tibz!+jDK|lB&sB+f!Rk?A*a# zZoGrO#7v}YkmT8k2>F>8GDcu`Yrf}{n3Ev`l(8bR_4;!#0t045p)AtmC*E_~93p^D_j z7O+0j7cB<$N?D5zs#?keVoQU_Nm#+dW76~EJXBDDDWGvR95MK~8%qfD@ZAa%7@B~X z4Q{N)=SPb*9iWVjv5|O5Txq5-D1xH-x+L?Jp3)%^_~pjxO*6_9L@XAw#b}$RhX^~z zaRf;b6oo?sZY++NLL846GX_P5WIVtSbtP&lS_HLZg`n1Cx-po?V1jDY=Nnd!7(;!4 z9UG@W8AQw(NxCEsbE8dqI8lWp z5+Dpz2s7Yl_Ti!Cczyn1v{iLTQKJb4?C>zkROEkpb4xzfKZ*2{gG1V|-Yv*vofZ%_ zgZF4+la-IxM)Yb zNP^_VWrksK#zg`=$gu#ITpa1390G9A5{615U#jV<0H;h*g%BX3kr0Mjo#hMtUN=VB zV6ur%e^@YO2!;MuB9ay}hT;K51y!bCwa)HfXqKZ~b|=j-9L)?Ns)24mZ&_k?(ni7T zt
  • dDue1vK^!*O5%%kAefpS(6q1{vxY@2PSUN=uY>(BQw)e&oLC8H;!3QCD$saS zXvp1R1x=Kh*{&(|1(>(3GwT^tk+9YrGT0U_*TMpuG+FS=W?gSg| z-0%zXl81ryHGH6e2sES)j|=L4wGAFMtG%AWfUDx0HK#M%&{3t`MC8hK;-1_rby36n z1(zA$#a7#EkM}&Xx9yAPkwt)$F q>-g@m+@_p;xq4vjl*euTJMTDGH+}4}wSB49LFg?h_jDH3E&Ch99x0yy literal 0 HcmV?d00001 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 index 0000000000..edae9c38c4 --- /dev/null +++ b/Resources/Textures/Objects/Tools/handheld_mass_scanner.rsi/meta.json @@ -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 index 0000000000000000000000000000000000000000..46d1c847feaa78d24705538f7329a92c8b4541b1 GIT binary patch literal 248 zcmeAS@N?(olHy`uVBq!ia0vp^4nVBH!3-p)I`?e@QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1``2&1HT-zcg4mT