mirror of
https://github.com/Skyrat-SS13/Skyrat-tg.git
synced 2026-08-28 23:42:54 +01:00
* The Voidwalker | New Midround Antagonist * [MIRROR] The Voidwalker | New Midround Antagonist [MDB IGNORE] (#3755) * The Voidwalker | New Midround Antagonist * Update role_preferences.dm * Update sql_ban_system.dm * Update _bodyparts.dm * Update role_preferences.dm * Update lazy_templates.dm * Update _bodyparts.dm * Update _bodyparts.dm * Grep --------- Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com> Co-authored-by: SomeRandomOwl <2568378+SomeRandomOwl@users.noreply.github.com> Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com> --------- Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com> Co-authored-by: SpaceLoveSs13 <68121607+SpaceLoveSs13@users.noreply.github.com> Co-authored-by: NovaBot <154629622+NovaBot13@users.noreply.github.com> Co-authored-by: SomeRandomOwl <2568378+SomeRandomOwl@users.noreply.github.com> Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
51 lines
1.5 KiB
Plaintext
51 lines
1.5 KiB
Plaintext
/// Allows us to move through glass but not electrified glass. Can also do a little slowdown before passing through
|
|
/datum/component/glass_passer
|
|
/// How long does it take us to move into glass?
|
|
var/pass_time = 0 SECONDS
|
|
|
|
/datum/component/glass_passer/Initialize(pass_time)
|
|
if(!ismob(parent)) //if its not a mob then just directly use passwindow
|
|
return COMPONENT_INCOMPATIBLE
|
|
|
|
src.pass_time = pass_time
|
|
|
|
if(!pass_time)
|
|
passwindow_on(parent, type)
|
|
else
|
|
RegisterSignal(parent, COMSIG_MOVABLE_BUMP, PROC_REF(bumped))
|
|
|
|
var/mob/mobbers = parent
|
|
mobbers.generic_canpass = FALSE
|
|
RegisterSignal(parent, COMSIG_MOVABLE_CROSS_OVER, PROC_REF(cross_over))
|
|
|
|
/datum/component/glass_passer/Destroy()
|
|
. = ..()
|
|
if(parent)
|
|
passwindow_off(parent, type)
|
|
|
|
/datum/component/glass_passer/proc/cross_over(mob/passer, atom/crosser)
|
|
SIGNAL_HANDLER
|
|
|
|
if(istype(crosser, /obj/structure/grille))
|
|
var/obj/structure/grille/grillefriend = crosser
|
|
if(grillefriend.is_shocked()) //prevent passage of shocked
|
|
crosser.balloon_alert(passer, "is shocked!")
|
|
return COMPONENT_BLOCK_CROSS
|
|
|
|
return null
|
|
|
|
/datum/component/glass_passer/proc/bumped(mob/living/owner, atom/bumpee)
|
|
SIGNAL_HANDLER
|
|
|
|
if(!istype(bumpee, /obj/structure/window))
|
|
return
|
|
|
|
INVOKE_ASYNC(src, PROC_REF(phase_through_glass), owner, bumpee)
|
|
|
|
/datum/component/glass_passer/proc/phase_through_glass(mob/living/owner, atom/bumpee)
|
|
if(!do_after(owner, pass_time, bumpee))
|
|
return
|
|
passwindow_on(owner, type)
|
|
try_move_adjacent(owner, get_dir(owner, bumpee))
|
|
passwindow_off(owner, type)
|