diff --git a/Content.Server/Shuttles/Components/ThrusterComponent.cs b/Content.Server/Shuttles/Components/ThrusterComponent.cs index 1f6a8e2b675..86abb745b18 100644 --- a/Content.Server/Shuttles/Components/ThrusterComponent.cs +++ b/Content.Server/Shuttles/Components/ThrusterComponent.cs @@ -3,6 +3,7 @@ using Content.Server.Shuttles.Systems; using Content.Shared.Construction.Prototypes; using Content.Shared.Damage; +using Content.Shared.DeviceLinking; // Frontier using Robust.Shared.GameStates; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; @@ -72,6 +73,19 @@ public sealed partial class ThrusterComponent : Component /// Frontier - Amount of charge this needs from an APC per second to function. /// public float OriginalLoad { get; set; } = 0; + + /// + /// Frontier - Make linkable to buttons + /// + [DataField("onPort", customTypeSerializer: typeof(PrototypeIdSerializer))] // Frontier + public string OnPort = "On"; // Frontier + + [DataField("offPort", customTypeSerializer: typeof(PrototypeIdSerializer))] // Frontier + public string OffPort = "Off"; // Frontier + + [DataField("togglePort", customTypeSerializer: typeof(PrototypeIdSerializer))] // Frontier + public string TogglePort = "Toggle"; // Frontier + } public enum ThrusterType diff --git a/Content.Server/Shuttles/Systems/ThrusterSystem.cs b/Content.Server/Shuttles/Systems/ThrusterSystem.cs index f10a5906adc..f9347643ae7 100644 --- a/Content.Server/Shuttles/Systems/ThrusterSystem.cs +++ b/Content.Server/Shuttles/Systems/ThrusterSystem.cs @@ -20,6 +20,7 @@ using Robust.Shared.Utility; using Content.Shared.Localizations; using Content.Server.Construction; // Frontier +using Content.Server.DeviceLinking.Events; // Frontier namespace Content.Server.Shuttles.Systems; @@ -57,8 +58,36 @@ public override void Initialize() SubscribeLocalEvent(OnRefreshParts); SubscribeLocalEvent(OnUpgradeExamine); + SubscribeLocalEvent(OnSignalReceived); // Frontier } + // Frontier: signal handler + private void OnSignalReceived(EntityUid uid, ThrusterComponent component, ref SignalReceivedEvent args) + { + if (args.Port == component.OffPort) + component.Enabled = false; + else if (args.Port == component.OnPort) + component.Enabled = true; + else if (args.Port == component.TogglePort) + component.Enabled ^= true; + else + return; // Invalid port, don't change the thruster. + + if (!component.Enabled) + { + if (TryComp(uid, out var apcPower) && component.OriginalLoad != 0 && apcPower.Load != 1) + apcPower.Load = 1; + DisableThruster(uid, component); + } + else if (CanEnable(uid, component)) + { + if (TryComp(uid, out var apcPower) && component.OriginalLoad != apcPower.Load) + apcPower.Load = component.OriginalLoad; + EnableThruster(uid, component); + } + } + // End Frontier: signal handler + private void OnThrusterExamine(EntityUid uid, ThrusterComponent component, ExaminedEvent args) { // Powered is already handled by other power components @@ -141,9 +170,8 @@ private void OnActivateThruster(EntityUid uid, ThrusterComponent component, Acti if (!component.Enabled) { - if (TryComp(uid, out var apcPower) && component.OriginalLoad != 0) // Frontier - apcPower.Load = 1; // Frontier - + if (TryComp(uid, out var apcPower) && component.OriginalLoad != 0 && apcPower.Load != 1) // Frontier + apcPower.Load = 1; // Frontier DisableThruster(uid, component); args.Handled = true; } @@ -151,7 +179,6 @@ private void OnActivateThruster(EntityUid uid, ThrusterComponent component, Acti { if (TryComp(uid, out var apcPower) && component.OriginalLoad != apcPower.Load) // Frontier apcPower.Load = component.OriginalLoad; // Frontier - EnableThruster(uid, component); args.Handled = true; } diff --git a/Resources/Changelog/Changelog.yml b/Resources/Changelog/Changelog.yml index 9980b291e0c..bc0e7df2514 100644 --- a/Resources/Changelog/Changelog.yml +++ b/Resources/Changelog/Changelog.yml @@ -7349,3 +7349,17 @@ Entries: message: Added Bahama Mama's, an alternative POI to Tinnia's Rest. id: 5319 time: '2024-09-25T17:35:04.0000000+00:00' +- author: spacedwarf14 + changes: + - type: Add + message: >- + Thruster can now be switched on and off with remote buttons, switches, + levers and signalers. + id: 5320 + time: '2024-09-25T22:48:50.0000000+00:00' +- author: dustylens + changes: + - type: Tweak + message: updated Bazaar with directional fans, fuel locker and atmos update. + id: 5321 + time: '2024-09-25T22:53:57.0000000+00:00' diff --git a/Resources/Maps/_NF/Shuttles/bazaar.yml b/Resources/Maps/_NF/Shuttles/bazaar.yml index 1da3198e105..a5c7f044603 100644 --- a/Resources/Maps/_NF/Shuttles/bazaar.yml +++ b/Resources/Maps/_NF/Shuttles/bazaar.yml @@ -1045,125 +1045,126 @@ entities: - type: Transform pos: -6.5,-3.5 parent: 1 -- proto: AtmosDeviceFanTiny +- proto: AtmosDeviceFanDirectional entities: - - uid: 55 + - uid: 48 components: - type: Transform rot: 1.5707963267948966 rad pos: 14.5,4.5 parent: 1 + - uid: 55 + components: + - type: Transform + pos: 1.5,-9.5 + parent: 1 - uid: 56 components: - type: Transform - rot: 1.5707963267948966 rad - pos: 13.5,-4.5 + rot: -1.5707963267948966 rad + pos: -12.5,-6.5 parent: 1 - uid: 57 components: - type: Transform - pos: 1.5,-9.5 + rot: -1.5707963267948966 rad + pos: -12.5,-5.5 parent: 1 - uid: 58 components: - type: Transform - pos: 0.5,-9.5 + rot: 1.5707963267948966 rad + pos: 13.5,-6.5 parent: 1 - uid: 59 components: - type: Transform - pos: -0.5,-9.5 + rot: 1.5707963267948966 rad + pos: 14.5,3.5 parent: 1 - uid: 60 components: - type: Transform rot: 1.5707963267948966 rad - pos: -12.5,-5.5 + pos: 13.5,-5.5 parent: 1 - uid: 61 components: - type: Transform - rot: 1.5707963267948966 rad - pos: -13.5,4.5 + pos: 0.5,-9.5 parent: 1 - uid: 62 components: - type: Transform - rot: 1.5707963267948966 rad - pos: -12.5,-4.5 + pos: -0.5,-9.5 parent: 1 - uid: 63 components: - type: Transform - rot: 1.5707963267948966 rad - pos: 13.5,-6.5 + pos: 10.5,0.5 parent: 1 - uid: 64 components: - type: Transform - rot: 1.5707963267948966 rad - pos: 13.5,-5.5 + pos: -9.5,0.5 parent: 1 - uid: 65 components: - type: Transform - rot: 1.5707963267948966 rad - pos: 10.5,0.5 - parent: 1 - - uid: 66 - components: - - type: Transform - rot: 1.5707963267948966 rad - pos: -10.5,0.5 + pos: 11.5,0.5 parent: 1 - uid: 67 components: - type: Transform - rot: 1.5707963267948966 rad - pos: 11.5,0.5 + pos: -10.5,0.5 parent: 1 - uid: 68 components: - type: Transform - rot: 1.5707963267948966 rad - pos: 14.5,1.5 + rot: -1.5707963267948966 rad + pos: -12.5,-4.5 parent: 1 - uid: 69 components: - type: Transform - rot: 1.5707963267948966 rad - pos: -9.5,0.5 + rot: -1.5707963267948966 rad + pos: -13.5,1.5 parent: 1 - uid: 70 components: - type: Transform - rot: 1.5707963267948966 rad - pos: -12.5,-6.5 + rot: -1.5707963267948966 rad + pos: -13.5,2.5 parent: 1 - uid: 71 components: - type: Transform - pos: 14.5,3.5 + rot: 1.5707963267948966 rad + pos: 13.5,-4.5 parent: 1 - uid: 72 components: - type: Transform - pos: 14.5,2.5 + rot: 1.5707963267948966 rad + pos: 14.5,1.5 parent: 1 - uid: 73 components: - type: Transform - pos: -13.5,3.5 + rot: 1.5707963267948966 rad + pos: 14.5,2.5 parent: 1 - - uid: 74 + - uid: 75 components: - type: Transform - pos: -13.5,2.5 + rot: -1.5707963267948966 rad + pos: -13.5,3.5 parent: 1 - - uid: 75 + - uid: 461 components: - type: Transform - pos: -13.5,1.5 + rot: -1.5707963267948966 rad + pos: -13.5,4.5 parent: 1 - proto: AtmosFixBlockerMarker entities: @@ -1404,51 +1405,33 @@ entities: - type: Transform pos: 11.5,0.5 parent: 1 - - type: DeviceLinkSink - links: - - 938 - uid: 83 components: - type: Transform pos: -10.5,0.5 parent: 1 - - type: DeviceLinkSink - links: - - 943 - uid: 85 components: - type: Transform pos: -9.5,0.5 parent: 1 - - type: DeviceLinkSink - links: - - 943 - uid: 590 components: - type: Transform pos: 10.5,0.5 parent: 1 - - type: DeviceLinkSink - links: - - 938 - uid: 591 components: - type: Transform rot: -1.5707963267948966 rad pos: -13.5,4.5 parent: 1 - - type: DeviceLinkSink - links: - - 942 - uid: 937 components: - type: Transform rot: 1.5707963267948966 rad pos: 14.5,4.5 parent: 1 - - type: DeviceLinkSink - links: - - 939 - proto: ButtonFrameCaution entities: - uid: 4 @@ -2889,26 +2872,36 @@ entities: - type: Transform pos: 4.5,-3.5 parent: 1 - - type: Physics - canCollide: False - type: ContainerContainer containers: board: !type:Container + showEnts: False + occludes: True ents: [] - bank-ATM-cashSlot: !type:ContainerSlot {} + bank-ATM-cashSlot: !type:ContainerSlot + showEnts: False + occludes: True + ent: null + - type: Physics + canCollide: False - type: ItemSlots - uid: 387 components: - type: Transform pos: -3.5,-3.5 parent: 1 - - type: Physics - canCollide: False - type: ContainerContainer containers: board: !type:Container + showEnts: False + occludes: True ents: [] - bank-ATM-cashSlot: !type:ContainerSlot {} + bank-ATM-cashSlot: !type:ContainerSlot + showEnts: False + occludes: True + ent: null + - type: Physics + canCollide: False - type: ItemSlots - proto: ConveyorBelt entities: @@ -2918,54 +2911,36 @@ entities: rot: -1.5707963267948966 rad pos: 14.5,4.5 parent: 1 - - type: DeviceLinkSink - links: - - 650 - uid: 349 components: - type: Transform rot: -1.5707963267948966 rad pos: 12.5,4.5 parent: 1 - - type: DeviceLinkSink - links: - - 650 - uid: 350 components: - type: Transform rot: -1.5707963267948966 rad pos: 13.5,4.5 parent: 1 - - type: DeviceLinkSink - links: - - 650 - uid: 351 components: - type: Transform rot: 1.5707963267948966 rad pos: -12.5,4.5 parent: 1 - - type: DeviceLinkSink - links: - - 649 - uid: 352 components: - type: Transform rot: 1.5707963267948966 rad pos: -11.5,4.5 parent: 1 - - type: DeviceLinkSink - links: - - 649 - uid: 353 components: - type: Transform rot: 1.5707963267948966 rad pos: -13.5,4.5 parent: 1 - - type: DeviceLinkSink - links: - - 649 - proto: ConveyorBeltAssembly entities: - uid: 354 @@ -3670,6 +3645,14 @@ entities: parent: 1 - type: AtmosPipeColor color: '#990000FF' + - uid: 74 + components: + - type: Transform + rot: 1.5707963267948966 rad + pos: -5.5,7.5 + parent: 1 + - type: AtmosPipeColor + color: '#0055CCFF' - uid: 95 components: - type: Transform @@ -4657,16 +4640,6 @@ entities: parent: 1 - type: AtmosPipeColor color: '#0055CCFF' -- proto: GasPressurePumpOn - entities: - - uid: 461 - components: - - type: Transform - rot: 1.5707963267948966 rad - pos: -5.5,7.5 - parent: 1 - - type: AtmosPipeColor - color: '#0055CCFF' - proto: GasPressurePumpOnMax entities: - uid: 509 @@ -5120,6 +5093,14 @@ entities: - type: Transform pos: -1.5,10.5 parent: 1 +- proto: LockerWallMaterialsFuelUraniumFilled2 + entities: + - uid: 66 + components: + - type: Transform + rot: 1.5707963267948966 rad + pos: -11.5,7.5 + parent: 1 - proto: MaterialReclaimer entities: - uid: 540 @@ -5134,6 +5115,20 @@ entities: - type: Transform pos: 3.280076,1.401608 parent: 1 +- proto: NFSignDock + entities: + - uid: 604 + components: + - type: Transform + rot: 3.141592653589793 rad + pos: -5.5,-3.5 + parent: 1 + - uid: 605 + components: + - type: Transform + rot: 3.141592653589793 rad + pos: 6.5,-3.5 + parent: 1 - proto: NitrogenCanister entities: - uid: 194 @@ -5174,14 +5169,6 @@ entities: pos: 2.5035143,9.95162 parent: 1 - proto: PlasticFlapsAirtightClear - entities: - - uid: 517 - components: - - type: Transform - rot: 1.5707963267948966 rad - pos: 14.5,4.5 - parent: 1 -- proto: PlasticFlapsClear entities: - uid: 381 components: @@ -5189,6 +5176,12 @@ entities: rot: -1.5707963267948966 rad pos: -13.5,4.5 parent: 1 + - uid: 517 + components: + - type: Transform + rot: 1.5707963267948966 rad + pos: 14.5,4.5 + parent: 1 - proto: PortableGeneratorSuperPacmanShuttle entities: - uid: 45 @@ -5531,18 +5524,6 @@ entities: - type: Transform pos: 11.5,-7.5 parent: 1 -- proto: SheetUranium - entities: - - uid: 48 - components: - - type: Transform - pos: -10.480434,9.520037 - parent: 1 - - uid: 531 - components: - - type: Transform - pos: -10.496059,7.488787 - parent: 1 - proto: ShuttersNormal entities: - uid: 525 @@ -5550,57 +5531,36 @@ entities: - type: Transform pos: -0.5,-3.5 parent: 1 - - type: DeviceLinkSink - links: - - 571 - uid: 526 components: - type: Transform pos: -1.5,-3.5 parent: 1 - - type: DeviceLinkSink - links: - - 571 - uid: 527 components: - type: Transform pos: -2.5,-3.5 parent: 1 - - type: DeviceLinkSink - links: - - 571 - uid: 549 components: - type: Transform pos: 0.5,-3.5 parent: 1 - - type: DeviceLinkSink - links: - - 571 - uid: 570 components: - type: Transform pos: 1.5,-3.5 parent: 1 - - type: DeviceLinkSink - links: - - 571 - uid: 573 components: - type: Transform pos: 2.5,-3.5 parent: 1 - - type: DeviceLinkSink - links: - - 571 - uid: 949 components: - type: Transform pos: 3.5,-3.5 parent: 1 - - type: DeviceLinkSink - links: - - 571 - proto: ShuttersNormalOpen entities: - uid: 192 @@ -5608,65 +5568,41 @@ entities: - type: Transform pos: -4.5,-3.5 parent: 1 - - type: DeviceLinkSink - links: - - 947 - uid: 193 components: - type: Transform pos: -6.5,2.5 parent: 1 - - type: DeviceLinkSink - links: - - 944 - uid: 775 components: - type: Transform pos: -6.5,3.5 parent: 1 - - type: DeviceLinkSink - links: - - 944 - uid: 776 components: - type: Transform pos: -4.5,-0.5 parent: 1 - - type: DeviceLinkSink - links: - - 947 - uid: 950 components: - type: Transform pos: 5.5,-3.5 parent: 1 - - type: DeviceLinkSink - links: - - 945 - uid: 951 components: - type: Transform pos: 5.5,-0.5 parent: 1 - - type: DeviceLinkSink - links: - - 945 - uid: 952 components: - type: Transform pos: 7.5,3.5 parent: 1 - - type: DeviceLinkSink - links: - - 946 - uid: 953 components: - type: Transform pos: 7.5,2.5 parent: 1 - - type: DeviceLinkSink - links: - - 946 - proto: ShuttersRadiation entities: - uid: 235 @@ -5674,9 +5610,6 @@ entities: - type: Transform pos: -9.5,8.5 parent: 1 - - type: DeviceLinkSink - links: - - 41 - proto: ShuttleWindow entities: - uid: 577 @@ -5912,20 +5845,6 @@ entities: - type: Transform pos: -4.5,5.5 parent: 1 -- proto: NFSignDock - entities: - - uid: 604 - components: - - type: Transform - rot: 3.141592653589793 rad - pos: -5.5,-3.5 - parent: 1 - - uid: 605 - components: - - type: Transform - rot: 3.141592653589793 rad - pos: 6.5,-3.5 - parent: 1 - proto: SinkEmpty entities: - uid: 523 @@ -6013,8 +5932,6 @@ entities: - type: Transform pos: -0.5,11.5 parent: 1 - - type: Physics - canCollide: False - proto: Table entities: - uid: 145 diff --git a/Resources/Prototypes/Entities/Structures/Shuttles/thrusters.yml b/Resources/Prototypes/Entities/Structures/Shuttles/thrusters.yml index b45d99d23e3..e9ebe617e7e 100644 --- a/Resources/Prototypes/Entities/Structures/Shuttles/thrusters.yml +++ b/Resources/Prototypes/Entities/Structures/Shuttles/thrusters.yml @@ -100,6 +100,16 @@ shader: unshaded visible: false offset: 0, 1 + - type: DeviceNetwork # frontier + deviceNetId: Wireless # frontier + receiveFrequencyId: BasicDevice # frontier + - type: WirelessNetworkConnection # frontier + range: 200 # frontier + - type: DeviceLinkSink # frontier + ports: # frontier + - On # frontier + - Off # frontier + - Toggle # frontier - type: entity id: ThrusterUnanchored