From f07c5bc10f282aa57163b473be152567621db8cd Mon Sep 17 00:00:00 2001 From: LordME <58342752+TheLordME@users.noreply.github.com> Date: Thu, 31 Oct 2024 20:23:27 +0100 Subject: [PATCH] gateway spawner --- citadel.dme | 1 + code/__DEFINES/vv.dm | 3 +++ .../gateway/stargate/stargate-station.dm | 25 +++++++++++++++++++ code/modules/mapping/spawner/gateway.dm | 12 +++++++++ code/modules/mapping/spawner/tcomms_relay.dm | 6 +---- 5 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 code/modules/mapping/spawner/gateway.dm diff --git a/citadel.dme b/citadel.dme index 79c90a8763fd..5451772a5667 100644 --- a/citadel.dme +++ b/citadel.dme @@ -3317,6 +3317,7 @@ #include "code\modules\mapping\map_injection\map_injection.dm" #include "code\modules\mapping\map_injection\starting_gear.dm" #include "code\modules\mapping\spawner\_spawner.dm" +#include "code\modules\mapping\spawner\gateway.dm" #include "code\modules\mapping\spawner\tcomms_relay.dm" #include "code\modules\mapping\spawner\window.dm" #include "code\modules\mapping\templates\engine.dm" diff --git a/code/__DEFINES/vv.dm b/code/__DEFINES/vv.dm index a3f0a9dee7e9..c58f5cb50db4 100644 --- a/code/__DEFINES/vv.dm +++ b/code/__DEFINES/vv.dm @@ -103,6 +103,9 @@ /// used on /mob as well as /obj/item/organ #define VV_HK_REMOVE_PHYSIOLOGY_MODIFIER "remove_physiology_mod" +// gateways +#define VV_HK_SETUP_GATEWAY "setup_gateway" + /* // /obj #define VV_HK_OSAY "osay" diff --git a/code/modules/gateway/stargate/stargate-station.dm b/code/modules/gateway/stargate/stargate-station.dm index b7e780051a44..08a036de1c38 100644 --- a/code/modules/gateway/stargate/stargate-station.dm +++ b/code/modules/gateway/stargate/stargate-station.dm @@ -125,3 +125,28 @@ else to_chat(user, "The gate is already calibrated, there is no work for you to do here.") return + +/obj/machinery/gateway/centerstation/proc/admin_setup(/mob/usr) + detect() + + awaygate = locate(/obj/machinery/gateway/centeraway) + if(!awaygate) // We still can't find the damn thing because there is no destination. + to_chat(usr, "Unable to locate awaygate (type: /obj/machinery/gateway/centeraway)") + return + + awaygate.stationgate = src + awaygate.detect() + + wait = 0 + + toggleon(usr) + awaygate.toggleon(usr) + +/obj/machinery/gateway/centerstation/vv_get_dropdown() + . = ..() + VV_DROPDOWN_OPTION(VV_HK_SETUP_GATEWAY, "Setup Gateway") + +/obj/machinery/gateway/centerstation/vv_do_topic(list/href_list) + if(href_list[VV_HK_SETUP_GATEWAY] && check_rights(R_FUN)) + admin_setup(usr) + . = ..() diff --git a/code/modules/mapping/spawner/gateway.dm b/code/modules/mapping/spawner/gateway.dm new file mode 100644 index 000000000000..f3404a898d36 --- /dev/null +++ b/code/modules/mapping/spawner/gateway.dm @@ -0,0 +1,12 @@ +/obj/spawner/gateway + name = "Gateway map helper" + var/obj/machinery/gateway/centeraway/gw + +/obj/spawner/gateway/Spawn() + ..() + gw = new(src.loc) + for(var/direction in GLOB.alldirs) + var/obj/machinery/gateway/new_gateway_part = new(get_step(src, direction)) + new_gateway_part.dir = direction + gw.detect() + qdel(src) diff --git a/code/modules/mapping/spawner/tcomms_relay.dm b/code/modules/mapping/spawner/tcomms_relay.dm index 8d9ee597bc64..5cc5001e6c37 100644 --- a/code/modules/mapping/spawner/tcomms_relay.dm +++ b/code/modules/mapping/spawner/tcomms_relay.dm @@ -12,11 +12,7 @@ /obj/spawner/tcomms_relay/autoconnect/Spawn() ..() var/obj/machinery/telecomms/hub/preset/station_hub - station_hub = locate(/obj/machinery/telecomms/hub/preset/rift) in world - if(!station_hub) - station_hub = locate(/obj/machinery/telecomms/hub/preset/triumph) in world - if(!station_hub) - station_hub = locate(/obj/machinery/telecomms/hub/preset/tether) in world + station_hub = locate(/obj/machinery/telecomms/hub/preset) in world if(!station_hub) log_and_message_admins("[src] failed to locate telecoms hub, no autoconnection possible.") else