-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathwormhole_jaunter.dm
95 lines (82 loc) · 3.44 KB
/
wormhole_jaunter.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/**********************Jaunter**********************/
/obj/item/wormhole_jaunter
name = "wormhole jaunter"
desc = "A single use device harnessing outdated wormhole technology, Nanotrasen has since turned its eyes to bluespace for more accurate teleportation. The wormholes it creates are unpleasant to travel through, to say the least.\nThanks to modifications provided by the Free Golems, this jaunter provides protection from chasms."
icon = 'icons/obj/mining.dmi'
icon_state = "Jaunter"
item_state = "electronic"
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
throwforce = 0
w_class = WEIGHT_CLASS_SMALL
throw_speed = 3
throw_range = 5
slot_flags = ITEM_SLOT_BELT
/obj/item/wormhole_jaunter/attack_self(mob/user)
user.visible_message(span_notice("[user.name] activates the [src.name]!"))
SSblackbox.record_feedback("tally", "jaunter", 1, "User") // user activated
activate(user, TRUE)
/obj/item/wormhole_jaunter/proc/turf_check(mob/user)
var/turf/device_turf = get_turf(user)
if(!device_turf || is_centcom_level(device_turf.z) || is_reserved_level(device_turf.z))
to_chat(user, span_notice("You're having difficulties getting the [src.name] to work."))
return FALSE
return TRUE
/obj/item/wormhole_jaunter/proc/get_destinations(mob/user)
var/list/destinations = list()
for(var/obj/item/beacon/B in GLOB.teleportbeacons)
var/turf/T = get_turf(B)
if(is_station_level(T.z))
destinations += B
return destinations
/obj/item/wormhole_jaunter/proc/activate(mob/user, adjacent)
if(!turf_check(user))
return
var/list/L = get_destinations(user)
if(!L.len)
to_chat(user, span_notice("The [src.name] found no beacons in the world to anchor a wormhole to."))
return
var/chosen_beacon = pick(L)
var/obj/effect/portal/jaunt_tunnel/J = new (get_turf(src), src, 100, null, FALSE, get_turf(chosen_beacon))
if(adjacent)
try_move_adjacent(J)
else
J.teleport(user) // send the user through instantly if it appears directly on top of them
playsound(src,'sound/effects/sparks4.ogg',50,1)
qdel(src)
/obj/item/wormhole_jaunter/emp_act(severity)
. = ..()
if(. & EMP_PROTECT_SELF)
return
var/mob/M = loc
if(istype(M))
var/triggered = FALSE
if(M.get_item_by_slot(ITEM_SLOT_BELT) == src && prob(10 * severity))
triggered = TRUE
if(triggered)
M.visible_message(span_warning("[src] overloads and activates!"))
SSblackbox.record_feedback("tally", "jaunter", 1, "EMP") // EMP accidental activation
activate(M)
/obj/item/wormhole_jaunter/proc/chasm_react(mob/user)
to_chat(user, "Your [name] activates, saving you from the chasm!</span>")
SSblackbox.record_feedback("tally", "jaunter", 1, "Chasm") // chasm automatic activation
activate(user, FALSE)
//jaunter tunnel
/obj/effect/portal/jaunt_tunnel
name = "jaunt tunnel"
icon = 'icons/effects/effects.dmi'
icon_state = "bhole3"
desc = "A stable hole in the universe made by a wormhole jaunter. Turbulent doesn't even begin to describe how rough passage through one of these is, but at least it will always get you somewhere near a beacon."
mech_sized = TRUE //save your ripley
innate_accuracy_penalty = 6
/obj/effect/portal/jaunt_tunnel/teleport(atom/movable/M)
. = ..()
if(.)
// KERPLUNK
playsound(M,'sound/weapons/resonator_blast.ogg',50,1)
if(iscarbon(M))
var/mob/living/carbon/L = M
L.Paralyze(60)
if(ishuman(L))
shake_camera(L, 20, 1)
addtimer(CALLBACK(L, TYPE_PROC_REF(/mob/living/carbon, vomit)), 20)