Skip to content

Commit

Permalink
gateway spawner (#6831)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game

<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->

## Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and it's effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->

:cl:
add: Added a spawner that sets a functioning away gate up
admin: Added a VV option to start the station gateway up without having
to interact with it
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
  • Loading branch information
TheLordME authored Nov 3, 2024
1 parent d0f62d5 commit 34a4db9
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 5 deletions.
1 change: 1 addition & 0 deletions citadel.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3321,6 +3321,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"
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/vv.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
25 changes: 25 additions & 0 deletions code/modules/gateway/stargate/stargate-station.dm
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,28 @@
else
to_chat(user, "<font color='black'>The gate is already calibrated, there is no work for you to do here.</font>")
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)
. = ..()
12 changes: 12 additions & 0 deletions code/modules/mapping/spawner/gateway.dm
Original file line number Diff line number Diff line change
@@ -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)
6 changes: 1 addition & 5 deletions code/modules/mapping/spawner/tcomms_relay.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 34a4db9

Please sign in to comment.