Skip to content

Commit 82f1fd5

Browse files
authored
Spacepod Cargo Bay Equipment and Pod Fabricator Spruce Up (#37208)
* pod updates * resist escape
1 parent 074c6b0 commit 82f1fd5

File tree

7 files changed

+338
-228
lines changed

7 files changed

+338
-228
lines changed

code/game/objects/effects/effect_system.dm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,8 @@ steam.start() -- spawns the effect
626626
if(src.processing)
627627
src.processing = 0
628628
spawn(0)
629+
if(!holder)
630+
return
629631
var/turf/T = get_turf(src.holder)
630632
if(currloc != T)
631633
switch(holder.dir)

code/modules/mob/living/living.dm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,11 @@ Thanks.
10221022
var/obj/structure/rack/crate_shelf/CS = C.loc
10231023
CS.relay_container_resist_act(src,R)
10241024
return
1025+
if(istype(C.loc, /obj/spacepod/) && istype(C,/obj/structure/closet/crate)) //todo - make this generic for future space pod cargo systems
1026+
var/obj/structure/closet/crate/R = C
1027+
var/obj/spacepod/speesepod = C.loc
1028+
speesepod.attempt_cargo_resist(src,R)
1029+
return
10251030
if(!istype(C.loc, /obj/item/delivery/large)) //Wouldn't want to interrupt escaping being wrapped over the next few trivial checks
10261031
if(istype(C, /obj/structure/closet/secure_closet))
10271032
var/obj/structure/closet/secure_closet/SC = L.loc

code/modules/research/designs/spacepod/weapons.dm

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,24 @@
2929
materials = list(MAT_IRON = 15000)
3030
locked = 1
3131

32+
/datum/design/pod_cargo_crate
33+
name = "Spacepod Cargo Bay (Crate)"
34+
desc = "Allows a space pod to hold a crate."
35+
id = "pod_crate"
36+
build_type = PODFAB
37+
build_path = /obj/item/device/spacepod_equipment/cargo/crate
38+
req_tech = list(Tc_MATERIALS = 2)
39+
category = "Pod_Parts"
40+
materials = list(MAT_IRON = 15000)
41+
3242
/datum/design/pod_lock
3343
name = "Spacepod Equipment (Toggle Lock)"
3444
desc = "Allows for the construction of a spacepod mounted locking system."
3545
id = "pod_lock"
3646
build_type = PODFAB
3747
build_path = /obj/item/device/spacepod_equipment/locking/lock
3848
req_tech = list(Tc_MATERIALS = 2, Tc_BLUESPACE = 2)
39-
category = "Misc"
49+
category = "Pod_Parts"
4050
materials = list(MAT_IRON = 3500)
4151

4252
/datum/design/pod_key
@@ -46,5 +56,5 @@
4656
build_type = PODFAB
4757
build_path = /obj/item/device/pod_key
4858
req_tech = list(Tc_MATERIALS = 2, Tc_BLUESPACE = 2)
49-
category = "Misc"
50-
materials = list(MAT_IRON = 1500)
59+
category = "Pod_Parts"
60+
materials = list(MAT_IRON = 1500)

code/modules/research/fabricators.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@
382382
break
383383
var/datum/design/D = set_parts[i]
384384
add_to_queue(D)
385-
visible_message("[bicon(src)] <b>[src]</b> beeps: \"[set_name] parts were added to the queue\".")
385+
visible_message("[bicon(src)] <b>[src]</b> beeps: \"[replacetext(set_name, "_", " ")] parts were added to the queue\".")
386386
return
387387

388388
/obj/machinery/r_n_d/fabricator/proc/add_to_queue(var/datum/design/part)

code/modules/spacepods/equipment.dm

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
//var/obj/item/device/spacepod_equipment/engine/engine_system // engine system
6060
//var/obj/item/device/spacepod_equipment/shield/shield_system // shielding system
6161
var/obj/item/device/spacepod_equipment/locking/locking_system // locking system
62+
var/obj/item/device/spacepod_equipment/cargo/cargo_system // cargo bay system
6263

6364
/datum/spacepod/equipment/New(var/obj/spacepod/SP)
6465
..()
@@ -197,3 +198,18 @@
197198
if(i < their_code.len && char == their_code[i])
198199
correct_positions++
199200
to_chat(user, "<span class = 'notice'>[found_values] correct values, [correct_positions] correct positions.</span>")
201+
202+
/obj/item/device/spacepod_equipment/cargo
203+
name = "pod cargo system"
204+
desc = "You shouldn't be seeing this."
205+
icon = 'icons/pods/ship.dmi'
206+
icon_state = "blank"
207+
var/list/allowed_types
208+
var/atom/movable/stored
209+
210+
/obj/item/device/spacepod_equipment/cargo/crate
211+
name = "pod cargo system"
212+
desc = "A pod system that allows a space pod to hold a single crate."
213+
icon = 'icons/obj/objects.dmi'
214+
icon_state = "shelf_base"
215+
allowed_types = list( /obj/structure/closet/crate)

code/modules/spacepods/spacepods.dm

Lines changed: 128 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@
9292
for(var/mob/living/L in occupants)
9393
move_outside(L)
9494
L.gib()
95+
if(ES && ES.cargo_system)
96+
QDEL_NULL(ES.cargo_system.stored)
9597
QDEL_LIST_NULL(actions)
9698
QDEL_NULL(pr_int_temp_processor)
9799
QDEL_NULL(pr_give_air)
@@ -140,10 +142,13 @@
140142
spawn(0)
141143
var/mob/living/L = get_pilot()
142144
if(L)
143-
144145
to_chat(L, "<big><span class='warning'>Critical damage to the vessel detected, core explosion imminent!</span></big>")
145-
for(var/i = 10, i >= 0; --i)
146+
if(ES && ES.cargo_system && ES.cargo_system.stored)
147+
ES.cargo_system.stored.forceMove(get_turf(src))
146148
if(L)
149+
to_chat(L, "<span class='warning'>Automatically jettisoning cargo.</span>")
150+
for(var/i = 10, i >= 0; --i)
151+
if(L && L == get_pilot())
147152
to_chat(L, "<span class='warning'>[i]</span>")
148153
if(i == 0)
149154
explosion(loc, 2, 4, 8)
@@ -164,6 +169,9 @@
164169
move_outside(H, get_turf(src))
165170
H.ex_act(severity + 1)
166171
to_chat(H, "<span class='warning'>You are forcefully thrown from \the [src]!</span>")
172+
if(ES && ES.cargo_system && ES.cargo_system.stored)
173+
ES.cargo_system.stored.forceMove(get_turf(src))
174+
ES.cargo_system.stored.ex_act(severity + 1)
167175
QDEL_NULL(ion_trail) // Should be nulled by qdel src in next line but OH WELL
168176
qdel(src)
169177
if(2)
@@ -182,6 +190,8 @@
182190
if(istype(AM,/obj/item))
183191
if(AM == battery || istype(AM, /obj/item/device/spacepod_equipment))
184192
continue //don't eject this particular item!
193+
if(ES && ES.cargo_system && istype(AM, ES.cargo_system.allowed_types))
194+
continue //it's a crate, probably!
185195
anyitem++
186196
AM.forceMove(get_turf(user))
187197
if(anyitem)
@@ -232,6 +242,15 @@
232242
ES.locking_system = W
233243
ES.locking_system.my_atom = src
234244
return
245+
if(istype(W, /obj/item/device/spacepod_equipment/cargo))
246+
if(ES.cargo_system)
247+
to_chat(user, "<span class = 'notice'>\The [src] already has a cargo system.</span>")
248+
return
249+
else if(user.drop_item(W, src))
250+
to_chat(user, "<span class='notice'>You insert \the [W] into the equipment system.</span>")
251+
ES.cargo_system = W
252+
ES.cargo_system.my_atom = src
253+
return
235254
if(W.force)
236255
visible_message("<span class = 'warning'>\The [user] hits \the [src] with \the [W]</span>")
237256
adjust_health(W.force)
@@ -260,6 +279,8 @@
260279
*/
261280
if(ES.locking_system)
262281
possible.Add("Locking System")
282+
if(ES.cargo_system)
283+
possible.Add("Cargo System")
263284
var/obj/item/device/spacepod_equipment/SPE
264285
switch(input(user, "Remove which equipment?", null, null) as null|anything in possible)
265286
if("Energy Cell")
@@ -283,6 +304,17 @@
283304
ES.locking_system = null
284305
else
285306
to_chat(user, "<span class='warning'>You need an open hand to do that.</span>")
307+
if("Cargo System")
308+
var/obj/item/device/spacepod_equipment/cargo/CARGOSYS = ES.cargo_system
309+
if(CARGOSYS.stored)
310+
to_chat(user, "<span class='warning'>The cargo bay is loaded, you need to empty it first.</span>")
311+
return
312+
if(user.put_in_any_hand_if_possible(CARGOSYS))
313+
to_chat(user, "<span class='notice'>You remove \the [CARGOSYS] from the equipment system.</span>")
314+
CARGOSYS.my_atom = null
315+
ES.cargo_system = null
316+
else
317+
to_chat(user, "<span class='warning'>You need an open hand to do that.</span>")
286318
/*
287319
if("engine system")
288320
SPE = ES.engine_system
@@ -393,12 +425,14 @@
393425
. = t_air.return_temperature()
394426
return
395427

396-
/obj/spacepod/MouseDropTo(mob/M, mob/user)
397-
if(M != user)
428+
/obj/spacepod/MouseDropTo(atom/moved, mob/user)
429+
if(!Adjacent(moved) || !Adjacent(user))
398430
return
399-
if(!Adjacent(M) || !Adjacent(user))
431+
if(ES && ES.cargo_system && is_type_in_list(moved, ES.cargo_system.allowed_types))
432+
attempt_load_cargo(moved, user)
433+
if(moved != user)
400434
return
401-
attempt_move_inside(M, user)
435+
attempt_move_inside(moved, user)
402436

403437
/obj/spacepod/MouseDropFrom(atom/over)
404438
if(!usr || !over)
@@ -463,6 +497,94 @@
463497
to_chat(usr, "You stop entering the pod.")
464498
return
465499

500+
/obj/spacepod/proc/attempt_load_cargo(atom/movable/moved, mob/user)
501+
if(!ES || !istype(ES))
502+
to_chat(user, "<span class='warning'>The pod has no equipment datum, or is the wrong type, yell at pomf.</span>")
503+
return
504+
if(!ES.cargo_system)
505+
to_chat(user, "<span class='warning'>The pod has no cargo system.</span>")
506+
return
507+
if(locked)
508+
to_chat(usr, "<span class = 'warning'>\The [src] is locked.</span>")
509+
return
510+
if(usr.incapacitated() || usr.lying) //are you cuffed, dying, lying, stunned or other
511+
return
512+
if (!ishigherbeing(usr))
513+
return
514+
if(ES.cargo_system.stored)
515+
to_chat(user, "<span class='warning'>The pod has no room in its cargo bay.</span>")
516+
517+
visible_message("<span class='notice'>[usr] starts to load \the [moved] into \the [src].</span>")
518+
519+
if(do_after(usr, src, 4 SECONDS))
520+
if(ES.cargo_system.stored)
521+
//Something loaded when you weren't looking!
522+
to_chat(user, "<span class='warning'>The pod has no room in its cargo bay.</span>")
523+
return
524+
moved.forceMove(src)
525+
ES.cargo_system.stored = moved
526+
src.add_fingerprint(usr)
527+
moved.add_fingerprint(usr)
528+
to_chat(usr, "<span class = 'notice'>You load \the [moved] into \the [src].</span>")
529+
else
530+
to_chat(usr, "You stop loading the pod.")
531+
return
532+
533+
/obj/spacepod/verb/attempt_unload_cargo()
534+
set category = "Spacepod"
535+
set name = "Unload Cargo"
536+
set src in oview(1)
537+
538+
if(!ES || !istype(ES))
539+
to_chat(usr, "<span class='warning'>The pod has no equipment datum, or is the wrong type, yell at pomf.</span>")
540+
return
541+
if(!ES.cargo_system)
542+
to_chat(usr, "<span class='warning'>The pod has no cargo system.</span>")
543+
return
544+
if(locked)
545+
to_chat(usr, "<span class = 'warning'>\The [src] is locked.</span>")
546+
return
547+
if(usr.incapacitated() || usr.lying) //are you cuffed, dying, lying, stunned or other
548+
return
549+
if (!ishigherbeing(usr))
550+
return
551+
if(!ES.cargo_system.stored)
552+
to_chat(usr, "<span class='warning'>The pod has nothing in the cargo bay.</span>")
553+
return
554+
555+
visible_message("<span class='notice'>[usr] starts to unload \the [src].</span>")
556+
557+
if(do_after(usr, src, 4 SECONDS))
558+
if(!ES.cargo_system.stored)
559+
//Something unloaded when you weren't looking!
560+
return
561+
ES.cargo_system.stored.forceMove(get_turf(src))
562+
src.add_fingerprint(usr)
563+
ES.cargo_system.stored.add_fingerprint(usr)
564+
to_chat(usr, "<span class = 'notice'>You unload \the [ES.cargo_system.stored] from \the [src].</span>")
565+
ES.cargo_system.stored = null
566+
else
567+
to_chat(usr, "You stop unloading the pod.")
568+
return
569+
570+
/obj/spacepod/proc/attempt_cargo_resist(var/mob/living/user, var/obj/contained)
571+
if(!ES || !istype(ES))
572+
to_chat(user, "<span class='warning'>The pod has no equipment datum, or is the wrong type, yell at pomf.</span>")
573+
return
574+
if(!ES.cargo_system)
575+
to_chat(user, "<span class='warning'>Something's resisting in a spacepod's cargo bay with no cargo bay. Tell your local coder...</span>")
576+
return
577+
user.visible_message("<span class='danger'>\The [src]'s cargo hatch begins to make banging sounds!</span>",
578+
"<span class='warning'>You slam on the back of \the [contained] and start trying to bust out of \the [src]'s cargo bay! (This will take about 30 seconds)</span>")
579+
if(do_after(user, src, 30 SECONDS))
580+
if(!ES.cargo_system.stored)
581+
//Something unloaded when you weren't looking!
582+
return
583+
ES.cargo_system.stored.forceMove(get_turf(src))
584+
user.visible_message("<span class='danger'>\The [src]'s cargo hatch pops open, and \the [contained] inside pops out!</span>",
585+
"<span class='warning'>You manage to pop \the [src]'s cargo door open!</span>")
586+
ES.cargo_system.stored = null
587+
466588
/datum/global_iterator/pod_preserve_temp //normalizing cabin air temperature to 20 degrees celsium
467589
delay = 20
468590
/datum/global_iterator/pod_preserve_temp/process(var/obj/spacepod/spacepod)

0 commit comments

Comments
 (0)