-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathsurvival_pod.dm
346 lines (296 loc) · 10.1 KB
/
survival_pod.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
/*****************************Survival Pod********************************/
/area/survivalpod
name = "\improper Emergency Shelter"
icon_state = "away"
static_lighting = TRUE
requires_power = FALSE
has_gravity = STANDARD_GRAVITY
valid_territory = FALSE
//Survival Capsule
/obj/item/survivalcapsule
name = "bluespace shelter capsule"
desc = "An emergency shelter stored within a pocket of bluespace."
icon_state = "capsule"
icon = 'icons/obj/mining.dmi'
w_class = WEIGHT_CLASS_TINY
var/template_id = "shelter_alpha"
var/datum/map_template/shelter/template
var/used = FALSE
/obj/item/survivalcapsule/proc/get_template()
if(template)
return
template = SSmapping.shelter_templates[template_id]
if(!template)
WARNING("Shelter template ([template_id]) not found!")
qdel(src)
/obj/item/survivalcapsule/Destroy()
template = null // without this, capsules would be one use. per round.
. = ..()
/obj/item/survivalcapsule/examine(mob/user)
. = ..()
get_template()
. += "This capsule has the [template.name] stored."
. += template.description
/obj/item/survivalcapsule/attack_self()
//Can't grab when capsule is New() because templates aren't loaded then
get_template()
if(!used)
loc.visible_message(span_warning("\The [src] begins to shake. Stand back!"))
used = TRUE
sleep(5 SECONDS)
var/turf/deploy_location = get_turf_global(src)
var/status = template.check_deploy(deploy_location)
switch(status)
if(SHELTER_DEPLOY_BAD_AREA)
src.loc.visible_message(span_warning("\The [src] will not function in this area."))
if(SHELTER_DEPLOY_BAD_TURFS, SHELTER_DEPLOY_ANCHORED_OBJECTS, SHELTER_DEPLOY_OUTSIDE_MAP)
var/width = template.width
var/height = template.height
src.loc.visible_message(span_warning("\The [src] doesn't have room to deploy! You need to clear a [width]x[height] area!"))
if(status != SHELTER_DEPLOY_ALLOWED)
used = FALSE
return
template.load(deploy_location, centered = TRUE)
var/turf/T = deploy_location
if(!is_mining_level(T.z)) //only report capsules away from the mining/lavaland level
message_admins("[ADMIN_LOOKUPFLW(usr)] activated a bluespace capsule away from the mining level! [ADMIN_VERBOSEJMP(T)]")
log_admin("[key_name(usr)] activated a bluespace capsule away from the mining level at [AREACOORD(T)]")
playsound(src, 'sound/effects/phasein.ogg', 100, TRUE)
new /obj/effect/particle_effect/fluid/smoke(get_turf(src))
qdel(src)
/obj/item/survivalcapsule/luxury
name = "luxury bluespace shelter capsule"
desc = "An exorbitantly expensive luxury suite stored within a pocket of bluespace."
template_id = "shelter_beta"
/obj/item/survivalcapsule/luxuryelite
name = "luxury elite bar capsule"
desc = "A luxury bar in a capsule. Bartender required and not included."
template_id = "shelter_charlie"
//Pod objects
//Window
/obj/structure/window/shuttle/survival_pod
name = "pod window"
icon = 'icons/obj/smooth_structures/pod_window.dmi'
icon_state = "pod_window-0"
base_icon_state = "pod_window"
smoothing_flags = SMOOTH_BITMASK
smoothing_groups = SMOOTH_GROUP_SHUTTLE_PARTS + SMOOTH_GROUP_SURVIVAL_TITANIUM_POD
canSmoothWith = SMOOTH_GROUP_SURVIVAL_TITANIUM_POD
/obj/structure/window/shuttle/survival_pod/spawner/north
dir = NORTH
/obj/structure/window/shuttle/survival_pod/spawner/east
dir = EAST
/obj/structure/window/shuttle/survival_pod/spawner/west
dir = WEST
/obj/structure/window/reinforced/survival_pod
name = "pod window"
icon = 'icons/obj/lavaland/survival_pod.dmi'
icon_state = "pwindow"
//Door
/obj/machinery/door/airlock/survival_pod
name = "airlock"
icon = 'icons/obj/doors/airlocks/survival/survival.dmi'
overlays_file = 'icons/obj/doors/airlocks/survival/survival_overlays.dmi'
assemblytype = /obj/structure/door_assembly/door_assembly_pod
anim_parts = "topbolts=0,6,0,3;bottombolts=0,-6,3,-6;top=0,4,0,2;bottom=0,-4,0,2;rightbolts=14,0,1.5,5;left=-15,0,1.5,5;right=14,0,1.5,5"
/obj/machinery/door/airlock/survival_pod/glass
opacity = FALSE
glass = TRUE
/obj/structure/door_assembly/door_assembly_pod
name = "pod airlock assembly"
icon = 'icons/obj/doors/airlocks/survival/survival.dmi'
base_name = "pod airlock"
overlays_file = 'icons/obj/doors/airlocks/survival/survival_overlays.dmi'
airlock_type = /obj/machinery/door/airlock/survival_pod
glass_type = /obj/machinery/door/airlock/survival_pod/glass
//Windoor
/obj/machinery/door/window/survival_pod
icon = 'icons/obj/lavaland/survival_pod.dmi'
icon_state = "windoor"
base_state = "windoor"
//Table
/obj/structure/table/survival_pod
icon = 'icons/obj/lavaland/survival_pod.dmi'
icon_state = "table"
smoothing_flags = NONE
smoothing_groups = null
canSmoothWith = null
//Sleeper
/obj/machinery/sleeper/survival_pod
icon = 'icons/obj/lavaland/survival_pod.dmi'
icon_state = "sleeper"
base_icon_state = "sleeper"
/obj/machinery/sleeper/survival_pod/update_icon_state()
. = ..()
icon_state = base_icon_state
/obj/machinery/sleeper/survival_pod/update_overlays()
. = ..()
if(!state_open)
. += "[base_icon_state]_cover"
//Lifeform Stasis Unit
/obj/machinery/stasis/survival_pod
icon = 'icons/obj/lavaland/survival_pod.dmi'
icon_state = "sleeper"
base_icon_state = "sleeper"
mattress_state = null
buckle_lying = 270
/obj/machinery/stasis/survival_pod/play_power_sound()
return
/obj/machinery/stasis/survival_pod/Initialize(mapload)
AddElement(/datum/element/update_icon_blocker)
return ..()
//Computer
/obj/item/gps/computer
name = "pod computer"
icon_state = "pod_computer"
icon = 'icons/obj/lavaland/pod_computer.dmi'
anchored = TRUE
density = TRUE
pixel_y = -32
/obj/item/gps/computer/wrench_act(mob/living/user, obj/item/I)
if(flags_1 & NODECONSTRUCT_1)
return TRUE
user.visible_message(span_warning("[user] disassembles [src]."),
span_notice("You start to disassemble [src]..."), "You hear clanking and banging noises.")
if(I.use_tool(src, user, 20, volume=50))
new /obj/item/gps(loc)
qdel(src)
return TRUE
/obj/item/gps/computer/attack_hand(mob/user)
. = ..()
if(.)
return
attack_self(user)
//Bed
/obj/structure/bed/pod
icon = 'icons/obj/lavaland/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/lavaland/donkvendor.dmi'
light_range = 5
light_power = 1.2
light_color = "#DDFFD3"
max_n_of_items = 10
pixel_y = -4
flags_1 = NODECONSTRUCT_1
supports_full_indicator_state = FALSE
supports_retrieval_state = FALSE
supports_capacity_indication = FALSE
pitches = FALSE
var/empty = FALSE
/obj/machinery/smartfridge/survival_pod/Initialize(mapload)
AddElement(/datum/element/update_icon_blocker)
return ..()
/obj/machinery/smartfridge/survival_pod/Initialize(mapload)
. = ..()
if(empty)
return
for(var/i in 1 to 5)
var/obj/item/reagent_containers/food/snacks/donkpocket/warm/W = new(src)
load(W)
if(prob(50))
var/obj/item/storage/pill_bottle/dice/D = new(src)
load(D)
else
var/obj/item/instrument/guitar/G = new(src)
load(G)
/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/lavaland/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/sheet/metal
var/buildstackamount = 5
can_atmos_pass = ATMOS_PASS_NO
/obj/structure/fans/deconstruct()
if(!(flags_1 & NODECONSTRUCT_1))
if(buildstacktype)
new buildstacktype(loc,buildstackamount)
qdel(src)
/obj/structure/fans/wrench_act(mob/living/user, obj/item/I)
if(flags_1 & NODECONSTRUCT_1)
return TRUE
user.visible_message(span_warning("[user] disassembles [src]."),
span_notice("You start to disassemble [src]..."), "You hear clanking and banging noises.")
if(I.use_tool(src, user, 20, volume=50))
deconstruct()
return TRUE
/obj/structure/fans/tiny
name = "tiny fan"
desc = "A tiny fan, releasing a thin gust of air."
layer = ABOVE_NORMAL_TURF_LAYER
density = FALSE
icon_state = "fan_tiny"
buildstackamount = 2
/obj/structure/fans/Initialize(mapload)
. = ..()
air_update_turf()
//Visible, indestructible fans
/obj/structure/fans/tiny/indestructible
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
//Inivisible, indestructible fans
/obj/structure/fans/tiny/invisible
name = "air flow blocker"
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
invisibility = INVISIBILITY_ABSTRACT
//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/turf/decals.dmi'
icon_state = "survival_nt"
/obj/structure/sign/mining/survival
name = "shelter sign"
desc = "A high visibility sign designating a safe shelter."
icon = 'icons/turf/decals.dmi'
icon_state = "survival_shelter"
//Fluff
/obj/structure/tubes
icon_state = "tubes"
icon = 'icons/obj/lavaland/survival_pod.dmi'
name = "tubes"
anchored = TRUE
layer = BELOW_MOB_LAYER
density = FALSE
/obj/item/fakeartefact
name = "expensive forgery"
icon = 'icons/mob/screen_gen.dmi'
icon_state = "x2"
var/possible = list(/obj/item/ship_in_a_bottle,
/obj/item/gun/energy/pulse,
/obj/item/book/granter/martial/carp,
/obj/item/melee/supermatter_sword,
/obj/item/shield/changeling,
/obj/item/lava_staff,
/obj/item/energy_katana,
/obj/item/hierophant_club,
/obj/item/his_grace,
/obj/item/gun/ballistic/minigun,
/obj/item/gun/ballistic/automatic/l6_saw,
/obj/item/gun/magic/staff/chaos,
/obj/item/gun/magic/staff/spellblade,
/obj/item/gun/magic/wand/fireball,
/obj/item/stack/telecrystal/twenty,
/obj/item/nuke_core,
/obj/item/bikehorn)
/obj/item/fakeartefact/Initialize(mapload)
. = ..()
var/obj/item/I = pick(possible)
name = initial(I.name)
icon = initial(I.icon)
desc = initial(I.desc)
icon_state = initial(I.icon_state)
item_state = initial(I.item_state)