mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Conflicts: baystation12.dme code/game/gamemodes/events.dm code/game/machinery/doors/door.dm code/game/machinery/gateway.dm code/game/objects/items/devices/flashlight.dm code/game/sound.dm code/global.dm code/modules/admin/admin_verbs.dm code/modules/awaymissions/zlevel.dm code/modules/food/recipes_microwave.dm code/modules/mining/mine_items.dm code/modules/mob/living/carbon/carbon.dm code/modules/mob/living/carbon/human/update_icons.dm code/modules/paperwork/clipboard.dm code/modules/paperwork/filingcabinet.dm code/modules/paperwork/folders.dm code/modules/paperwork/handlabeler.dm code/modules/paperwork/paper.dm code/modules/paperwork/paperbin.dm code/modules/paperwork/pen.dm code/modules/paperwork/photocopier.dm code/modules/paperwork/stamps.dm code/world.dm html/changelog.html maps/RandomZLevels/fileList.txt Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
60 lines
1.2 KiB
Plaintext
60 lines
1.2 KiB
Plaintext
proc/createRandomZlevel()
|
|
if(awaydestinations.len) //crude, but it saves another var!
|
|
return
|
|
|
|
var/list/potentialRandomZlevels = list()
|
|
|
|
var/text = file2text("maps/RandomZLevels/fileList.txt")
|
|
|
|
if (!text) // No random Z-levels for you.
|
|
return
|
|
|
|
world << "\red \b Searching for away missions..."
|
|
|
|
var/list/CL = dd_text2list(text, "\n")
|
|
|
|
for (var/t in CL)
|
|
if (!t)
|
|
continue
|
|
|
|
t = trim(t)
|
|
if (length(t) == 0)
|
|
continue
|
|
else if (copytext(t, 1, 2) == "#")
|
|
continue
|
|
|
|
var/pos = findtext(t, " ")
|
|
var/name = null
|
|
// var/value = null
|
|
|
|
if (pos)
|
|
name = lowertext(copytext(t, 1, pos))
|
|
// value = copytext(t, pos + 1)
|
|
else
|
|
name = lowertext(t)
|
|
|
|
if (!name)
|
|
continue
|
|
|
|
potentialRandomZlevels.Add(t)
|
|
|
|
|
|
if(potentialRandomZlevels.len)
|
|
world << "\red \b Loading away mission..."
|
|
|
|
var/map = pick(potentialRandomZlevels)
|
|
world.log << "away mission loaded: [map]"
|
|
var/file = file(map)
|
|
if(isfile(file))
|
|
maploader.load_map(file)
|
|
|
|
for(var/obj/effect/landmark/L in landmarks_list)
|
|
if (L.name != "awaystart")
|
|
continue
|
|
awaydestinations.Add(L)
|
|
|
|
world << "\red \b Away mission loaded."
|
|
|
|
else
|
|
world << "\red \b No away missions found."
|
|
return |