/
supply_pod_quick.dm
48 lines (40 loc) · 1.38 KB
/
supply_pod_quick.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
#define SUPPLY_POD_QUICK_DAMAGE 40
#define SUPPLY_POD_QUICK_FIRE_RANGE 2
/// Quickly throws a supply pod at the target, optionally with an item
/datum/smite/supply_pod_quick
name = "Supply Pod (Quick)"
/// What is sent down with the pod
var/target_path
/datum/smite/supply_pod_quick/configure(client/user)
var/attempted_target_path = input(
user,
"Enter typepath of an atom you'd like to send with the pod (type \"empty\" to send an empty pod):",
"Typepath",
"/obj/item/food/grown/harebell",
) as null|text
if (isnull(attempted_target_path)) //The user pressed "Cancel"
return FALSE
if (attempted_target_path == "empty")
target_path = null
return
// if you didn't type empty, we want to load the pod with a delivery
var/delivery = text2path(attempted_target_path)
if(!ispath(delivery))
delivery = pick_closest_path(attempted_target_path)
if(!delivery)
tgui_alert(user, "ERROR: Incorrect / improper path given.")
return FALSE
target_path = delivery
/datum/smite/supply_pod_quick/effect(client/user, mob/living/target)
. = ..()
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