From 32ffba28cd98b2c5246b279b5db93a55e59a1ced Mon Sep 17 00:00:00 2001 From: MrDoomBringer Date: Sun, 30 Sep 2018 22:02:04 -0400 Subject: [PATCH] Adds a "Launch Supplypod (Quick)" adminverb (#40501) cl MrDoomBringer admin: Admins can now launch supplypods the old, slightly quicker way as well /cl Saves a few button presses, and some admins requested it. Tested, should work fine. --- code/__DEFINES/admin.dm | 1 + code/modules/admin/verbs/randomverbs.dm | 19 ++++++++++++++++++- code/modules/cargo/expressconsole.dm | 2 +- code/modules/cargo/supplypod.dm | 13 +++++++++---- 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/code/__DEFINES/admin.dm b/code/__DEFINES/admin.dm index 21024e78f7e..2e7761d9ebc 100644 --- a/code/__DEFINES/admin.dm +++ b/code/__DEFINES/admin.dm @@ -69,6 +69,7 @@ #define ADMIN_PUNISHMENT_BSA "Bluespace Artillery Device" #define ADMIN_PUNISHMENT_FIREBALL "Fireball" #define ADMIN_PUNISHMENT_ROD "Immovable Rod" +#define ADMIN_PUNISHMENT_SUPPLYPOD_QUICK "Supply Pod (Quick)" #define ADMIN_PUNISHMENT_SUPPLYPOD "Supply Pod" #define ADMIN_PUNISHMENT_MAZING "Puzzle" diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 4b4409dd781..de99171eb96 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -1249,7 +1249,7 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits if(!check_rights(R_ADMIN) || !check_rights(R_FUN)) return - var/list/punishment_list = list(ADMIN_PUNISHMENT_LIGHTNING, ADMIN_PUNISHMENT_BRAINDAMAGE, ADMIN_PUNISHMENT_GIB, ADMIN_PUNISHMENT_BSA, ADMIN_PUNISHMENT_FIREBALL, ADMIN_PUNISHMENT_ROD, ADMIN_PUNISHMENT_SUPPLYPOD, ADMIN_PUNISHMENT_MAZING) + var/list/punishment_list = list(ADMIN_PUNISHMENT_LIGHTNING, ADMIN_PUNISHMENT_BRAINDAMAGE, ADMIN_PUNISHMENT_GIB, ADMIN_PUNISHMENT_BSA, ADMIN_PUNISHMENT_FIREBALL, ADMIN_PUNISHMENT_ROD, ADMIN_PUNISHMENT_SUPPLYPOD_QUICK, ADMIN_PUNISHMENT_SUPPLYPOD, ADMIN_PUNISHMENT_MAZING) var/punishment = input("Choose a punishment", "DIVINE SMITING") as null|anything in punishment_list @@ -1277,6 +1277,23 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits var/turf/startT = spaceDebrisStartLoc(startside, T.z) var/turf/endT = spaceDebrisFinishLoc(startside, T.z) new /obj/effect/immovablerod(startT, endT,target) + if(ADMIN_PUNISHMENT_SUPPLYPOD_QUICK) + var/target_path = input(usr,"Enter typepath of an atom you'd like to send with the pod (type \"empty\" to send an empty pod):" ,"Typepath","/obj/item/reagent_containers/food/snacks/grown/harebell") as null|text + var/obj/structure/closet/supplypod/centcompod/pod = new() + pod.damage = 40 + pod.explosionSize = list(0,0,0,2) + pod.effectStun = TRUE + if (isnull(target_path)) + alert("ERROR: NULL path given.") + return + if (target_path != "empty")//if you didn't type empty, we want to load the pod with a delivery + var/delivery = text2path(target_path) + if(!ispath(delivery)) + delivery = pick_closest_path(target_path) + if(!delivery) + alert("ERROR: Incorrect / improper path given.") + new delivery(pod) + new /obj/effect/DPtarget(get_turf(target), pod) if(ADMIN_PUNISHMENT_SUPPLYPOD) var/datum/centcom_podlauncher/plaunch = new(usr) if(!holder) diff --git a/code/modules/cargo/expressconsole.dm b/code/modules/cargo/expressconsole.dm index 6639ff9f1c9..ed688d7fd22 100644 --- a/code/modules/cargo/expressconsole.dm +++ b/code/modules/cargo/expressconsole.dm @@ -20,7 +20,7 @@ var/list/meme_pack_data var/obj/item/supplypod_beacon/beacon //the linked supplypod beacon var/area/landingzone = /area/quartermaster/storage //where we droppin boys - var/podType = /obj/structure/closet/supplypod //0 is your standard supply supplypod (requires dissassembly after landing), 1 is the bluespace supply pod (teleports out after landing) + var/podType = /obj/structure/closet/supplypod var/cooldown = 0 //cooldown to prevent printing supplypod beacon spam var/locked = TRUE //is the console locked? unlock with ID var/usingBeacon = FALSE //is the console in beacon mode? exists to let beacon know when a pod may come in diff --git a/code/modules/cargo/supplypod.dm b/code/modules/cargo/supplypod.dm index ef80b692222..1b2c8555ad8 100644 --- a/code/modules/cargo/supplypod.dm +++ b/code/modules/cargo/supplypod.dm @@ -215,13 +215,18 @@ /obj/effect/ex_act() return -/obj/effect/DPtarget/Initialize(mapload, podParam, var/datum/supply_order/SO = null) +/obj/effect/DPtarget/Initialize(mapload, podParam, var/single_order = null) if (ispath(podParam)) //We can pass either a path for a pod (as expressconsoles do), or a reference to an instantiated pod (as the centcom_podlauncher does) podParam = new podParam() //If its just a path, instantiate it pod = podParam - if (SO) - SO.generate(pod) - for (var/mob/living/M in podParam) //If there are any mobs in the supplypod, we want to forceMove them into the target. This is so that they can see where they are about to land, AND so that they don't get sent to the nullspace error room (as the pod is currently in nullspace) + if (single_order) + if (istype(single_order, /datum/supply_order)) + var/datum/supply_order/SO = single_order + SO.generate(pod) + else if (istype(single_order, /atom/movable)) + var/atom/movable/O = single_order + O.forceMove(pod) + for (var/mob/living/M in pod) //If there are any mobs in the supplypod, we want to forceMove them into the target. This is so that they can see where they are about to land, AND so that they don't get sent to the nullspace error room (as the pod is currently in nullspace) M.forceMove(src) if(pod.effectStun) //If effectStun is true, stun any mobs caught on this target until the pod gets a chance to hit them for (var/mob/living/M in get_turf(src))