Areas can have their own base turf type (#10765)

This commit is contained in:
unid15
2016-06-25 22:18:35 +02:00
committed by clusterfack
parent b3c277234e
commit 578a76b0bf
12 changed files with 634 additions and 613 deletions

View File

@@ -674,7 +674,7 @@
turfs_to_update += new_turf turfs_to_update += new_turf
//Delete the old turf //Delete the old turf
var/replacing_turf_type = get_base_turf(old_turf.z) var/replacing_turf_type = old_turf.get_underlying_turf()
var/obj/docking_port/destination/D = linked_port.docked_with var/obj/docking_port/destination/D = linked_port.docked_with
if(D && istype(D)) replacing_turf_type = D.base_turf_type if(D && istype(D)) replacing_turf_type = D.base_turf_type

View File

@@ -10,6 +10,8 @@
var/turret_protected = 0 var/turret_protected = 0
var/list/turretTargets = list() var/list/turretTargets = list()
var/base_turf_type = null
/area/New() /area/New()
area_turfs = list() area_turfs = list()
icon_state = "" icon_state = ""

View File

@@ -66,7 +66,7 @@ var/image/list/w_overlays = list("wet" = image('icons/effects/water.dmi',icon_st
//set src in oview(1) //set src in oview(1)
switch(severity) switch(severity)
if(1.0) if(1.0)
src.ChangeTurf(get_base_turf(src.z)) src.ChangeTurf(get_underlying_turf())
if(2.0) if(2.0)
switch(pick(1,2;75,3)) switch(pick(1,2;75,3))
if (1) if (1)
@@ -75,7 +75,7 @@ var/image/list/w_overlays = list("wet" = image('icons/effects/water.dmi',icon_st
var/obj/item/stack/sheet/metal/M = getFromPool(/obj/item/stack/sheet/metal, get_turf(src)) var/obj/item/stack/sheet/metal/M = getFromPool(/obj/item/stack/sheet/metal, get_turf(src))
M.amount = 1 M.amount = 1
if(2) if(2)
src.ChangeTurf(get_base_turf(src.z)) src.ChangeTurf(get_underlying_turf())
if(3) if(3)
if(prob(80)) if(prob(80))
src.break_tile_to_plating() src.break_tile_to_plating()

View File

@@ -126,7 +126,7 @@
if(prob(80)) if(prob(80))
src.ReplaceWithLattice() src.ReplaceWithLattice()
else if(prob(50)) else if(prob(50))
src.ChangeTurf(get_base_turf(src.z)) src.ChangeTurf(get_underlying_turf())
else else
var/turf/simulated/floor/F = src var/turf/simulated/floor/F = src
F.make_plating() F.make_plating()

View File

@@ -61,7 +61,7 @@
severity = 1.0 severity = 1.0
switch(severity) switch(severity)
if(1.0) if(1.0)
src.ChangeTurf(get_base_turf(src.z)) //You get NOTHING, you LOSE src.ChangeTurf(get_underlying_turf()) //You get NOTHING, you LOSE
return return
if(2.0) if(2.0)
if(prob(50)) if(prob(50))

View File

@@ -503,8 +503,15 @@
S.air.update_values() S.air.update_values()
*/ */
/turf/proc/get_underlying_turf()
var/area/A = loc
if(A.base_turf_type)
return A.base_turf_type
return get_base_turf(z)
/turf/proc/ReplaceWithLattice() /turf/proc/ReplaceWithLattice()
src.ChangeTurf(get_base_turf(src.z)) src.ChangeTurf(get_underlying_turf())
if(istype(src, /turf/space)) if(istype(src, /turf/space))
new /obj/structure/lattice(src) new /obj/structure/lattice(src)
@@ -623,7 +630,7 @@
/turf/proc/cultify() /turf/proc/cultify()
if(istype(src, get_base_turf(src.z))) //Don't cultify the base turf, ever if(istype(src, get_underlying_turf())) //Don't cultify the base turf, ever
return return
ChangeTurf(get_base_turf(src.z)) ChangeTurf(get_base_turf(src.z))
@@ -631,7 +638,7 @@
return PROJREACT_WALLS return PROJREACT_WALLS
/turf/singularity_act() /turf/singularity_act()
if(istype(src, get_base_turf(src.z))) //Don't singulo the base turf, ever if(istype(src, get_underlying_turf())) //Don't singulo the base turf, ever
return return
if(intact) if(intact)
for(var/obj/O in contents) for(var/obj/O in contents)
@@ -639,7 +646,7 @@
continue continue
if(O.invisibility == 101) if(O.invisibility == 101)
O.singularity_act() O.singularity_act()
ChangeTurf(get_base_turf(src.z)) ChangeTurf(get_underlying_turf())
return(2) return(2)
//Return a lattice to allow catwalk building //Return a lattice to allow catwalk building

View File

@@ -31,7 +31,7 @@
return 1 return 1
playsound(get_turf(master), 'sound/items/Deconstruct.ogg', 50, 1) playsound(get_turf(master), 'sound/items/Deconstruct.ogg', 50, 1)
T.ChangeTurf(get_base_turf(T.z)) T.ChangeTurf(T.get_underlying_turf())
return 0 return 0
else if(istype(A, /obj/machinery/door/airlock)) else if(istype(A, /obj/machinery/door/airlock))
@@ -146,9 +146,9 @@
/datum/rcd_schematic/con_airlock/get_HTML(var/obj/machinery/door/airlock/D) /datum/rcd_schematic/con_airlock/get_HTML(var/obj/machinery/door/airlock/D)
. = "<p>" . = "<p>"
. += {" . += {"
<form action="?src=\ref[master.interface]" method="get"> <form action="?src=\ref[master.interface]" method="get">
<input type="hidden" name="src" value="\ref[master.interface]"/> <input type="hidden" name="src" value="\ref[master.interface]"/>
[istype(D) ? "<input type=\"hidden\" name = \"target\" value=\"\ref[D]\"/>" : ""] [istype(D) ? "<input type=\"hidden\" name = \"target\" value=\"\ref[D]\"/>" : ""]
<input type="text" name="new_name" value="[istype(D) ? D.name : selected_name]"/> <input type="text" name="new_name" value="[istype(D) ? D.name : selected_name]"/>
<input type="submit" name="act" value="Save Name"/> <input type="submit" name="act" value="Save Name"/>
@@ -177,7 +177,7 @@
<form action="?src=\ref[master.interface]" method="get" id="accessList" style="display:inline-block;font-size:100%"> <form action="?src=\ref[master.interface]" method="get" id="accessList" style="display:inline-block;font-size:100%">
<input type="hidden" name="src" value="\ref[master.interface]"/> <input type="hidden" name="src" value="\ref[master.interface]"/>
[istype(D) ? "<input type=\"hidden\" name = \"target\" value=\"\ref[D]\"/>" : ""] [istype(D) ? "<input type=\"hidden\" name = \"target\" value=\"\ref[D]\"/>" : ""]
<input type="submit" value="Save Access Settings"/><br/><br/> <input type="submit" value="Save Access Settings"/><br/><br/>
@@ -295,7 +295,7 @@
return return
var/list/new_access = new var/list/new_access = new
//Along with oneAccess, the hrefs for access levels get called, as such we process them here before we return 1 //Along with oneAccess, the hrefs for access levels get called, as such we process them here before we return 1
var/list/access_levels = get_all_accesses() var/list/access_levels = get_all_accesses()
for(var/href_key in href_list - list("oneAccess", "src")) //This should loop through all the access levels that are on. for(var/href_key in href_list - list("oneAccess", "src")) //This should loop through all the access levels that are on.
@@ -315,7 +315,7 @@
else else
D.req_access = new_access.Copy() D.req_access = new_access.Copy()
D.req_one_access.Cut() D.req_one_access.Cut()
master.update_options_menu(list2params(list(D))) master.update_options_menu(list2params(list(D)))
return 1 return 1

View File

@@ -642,7 +642,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
feedback_add_details("admin_verb","DEL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! feedback_add_details("admin_verb","DEL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
if(istype(O,/turf)) if(istype(O,/turf))
var/turf/T=O var/turf/T=O
T.ChangeTurf(get_base_turf(T.z)) T.ChangeTurf(T.get_underlying_turf())
else else
qdel(O) qdel(O)

View File

@@ -1246,7 +1246,7 @@ var/global/list/arena_spawnpoints = list()//used by /mob/dead/observer/Logout()
for(var/atom/movable/AM in T) for(var/atom/movable/AM in T)
AM.areaMaster = get_area_master(T) AM.areaMaster = get_area_master(T)
if(open_space && (under.name == "Space")) if(open_space && (under.name == "Space"))
T.ChangeTurf(get_base_turf(T.z)) T.ChangeTurf(T.get_underlying_turf())
else else
T.ChangeTurf(/turf/simulated/floor/plating) T.ChangeTurf(/turf/simulated/floor/plating)
T.maptext = null T.maptext = null

View File

@@ -7,6 +7,6 @@
/turf/simulated/floor/engine/blob_act() /turf/simulated/floor/engine/blob_act()
if(prob(25)) if(prob(25))
ChangeTurf(get_base_turf(src.z)) ChangeTurf(get_underlying_turf())
return return
return return

View File

@@ -10,11 +10,22 @@
//Optional area: Tower of Madness. Contains many mummy priests and faithless, in the end there's an altar. Praying at the altar will cause you to completely lose your mind and gain many superpowers. //Optional area: Tower of Madness. Contains many mummy priests and faithless, in the end there's an altar. Praying at the altar will cause you to completely lose your mind and gain many superpowers.
/area/awaymission/tomb/expedition_camp
/area/awaymission/tomb/outside
name = "desert"
base_turf_type = /turf/unsimulated/beach/sand
dynamic_lighting = 0
/area/awaymission/tomb/outside/expedition_camp
name = "expedition camp" name = "expedition camp"
/area/awaymission/tomb/pyramid_outside /area/awaymission/tomb/outside/pyramid_outside
name = "great pyramid" name = "great pyramid"
dynamic_lighting = 1
/area/awaymission/tomb
base_turf_type = /turf/unsimulated/floor/asteroid/air
/area/awaymission/tomb/tomb_of_rafid /area/awaymission/tomb/tomb_of_rafid
name = "Tomb of Rafid" name = "Tomb of Rafid"

File diff suppressed because it is too large Load Diff