Port /tg/ lavaland shelters

Nanotech twist rather than bluespace, but whatever.
This commit is contained in:
Arokha Sieyes
2018-04-23 15:25:35 -04:00
parent 43299a5e3a
commit d5c9d3cb4e
12 changed files with 697 additions and 5 deletions

View File

@@ -32,3 +32,9 @@
//Assistant/Visitor/Whatever
#define USELESS_JOB "Visitor"
// Bluespace shelter deploy checks
#define SHELTER_DEPLOY_ALLOWED "allowed"
#define SHELTER_DEPLOY_BAD_TURFS "bad turfs"
#define SHELTER_DEPLOY_BAD_AREA "bad area"
#define SHELTER_DEPLOY_ANCHORED_OBJECTS "anchored objects"

View File

@@ -9,14 +9,15 @@ SUBSYSTEM_DEF(mapping)
var/obj/effect/landmark/engine_loader/engine_loader
var/list/shelter_templates = list()
/datum/controller/subsystem/mapping/Recover()
flags |= SS_NO_INIT // Make extra sure we don't initialize twice.
shelter_templates = SSmapping.shelter_templates
/datum/controller/subsystem/mapping/Initialize(timeofday)
loadEngine()
// TODO - This probably should be here
// // Pick a random away mission.
// createRandomZlevel()
preloadShelterTemplates()
// Mining generation probably should be here too
// TODO - Other stuff related to maps and areas could be moved here too. Look at /tg
if(using_map)
@@ -88,6 +89,15 @@ SUBSYSTEM_DEF(mapping)
else
MT.load_new_z(centered = FALSE)
/datum/controller/subsystem/mapping/proc/preloadShelterTemplates()
for(var/item in subtypesof(/datum/map_template/shelter))
var/datum/map_template/shelter/shelter_type = item
if(!(initial(shelter_type.mappath)))
continue
var/datum/map_template/shelter/S = new shelter_type()
shelter_templates[S.shelter_id] = S
/datum/controller/subsystem/mapping/stat_entry(msg)
if (!Debug2)
return // Only show up in stat panel if debugging is enabled.

View File

@@ -10,7 +10,7 @@
idle_power_usage = 5
active_power_usage = 100
flags = NOREACT
var/global/max_n_of_items = 999 // Sorry but the BYOND infinite loop detector doesn't look things over 1000.
var/max_n_of_items = 999 // Sorry but the BYOND infinite loop detector doesn't look things over 1000. //VOREStation Edit - Non-global
var/icon_on = "smartfridge"
var/icon_off = "smartfridge-off"
var/icon_panel = "smartfridge-panel"

View File

@@ -0,0 +1,254 @@
/*****************************Survival Pod********************************/
/area/survivalpod
name = "\improper Emergency Shelter"
icon_state = "away"
dynamic_lighting = TRUE
requires_power = FALSE
has_gravity = TRUE
//Survival Capsule
/obj/item/device/survivalcapsule
name = "surfluid shelter capsule"
desc = "An emergency shelter programmed into construction nanomachines. It has a license for use printed on the bottom."
icon_state = "houseball"
icon = 'icons/obj/device_alt.dmi'
w_class = ITEMSIZE_TINY
var/template_id = "shelter_alpha"
var/datum/map_template/shelter/template
var/used = FALSE
/obj/item/device/survivalcapsule/proc/get_template()
if(template)
return
template = SSmapping.shelter_templates[template_id]
if(!template)
throw EXCEPTION("Shelter template ([template_id]) not found!")
qdel(src)
/obj/item/device/survivalcapsule/Destroy()
template = null // without this, capsules would be one use. per round.
. = ..()
/obj/item/device/survivalcapsule/examine(mob/user)
. = ..()
get_template()
to_chat(user, "This capsule has the [template.name] stored.")
to_chat(user, template.description)
/obj/item/device/survivalcapsule/attack_self()
//Can't grab when capsule is New() because templates aren't loaded then
get_template()
if(!used)
loc.visible_message("<span class='warning'>\The [src] begins to shake. Stand back!</span>")
used = TRUE
sleep(5 SECONDS)
var/turf/deploy_location = get_turf(src)
var/status = template.check_deploy(deploy_location)
switch(status)
if(SHELTER_DEPLOY_BAD_AREA)
src.loc.visible_message("<span class='warning'>\The [src] will not function in this area.</span>")
if(SHELTER_DEPLOY_BAD_TURFS, SHELTER_DEPLOY_ANCHORED_OBJECTS)
var/width = template.width
var/height = template.height
src.loc.visible_message("<span class='warning'>\The [src] doesn't have room to deploy! You need to clear a [width]x[height] area!</span>")
if(status != SHELTER_DEPLOY_ALLOWED)
used = FALSE
return
var/turf/T = deploy_location
var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread()
smoke.attach(T)
smoke.set_up(10, 0, T)
smoke.start()
sleep(4 SECONDS)
playsound(get_turf(src), 'sound/effects/phasein.ogg', 100, 1)
log_and_message_admins("[key_name_admin(usr)] activated a bluespace capsule at [get_area(T)]!")
template.load(deploy_location, centered = TRUE)
qdel(src)
/obj/item/device/survivalcapsule/luxury
name = "luxury surfluid shelter capsule"
desc = "An exorbitantly expensive luxury suite programmed into construction nanomachines. There's a license for use printed on the bottom."
template_id = "shelter_beta"
//Pod objects
//Walls
/turf/simulated/shuttle/wall/voidcraft/survival
name = "survival shelter"
stripe_color = "#efbc3b"
//Doors
/obj/machinery/door/airlock/voidcraft/survival_pod
name = "survival airlock"
block_air_zones = 1
//Windows
/obj/structure/window/reinforced/survival_pod
name = "pod window"
icon = 'icons/obj/survival_pod.dmi'
icon_state = "pwindow"
basestate = "pwindow"
//The windows have diagonal versions, and will never be a full window
/obj/structure/window/reinforced/survival_pod/is_full_window()
return FALSE
/obj/structure/window/reinforced/survival_pod/update_icon()
icon_state = basestate
//Windoor
/obj/machinery/door/window/survival_pod
icon = 'icons/obj/survival_pod.dmi'
icon_state = "windoor"
base_state = "windoor"
//Table
/obj/structure/table/survival_pod
icon = 'icons/obj/survival_pod.dmi'
icon_state = "table"
//Sleeper
/obj/machinery/sleeper/survival_pod
icon = 'icons/obj/survival_pod.dmi'
icon_state = "sleeper"
stasis_level = 100 //Just one setting
/obj/machinery/sleeper/survival_pod/update_icon()
if(occupant)
add_overlay("sleeper_cover")
else
cut_overlays()
//Computer
/obj/item/device/gps/computer
name = "pod computer"
icon_state = "pod_computer"
icon = 'icons/obj/survival_pod_comp.dmi'
anchored = TRUE
density = TRUE
pixel_y = -32
/obj/item/device/gps/computer/attackby(obj/item/I, mob/living/user)
if(istype(I, /obj/item/weapon/wrench))
user.visible_message("<span class='warning'>[user] disassembles [src].</span>",
"<span class='notice'>You start to disassemble [src]...</span>", "You hear clanking and banging noises.")
if(do_after(user,4 SECONDS,src))
new /obj/item/device/gps(loc)
qdel(src)
return TRUE
return FALSE
/obj/item/device/gps/computer/attack_hand(mob/user)
. = ..()
if(.)
return
attack_self(user)
//Bed
/obj/structure/bed/pod
icon = 'icons/obj/survival_pod.dmi'
icon_state = "bed"
//Survival Storage Unit
/obj/machinery/smartfridge/survival_pod
name = "survival pod storage"
desc = "A heated storage unit."
icon_state = "donkvendor"
icon = 'icons/obj/survival_pod_vend.dmi'
icon_on = "donkvendor"
icon_off = "donkvendor"
light_range = 5
light_power = 1.2
light_color = "#DDFFD3"
pixel_y = -4
max_n_of_items = 10
var/empty = FALSE
/obj/machinery/smartfridge/survival_pod/initialize(mapload)
. = ..()
if(empty)
return
for(var/i in 1 to 5)
var/obj/item/weapon/reagent_containers/food/snacks/liquidfood/W = new(src)
stock(W)
if(prob(50))
var/obj/item/weapon/storage/pill_bottle/dice/D = new(src)
stock(D)
else
var/obj/item/device/violin/V = new(src)
stock(V)
/obj/machinery/smartfridge/survival_pod/accept_check(obj/item/O)
return isitem(O)
/obj/machinery/smartfridge/survival_pod/empty
name = "dusty survival pod storage"
desc = "A heated storage unit. This one's seen better days."
empty = TRUE
//Fans
/obj/structure/fans
icon = 'icons/obj/survival_pod.dmi'
icon_state = "fans"
name = "environmental regulation system"
desc = "A large machine releasing a constant gust of air."
anchored = TRUE
density = TRUE
var/buildstacktype = /obj/item/stack/material/steel
var/buildstackamount = 5
/obj/structure/fans/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(!height)
return FALSE
return TRUE
/obj/structure/fans/proc/deconstruct()
new buildstacktype(loc,buildstackamount)
qdel(src)
/obj/structure/fans/attackby(obj/item/I, mob/living/user)
if(istype(I, /obj/item/weapon/wrench))
user.visible_message("<span class='warning'>[user] disassembles [src].</span>",
"<span class='notice'>You start to disassemble [src]...</span>", "You hear clanking and banging noises.")
if(do_after(user,4 SECONDS,src))
deconstruct()
return TRUE
return TRUE
/obj/structure/fans/tiny
name = "tiny fan"
desc = "A tiny fan, releasing a thin gust of air."
plane = TURF_PLANE
layer = ABOVE_TURF_LAYER
density = FALSE
icon_state = "fan_tiny"
buildstackamount = 2
//Signs
/obj/structure/sign/mining
name = "nanotrasen mining corps sign"
desc = "A sign of relief for weary miners, and a warning for would-be competitors to Nanotrasen's mining claims."
icon = 'icons/obj/survival_pod.dmi'
icon_state = "ntpod"
/obj/structure/sign/mining/survival
name = "shelter sign"
desc = "A high visibility sign designating a safe shelter."
icon = 'icons/obj/survival_pod.dmi'
icon_state = "survival"
//Fluff
/obj/structure/tubes
icon_state = "tubes"
icon = 'icons/obj/survival_pod.dmi'
name = "tubes"
anchored = TRUE
layer = BELOW_MOB_LAYER
density = FALSE

View File

@@ -0,0 +1,60 @@
/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/unsimulated)
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/submaps/shelters/shelter_1.dmm"
/datum/map_template/shelter/alpha/New()
. = ..()
whitelisted_turfs = typecacheof(/turf/simulated/mineral)
banned_objects = list()
/datum/map_template/shelter/beta
name = "Shelter Beta"
shelter_id = "shelter_beta"
description = "An extremely luxurious shelter, containing all \
the amenities of home, including carpeted floors, hot and cold \
running water, a gourmet three course meal, cooking facilities, \
and a deluxe companion to keep you from getting lonely during \
an ash storm."
mappath = "maps/submaps/shelters/shelter_2.dmm"
/datum/map_template/shelter/beta/New()
. = ..()
whitelisted_turfs = typecacheof(/turf/simulated/mineral)
banned_objects = list()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 56 KiB

BIN
icons/obj/survival_pod.dmi Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1,106 @@
//MAP CONVERTED BY dmm2tgm.py THIS HEADER COMMENT PREVENTS RECONVERSION, DO NOT REMOVE
"a" = (
/turf/simulated/shuttle/wall/voidcraft,
/area/survivalpod)
"b" = (
/obj/structure/sign/mining/survival{
dir = 1
},
/turf/simulated/shuttle/wall/voidcraft,
/area/survivalpod)
"c" = (
/obj/structure/fans,
/turf/simulated/shuttle/floor/voidcraft,
/area/survivalpod)
"d" = (
/obj/machinery/smartfridge/survival_pod,
/turf/simulated/shuttle/floor/voidcraft,
/area/survivalpod)
"e" = (
/obj/item/device/gps/computer,
/turf/simulated/shuttle/floor/voidcraft,
/area/survivalpod)
"f" = (
/obj/structure/sign/mining/survival{
dir = 8
},
/turf/simulated/shuttle/wall/voidcraft,
/area/survivalpod)
"g" = (
/obj/machinery/sleeper/survival_pod,
/turf/simulated/shuttle/floor/voidcraft,
/area/survivalpod)
"h" = (
/turf/simulated/shuttle/floor/voidcraft,
/area/survivalpod)
"i" = (
/obj/structure/bed/pod,
/obj/item/weapon/bedsheet/mime,
/turf/simulated/shuttle/floor/voidcraft,
/area/survivalpod)
"j" = (
/obj/structure/sign/mining/survival{
dir = 4
},
/turf/simulated/shuttle/wall/voidcraft,
/area/survivalpod)
"k" = (
/obj/structure/table/survival_pod,
/turf/simulated/shuttle/floor/voidcraft,
/area/survivalpod)
"l" = (
/obj/structure/tubes,
/obj/structure/bed/chair/comfy/black{
dir = 8
},
/turf/simulated/shuttle/floor/voidcraft,
/area/survivalpod)
"m" = (
/obj/structure/sign/mining/survival,
/turf/simulated/shuttle/wall/voidcraft,
/area/survivalpod)
"n" = (
/obj/structure/fans/tiny,
/obj/machinery/door/airlock/voidcraft/survival_pod,
/turf/simulated/shuttle/floor/voidcraft,
/area/survivalpod)
"o" = (
/obj/structure/sign/mining,
/turf/simulated/shuttle/wall/voidcraft,
/area/survivalpod)
(1,1,1) = {"
a
a
f
a
a
"}
(2,1,1) = {"
a
c
g
k
m
"}
(3,1,1) = {"
b
d
h
h
n
"}
(4,1,1) = {"
a
e
i
l
o
"}
(5,1,1) = {"
a
a
j
a
a
"}

View File

@@ -0,0 +1,254 @@
//MAP CONVERTED BY dmm2tgm.py THIS HEADER COMMENT PREVENTS RECONVERSION, DO NOT REMOVE
"a" = (
/turf/simulated/shuttle/wall/voidcraft/survival,
/area/survivalpod)
"b" = (
/obj/structure/sign/mining/survival{
dir = 1
},
/turf/simulated/shuttle/wall/voidcraft/survival,
/area/survivalpod)
"c" = (
/obj/structure/table/steel,
/obj/item/weapon/reagent_containers/food/drinks/glass2/rocks{
pixel_x = 7;
pixel_y = 2
},
/obj/item/weapon/reagent_containers/food/snacks/generalschicken,
/obj/item/weapon/material/kitchen/utensil/fork{
pixel_x = 12
},
/turf/simulated/floor/carpet/bcarpet,
/area/survivalpod)
"d" = (
/obj/structure/sign/mining/survival{
dir = 8
},
/turf/simulated/shuttle/wall/voidcraft/survival,
/area/survivalpod)
"e" = (
/obj/structure/fans,
/turf/simulated/shuttle/floor/voidcraft,
/area/survivalpod)
"f" = (
/obj/machinery/smartfridge/survival_pod,
/turf/simulated/shuttle/floor/voidcraft,
/area/survivalpod)
"g" = (
/obj/item/device/gps/computer,
/turf/simulated/shuttle/floor/voidcraft,
/area/survivalpod)
"h" = (
/obj/machinery/shower,
/obj/item/weapon/soap/deluxe,
/obj/structure/curtain,
/turf/simulated/shuttle/floor/voidcraft,
/area/survivalpod)
"i" = (
/obj/structure/toilet,
/turf/simulated/shuttle/floor/voidcraft,
/area/survivalpod)
"j" = (
/obj/structure/sign/mining/survival{
dir = 4
},
/turf/simulated/shuttle/wall/voidcraft/survival,
/area/survivalpod)
"k" = (
/obj/machinery/sleeper/survival_pod,
/turf/simulated/shuttle/floor/voidcraft,
/area/survivalpod)
"l" = (
/turf/simulated/shuttle/floor/voidcraft,
/area/survivalpod)
"m" = (
/obj/structure/bed/pod,
/obj/item/weapon/bedsheet/blue,
/turf/simulated/shuttle/floor/voidcraft,
/area/survivalpod)
"n" = (
/obj/structure/window/reinforced/survival_pod{
dir = 8
},
/obj/machinery/door/window/survival_pod{
dir = 1;
icon_state = "windoor"
},
/turf/simulated/floor/carpet/bcarpet,
/area/survivalpod)
"o" = (
/obj/structure/bed/chair/comfy/black,
/obj/structure/window/reinforced/survival_pod{
icon_state = "pwindow";
dir = 1
},
/turf/simulated/floor/carpet/bcarpet,
/area/survivalpod)
"p" = (
/obj/structure/table/survival_pod,
/obj/item/weapon/storage/firstaid/adv{
pixel_x = 4
},
/turf/simulated/shuttle/floor/voidcraft,
/area/survivalpod)
"q" = (
/obj/structure/tubes,
/obj/machinery/holoplant,
/turf/simulated/shuttle/floor/voidcraft,
/area/survivalpod)
"r" = (
/obj/structure/window/reinforced/survival_pod{
dir = 8;
icon_state = "pwindow"
},
/turf/simulated/floor/carpet/bcarpet,
/area/survivalpod)
"s" = (
/obj/machinery/light{
dir = 4;
light_color = "#DDFFD3"
},
/obj/structure/table/steel,
/obj/item/weapon/reagent_containers/food/drinks/glass2/rocks{
pixel_x = 7;
pixel_y = 2
},
/obj/item/weapon/reagent_containers/food/drinks/bottle/wine{
pixel_x = -6;
pixel_y = 10
},
/turf/simulated/floor/carpet/bcarpet,
/area/survivalpod)
"t" = (
/obj/machinery/microwave{
pixel_y = -2
},
/obj/structure/window/reinforced/survival_pod{
icon_state = "pwindow";
dir = 1
},
/obj/structure/table/steel{
pixel_y = -9
},
/turf/simulated/floor/carpet/bcarpet,
/area/survivalpod)
"u" = (
/obj/machinery/door/window/survival_pod{
icon_state = "windoor";
dir = 1
},
/turf/simulated/floor/carpet/bcarpet,
/area/survivalpod)
"v" = (
/obj/structure/window/reinforced/survival_pod{
icon_state = "pwindow";
dir = 1
},
/turf/simulated/floor/carpet/bcarpet,
/area/survivalpod)
"w" = (
/obj/structure/window/reinforced/survival_pod{
density = 0;
dir = 9;
icon_state = "pwindow"
},
/turf/simulated/floor/carpet/bcarpet,
/area/survivalpod)
"y" = (
/obj/structure/sink/kitchen{
icon_state = "sink_alt";
dir = 4;
pixel_x = -13
},
/turf/simulated/floor/carpet/bcarpet,
/area/survivalpod)
"z" = (
/obj/machinery/light,
/turf/simulated/floor/carpet/bcarpet,
/area/survivalpod)
"A" = (
/turf/simulated/floor/carpet/bcarpet,
/area/survivalpod)
"B" = (
/obj/structure/bed/chair/comfy/black{
dir = 1
},
/turf/simulated/floor/carpet/bcarpet,
/area/survivalpod)
"C" = (
/obj/structure/sign/mining/survival,
/turf/simulated/shuttle/wall/voidcraft/survival,
/area/survivalpod)
"D" = (
/obj/structure/fans/tiny,
/obj/machinery/door/airlock/voidcraft/survival_pod,
/turf/simulated/shuttle/floor/voidcraft,
/area/survivalpod)
"E" = (
/obj/structure/sign/mining,
/turf/simulated/shuttle/wall/voidcraft/survival,
/area/survivalpod)
(1,1,1) = {"
a
d
a
d
a
d
a
"}
(2,1,1) = {"
b
e
k
p
t
y
C
"}
(3,1,1) = {"
a
f
l
l
u
z
a
"}
(4,1,1) = {"
b
g
m
q
v
A
D
"}
(5,1,1) = {"
a
h
n
r
w
A
a
"}
(6,1,1) = {"
b
i
o
s
c
B
E
"}
(7,1,1) = {"
a
j
a
j
a
j
a
"}

View File

@@ -1852,6 +1852,8 @@
#include "code\modules\mining\ore.dm"
#include "code\modules\mining\ore_datum.dm"
#include "code\modules\mining\satchel_ore_boxdm.dm"
#include "code\modules\mining\shelter_atoms.dm"
#include "code\modules\mining\shelters.dm"
#include "code\modules\mining\drilling\drill.dm"
#include "code\modules\mining\drilling\scanner.dm"
#include "code\modules\mob\animations.dm"