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
//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
if(D && istype(D)) replacing_turf_type = D.base_turf_type

View File

@@ -10,6 +10,8 @@
var/turret_protected = 0
var/list/turretTargets = list()
var/base_turf_type = null
/area/New()
area_turfs = list()
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)
switch(severity)
if(1.0)
src.ChangeTurf(get_base_turf(src.z))
src.ChangeTurf(get_underlying_turf())
if(2.0)
switch(pick(1,2;75,3))
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))
M.amount = 1
if(2)
src.ChangeTurf(get_base_turf(src.z))
src.ChangeTurf(get_underlying_turf())
if(3)
if(prob(80))
src.break_tile_to_plating()

View File

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

View File

@@ -61,7 +61,7 @@
severity = 1.0
switch(severity)
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
if(2.0)
if(prob(50))

View File

@@ -503,8 +503,15 @@
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()
src.ChangeTurf(get_base_turf(src.z))
src.ChangeTurf(get_underlying_turf())
if(istype(src, /turf/space))
new /obj/structure/lattice(src)
@@ -623,7 +630,7 @@
/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
ChangeTurf(get_base_turf(src.z))
@@ -631,7 +638,7 @@
return PROJREACT_WALLS
/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
if(intact)
for(var/obj/O in contents)
@@ -639,7 +646,7 @@
continue
if(O.invisibility == 101)
O.singularity_act()
ChangeTurf(get_base_turf(src.z))
ChangeTurf(get_underlying_turf())
return(2)
//Return a lattice to allow catwalk building

View File

@@ -31,7 +31,7 @@
return 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
else if(istype(A, /obj/machinery/door/airlock))

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!
if(istype(O,/turf))
var/turf/T=O
T.ChangeTurf(get_base_turf(T.z))
T.ChangeTurf(T.get_underlying_turf())
else
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)
AM.areaMaster = get_area_master(T)
if(open_space && (under.name == "Space"))
T.ChangeTurf(get_base_turf(T.z))
T.ChangeTurf(T.get_underlying_turf())
else
T.ChangeTurf(/turf/simulated/floor/plating)
T.maptext = null

View File

@@ -7,6 +7,6 @@
/turf/simulated/floor/engine/blob_act()
if(prob(25))
ChangeTurf(get_base_turf(src.z))
ChangeTurf(get_underlying_turf())
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.
/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"
/area/awaymission/tomb/pyramid_outside
/area/awaymission/tomb/outside/pyramid_outside
name = "great pyramid"
dynamic_lighting = 1
/area/awaymission/tomb
base_turf_type = /turf/unsimulated/floor/asteroid/air
/area/awaymission/tomb/tomb_of_rafid
name = "Tomb of Rafid"

File diff suppressed because it is too large Load Diff