diff --git a/Content.Server/Anomaly/AnomalySynchronizerSystem.cs b/Content.Server/Anomaly/AnomalySynchronizerSystem.cs index 7b42b9d890..434a3fef66 100644 --- a/Content.Server/Anomaly/AnomalySynchronizerSystem.cs +++ b/Content.Server/Anomaly/AnomalySynchronizerSystem.cs @@ -25,8 +25,6 @@ public sealed partial class AnomalySynchronizerSystem : EntitySystem [Dependency] private readonly SharedPopupSystem _popup = default!; [Dependency] private readonly PowerReceiverSystem _power = default!; - private const float AttachRange = 0.15f; // The radius of one tile. It must not be set higher, otherwise the anomaly can be moved from tile to tile. - public override void Initialize() { base.Initialize(); @@ -55,9 +53,9 @@ public sealed partial class AnomalySynchronizerSystem : EntitySystem } var coords = _transform.GetMapCoordinates(ent); - var anomaly = _entityLookup.GetEntitiesInRange(coords, AttachRange).FirstOrDefault(); + var anomaly = _entityLookup.GetEntitiesInRange(coords, ent.Comp.AttachRange).FirstOrDefault(); - if (anomaly.Owner is {Valid: false}) // no anomaly in range + if (anomaly.Owner is { Valid: false }) // no anomaly in range { if (user is not null) _popup.PopupEntity(Loc.GetString("anomaly-sync-no-anomaly"), ent, user.Value); @@ -77,7 +75,6 @@ public sealed partial class AnomalySynchronizerSystem : EntitySystem if (!TryComp(ent.Comp.ConnectedAnomaly, out var anomaly)) return; - _anomaly.DoAnomalyPulse(ent.Comp.ConnectedAnomaly.Value, anomaly); DisconneсtFromAnomaly(ent, anomaly); } @@ -92,7 +89,8 @@ public sealed partial class AnomalySynchronizerSystem : EntitySystem return; var user = args.User; - args.Verbs.Add(new() { + args.Verbs.Add(new() + { Act = () => { TryAttachNearbyAnomaly(ent, user); @@ -117,7 +115,9 @@ public sealed partial class AnomalySynchronizerSystem : EntitySystem var targetXform = _transform.GetWorldPosition(ent); _transform.SetWorldPosition(anomaly, targetXform); - _anomaly.DoAnomalyPulse(anomaly, anomaly); + if (ent.Comp.PulseOnConnect) + _anomaly.DoAnomalyPulse(anomaly, anomaly); + _popup.PopupEntity(Loc.GetString("anomaly-sync-connected"), ent, PopupType.Medium); _audio.PlayPvs(ent.Comp.ConnectedSound, ent); } @@ -129,7 +129,9 @@ public sealed partial class AnomalySynchronizerSystem : EntitySystem if (ent.Comp.ConnectedAnomaly == null) return; - _anomaly.DoAnomalyPulse(ent.Comp.ConnectedAnomaly.Value, anomaly); + if (ent.Comp.PulseOnDisconnect) + _anomaly.DoAnomalyPulse(ent.Comp.ConnectedAnomaly.Value, anomaly); + _popup.PopupEntity(Loc.GetString("anomaly-sync-disconnected"), ent, PopupType.Large); _audio.PlayPvs(ent.Comp.ConnectedSound, ent); diff --git a/Content.Server/Anomaly/Components/AnomalySynchronizerComponent.cs b/Content.Server/Anomaly/Components/AnomalySynchronizerComponent.cs index 295ce885c2..235e740cf3 100644 --- a/Content.Server/Anomaly/Components/AnomalySynchronizerComponent.cs +++ b/Content.Server/Anomaly/Components/AnomalySynchronizerComponent.cs @@ -1,5 +1,3 @@ -using Content.Shared.Anomaly; -using Content.Shared.Anomaly.Components; using Content.Shared.DeviceLinking; using Robust.Shared.Audio; using Robust.Shared.Prototypes; @@ -18,6 +16,23 @@ public sealed partial class AnomalySynchronizerComponent : Component [DataField, ViewVariables(VVAccess.ReadWrite)] public EntityUid? ConnectedAnomaly; + /// + /// Should the anomaly pulse when connected to the synchronizer? + /// + [DataField] + public bool PulseOnConnect = true; + + /// + /// Should the anomaly pulse when disconnected from synchronizer? + /// + [DataField] + public bool PulseOnDisconnect = false; + + /// + /// minimum distance from the synchronizer to the anomaly to be attached + /// + [DataField] + public float AttachRange = 0.4f; [DataField] public ProtoId DecayingPort = "Decaying"; diff --git a/Resources/Prototypes/Entities/Objects/Devices/Electronics/signaller.yml b/Resources/Prototypes/Entities/Objects/Devices/Electronics/signaller.yml index 2a0b5ba118..aa889341b1 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/Electronics/signaller.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/Electronics/signaller.yml @@ -4,7 +4,7 @@ parent: BaseItem id: RemoteSignaller name: remote signaller - description: A handheld device used for remotely sending signals to objects. + description: A handheld device used for remotely sending signals to objects within a small radius of about 15 meters. components: - type: Sprite sprite: Objects/Devices/signaller.rsi @@ -19,3 +19,21 @@ - type: Tag tags: - Payload + - type: DeviceNetwork + deviceNetId: Wireless + receiveFrequencyId: BasicDevice + - type: WirelessNetworkConnection + range: 15 + +- type: entity + parent: RemoteSignaller + id: RemoteSignallerAdvanced + name: advanced remote signaller + description: A handheld device used for remotely sending signals to objects within a small radius of about 50 meters. + components: + - type: Sprite + state: signaller2 + - type: WirelessNetworkConnection + range: 50 + - type: StaticPrice + price: 30 \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Structures/Machines/anomaly_sync.yml b/Resources/Prototypes/Entities/Structures/Machines/anomaly_sync.yml index 88169ecd67..3019b8adf8 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/anomaly_sync.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/anomaly_sync.yml @@ -10,7 +10,7 @@ - type: DeviceNetwork deviceNetId: Wireless - type: WirelessNetworkConnection - range: 300 + range: 100 - type: DeviceNetworkRequiresPower - type: DeviceLinkSource ports: @@ -39,19 +39,15 @@ shape: !type:PhysShapeAabb bounds: "-0.35,-0.35,0.35,0.35" - density: 190 + density: 100 mask: - - MachineMask - layer: - - Impassable - - MidImpassable - - LowImpassable - hard: False + - ItemMask + hard: True - type: Transform anchored: true noRot: false - type: ApcPowerReceiver - powerLoad: 15000 + powerLoad: 2500 needsPower: true - type: ItemPlacer whitelist: diff --git a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml index 3a6cf77209..a5d1ec8df0 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml @@ -286,6 +286,7 @@ - ChemicalPayload - FlashPayload - Signaller + - SignallerAdvanced - SignalTrigger - VoiceTrigger - Igniter diff --git a/Resources/Prototypes/Recipes/Lathes/devices.yml b/Resources/Prototypes/Recipes/Lathes/devices.yml index 62582fad9c..8b748f3fe5 100644 --- a/Resources/Prototypes/Recipes/Lathes/devices.yml +++ b/Resources/Prototypes/Recipes/Lathes/devices.yml @@ -76,6 +76,16 @@ Steel: 100 Plastic: 200 Glass: 100 + +- type: latheRecipe + id: SignallerAdvanced + result: RemoteSignallerAdvanced + category: Parts + completetime: 2 + materials: + Steel: 100 + Plastic: 200 + Plasma: 100 - type: latheRecipe id: AnomalyLocator diff --git a/Resources/Prototypes/Research/arsenal.yml b/Resources/Prototypes/Research/arsenal.yml index 8a0fe5d77c..795c3ffdaf 100644 --- a/Resources/Prototypes/Research/arsenal.yml +++ b/Resources/Prototypes/Research/arsenal.yml @@ -44,7 +44,8 @@ tier: 1 cost: 7500 recipeUnlocks: - - Signaller + - Signaller + - SignallerAdvanced - SignalTrigger - VoiceTrigger - TimerTrigger diff --git a/Resources/Textures/Objects/Devices/signaller.rsi/meta.json b/Resources/Textures/Objects/Devices/signaller.rsi/meta.json index fc6d09bffa..cefaeebebf 100644 --- a/Resources/Textures/Objects/Devices/signaller.rsi/meta.json +++ b/Resources/Textures/Objects/Devices/signaller.rsi/meta.json @@ -2,7 +2,7 @@ "version": 1, "license": "CC-BY-SA-3.0", - "copyright": "Taken from Goonstation at commit https://github.com/goonstation/goonstation/commit/354d9635460c296dc7dce23ab39481dc4de6dc00", + "copyright": "Taken from Goonstation at commit https://github.com/goonstation/goonstation/commit/354d9635460c296dc7dce23ab39481dc4de6dc00, signaller2 created by TheShuEd", "size": { "x": 32, @@ -12,6 +12,10 @@ { "name": "signaller", "directions": 1 + }, + { + "name": "signaller2", + "directions": 1 } ] } \ No newline at end of file diff --git a/Resources/Textures/Objects/Devices/signaller.rsi/signaller2.png b/Resources/Textures/Objects/Devices/signaller.rsi/signaller2.png new file mode 100644 index 0000000000..799a7be6ea Binary files /dev/null and b/Resources/Textures/Objects/Devices/signaller.rsi/signaller2.png differ