Shuttle stuffs and gateway refactor port https://github.com/tgstation/tgstation/pull/49868/
This commit is contained in:
@@ -2,33 +2,34 @@
|
||||
GLOBAL_LIST_INIT(potentialRandomZlevels, generateMapList(filename = "[global.config.directory]/awaymissionconfig.txt"))
|
||||
|
||||
/proc/createRandomZlevel()
|
||||
if(GLOB.awaydestinations.len) //crude, but it saves another var!
|
||||
return
|
||||
|
||||
if(GLOB.potentialRandomZlevels && GLOB.potentialRandomZlevels.len)
|
||||
to_chat(world, "<span class='boldannounce'>Loading away mission...</span>")
|
||||
var/map = pick(GLOB.potentialRandomZlevels)
|
||||
load_new_z_level(map, "Away Mission")
|
||||
to_chat(world, "<span class='boldannounce'>Away mission loaded.</span>")
|
||||
|
||||
/proc/reset_gateway_spawns(reset = FALSE)
|
||||
for(var/obj/machinery/gateway/G in world)
|
||||
if(reset)
|
||||
G.randomspawns = GLOB.awaydestinations
|
||||
else
|
||||
G.randomspawns.Add(GLOB.awaydestinations)
|
||||
|
||||
/obj/effect/landmark/awaystart
|
||||
name = "away mission spawn"
|
||||
desc = "Randomly picked away mission spawn points."
|
||||
var/id
|
||||
var/delay = TRUE // If the generated destination should be delayed by configured gateway delay
|
||||
|
||||
/obj/effect/landmark/awaystart/New()
|
||||
GLOB.awaydestinations += src
|
||||
..()
|
||||
/obj/effect/landmark/awaystart/Initialize()
|
||||
. = ..()
|
||||
var/datum/gateway_destination/point/current
|
||||
for(var/datum/gateway_destination/point/D in GLOB.gateway_destinations)
|
||||
if(D.id == id)
|
||||
current = D
|
||||
if(!current)
|
||||
current = new
|
||||
current.id = id
|
||||
if(delay)
|
||||
current.wait = CONFIG_GET(number/gateway_delay)
|
||||
GLOB.gateway_destinations += current
|
||||
current.target_turfs += get_turf(src)
|
||||
|
||||
/obj/effect/landmark/awaystart/Destroy()
|
||||
GLOB.awaydestinations -= src
|
||||
return ..()
|
||||
/obj/effect/landmark/awaystart/nodelay
|
||||
delay = FALSE
|
||||
|
||||
/proc/generateMapList(filename)
|
||||
. = list()
|
||||
|
||||
Reference in New Issue
Block a user