Node Scanner (#12889)
* node scanners + new tech * Sue me for making my shit copyright free
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
namespace Content.Server.Xenoarchaeology.Equipment.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed class NodeScannerComponent : Component
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using Content.Server.Popups;
|
||||
using Content.Server.Xenoarchaeology.Equipment.Components;
|
||||
using Content.Server.Xenoarchaeology.XenoArtifacts;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Timing;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
namespace Content.Server.Xenoarchaeology.Equipment.Systems;
|
||||
|
||||
public sealed class NodeScannerSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly UseDelaySystem _useDelay = default!;
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<NodeScannerComponent, AfterInteractEvent>(OnAfterInteract);
|
||||
}
|
||||
|
||||
private void OnAfterInteract(EntityUid uid, NodeScannerComponent component, AfterInteractEvent args)
|
||||
{
|
||||
if (!args.CanReach || args.Target == null)
|
||||
return;
|
||||
|
||||
if (!TryComp<ArtifactComponent>(args.Target, out var artifact) || artifact.CurrentNode == null)
|
||||
return;
|
||||
|
||||
if (args.Handled)
|
||||
return;
|
||||
args.Handled = true;
|
||||
|
||||
var target = args.Target.Value;
|
||||
_useDelay.BeginDelay(uid);
|
||||
_popupSystem.PopupEntity(Loc.GetString("node-scan-popup",
|
||||
("id", $"{artifact.CurrentNode.Id}")), target, Filter.Pvs(target));
|
||||
}
|
||||
}
|
||||
@@ -48,7 +48,8 @@ public sealed partial class ArtifactSystem
|
||||
var node = uninitializedNodes.First();
|
||||
uninitializedNodes.Remove(node);
|
||||
|
||||
node.Id = _random.Next(0, 10000);
|
||||
//random 5-digit number
|
||||
node.Id = _random.Next(10000, 100000);
|
||||
|
||||
//Generate the connected nodes
|
||||
var maxEdges = Math.Max(1, targetNodeAmount - tree.AllNodes.Count - uninitializedNodes.Count - 1);
|
||||
|
||||
1
Resources/Locale/en-US/xenoarchaeology/node-scanner.ftl
Normal file
1
Resources/Locale/en-US/xenoarchaeology/node-scanner.ftl
Normal file
@@ -0,0 +1 @@
|
||||
node-scan-popup = The node ID is {$id}
|
||||
@@ -484,6 +484,7 @@
|
||||
- MicroLaserStockPart
|
||||
- MicroManipulatorStockPart
|
||||
- ScanningModuleStockPart
|
||||
- NodeScanner
|
||||
|
||||
- type: technology
|
||||
name: technologies-robotics-technology
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
- type: entity
|
||||
parent: BaseItem
|
||||
id: NodeScanner
|
||||
name: node scanner
|
||||
description: The archeologist's friend, able to identify the node of an artifact with only a single scan.
|
||||
components:
|
||||
- type: Sprite
|
||||
sprite: Objects/Specific/Xenoarchaeology/node_scanner.rsi
|
||||
state: icon
|
||||
netsync: false
|
||||
- type: Item
|
||||
sprite: Objects/Specific/Xenoarchaeology/node_scanner.rsi
|
||||
- type: NodeScanner
|
||||
- type: UseDelay
|
||||
delay: 3
|
||||
@@ -228,6 +228,7 @@
|
||||
- PowerCellHigh
|
||||
- SynthesizerInstrument
|
||||
- RPED
|
||||
- NodeScanner
|
||||
- HolofanProjector
|
||||
|
||||
- type: entity
|
||||
|
||||
@@ -85,3 +85,14 @@
|
||||
Steel: 300
|
||||
Plastic: 300
|
||||
Glass: 100
|
||||
|
||||
- type: latheRecipe
|
||||
id: NodeScanner
|
||||
icon:
|
||||
sprite: Objects/Specific/Xenoarchaeology/node_scanner.rsi
|
||||
state: icon
|
||||
result: NodeScanner
|
||||
completetime: 2
|
||||
materials:
|
||||
Steel: 100
|
||||
Plastic: 50
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 536 B |
Binary file not shown.
|
After Width: | Height: | Size: 431 B |
Binary file not shown.
|
After Width: | Height: | Size: 407 B |
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"version": 1,
|
||||
"license": "CC0-1.0",
|
||||
"copyright": "Created by EmoGarbage404",
|
||||
"size": {
|
||||
"x": 32,
|
||||
"y": 32
|
||||
},
|
||||
"states": [
|
||||
{
|
||||
"name": "icon"
|
||||
},
|
||||
{
|
||||
"name": "inhand-left",
|
||||
"directions": 4
|
||||
},
|
||||
{
|
||||
"name": "inhand-right",
|
||||
"directions": 4
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user