refactors pods, new helper for spawning items from pods through code (#58222)

This commit is contained in:
tralezab
2021-04-13 00:37:48 -07:00
committed by GitHub
parent 9845c6be8d
commit d0eb1ce36c
10 changed files with 102 additions and 43 deletions

View File

@@ -713,15 +713,18 @@
var/chosen = pick_closest_path(object)
if(!chosen)
return
var/turf/T = get_turf(usr)
var/turf/target_turf = get_turf(usr)
if(ispath(chosen, /turf))
T.ChangeTurf(chosen)
target_turf.ChangeTurf(chosen)
else
var/obj/structure/closet/supplypod/centcompod/pod = new()
var/obj/structure/closet/supplypod/pod = podspawn(list(
"target" = target_turf,
"path" = /obj/structure/closet/supplypod/centcompod,
))
//we need to set the admin spawn flag for the spawned items so we do it outside of the podspawn proc
var/atom/A = new chosen(pod)
A.flags_1 |= ADMIN_SPAWNED_1
new /obj/effect/pod_landingzone(T, pod)
log_admin("[key_name(usr)] pod-spawned [chosen] at [AREACOORD(usr)]")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Podspawn Atom") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!

View File

@@ -34,16 +34,15 @@
/datum/smite/supply_pod_quick/effect(client/user, mob/living/target)
. = ..()
var/obj/structure/closet/supplypod/centcompod/pod = new
pod.damage = SUPPLY_POD_QUICK_DAMAGE
pod.explosionSize = list(0, 0, 0, SUPPLY_POD_QUICK_FIRE_RANGE)
pod.effectStun = TRUE
if (!isnull(target_path))
new target_path(pod)
new /obj/effect/pod_landingzone(get_turf(target), pod)
podspawn(list(
"target" = get_turf(target),
"path" = /obj/structure/closet/supplypod/centcompod,
"style" = STYLE_CENTCOM,
"spawn" = target_path,
"damage" = SUPPLY_POD_QUICK_DAMAGE,
"explosionSize" = list(0, 0, 0, SUPPLY_POD_QUICK_FIRE_RANGE),
"effectStun" = TRUE
))
#undef SUPPLY_POD_QUICK_DAMAGE
#undef SUPPLY_POD_QUICK_FIRE_RANGE