Files
Bubberstation/code/modules/mining/shelters.dm
SkyratBot 215f11b88d [MIRROR] Emergency Relief Capsule [MDB IGNORE] (#22199)
* Emergency Relief Capsule (#76457)

## About The Pull Request

Getting back into coding by making some soul PRs.
Adds a new kind of bluespace capsule which replaces the default one when
the "budget pods" station trait runs, and is available from the vendor
for a (marginal) discount.

![image](https://github.com/tgstation/tgstation/assets/7483112/3fdf30e4-56c3-4181-9f8f-d11b6ec7a5e5)

![image](https://github.com/tgstation/tgstation/assets/7483112/a47581aa-ee2b-47c4-bd91-5a71391c2dd9)

The Nanotrasen Emergency Relief Capsule provides a port in the storm for
people with an urgent need, and very little else.

## Why It's Good For The Game

This one is mostly just kind of funny I'll be honest.
I guess it uuuuuuuh provides a kind of pod with no GPS signal if you
really want to go off the grid? But anything I write here is secondary
to the point of "someone suggested it on the forums and I liked it".

## Changelog

🆑
add: Budget cuts can sometimes effect the station's supply of Emergency
Bluespace Shelters.
/🆑

* Emergency Relief Capsule

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
2023-07-03 17:34:13 -04:00

101 lines
3.5 KiB
Plaintext

/datum/map_template/shelter
var/shelter_id
var/description
var/list/blacklisted_turfs
var/list/whitelisted_turfs
var/list/banned_areas
var/list/banned_objects
has_ceiling = TRUE
ceiling_turf = /turf/open/floor/engine/hull
ceiling_baseturfs = list(/turf/open/floor/plating)
/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
// Check if the shelter sticks out of map borders
var/shelter_origin_x = deploy_location.x - round(width/2)
if(shelter_origin_x <= 1 || shelter_origin_x+width > world.maxx)
return SHELTER_DEPLOY_OUTSIDE_MAP
var/shelter_origin_y = deploy_location.y - round(height/2)
if(shelter_origin_y <= 1 || shelter_origin_y+height > world.maxy)
return SHELTER_DEPLOY_OUTSIDE_MAP
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/shelter_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 = "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/templates/shelter_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 luxury elite bar which holds an entire bar \
along with two vending machines, tables, and a restroom that \
also has a sink. This isn't a survival capsule and so you can \
expect that this won't save you if you're bleeding out to \
death."
mappath = "_maps/templates/shelter_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/toilet
name = "Emergency Relief Shelter"
shelter_id = "shelter_toilet"
description = "A stripped-down emergency shelter focused on providing \
only the most essential amenities to unfortunate employees who find \
themselves in need far from home."
mappath = "_maps/templates/shelter_t.dmm"
/datum/map_template/shelter/toilet/New()
. = ..()
whitelisted_turfs = typecacheof(/turf/closed/mineral)
banned_objects = typecacheof(/obj/structure/stone_tile)