From ada08f578bd486eabe985d7acbf65a5e39b705fc Mon Sep 17 00:00:00 2001 From: GDN Date: Sun, 16 Jul 2023 15:54:06 -0500 Subject: [PATCH] If you get facehugged and nested, you are now able to ghost --- code/_onclick/hud/alert.dm | 24 +++++++++++++++++++ .../stool_bed_chair_nest/alien_nests.dm | 17 +++++++++++-- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index 256a04090c2..1d191ae2d87 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -540,6 +540,30 @@ so as to remain in compliance with the most up-to-date laws." var/mob/dead/observer/G = usr G.reenter_corpse() +/obj/screen/alert/ghost + name = "Ghost" + desc = "Would you like to ghost? You will be notified when your body is removed from the nest." + icon_state = "template" + timeout = 5 MINUTES // longer than any infection should be + +/obj/screen/alert/ghost/Initialize(mapload) + . = ..() + var/image/I = image('icons/mob/mob.dmi', icon_state = "ghost", layer = FLOAT_LAYER, dir = SOUTH) + I.layer = FLOAT_LAYER + I.plane = FLOAT_PLANE + overlays += I + +/obj/screen/alert/ghost/Click() + var/mob/living/carbon/human/infected_user = usr + if(!istype(infected_user) || infected_user.stat == DEAD) + infected_user.clear_alert("ghost_nest") + return + var/obj/item/clothing/mask/facehugger/hugger_mask = infected_user.wear_mask + if(!istype(hugger_mask) || !(locate(/obj/item/organ/internal/body_egg/alien_embryo) in infected_user.internal_organs) || hugger_mask.sterile) + infected_user.clear_alert("ghost_nest") + return + infected_user.ghostize(TRUE) + /obj/screen/alert/notify_action name = "Body created" desc = "A body was created. You can enter it." diff --git a/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm b/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm index 49d4946ba68..219b4a8d3fb 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm @@ -9,6 +9,7 @@ var/image/nest_overlay comfort = 0 flags = NODECONSTRUCT + var/ghost_timer /obj/structure/bed/nest/Initialize(mapload) . = ..() @@ -32,7 +33,7 @@ M.visible_message("[M.name] struggles to break free from the gelatinous resin!",\ "You struggle to break free from the gelatinous resin... (Stay still for two minutes.)",\ "You hear squelching...") - if(!do_after(M, 1200, target = src)) + if(!do_after(M, 120 SECONDS, target = src)) if(M && M.buckled) to_chat(M, "You fail to escape \the [src]!") return @@ -46,7 +47,7 @@ add_fingerprint(user) /obj/structure/bed/nest/user_buckle_mob(mob/living/M, mob/living/user) - if (!ismob(M) || (get_dist(src, user) > 1) || (M.loc != loc) || user.incapacitated() || M.buckled) + if(!istype(M) || (get_dist(src, user) > 1) || (M.loc != loc) || user.incapacitated() || M.buckled) return if(M.get_int_organ(/obj/item/organ/internal/alien/hivenode)) @@ -64,7 +65,16 @@ M.visible_message("[user.name] secretes a thick vile goo, securing [M.name] into [src]!",\ "[user.name] drenches you in a foul-smelling resin, trapping you in [src]!",\ "You hear squelching...") + ghost_timer = addtimer(CALLBACK(src, PROC_REF(ghost_check)), 15 SECONDS, TIMER_UNIQUE|TIMER_STOPPABLE) +/obj/structure/bed/nest/proc/ghost_check() + if(!length(buckled_mobs)) + return + for(var/mob/living/carbon/human/buckled_mob in buckled_mobs) + var/obj/item/clothing/mask/facehugger/hugger_mask = buckled_mob.wear_mask + if(istype(hugger_mask) && !hugger_mask.sterile && (locate(/obj/item/organ/internal/body_egg/alien_embryo) in buckled_mob.internal_organs)) + buckled_mob.throw_alert("ghost_nest", /obj/screen/alert/ghost) + to_chat(buckled_mob, "You may now ghost, you keep respawnability in this state. You will be alerted when you're removed from the nest.") /obj/structure/bed/nest/post_buckle_mob(mob/living/M) M.pixel_y = 0 @@ -77,6 +87,9 @@ M.pixel_y = M.get_standard_pixel_y_offset() M.layer = initial(M.layer) cut_overlay(nest_overlay) + deltimer(ghost_timer) + M.clear_alert("ghost_nest") + M.notify_ghost_cloning("You have been unbuckled from an alien nest! Click that alert to re-enter your body.", source = src) /obj/structure/bed/nest/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0) switch(damage_type)