diff --git a/code/game/machinery/transportpod.dm b/code/game/machinery/transportpod.dm new file mode 100644 index 0000000000..96401c0908 --- /dev/null +++ b/code/game/machinery/transportpod.dm @@ -0,0 +1,110 @@ +/obj/machinery/transportpod + name = "Ballistic Transportation Pod" + desc = "A fast transit ballistic pod used to get from one place to the next. Batteries not included!" + icon = 'icons/obj/structures.dmi' + icon_state = "borg_pod_opened" + + density = 1 //thicc + anchored = 1 + use_power = 0 + + var/in_transit = 0 + var/mob/occupant = null + + var/xc = list(137, 209, 163, 110, 95, 60, 129, 201) // List of x values on the map to go to. + var/yc = list(134, 99, 169, 120, 96, 122, 189, 219) // List of y values on the map to go to. + + var/limit_x = 3 + var/limit_y = 3 + +/obj/machinery/transportpod/process() + if(occupant) + if(in_transit) + var/locNum = rand(0, 7) //pick a random location + var/turf/L = locate(xc[locNum], yc[locNum], 1) // Pairs the X and Y to get an actual location. + limit_x = xc[locNum]+1 + limit_y = yc[locNum]+1 + build() + sleep(20) //Give explosion time so the pod itself doesn't go boom + src.forceMove(L) + playsound(src, pick('sound/effects/Explosion1.ogg', 'sound/effects/Explosion2.ogg', 'sound/effects/Explosion3.ogg', 'sound/effects/Explosion4.ogg')) + in_transit = 0 + sleep(2) + go_out() + sleep(2) + del(src) + +/obj/machinery/transportpod/relaymove(mob/user as mob) + if(user.stat) + return + go_out() + return + +/obj/machinery/transportpod/update_icon() + ..() + if(occupant) + icon_state = "borg_pod_closed" + else + icon_state = "borg_pod_opened" + +/obj/machinery/transportpod/Bumped(var/mob/living/O) + go_in(O) + +/obj/machinery/transportpod/proc/go_in(var/mob/living/carbon/human/O) + if(occupant) + return + + if(O.incapacitated()) //aint no sleepy people getting in here + return + + add_fingerprint(O) + O.reset_view(src) + O.forceMove(src) + occupant = O + update_icon() + if(alert(O, "Are you sure you're ready to launch?", , "Yes", "No") == "Yes") + in_transit = 1 + playsound(src, HYPERSPACE_WARMUP) + else + go_out() + return 1 + +/obj/machinery/transportpod/proc/go_out() + if(!occupant) + return + + occupant.forceMove(src.loc) + occupant.reset_view() + occupant = null + update_icon() + +/obj/machinery/transportpod/verb/move_eject() + set category = "Object" + set name = "Eject Pod" + set src in oview(1) + + if(usr.incapacitated()) + return + + go_out() + add_fingerprint(usr) + return + +/obj/machinery/transportpod/verb/move_inside() + set category = "Object" + set name = "Enter Pod" + set src in oview(1) + + if(usr.incapacitated()) //just to DOUBLE CHECK the damn sleepy people don't touch the pod + return + + go_in(usr) + +/obj/machinery/transportpod/proc/build() + for(var/x = limit_x-2, x <= limit_x, x++) + for(var/y = limit_y-2, y <= limit_y, y++) + var/current_cell = locate(x, y, 1) + var/turf/T = get_turf(current_cell) + if(!current_cell) + continue + T.ChangeTurf(/turf/unsimulated/floor/shuttle_ceiling) \ No newline at end of file diff --git a/polaris.dme b/polaris.dme index 2b05f089ec..f193f1328c 100644 --- a/polaris.dme +++ b/polaris.dme @@ -616,6 +616,7 @@ #include "code\game\machinery\supplybeacon.dm" #include "code\game\machinery\syndicatebeacon.dm" #include "code\game\machinery\teleporter.dm" +#include "code\game\machinery\transportpod.dm" #include "code\game\machinery\turret_control.dm" #include "code\game\machinery\vending.dm" #include "code\game\machinery\vr_console.dm"