Files
GS13NG/code/datums/elements/ventcrawling.dm
raspy-on-osu 0e652cb64c init
2020-12-26 06:02:09 -05:00

32 lines
932 B
Plaintext

/datum/element/ventcrawling
element_flags = ELEMENT_BESPOKE|ELEMENT_DETACH
id_arg_index = 2
var/tier
/datum/element/ventcrawling/Attach(datum/target, duration = 0, given_tier = VENTCRAWLER_NUDE)
. = ..()
src.tier = given_tier
RegisterSignal(target, COMSIG_HANDLE_VENTCRAWL, .proc/handle_ventcrawl)
RegisterSignal(target, COMSIG_CHECK_VENTCRAWL, .proc/check_ventcrawl)
to_chat(target, "<span class='notice'>You can ventcrawl! Use alt+click on vents to quickly travel about the station.</span>")
if(duration!=0)
addtimer(CALLBACK(src, .proc/Detach, target), duration)
/datum/element/ventcrawling/Detach(datum/target)
. = ..()
UnregisterSignal(target, COMSIG_HANDLE_VENTCRAWL)
/datum/element/ventcrawling/proc/handle_ventcrawl(datum/target,atom/A)
var/mob/living/person = target
if(!istype(person))
return FALSE
person.handle_ventcrawl(A,tier)
/datum/element/ventcrawling/proc/check_ventcrawl()
return tier