mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-30 07:27:57 +01:00
77 lines
2.8 KiB
Plaintext
77 lines
2.8 KiB
Plaintext
/**********************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 can be worn on the belt to provide protection from chasms."
|
|
icon = 'icons/obj/items.dmi'
|
|
icon_state = "Jaunter"
|
|
item_state = "electronic"
|
|
throwforce = 0
|
|
w_class = WEIGHT_CLASS_SMALL
|
|
throw_speed = 3
|
|
throw_range = 5
|
|
origin_tech = "bluespace=2"
|
|
slot_flags = SLOT_BELT
|
|
|
|
/obj/item/wormhole_jaunter/attack_self(mob/user)
|
|
user.visible_message("<span class='notice'>[user.name] activates the [name]!</span>")
|
|
activate(user, TRUE)
|
|
|
|
/obj/item/wormhole_jaunter/proc/turf_check(mob/user)
|
|
var/turf/device_turf = get_turf(user)
|
|
if(!device_turf || !is_teleport_allowed(device_turf.z))
|
|
to_chat(user, "<span class='notice'>You're having difficulties getting the [name] to work.</span>")
|
|
return FALSE
|
|
return TRUE
|
|
|
|
/obj/item/wormhole_jaunter/proc/get_destinations(mob/user)
|
|
var/list/destinations = list()
|
|
|
|
for(var/obj/item/radio/beacon/B in world)
|
|
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 class='notice'>The [name] found no beacons in the world to anchor a wormhole to.</span>")
|
|
return
|
|
var/chosen_beacon = pick(L)
|
|
var/obj/effect/portal/jaunt_tunnel/J = new(get_turf(src), get_turf(chosen_beacon), src, 100)
|
|
if(adjacent)
|
|
try_move_adjacent(J)
|
|
else
|
|
J.teleport(user)
|
|
playsound(src,'sound/effects/sparks4.ogg',50,1)
|
|
qdel(src)
|
|
|
|
/obj/item/wormhole_jaunter/proc/chasm_react(mob/user)
|
|
if(user.get_item_by_slot(slot_belt) == src)
|
|
to_chat(user, "Your [name] activates, saving you from the chasm!</span>")
|
|
activate(user, FALSE)
|
|
else
|
|
to_chat(user, "[src] is not attached to your belt, preventing it from saving you from the chasm. RIP.</span>")
|
|
|
|
/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."
|
|
failchance = 0
|
|
|
|
/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.Weaken(6)
|
|
if(ishuman(L))
|
|
shake_camera(L, 20, 1)
|
|
addtimer(CALLBACK(L, /mob/living/carbon.proc/vomit), 20) |