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 vuonojenmustaturska
parent 445260bc8f
commit b831ab50aa
2 changed files with 40 additions and 71 deletions

View File

@@ -801,9 +801,6 @@
/turf/open/floor/plating, /turf/open/floor/plating,
/area/mine/eva) /area/mine/eva)
"cq" = ( "cq" = (
/obj/effect/baseturf_helper/picky/lava_land/basalt{
whitelist = /turf/open/floor
},
/turf/open/floor/mech_bay_recharge_floor, /turf/open/floor/mech_bay_recharge_floor,
/area/mine/eva) /area/mine/eva)
"cr" = ( "cr" = (
@@ -834,9 +831,6 @@
/area/lavaland/surface/outdoors) /area/lavaland/surface/outdoors)
"cw" = ( "cw" = (
/obj/machinery/computer/secure_data, /obj/machinery/computer/secure_data,
/obj/effect/baseturf_helper/picky/lava_land/basalt{
whitelist = /turf/open/floor
},
/turf/open/floor/plasteel, /turf/open/floor/plasteel,
/area/mine/laborcamp/security) /area/mine/laborcamp/security)
"cx" = ( "cx" = (
@@ -1035,9 +1029,6 @@
/obj/effect/turf_decal/loading_area{ /obj/effect/turf_decal/loading_area{
dir = 8 dir = 8
}, },
/obj/effect/baseturf_helper/picky/lava_land/basalt{
whitelist = /turf/open/floor
},
/turf/open/floor/plasteel, /turf/open/floor/plasteel,
/area/mine/production) /area/mine/production)
"dc" = ( "dc" = (
@@ -1211,9 +1202,6 @@
dir = 8; dir = 8;
network = list("mine") network = list("mine")
}, },
/obj/effect/baseturf_helper/picky/lava_land/basalt{
whitelist = /turf/open/floor
},
/turf/open/floor/circuit, /turf/open/floor/circuit,
/area/mine/maintenance) /area/mine/maintenance)
"dB" = ( "dB" = (
@@ -3278,7 +3266,7 @@
/turf/open/floor/plating/asteroid/basalt/lava_land_surface, /turf/open/floor/plating/asteroid/basalt/lava_land_surface,
/area/lavaland/surface/outdoors) /area/lavaland/surface/outdoors)
"Wt" = ( "Wt" = (
/obj/effect/baseturf_helper/picky/lava_land/plating, /obj/effect/baseturf_helper/lava_land/surface,
/turf/closed/wall, /turf/closed/wall,
/area/mine/laborcamp/security) /area/mine/laborcamp/security)
"Wz" = ( "Wz" = (
@@ -3337,39 +3325,25 @@
/turf/open/floor/plasteel, /turf/open/floor/plasteel,
/area/mine/production) /area/mine/production)
"WF" = ( "WF" = (
/obj/effect/baseturf_helper/picky/lava_land/plating, /obj/effect/baseturf_helper/lava_land/surface,
/turf/closed/wall, /turf/closed/wall,
/area/mine/laborcamp) /area/mine/laborcamp)
"WG" = (
/obj/effect/baseturf_helper/picky/lava_land/basalt{
whitelist = /turf/open/floor
},
/turf/open/floor/plasteel,
/area/mine/laborcamp)
"WH" = ( "WH" = (
/obj/effect/baseturf_helper/picky/lava_land/plating, /obj/effect/baseturf_helper/lava_land/surface,
/turf/closed/wall, /turf/closed/wall,
/area/mine/eva) /area/mine/eva)
"WI" = ( "WI" = (
/obj/effect/baseturf_helper/picky/lava_land/plating, /obj/effect/baseturf_helper/lava_land/surface,
/turf/closed/wall, /turf/closed/wall,
/area/mine/production) /area/mine/production)
"WJ" = ( "WJ" = (
/obj/effect/baseturf_helper/picky/lava_land/plating, /obj/effect/baseturf_helper/lava_land/surface,
/turf/closed/wall/r_wall, /turf/closed/wall/r_wall,
/area/mine/maintenance) /area/mine/maintenance)
"WK" = ( "WK" = (
/obj/effect/baseturf_helper/picky/lava_land/plating, /obj/effect/baseturf_helper/lava_land/surface,
/turf/closed/wall, /turf/closed/wall,
/area/mine/living_quarters) /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) = {" (1,1,1) = {"
aa aa
@@ -8728,7 +8702,7 @@ aq
ba ba
aq aq
bj bj
WG az
az az
aq aq
ca ca
@@ -13111,7 +13085,7 @@ dQ
ec ec
er er
dZ dZ
WL eL
fh fh
ft ft
eL eL

View File

@@ -6,19 +6,44 @@
name = "baseturf editor" name = "baseturf editor"
icon = 'icons/effects/mapping_helpers.dmi' icon = 'icons/effects/mapping_helpers.dmi'
icon_state = "" icon_state = ""
var/baseturf = null
var/list/baseturf_to_replace
var/baseturf
layer = POINT_LAYER layer = POINT_LAYER
/obj/effect/baseturf_helper/Initialize() /obj/effect/baseturf_helper/Initialize()
. = ..() . = ..()
var/area/thearea = get_area(src) return INITIALIZE_HINT_LATELOAD
for(var/turf/T in get_area_turfs(thearea, z))
replace_baseturf(T) /obj/effect/baseturf_helper/LateInitialize()
return INITIALIZE_HINT_QDEL 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) /obj/effect/baseturf_helper/proc/replace_baseturf(turf/thing)
if(thing.baseturfs != thing.type) var/list/baseturf_cache = thing.baseturfs
thing.baseturfs = baseturf 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 /obj/effect/baseturf_helper/space
name = "space baseturf editor" name = "space baseturf editor"
@@ -56,36 +81,6 @@
name = "lavaland baseturf editor" name = "lavaland baseturf editor"
baseturf = /turf/open/lava/smooth/lava_land_surface 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 /obj/effect/mapping_helpers
icon = 'icons/effects/mapping_helpers.dmi' icon = 'icons/effects/mapping_helpers.dmi'