Merge pull request #18484 from coiax/random-space

All of space is now randomised
This commit is contained in:
oranges
2016-06-23 09:12:48 +12:00
committed by GitHub
49 changed files with 18765 additions and 207216 deletions
+2 -1
View File
@@ -146,7 +146,8 @@ var/list/admin_verbs_debug = list(
/client/proc/create_outfits,
/client/proc/debug_huds,
/client/proc/map_template_load,
/client/proc/map_template_upload
/client/proc/map_template_upload,
/client/proc/jump_to_ruin
)
var/list/admin_verbs_possess = list(
/proc/possess,
+32
View File
@@ -735,3 +735,35 @@ var/global/list/g_fancy_list_of_types = null
if(!holder)
return
debug_variables(huds[i])
/client/proc/jump_to_ruin()
set category = "Debug"
set name = "Jump to Ruin"
set desc = "Displays a list of all placed ruins to teleport to."
if(!holder)
return
var/list/names = list()
for(var/i in ruin_landmarks)
var/obj/effect/landmark/ruin/ruin_landmark = i
var/datum/map_template/ruin/template = ruin_landmark.ruin_template
var/count = 1
var/name = template.name
var/original_name = name
while(name in names)
count++
name = "[original_name] ([count])"
names[name] = ruin_landmark
var/ruinname = input("Select ruin", "Jump to Ruin") as null|anything in names
var/obj/effect/landmark/ruin/landmark = names[ruinname]
if(istype(landmark))
var/datum/map_template/ruin/template = landmark.ruin_template
usr.forceMove(get_turf(landmark))
usr << "<span class='name'>[template.name]</span>"
usr << "<span class='italics'>[template.description]</span>"
+37 -7
View File
@@ -1,19 +1,49 @@
/*An alternative to exit gateways, signposts send you back to the arrivals shuttle with their semiotic magic.*/
/*An alternative to exit gateways, signposts send you back to somewhere safe onstation with their semiotic magic.*/
/obj/structure/signpost
icon = 'icons/obj/stationobjs.dmi'
icon_state = "signpost"
anchored = 1
density = 1
var/question = "Travel back?"
var/zlevels = list(ZLEVEL_STATION)
/obj/structure/signpost/New()
. = ..()
SetLuminosity(2)
/obj/structure/signpost/attackby(obj/item/weapon/W, mob/user, params)
return attack_hand(user)
/obj/structure/signpost/attack_hand(mob/user)
switch(alert("Travel back to ss13?",,"Yes","No"))
switch(alert(question,name,"Yes","No"))
if("Yes")
if(user.z != src.z)
return
user.loc.loc.Exited(user)
user.loc = pick(latejoin)
var/turf/T = find_safe_turf(zlevels=zlevels)
if(T)
var/area/A = get_area(T)
user.forceMove(T)
user << "<span class='notice'>You blink and find yourself \
in [A.name].</span>"
else
user << "Nothing happens. You feel that this is a bad sign."
if("No")
return
return
/obj/structure/signpost/salvation
name = "\proper salvation"
desc = "In the darkest times, we will find our way home."
/obj/structure/signpost/exit
name = "exit"
desc = "Make sure to bring all your belongings with you when you \
exit the area."
question = "Leave? You might never come back."
/obj/structure/signpost/exit/New()
. = ..()
zlevels = list()
for(var/i in 1 to world.maxz)
zlevels += i
zlevels -= ZLEVEL_CENTCOM // no easy victory, even with meme signposts
// also, could you think of the horror if they ended up in a holodeck
// template or something
+15 -10
View File
@@ -1,3 +1,4 @@
// How much "space" we give the edge of the map
var/global/list/potentialRandomZlevels = generateMapList(filename = "config/awaymissionconfig.txt")
/proc/createRandomZlevel()
@@ -24,10 +25,6 @@ var/global/list/potentialRandomZlevels = generateMapList(filename = "config/away
world << "<span class='boldannounce'>Away mission loaded.</span>"
SortAreas() //To add recently loaded areas
else
world << "<span class='boldannounce'>No away missions found.</span>"
return
/proc/generateMapList(filename)
var/list/potentialMaps = list()
@@ -62,12 +59,12 @@ var/global/list/potentialRandomZlevels = generateMapList(filename = "config/away
return potentialMaps
/proc/seedRuins(z_level = 1, budget = 0, whitelist = /area/space, list/potentialRuins = space_ruins_templates)
/proc/seedRuins(list/z_levels = null, budget = 0, whitelist = /area/space, list/potentialRuins = space_ruins_templates)
if(!z_levels || !z_levels.len)
z_levels = list(1)
var/overall_sanity = 100
var/ruins = potentialRuins.Copy()
world << "<span class='boldannounce'>Loading ruins...</span>"
while(budget > 0 && overall_sanity > 0)
// Pick a ruin
var/datum/map_template/ruin/ruin = ruins[pick(ruins)]
@@ -81,7 +78,10 @@ var/global/list/potentialRandomZlevels = generateMapList(filename = "config/away
while(sanity > 0)
sanity--
var/turf/T = locate(rand(25, world.maxx - 25), rand(25, world.maxy - 25), z_level)
var/width_border = TRANSITIONEDGE + round(ruin.width / 2)
var/height_border = TRANSITIONEDGE + round(ruin.height / 2)
var/z_level = pick(z_levels)
var/turf/T = locate(rand(width_border, world.maxx - width_border), rand(height_border, world.maxy - height_border), z_level)
var/valid = TRUE
for(var/turf/check in ruin.get_affected_turfs(T,1))
@@ -122,11 +122,16 @@ var/global/list/potentialRandomZlevels = generateMapList(filename = "config/away
template = safepick(possible_ruins)
if(!template)
return FALSE
for(var/i in template.get_affected_turfs(get_turf(src), 1))
var/turf/central_turf = get_turf(src)
for(var/i in template.get_affected_turfs(central_turf, 1))
var/turf/T = i
for(var/mob/living/simple_animal/monster in T)
qdel(monster)
template.load(get_turf(src),centered = TRUE)
template.load(central_turf,centered = TRUE)
template.loaded++
var/datum/map_template/ruin = template
if(istype(ruin))
new /obj/effect/landmark/ruin(central_turf, ruin)
qdel(src)
return TRUE
@@ -84,7 +84,6 @@
investigate_log("has exploded.", "supermatter")
explosion(get_turf(src), explosion_power, explosion_power * 2, explosion_power * 3, explosion_power * 4, 1, 1)
qdel(src)
return
/obj/machinery/power/supermatter_shard/process()
var/turf/L = loc
@@ -262,7 +261,6 @@
return attack_hand(user)
else
user << "<span class='warning'>You attempt to interface with the control circuits but find they are not connected to your network. Maybe in a future firmware update.</span>"
return
/obj/machinery/power/supermatter_shard/attack_ai(mob/user)
user << "<span class='warning'>You attempt to interface with the control circuits but find they are not connected to your network. Maybe in a future firmware update.</span>"
@@ -282,7 +280,6 @@
for(var/obj/machinery/power/rad_collector/R in rad_collectors)
if(get_dist(R, src) <= 15) // Better than using orange() every process
R.receive_pulse(power/10)
return
/obj/machinery/power/supermatter_shard/attackby(obj/item/W, mob/living/user, params)
if(!istype(W) || (W.flags & ABSTRACT) || !istype(user))
+7 -1
View File
@@ -45,4 +45,10 @@
/area/ruin/onehalf/bridge
name = "Bridge"
icon_state = "bridge"
icon_state = "bridge"
/area/ruin/powered/dinner_for_two
name = "Dinner for Two"
/area/ruin/powered/authorship
name = "Authorship"
@@ -1,4 +1,4 @@
//This is realisation of the working torus-looping randomized-per-round space map, this kills the cube
//This is a simple 3 by 3 grid working off the corpse of the space torus. The donut is dead, cube has been avenged!
#define Z_LEVEL_NORTH "1"
#define Z_LEVEL_SOUTH "2"
@@ -12,13 +12,13 @@ var/list/z_levels_list = list()
var/name = "Your config settings failed, you need to fix this for the datum space levels to work"
var/list/neigbours = list()
var/z_value = 1 //actual z placement
var/linked = 1
var/linked = SELFLOOPING
var/xi
var/yi //imaginary placements on the grid
/datum/space_level/New(transition_type)
linked = transition_type
if(linked == 1)
if(linked == SELFLOOPING)
neigbours = list()
var/list/L = list(Z_LEVEL_NORTH,Z_LEVEL_SOUTH,Z_LEVEL_EAST,Z_LEVEL_WEST)
for(var/A in L)
@@ -84,7 +84,7 @@ var/list/z_levels_list = list()
D = new(map_transition_config[A])
D.name = A
D.z_value = k
if(D.linked < 2)
if(D.linked != CROSSLINKED)
z_levels_list["[D.z_value]"] = D
else
SLS.Add(D)
@@ -104,8 +104,7 @@ var/list/z_levels_list = list()
var/list/used_points = list()
grid.Cut()
while(SLS.len)
D = pick(SLS)
SLS.Remove(D)
D = pick_n_take(SLS)
D.xi = P.x
D.yi = P.y
P.spl = D
@@ -154,6 +153,7 @@ var/list/z_levels_list = list()
S.destination_x = x_pos_transition[side] == 1 ? S.x : x_pos_transition[side]
S.destination_y = y_pos_transition[side] == 1 ? S.y : y_pos_transition[side]
S.destination_z = zdestination
//S.maptext = "[zdestination]" // for debugging
for(var/A in grid)
z_levels_list[A] = grid[A]
@@ -161,4 +161,4 @@ var/list/z_levels_list = list()
#undef Z_LEVEL_NORTH
#undef Z_LEVEL_SOUTH
#undef Z_LEVEL_EAST
#undef Z_LEVEL_WEST
#undef Z_LEVEL_WEST
+35
View File
@@ -118,3 +118,38 @@ var/list/GPS_list = list()
icon_state = "gps-m"
gpstag = "MINER"
desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
/obj/item/device/gps/visible_debug
name = "visible GPS"
gpstag = "ADMIN"
desc = "This admin-spawn GPS unit leaves the coordinates visible \
on any turf that it passes over, for debugging. Especially useful \
for marking the area around the transition edges."
var/list/turf/tagged
/obj/item/device/gps/visible_debug/New()
. = ..()
tagged = list()
SSfastprocess.processing += src
/obj/item/device/gps/visible_debug/process()
var/turf/T = get_turf(src)
if(T)
// I assume it's faster to color,tag and OR the turf in, rather
// then checking if its there
T.color = RANDOM_COLOUR
T.maptext = "[x],[y],[z]"
tagged |= T
/obj/item/device/gps/visible_debug/proc/clear()
while(tagged.len)
var/turf/T = pop(tagged)
T.color = initial(T.color)
T.maptext = initial(T.maptext)
/obj/item/device/gps/visible_debug/Destroy()
if(tagged)
clear()
tagged = null
SSfastprocess.processing -= src
. = ..()