From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Fri, 6 Sep 2024 14:05:53 +0000 (-0400) Subject: Mineral Scanner (#31390) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=85992518256e85c7980b784b6462727f9158a413;p=space-station-14.git Mineral Scanner (#31390) * Mineral Scanner * doink * review * sunday funday * review and fix bugs i think? * Update MiningOverlay.cs --- diff --git a/Content.Client/Mining/MiningOverlay.cs b/Content.Client/Mining/MiningOverlay.cs new file mode 100644 index 0000000000..b23835b36e --- /dev/null +++ b/Content.Client/Mining/MiningOverlay.cs @@ -0,0 +1,96 @@ +using System.Numerics; +using Content.Shared.Mining.Components; +using Robust.Client.GameObjects; +using Robust.Client.Graphics; +using Robust.Client.Player; +using Robust.Shared.Enums; +using Robust.Shared.Timing; +using Robust.Shared.Utility; + +namespace Content.Client.Mining; + +public sealed class MiningOverlay : Overlay +{ + [Dependency] private readonly IEntityManager _entityManager = default!; + [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private readonly IPlayerManager _player = default!; + private readonly EntityLookupSystem _lookup; + private readonly SpriteSystem _sprite; + private readonly TransformSystem _xform; + + private readonly EntityQuery _spriteQuery; + private readonly EntityQuery _xformQuery; + + public override OverlaySpace Space => OverlaySpace.WorldSpace; + public override bool RequestScreenTexture => false; + + private readonly HashSet> _viewableEnts = new(); + + public MiningOverlay() + { + IoCManager.InjectDependencies(this); + + _lookup = _entityManager.System(); + _sprite = _entityManager.System(); + _xform = _entityManager.System(); + + _spriteQuery = _entityManager.GetEntityQuery(); + _xformQuery = _entityManager.GetEntityQuery(); + } + + protected override void Draw(in OverlayDrawArgs args) + { + var handle = args.WorldHandle; + + if (_player.LocalEntity is not { } localEntity || + !_entityManager.TryGetComponent(localEntity, out var viewerComp)) + return; + + if (viewerComp.LastPingLocation == null) + return; + + var scaleMatrix = Matrix3Helpers.CreateScale(Vector2.One); + + _viewableEnts.Clear(); + _lookup.GetEntitiesInRange(viewerComp.LastPingLocation.Value, viewerComp.ViewRange, _viewableEnts); + foreach (var ore in _viewableEnts) + { + if (!_xformQuery.TryComp(ore, out var xform) || + !_spriteQuery.TryComp(ore, out var sprite)) + continue; + + if (xform.MapID != args.MapId || !sprite.Visible) + continue; + + if (!sprite.LayerMapTryGet(MiningScannerVisualLayers.Overlay, out var idx)) + continue; + var layer = sprite[idx]; + + if (layer.ActualRsi?.Path == null || layer.RsiState.Name == null) + continue; + + var gridRot = xform.GridUid == null ? 0 : _xformQuery.CompOrNull(xform.GridUid.Value)?.LocalRotation ?? 0; + var rotationMatrix = Matrix3Helpers.CreateRotation(gridRot); + + var worldMatrix = Matrix3Helpers.CreateTranslation(_xform.GetWorldPosition(xform)); + var scaledWorld = Matrix3x2.Multiply(scaleMatrix, worldMatrix); + var matty = Matrix3x2.Multiply(rotationMatrix, scaledWorld); + handle.SetTransform(matty); + + var spriteSpec = new SpriteSpecifier.Rsi(layer.ActualRsi.Path, layer.RsiState.Name); + var texture = _sprite.GetFrame(spriteSpec, TimeSpan.FromSeconds(layer.AnimationTime)); + + var animTime = (viewerComp.NextPingTime - _timing.CurTime).TotalSeconds; + + + var alpha = animTime < viewerComp.AnimationDuration + ? 0 + : (float) Math.Clamp((animTime - viewerComp.AnimationDuration) / viewerComp.AnimationDuration, 0f, 1f); + var color = Color.White.WithAlpha(alpha); + + handle.DrawTexture(texture, -(Vector2) texture.Size / 2f / EyeManager.PixelsPerMeter, layer.Rotation, modulate: color); + + } + handle.SetTransform(Matrix3x2.Identity); + } +} diff --git a/Content.Client/Mining/MiningOverlaySystem.cs b/Content.Client/Mining/MiningOverlaySystem.cs new file mode 100644 index 0000000000..294cab30ca --- /dev/null +++ b/Content.Client/Mining/MiningOverlaySystem.cs @@ -0,0 +1,54 @@ +using Content.Shared.Mining.Components; +using Robust.Client.Graphics; +using Robust.Client.Player; +using Robust.Shared.Player; + +namespace Content.Client.Mining; + +/// +/// This handles the lifetime of the for a given entity. +/// +public sealed class MiningOverlaySystem : EntitySystem +{ + [Dependency] private readonly IPlayerManager _player = default!; + [Dependency] private readonly IOverlayManager _overlayMan = default!; + + private MiningOverlay _overlay = default!; + + /// + public override void Initialize() + { + SubscribeLocalEvent(OnInit); + SubscribeLocalEvent(OnShutdown); + SubscribeLocalEvent(OnPlayerAttached); + SubscribeLocalEvent(OnPlayerDetached); + + _overlay = new(); + } + + private void OnPlayerAttached(Entity ent, ref LocalPlayerAttachedEvent args) + { + _overlayMan.AddOverlay(_overlay); + } + + private void OnPlayerDetached(Entity ent, ref LocalPlayerDetachedEvent args) + { + _overlayMan.RemoveOverlay(_overlay); + } + + private void OnInit(Entity ent, ref ComponentInit args) + { + if (_player.LocalEntity == ent) + { + _overlayMan.AddOverlay(_overlay); + } + } + + private void OnShutdown(Entity ent, ref ComponentShutdown args) + { + if (_player.LocalEntity == ent) + { + _overlayMan.RemoveOverlay(_overlay); + } + } +} diff --git a/Content.Client/Mining/OreVeinVisualsComponent.cs b/Content.Client/Mining/OreVeinVisualsComponent.cs deleted file mode 100644 index c662111c3e..0000000000 --- a/Content.Client/Mining/OreVeinVisualsComponent.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Content.Client.Mining; - -public sealed class OreVeinVisualsComponent -{ - -} diff --git a/Content.Server/Mining/MiningSystem.cs b/Content.Server/Mining/MiningSystem.cs index a673cda946..18e96e5769 100644 --- a/Content.Server/Mining/MiningSystem.cs +++ b/Content.Server/Mining/MiningSystem.cs @@ -1,6 +1,6 @@ -using Content.Server.Mining.Components; using Content.Shared.Destructible; using Content.Shared.Mining; +using Content.Shared.Mining.Components; using Content.Shared.Random; using Content.Shared.Random.Helpers; using Robust.Shared.Prototypes; diff --git a/Content.Shared/Item/ItemToggle/ItemToggleSystem.cs b/Content.Shared/Item/ItemToggle/ItemToggleSystem.cs index 33b88dbaf8..98029f97d5 100644 --- a/Content.Shared/Item/ItemToggle/ItemToggleSystem.cs +++ b/Content.Shared/Item/ItemToggle/ItemToggleSystem.cs @@ -282,7 +282,7 @@ public sealed class ItemToggleSystem : EntitySystem if (comp.ActiveSound != null && comp.PlayingStream == null) { - var loop = AudioParams.Default.WithLoop(true); + var loop = comp.ActiveSound.Params.WithLoop(true); var stream = args.Predicted ? _audio.PlayPredicted(comp.ActiveSound, uid, args.User, loop) : _audio.PlayPvs(comp.ActiveSound, uid, loop); diff --git a/Content.Shared/Mining/Components/MiningScannerComponent.cs b/Content.Shared/Mining/Components/MiningScannerComponent.cs new file mode 100644 index 0000000000..3cf65e810d --- /dev/null +++ b/Content.Shared/Mining/Components/MiningScannerComponent.cs @@ -0,0 +1,13 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared.Mining.Components; + +/// +/// This is a component that, when held in the inventory or pocket of a player, gives the the MiningOverlay. +/// +[RegisterComponent, NetworkedComponent, Access(typeof(MiningScannerSystem))] +public sealed partial class MiningScannerComponent : Component +{ + [DataField] + public float Range = 5; +} diff --git a/Content.Shared/Mining/Components/MiningScannerViewableComponent.cs b/Content.Shared/Mining/Components/MiningScannerViewableComponent.cs new file mode 100644 index 0000000000..9ab1207025 --- /dev/null +++ b/Content.Shared/Mining/Components/MiningScannerViewableComponent.cs @@ -0,0 +1,13 @@ +using Robust.Shared.GameStates; +using Robust.Shared.Serialization; + +namespace Content.Shared.Mining.Components; + +[RegisterComponent, NetworkedComponent, Access(typeof(MiningScannerSystem))] +public sealed partial class MiningScannerViewableComponent : Component; + +[Serializable, NetSerializable] +public enum MiningScannerVisualLayers : byte +{ + Overlay +} diff --git a/Content.Shared/Mining/Components/MiningScannerViewerComponent.cs b/Content.Shared/Mining/Components/MiningScannerViewerComponent.cs new file mode 100644 index 0000000000..65fe1f23c4 --- /dev/null +++ b/Content.Shared/Mining/Components/MiningScannerViewerComponent.cs @@ -0,0 +1,36 @@ +using Robust.Shared.Audio; +using Robust.Shared.GameStates; +using Robust.Shared.Map; + +namespace Content.Shared.Mining.Components; + +[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause, Access(typeof(MiningScannerSystem))] +public sealed partial class MiningScannerViewerComponent : Component +{ + [DataField, ViewVariables(VVAccess.ReadOnly), AutoNetworkedField] + public float ViewRange; + + [DataField, AutoNetworkedField] + public float AnimationDuration = 1.5f; + + [DataField, AutoNetworkedField] + public TimeSpan PingDelay = TimeSpan.FromSeconds(5); + + [DataField, AutoNetworkedField, AutoPausedField] + public TimeSpan NextPingTime = TimeSpan.MaxValue; + + [DataField] + public EntityCoordinates? LastPingLocation; + + [DataField, AutoNetworkedField] + public SoundSpecifier? PingSound = new SoundPathSpecifier("/Audio/Machines/sonar-ping.ogg") + { + Params = new AudioParams + { + Volume = -3, + } + }; + + [DataField] + public bool QueueRemoval; +} diff --git a/Content.Shared/Mining/Components/OreVeinComponent.cs b/Content.Shared/Mining/Components/OreVeinComponent.cs index 03e6a976cb..6ee40a624e 100644 --- a/Content.Shared/Mining/Components/OreVeinComponent.cs +++ b/Content.Shared/Mining/Components/OreVeinComponent.cs @@ -1,8 +1,7 @@ -using Content.Shared.Mining; using Content.Shared.Random; -using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; +using Robust.Shared.Prototypes; -namespace Content.Server.Mining.Components; +namespace Content.Shared.Mining.Components; /// /// Defines an entity that will drop a random ore after being destroyed. @@ -14,19 +13,19 @@ public sealed partial class OreVeinComponent : Component /// How often an entity will be seeded with ore. Note: the amount of ore /// that is dropped is dependent on the ore prototype. /// - [DataField("oreChance")] + [DataField] public float OreChance = 0.1f; /// /// The weighted random prototype used for determining what ore will be dropped. /// - [DataField("oreRarityPrototypeId", customTypeSerializer: typeof(PrototypeIdSerializer))] - public string? OreRarityPrototypeId; + [DataField] + public ProtoId? OreRarityPrototypeId; /// /// The ore that this entity holds. /// If set in the prototype, it will not be overriden. /// - [DataField("currentOre", customTypeSerializer: typeof(PrototypeIdSerializer)), ViewVariables(VVAccess.ReadWrite)] - public string? CurrentOre; + [DataField] + public ProtoId? CurrentOre; } diff --git a/Content.Shared/Mining/MiningScannerSystem.cs b/Content.Shared/Mining/MiningScannerSystem.cs new file mode 100644 index 0000000000..22e9061b09 --- /dev/null +++ b/Content.Shared/Mining/MiningScannerSystem.cs @@ -0,0 +1,101 @@ +using Content.Shared.Inventory; +using Content.Shared.Item.ItemToggle.Components; +using Content.Shared.Mining.Components; +using Robust.Shared.Audio.Systems; +using Robust.Shared.Containers; +using Robust.Shared.Network; +using Robust.Shared.Timing; + +namespace Content.Shared.Mining; + +public sealed class MiningScannerSystem : EntitySystem +{ + [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private readonly INetManager _net = default!; + [Dependency] private readonly SharedAudioSystem _audio = default!; + [Dependency] private readonly SharedContainerSystem _container = default!; + [Dependency] private readonly InventorySystem _inventory = default!; + + /// + public override void Initialize() + { + SubscribeLocalEvent(OnInserted); + SubscribeLocalEvent(OnRemoved); + SubscribeLocalEvent(OnToggled); + } + + private void OnInserted(Entity ent, ref EntGotInsertedIntoContainerMessage args) + { + UpdateViewerComponent(args.Container.Owner); + } + + private void OnRemoved(Entity ent, ref EntGotRemovedFromContainerMessage args) + { + UpdateViewerComponent(args.Container.Owner); + } + + private void OnToggled(Entity ent, ref ItemToggledEvent args) + { + if (_container.TryGetContainingContainer((ent.Owner, null, null), out var container)) + UpdateViewerComponent(container.Owner); + } + + public void UpdateViewerComponent(EntityUid uid) + { + Entity? scannerEnt = null; + + var ents = _inventory.GetHandOrInventoryEntities(uid); + foreach (var ent in ents) + { + if (!TryComp(ent, out var scannerComponent) || + !TryComp(ent, out var toggle)) + continue; + + if (!toggle.Activated) + continue; + + if (scannerEnt == null || scannerComponent.Range > scannerEnt.Value.Comp.Range) + scannerEnt = (ent, scannerComponent); + } + + if (_net.IsServer) + { + if (scannerEnt == null) + { + if (TryComp(uid, out var viewer)) + viewer.QueueRemoval = true; + } + else + { + var viewer = EnsureComp(uid); + viewer.ViewRange = scannerEnt.Value.Comp.Range; + viewer.QueueRemoval = false; + viewer.NextPingTime = _timing.CurTime + viewer.PingDelay; + Dirty(uid, viewer); + } + } + } + + public override void Update(float frameTime) + { + base.Update(frameTime); + + var query = EntityQueryEnumerator(); + while (query.MoveNext(out var uid, out var viewer, out var xform)) + { + if (viewer.QueueRemoval) + { + RemCompDeferred(uid, viewer); + continue; + } + + if (_timing.CurTime < viewer.NextPingTime) + continue; + + viewer.NextPingTime = _timing.CurTime + viewer.PingDelay; + viewer.LastPingLocation = xform.Coordinates; + if (_net.IsClient && _timing.IsFirstTimePredicted) + _audio.PlayEntity(viewer.PingSound, uid, uid); + } + } +} diff --git a/Content.Shared/Mining/OrePrototype.cs b/Content.Shared/Mining/OrePrototype.cs index a4f8a40a6f..d75ab19c49 100644 --- a/Content.Shared/Mining/OrePrototype.cs +++ b/Content.Shared/Mining/OrePrototype.cs @@ -1,26 +1,27 @@ using Robust.Shared.Prototypes; -using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; +using Robust.Shared.Utility; namespace Content.Shared.Mining; /// /// This is a prototype for defining ores that generate in rock /// -[Prototype("ore")] +[Prototype] public sealed partial class OrePrototype : IPrototype { /// [IdDataField] public string ID { get; private set; } = default!; - [DataField("oreEntity", customTypeSerializer: typeof(PrototypeIdSerializer))] - public string? OreEntity; + [DataField] + public EntProtoId? OreEntity; - [DataField("minOreYield")] + [DataField] public int MinOreYield = 1; - [DataField("maxOreYield")] + [DataField] public int MaxOreYield = 1; - //TODO: add sprites for ores for things like mining analyzer + [DataField] + public SpriteSpecifier? OreSprite; } diff --git a/Resources/Audio/Machines/attributions.yml b/Resources/Audio/Machines/attributions.yml index 83725f2b80..b1f9924546 100644 --- a/Resources/Audio/Machines/attributions.yml +++ b/Resources/Audio/Machines/attributions.yml @@ -143,6 +143,11 @@ copyright: "/tg/station" source: "https://github.com/tgstation/tgstation/blob/3eeba3899f22638595333c63b7b7433001f91bb2/sound/machines/eject.ogg" +- files: ["sonar-ping.ogg"] + license: "CC-BY-SA-3.0" + copyright: "/tg/station" + source: "https://github.com/tgstation/tgstation/blob/002051a3d5e4a35af504e52c0990bf4e22a908dc/sound/machines/sonar-ping.ogg" + - files: ["scanning.ogg"] license: "CC0-1.0" copyright: "Samuel Gremaud on freesound.org" diff --git a/Resources/Audio/Machines/sonar-ping.ogg b/Resources/Audio/Machines/sonar-ping.ogg new file mode 100644 index 0000000000..c69d435209 Binary files /dev/null and b/Resources/Audio/Machines/sonar-ping.ogg differ diff --git a/Resources/Prototypes/Entities/Markers/Spawners/Random/Salvage/tables_loot.yml b/Resources/Prototypes/Entities/Markers/Spawners/Random/Salvage/tables_loot.yml index 78c338fcb5..552b8aae0d 100644 --- a/Resources/Prototypes/Entities/Markers/Spawners/Random/Salvage/tables_loot.yml +++ b/Resources/Prototypes/Entities/Markers/Spawners/Random/Salvage/tables_loot.yml @@ -228,6 +228,8 @@ - id: ClothingEyesGlassesMeson - id: ClothingBeltSalvageWebbing - id: SeismicCharge + - id: MineralScanner + weight: 0.5 - id: WeaponCrusher weight: 0.5 - !type:GroupSelector @@ -239,6 +241,7 @@ id: SalvageEquipmentLegendary table: !type:GroupSelector children: + - id: AdvancedMineralScanner - id: BlueprintFulton - id: BlueprintSeismicCharge - id: WeaponCrusherGlaive diff --git a/Resources/Prototypes/Entities/Objects/Specific/Robotics/borg_modules.yml b/Resources/Prototypes/Entities/Objects/Specific/Robotics/borg_modules.yml index 062e261dc5..3b3a539664 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Robotics/borg_modules.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Robotics/borg_modules.yml @@ -206,6 +206,7 @@ items: - MiningDrill - Shovel + - MineralScannerUnpowered - OreBag - Crowbar - RadioHandheld diff --git a/Resources/Prototypes/Entities/Objects/Specific/Salvage/scanner.yml b/Resources/Prototypes/Entities/Objects/Specific/Salvage/scanner.yml new file mode 100644 index 0000000000..9c3e783c51 --- /dev/null +++ b/Resources/Prototypes/Entities/Objects/Specific/Salvage/scanner.yml @@ -0,0 +1,91 @@ +- type: entity + id: MineralScannerUnpowered + parent: BaseItem + name: mineral scanner + description: A scanner that checks surrounding rock for useful minerals. It must be in your hand or pocket to work. + suffix: Unpowered + components: + - type: Sprite + sprite: Objects/Specific/Mining/mineral_scanner.rsi + layers: + - state: icon + - state: icon-o + shader: unshaded + visible: false + map: ["enum.ToggleVisuals.Layer"] + - type: ItemToggleActiveSound + activeSound: + path: /Audio/Ambience/Objects/light_hum.ogg + params: + volume: -10 + maxDistance: 1 + - type: Appearance + - type: GenericVisualizer + visuals: + enum.ToggleVisuals.Toggled: + enum.ToggleVisuals.Layer: + True: { visible: true } + False: { visible: false } + - type: ItemToggle + soundActivate: + path: /Audio/Weapons/click.ogg + params: + maxDistance: 1 + - type: MiningScanner + +- type: entity + id: MineralScanner + parent: [ MineralScannerUnpowered, PowerCellSlotMediumItem ] + suffix: Powered + components: + - type: ToggleCellDraw + - type: PowerCellDraw + drawRate: 2.4 # ~5 minutes on a medium power cell. + useRate: 0 + +- type: entity + id: MineralScannerEmpty + parent: MineralScanner + suffix: Empty + components: + - type: ItemSlots + slots: + cell_slot: + name: power-cell-slot-component-slot-name-default + +- type: entity + id: AdvancedMineralScannerUnpowered + parent: MineralScannerUnpowered + name: advanced mineral scanner + description: A scanner that checks surrounding rock for useful minerals. It must be in your hand or pocket to work. This one has an extended range. + suffix: Unpowered + components: + - type: Sprite + layers: + - state: adv + - state: adv-o + shader: unshaded + visible: false + map: ["enum.ToggleVisuals.Layer"] + - type: MiningScanner + range: 10 + +- type: entity + id: AdvancedMineralScanner + parent: [ AdvancedMineralScannerUnpowered, PowerCellSlotMediumItem ] + suffix: Powered + components: + - type: ToggleCellDraw + - type: PowerCellDraw + drawRate: 1.2 # ~10 minutes on a medium power cell. + useRate: 0 + +- type: entity + id: AdvancedMineralScannerEmpty + parent: AdvancedMineralScanner + suffix: Empty + components: + - type: ItemSlots + slots: + cell_slot: + name: power-cell-slot-component-slot-name-default diff --git a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml index d1d3088113..1bd5bc74a9 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml @@ -323,6 +323,8 @@ - PowerCellHigh - WeaponPistolCHIMP - ClothingMaskWeldingGas + - MineralScannerEmpty + - AdvancedMineralScannerEmpty - WeaponGauntletGorilla - SynthesizerInstrument - ClothingShoesBootsMagSci diff --git a/Resources/Prototypes/Entities/Structures/Walls/asteroid.yml b/Resources/Prototypes/Entities/Structures/Walls/asteroid.yml index 755a1ee8b4..54f553ab9c 100644 --- a/Resources/Prototypes/Entities/Structures/Walls/asteroid.yml +++ b/Resources/Prototypes/Entities/Structures/Walls/asteroid.yml @@ -31,6 +31,7 @@ state: rock_asteroid_north - map: [ "enum.EdgeLayer.West" ] state: rock_asteroid_west + - type: MiningScannerViewable - type: Damageable damageContainer: StructuralInorganic damageModifierSet: Rock @@ -70,6 +71,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_asteroid_west - state: rock_coal + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: AsteroidRockGold @@ -92,6 +94,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_asteroid_west - state: rock_gold + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: AsteroidRockDiamond @@ -114,6 +117,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_asteroid_west - state: rock_diamond + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: AsteroidRockPlasma @@ -136,6 +140,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_asteroid_west - state: rock_phoron + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: AsteroidRockQuartz @@ -158,6 +163,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_asteroid_west - state: rock_quartz + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: AsteroidRockQuartzCrab @@ -180,6 +186,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_asteroid_west - state: rock_quartz + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: AsteroidRockSilver @@ -202,6 +209,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_asteroid_west - state: rock_silver + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: AsteroidRockSilverCrab @@ -234,6 +242,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_asteroid_west - state: rock_tin + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: AsteroidRockTinCrab @@ -265,6 +274,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_asteroid_west - state: rock_uranium + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: AsteroidRockUraniumCrab @@ -296,6 +306,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_asteroid_west - state: rock_bananium + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: AsteroidRockSalt @@ -318,6 +329,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_asteroid_west - state: rock_salt + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: AsteroidRockArtifactFragment @@ -340,6 +352,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_asteroid_west - state: rock_artifact_fragment + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: AsteroidRockMining @@ -412,6 +425,7 @@ - map: [ "enum.EdgeLayer.West" ] state: ironrock_west - state: rock_coal + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: IronRockGold @@ -434,6 +448,7 @@ - map: [ "enum.EdgeLayer.West" ] state: ironrock_west - state: rock_gold + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: IronRockPlasma @@ -456,6 +471,7 @@ - map: [ "enum.EdgeLayer.West" ] state: ironrock_west - state: rock_phoron + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: IronRockQuartz @@ -478,6 +494,7 @@ - map: [ "enum.EdgeLayer.West" ] state: ironrock_west - state: rock_quartz + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: IronRockSilver @@ -500,6 +517,7 @@ - map: [ "enum.EdgeLayer.West" ] state: ironrock_west - state: rock_silver + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: IronRockIron @@ -522,6 +540,7 @@ - map: [ "enum.EdgeLayer.West" ] state: ironrock_west - state: rock_tin + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: IronRockUranium @@ -544,6 +563,7 @@ - map: [ "enum.EdgeLayer.West" ] state: ironrock_west - state: rock_uranium + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: IronRockBananium @@ -566,6 +586,7 @@ - map: [ "enum.EdgeLayer.West" ] state: ironrock_west - state: rock_bananium + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: IronRockSalt @@ -588,6 +609,7 @@ - map: [ "enum.EdgeLayer.West" ] state: ironrock_west - state: rock_salt + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: IronRockArtifactFragment @@ -610,6 +632,7 @@ - map: [ "enum.EdgeLayer.West" ] state: ironrock_west - state: rock_artifact_fragment + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: IronRockDiamond @@ -632,6 +655,7 @@ - map: [ "enum.EdgeLayer.West" ] state: ironrock_west - state: rock_diamond + map: [ "enum.MiningScannerVisualLayers.Overlay" ] # Rocks and ore veins - type: entity @@ -664,6 +688,7 @@ - type: Icon sprite: Structures/Walls/rock.rsi state: rock + - type: MiningScannerViewable - type: SmoothEdge - type: Sprite sprite: Structures/Walls/rock.rsi @@ -707,6 +732,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_west - state: rock_coal + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockGold @@ -736,6 +762,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_west - state: rock_gold + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockDiamond @@ -758,6 +785,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_west - state: rock_diamond + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockPlasma @@ -787,6 +815,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_west - state: rock_phoron + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockQuartz @@ -816,6 +845,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_west - state: rock_quartz + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockSilver @@ -845,6 +875,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_west - state: rock_silver + map: [ "enum.MiningScannerVisualLayers.Overlay" ] # Yes I know it drops steel but we may get smelting at some point - type: entity @@ -875,6 +906,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_west - state: rock_tin + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockUranium @@ -904,6 +936,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_west - state: rock_uranium + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity @@ -934,6 +967,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_west - state: rock_bananium + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockArtifactFragment @@ -963,6 +997,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_west - state: rock_artifact_fragment + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockSalt @@ -992,6 +1027,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_west - state: rock_salt + map: [ "enum.MiningScannerVisualLayers.Overlay" ] # Basalt variants - type: entity @@ -1036,6 +1072,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_wall_west - state: rock_coal + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockBasaltGold @@ -1058,6 +1095,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_wall_west - state: rock_gold + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockBasaltDiamond @@ -1080,6 +1118,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_wall_west - state: rock_diamond + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockBasaltPlasma @@ -1102,6 +1141,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_wall_west - state: rock_phoron + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockBasaltQuartz @@ -1124,6 +1164,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_wall_west - state: rock_quartz + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockBasaltSilver @@ -1146,6 +1187,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_wall_west - state: rock_silver + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockBasaltTin @@ -1168,6 +1210,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_wall_west - state: rock_tin + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockBasaltUranium @@ -1190,6 +1233,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_wall_west - state: rock_uranium + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity @@ -1213,6 +1257,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_wall_west - state: rock_bananium + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockBasaltArtifactFragment @@ -1235,6 +1280,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_wall_west - state: rock_artifact_fragment + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockBasaltSalt @@ -1257,6 +1303,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_wall_west - state: rock_salt + map: [ "enum.MiningScannerVisualLayers.Overlay" ] # Snow variants - type: entity @@ -1301,6 +1348,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_snow_west - state: rock_coal + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockSnowGold @@ -1323,6 +1371,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_snow_west - state: rock_gold + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockSnowDiamond @@ -1345,6 +1394,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_snow_west - state: rock_diamond + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockSnowPlasma @@ -1367,6 +1417,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_snow_west - state: rock_phoron + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockSnowQuartz @@ -1389,6 +1440,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_snow_west - state: rock_quartz + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockSnowSilver @@ -1411,6 +1463,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_snow_west - state: rock_silver + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockSnowTin @@ -1433,6 +1486,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_snow_west - state: rock_tin + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockSnowUranium @@ -1455,6 +1509,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_snow_west - state: rock_uranium + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity @@ -1478,6 +1533,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_snow_west - state: rock_bananium + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockSnowArtifactFragment @@ -1500,6 +1556,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_snow_west - state: rock_artifact_fragment + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockSnowSalt @@ -1522,6 +1579,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_snow_west - state: rock_salt + map: [ "enum.MiningScannerVisualLayers.Overlay" ] # Sand variants - type: entity @@ -1566,6 +1624,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_sand_west - state: rock_coal + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockSandGold @@ -1588,6 +1647,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_sand_west - state: rock_gold + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockSandDiamond @@ -1610,6 +1670,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_sand_west - state: rock_diamond + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockSandPlasma @@ -1632,6 +1693,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_sand_west - state: rock_phoron + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockSandQuartz @@ -1654,6 +1716,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_sand_west - state: rock_quartz + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockSandSilver @@ -1676,6 +1739,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_sand_west - state: rock_silver + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockSandTin @@ -1698,6 +1762,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_sand_west - state: rock_tin + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockSandUranium @@ -1720,6 +1785,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_sand_west - state: rock_uranium + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockSandBananium @@ -1742,6 +1808,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_sand_west - state: rock_bananium + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockSandArtifactFragment @@ -1764,6 +1831,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_sand_west - state: rock_artifact_fragment + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockSandSalt @@ -1786,6 +1854,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_sand_west - state: rock_salt + map: [ "enum.MiningScannerVisualLayers.Overlay" ] # Chromite variants - type: entity @@ -1830,6 +1899,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_chromite_west - state: rock_coal + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockChromiteGold @@ -1852,6 +1922,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_chromite_west - state: rock_gold + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockChromiteDiamond @@ -1874,6 +1945,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_chromite_west - state: rock_diamond + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockChromitePlasma @@ -1896,6 +1968,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_chromite_west - state: rock_phoron + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockChromiteQuartz @@ -1918,6 +1991,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_chromite_west - state: rock_quartz + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockChromiteSilver @@ -1940,6 +2014,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_chromite_west - state: rock_silver + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockChromiteTin @@ -1962,6 +2037,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_chromite_west - state: rock_tin + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockChromiteUranium @@ -1984,6 +2060,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_chromite_west - state: rock_uranium + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity @@ -2007,6 +2084,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_chromite_west - state: rock_bananium + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockChromiteArtifactFragment @@ -2029,6 +2107,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_chromite_west - state: rock_artifact_fragment + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockChromiteSalt @@ -2051,6 +2130,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_chromite_west - state: rock_salt + map: [ "enum.MiningScannerVisualLayers.Overlay" ] # Andesite variants - type: entity @@ -2095,6 +2175,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_andesite_west - state: rock_coal + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockAndesiteGold @@ -2117,6 +2198,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_andesite_west - state: rock_gold + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockAndesiteDiamond @@ -2139,6 +2221,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_andesite_west - state: rock_diamond + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockAndesitePlasma @@ -2161,6 +2244,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_andesite_west - state: rock_phoron + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockAndesiteQuartz @@ -2183,6 +2267,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_andesite_west - state: rock_quartz + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockAndesiteSilver @@ -2205,6 +2290,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_andesite_west - state: rock_silver + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockAndesiteTin @@ -2227,6 +2313,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_andesite_west - state: rock_tin + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockAndesiteUranium @@ -2249,6 +2336,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_andesite_west - state: rock_uranium + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity @@ -2272,6 +2360,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_andesite_west - state: rock_bananium + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockAndesiteArtifactFragment @@ -2294,6 +2383,7 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_andesite_west - state: rock_artifact_fragment + map: [ "enum.MiningScannerVisualLayers.Overlay" ] - type: entity id: WallRockAndesiteSalt @@ -2316,3 +2406,4 @@ - map: [ "enum.EdgeLayer.West" ] state: rock_andesite_west - state: rock_salt + map: [ "enum.MiningScannerVisualLayers.Overlay" ] diff --git a/Resources/Prototypes/Recipes/Lathes/salvage.yml b/Resources/Prototypes/Recipes/Lathes/salvage.yml index 2def767e91..4600669cc5 100644 --- a/Resources/Prototypes/Recipes/Lathes/salvage.yml +++ b/Resources/Prototypes/Recipes/Lathes/salvage.yml @@ -1,3 +1,23 @@ +- type: latheRecipe + id: MineralScannerEmpty + result: MineralScannerEmpty + completetime: 3 + materials: + Steel: 1000 + Glass: 300 + Plastic: 300 + Gold: 500 + +- type: latheRecipe + id: AdvancedMineralScannerEmpty + result: AdvancedMineralScannerEmpty + completetime: 1 + materials: + Steel: 1000 + Glass: 300 + Plastic: 300 + Uranium: 500 + - type: latheRecipe id: Fulton result: Fulton1 diff --git a/Resources/Prototypes/Research/industrial.yml b/Resources/Prototypes/Research/industrial.yml index 8e11f661a8..1ee724ecdf 100644 --- a/Resources/Prototypes/Research/industrial.yml +++ b/Resources/Prototypes/Research/industrial.yml @@ -11,6 +11,7 @@ cost: 7500 recipeUnlocks: - MiningDrill + - MineralScannerEmpty - BorgModuleMining - BorgModuleGrapplingGun - OreProcessorIndustrialMachineCircuitboard @@ -179,6 +180,7 @@ recipeUnlocks: - OreBagOfHolding - MiningDrillDiamond + - AdvancedMineralScannerEmpty # Tier 3 diff --git a/Resources/Textures/Objects/Specific/Mining/mineral_scanner.rsi/adv-o.png b/Resources/Textures/Objects/Specific/Mining/mineral_scanner.rsi/adv-o.png new file mode 100644 index 0000000000..f33c745e6e Binary files /dev/null and b/Resources/Textures/Objects/Specific/Mining/mineral_scanner.rsi/adv-o.png differ diff --git a/Resources/Textures/Objects/Specific/Mining/mineral_scanner.rsi/adv.png b/Resources/Textures/Objects/Specific/Mining/mineral_scanner.rsi/adv.png new file mode 100644 index 0000000000..85ff9509f0 Binary files /dev/null and b/Resources/Textures/Objects/Specific/Mining/mineral_scanner.rsi/adv.png differ diff --git a/Resources/Textures/Objects/Specific/Mining/mineral_scanner.rsi/icon-o.png b/Resources/Textures/Objects/Specific/Mining/mineral_scanner.rsi/icon-o.png new file mode 100644 index 0000000000..c1313c5140 Binary files /dev/null and b/Resources/Textures/Objects/Specific/Mining/mineral_scanner.rsi/icon-o.png differ diff --git a/Resources/Textures/Objects/Specific/Mining/mineral_scanner.rsi/icon.png b/Resources/Textures/Objects/Specific/Mining/mineral_scanner.rsi/icon.png new file mode 100644 index 0000000000..351ada6f76 Binary files /dev/null and b/Resources/Textures/Objects/Specific/Mining/mineral_scanner.rsi/icon.png differ diff --git a/Resources/Textures/Objects/Specific/Mining/mineral_scanner.rsi/meta.json b/Resources/Textures/Objects/Specific/Mining/mineral_scanner.rsi/meta.json new file mode 100644 index 0000000000..e427ff0d00 --- /dev/null +++ b/Resources/Textures/Objects/Specific/Mining/mineral_scanner.rsi/meta.json @@ -0,0 +1,23 @@ +{ + "version": 1, + "license": "CC-BY-SA-3.0", + "copyright": "Taken from vgstation at https://github.com/vgstation-coders/vgstation13/commit/125c975f1b3bf9826b37029e9ab5a5f89e975a7e. adv and adv-o by EmoGarbage404", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "icon" + }, + { + "name": "icon-o" + }, + { + "name": "adv" + }, + { + "name": "adv-o" + } + ] +}