[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();
}
var coords = _transform.GetMapCoordinates(ent);
- var anomaly = _entityLookup.GetEntitiesInRange<AnomalyComponent>(coords, AttachRange).FirstOrDefault();
+ var anomaly = _entityLookup.GetEntitiesInRange<AnomalyComponent>(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);
if (!TryComp<AnomalyComponent>(ent.Comp.ConnectedAnomaly, out var anomaly))
return;
- _anomaly.DoAnomalyPulse(ent.Comp.ConnectedAnomaly.Value, anomaly);
DisconneсtFromAnomaly(ent, anomaly);
}
return;
var user = args.User;
- args.Verbs.Add(new() {
+ args.Verbs.Add(new()
+ {
Act = () =>
{
TryAttachNearbyAnomaly(ent, user);
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);
}
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);
-using Content.Shared.Anomaly;
-using Content.Shared.Anomaly.Components;
using Content.Shared.DeviceLinking;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
[DataField, ViewVariables(VVAccess.ReadWrite)]
public EntityUid? ConnectedAnomaly;
+ /// <summary>
+ /// Should the anomaly pulse when connected to the synchronizer?
+ /// </summary>
+ [DataField]
+ public bool PulseOnConnect = true;
+
+ /// <summary>
+ /// Should the anomaly pulse when disconnected from synchronizer?
+ /// </summary>
+ [DataField]
+ public bool PulseOnDisconnect = false;
+
+ /// <summary>
+ /// minimum distance from the synchronizer to the anomaly to be attached
+ /// </summary>
+ [DataField]
+ public float AttachRange = 0.4f;
[DataField]
public ProtoId<SourcePortPrototype> DecayingPort = "Decaying";
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
- 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