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 0000000000..2aea25dd68 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 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 0000000000..46d1c847fe Binary files /dev/null and b/Resources/Textures/Objects/Tools/handheld_mass_scanner.rsi/scanner.png differ