Files
GS13/code/modules/mining/shelters.dm
DexterDude 517b1763b2 Test
Pod addition (test)
2019-09-25 02:34:19 -04:00

85 lines
2.9 KiB
Plaintext

/datum/map_template/shelter
var/shelter_id
var/description
var/blacklisted_turfs
var/whitelisted_turfs
var/banned_areas
var/banned_objects
/datum/map_template/shelter/New()
. = ..()
blacklisted_turfs = typecacheof(/turf/closed)
whitelisted_turfs = list()
banned_areas = typecacheof(/area/shuttle)
banned_objects = list()
/datum/map_template/shelter/proc/check_deploy(turf/deploy_location)
var/affected = get_affected_turfs(deploy_location, centered=TRUE)
for(var/turf/T in affected)
var/area/A = get_area(T)
if(is_type_in_typecache(A, banned_areas))
return SHELTER_DEPLOY_BAD_AREA
var/banned = is_type_in_typecache(T, blacklisted_turfs)
var/permitted = is_type_in_typecache(T, whitelisted_turfs)
if(banned && !permitted)
return SHELTER_DEPLOY_BAD_TURFS
for(var/obj/O in T)
if((O.density && O.anchored) || is_type_in_typecache(O, banned_objects))
return SHELTER_DEPLOY_ANCHORED_OBJECTS
return SHELTER_DEPLOY_ALLOWED
/datum/map_template/shelter/alpha
name = "Shelter Alpha"
shelter_id = "shelter_alpha"
description = "A cosy self-contained pressurized shelter, with \
built-in navigation, entertainment, medical facilities and a \
sleeping area! Order now, and we'll throw in a TINY FAN, \
absolutely free!"
mappath = "_maps/templates/new_pod_1.dmm"
/datum/map_template/shelter/alpha/New()
. = ..()
whitelisted_turfs = typecacheof(/turf/closed/mineral)
banned_objects = typecacheof(/obj/structure/stone_tile)
/datum/map_template/shelter/beta
name = "Shelter Beta"
shelter_id = "shelter_beta"
description = "A medium sized pod containing a slight bit \
more than the standard pod provided to miners. Order now, \
and we'll throw in TWO tiny fans, absolutely free!"
mappath = "_maps/templates/new_pod_2.dmm"
/datum/map_template/shelter/beta/New()
. = ..()
whitelisted_turfs = typecacheof(/turf/closed/mineral)
banned_objects = typecacheof(/obj/structure/stone_tile)
/datum/map_template/shelter/charlie
name = "Shelter Charlie"
shelter_id = "shelter_charlie"
description = "A large pod fitted with a closed off sleeping \
quarters, medbay and all the amenities the medium pod provides \
and more! Comes with TWO tiny fans and a mining vendor 100% free!"
mappath = "_maps/templates/new_pod_3.dmm"
/datum/map_template/shelter/charlie/New()
. = ..()
whitelisted_turfs = typecacheof(/turf/closed/mineral)
banned_objects = typecacheof(/obj/structure/stone_tile)
/datum/map_template/shelter/delta
name = "Shelter Delta"
shelter_id = "shelter_delta"
description = "A nice, luxury pod fit for some significant individual.\
Either that or a miner with a bit of time on their hands and a lot of \
points saved up. Comes with a bar, bedroom and observation deck for \
staring at the pits of lava and the poor souls banging on your door."
mappath = "_maps/templates/new_pod_luxury.dmm"
/datum/map_template/shelter/delta/New()
. = ..()
whitelisted_turfs = typecacheof(/turf/closed/mineral)
banned_objects = typecacheof(/obj/structure/stone_tile)