Updates baseturf helpers to the new baseturf system (#37154)

This commit is contained in:
Emmett Gaines
2018-04-13 08:59:01 -04:00
committed by yogstation13-bot
parent 14396606fc
commit fcfbe74bca
2 changed files with 40 additions and 71 deletions

View File

@@ -801,9 +801,6 @@
/turf/open/floor/plating,
/area/mine/eva)
"cq" = (
/obj/effect/baseturf_helper/picky/lava_land/basalt{
whitelist = /turf/open/floor
},
/turf/open/floor/mech_bay_recharge_floor,
/area/mine/eva)
"cr" = (
@@ -834,9 +831,6 @@
/area/lavaland/surface/outdoors)
"cw" = (
/obj/machinery/computer/secure_data,
/obj/effect/baseturf_helper/picky/lava_land/basalt{
whitelist = /turf/open/floor
},
/turf/open/floor/plasteel,
/area/mine/laborcamp/security)
"cx" = (
@@ -1035,9 +1029,6 @@
/obj/effect/turf_decal/loading_area{
dir = 8
},
/obj/effect/baseturf_helper/picky/lava_land/basalt{
whitelist = /turf/open/floor
},
/turf/open/floor/plasteel,
/area/mine/production)
"dc" = (
@@ -1211,9 +1202,6 @@
dir = 8;
network = list("mine")
},
/obj/effect/baseturf_helper/picky/lava_land/basalt{
whitelist = /turf/open/floor
},
/turf/open/floor/circuit,
/area/mine/maintenance)
"dB" = (
@@ -3284,7 +3272,7 @@
/turf/open/floor/plating/asteroid/basalt/lava_land_surface,
/area/lavaland/surface/outdoors)
"Wt" = (
/obj/effect/baseturf_helper/picky/lava_land/plating,
/obj/effect/baseturf_helper/lava_land/surface,
/turf/closed/wall,
/area/mine/laborcamp/security)
"Wz" = (
@@ -3343,39 +3331,25 @@
/turf/open/floor/plasteel,
/area/mine/production)
"WF" = (
/obj/effect/baseturf_helper/picky/lava_land/plating,
/obj/effect/baseturf_helper/lava_land/surface,
/turf/closed/wall,
/area/mine/laborcamp)
"WG" = (
/obj/effect/baseturf_helper/picky/lava_land/basalt{
whitelist = /turf/open/floor
},
/turf/open/floor/plasteel,
/area/mine/laborcamp)
"WH" = (
/obj/effect/baseturf_helper/picky/lava_land/plating,
/obj/effect/baseturf_helper/lava_land/surface,
/turf/closed/wall,
/area/mine/eva)
"WI" = (
/obj/effect/baseturf_helper/picky/lava_land/plating,
/obj/effect/baseturf_helper/lava_land/surface,
/turf/closed/wall,
/area/mine/production)
"WJ" = (
/obj/effect/baseturf_helper/picky/lava_land/plating,
/obj/effect/baseturf_helper/lava_land/surface,
/turf/closed/wall/r_wall,
/area/mine/maintenance)
"WK" = (
/obj/effect/baseturf_helper/picky/lava_land/plating,
/obj/effect/baseturf_helper/lava_land/surface,
/turf/closed/wall,
/area/mine/living_quarters)
"WL" = (
/obj/effect/baseturf_helper/picky/lava_land/basalt{
whitelist = /turf/open/floor
},
/turf/open/floor/plasteel/purple/corner{
dir = 8
},
/area/mine/living_quarters)
(1,1,1) = {"
aa
@@ -8734,7 +8708,7 @@ aq
ba
aq
bj
WG
az
az
aq
ca
@@ -13117,7 +13091,7 @@ dQ
ec
er
dZ
WL
eL
fh
ft
eL

View File

@@ -6,19 +6,44 @@
name = "baseturf editor"
icon = 'icons/effects/mapping_helpers.dmi'
icon_state = ""
var/baseturf = null
var/list/baseturf_to_replace
var/baseturf
layer = POINT_LAYER
/obj/effect/baseturf_helper/Initialize()
. = ..()
var/area/thearea = get_area(src)
for(var/turf/T in get_area_turfs(thearea, z))
replace_baseturf(T)
return INITIALIZE_HINT_QDEL
return INITIALIZE_HINT_LATELOAD
/obj/effect/baseturf_helper/LateInitialize()
if(!baseturf_to_replace)
baseturf_to_replace = typecacheof(/turf/open/space)
else if(!length(baseturf_to_replace))
baseturf_to_replace = list(baseturf_to_replace = TRUE)
else if(baseturf_to_replace[baseturf_to_replace[1]] != TRUE) // It's not associative
var/list/formatted = list()
for(var/i in baseturf_to_replace)
formatted[i] = TRUE
baseturf_to_replace = formatted
var/area/our_area = get_area(src)
for(var/i in get_area_turfs(our_area, z))
replace_baseturf(i)
qdel(src)
/obj/effect/baseturf_helper/proc/replace_baseturf(turf/thing)
if(thing.baseturfs != thing.type)
thing.baseturfs = baseturf
var/list/baseturf_cache = thing.baseturfs
if(length(baseturf_cache))
for(var/i in baseturf_cache)
if(baseturf_to_replace[i])
baseturf_cache -= i
else if(baseturf_to_replace[thing.baseturfs])
thing.assemble_baseturfs(baseturf)
return
thing.PlaceOnBottom(null, baseturf)
/obj/effect/baseturf_helper/space
name = "space baseturf editor"
@@ -56,36 +81,6 @@
name = "lavaland baseturf editor"
baseturf = /turf/open/lava/smooth/lava_land_surface
// Does the same thing as baseturf_helper but only the specified kinds of turf (the kind it's placed on or varedited)
/obj/effect/baseturf_helper/picky
var/list/whitelist
// Can be mapedited as: a single type, a list of types, or a typecache-like list
// The first 2 make a typecache of the given values
// The last uses it as is
/obj/effect/baseturf_helper/picky/Initialize()
if(!whitelist)
whitelist = list(loc.type)
else if(!islist(whitelist))
whitelist = list(whitelist)
else if(whitelist[whitelist[1]]) // Checking if it's a typecache-like list
return ..()
whitelist = typecacheof(whitelist)
return ..()
/obj/effect/baseturf_helper/picky/replace_baseturf(turf/thing)
if(!whitelist[thing.type])
return
return ..()
/obj/effect/baseturf_helper/picky/lava_land/plating
name = "picky lavaland plating baseturf helper"
baseturf = /turf/open/floor/plating/lavaland_baseturf
/obj/effect/baseturf_helper/picky/lava_land/basalt
name = "picky lavaland basalt baseturf helper"
baseturf = /turf/open/floor/plating/asteroid/basalt/lava_land_surface
/obj/effect/mapping_helpers
icon = 'icons/effects/mapping_helpers.dmi'