From 580fb4ba9a082057fdcdd4309cba26472d8763ba Mon Sep 17 00:00:00 2001 From: Chap Date: Sat, 2 Nov 2024 12:37:24 +0100 Subject: [PATCH] [TWEAK] Cryopod now give you a HUD alert that you can click to ghost (#26808) * Cryopod now throws an alert when entered. * Makes these subtypes * Requested changes * Requested changes * Update code/_onclick/hud/alert.dm Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> Signed-off-by: Chap --------- Signed-off-by: Chap Co-authored-by: Adrer Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> --- code/_onclick/hud/alert.dm | 18 ++++++++++++++++-- code/game/machinery/cryopod.dm | 3 +++ .../stool_bed_chair_nest/alien_nests.dm | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index 479be6b86ac..2cf74f2d8a8 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -615,9 +615,9 @@ so as to remain in compliance with the most up-to-date laws." /atom/movable/screen/alert/ghost name = "Ghost" - desc = "Would you like to ghost? You will be notified when your body is removed from the nest." + desc = "Would you like to ghost?" icon_state = "template" - timeout = 5 MINUTES // longer than any infection should be + timeout = 5 MINUTES /atom/movable/screen/alert/ghost/Initialize(mapload) . = ..() @@ -626,7 +626,21 @@ so as to remain in compliance with the most up-to-date laws." I.plane = FLOAT_PLANE overlays += I +/atom/movable/screen/alert/ghost/proc/handle_ghosting(mob/living/carbon/human/target) + target.ghost() + /atom/movable/screen/alert/ghost/Click() + if(!..()) + return + handle_ghosting(usr) + +/atom/movable/screen/alert/ghost/cryo + desc = "Would you like to ghost? Your body will automatically be moved into cryostorage." + +/atom/movable/screen/alert/ghost/xeno + desc = "Would you like to ghost? You will be notified when your body is removed from the nest." + +/atom/movable/screen/alert/ghost/xeno/Click() if(!..()) return var/mob/living/carbon/human/infected_user = usr diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 6d17e55271a..07a63c0574f 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -501,6 +501,7 @@ icon_state = occupied_icon_state + M.throw_alert("cryopod", /atom/movable/screen/alert/ghost/cryo) to_chat(M, "[on_enter_occupant_message]") to_chat(M, "If you ghost, log out or close your client now, your character will shortly be permanently removed from the round.") @@ -585,6 +586,7 @@ icon_state = occupied_icon_state to_chat(E, "[on_enter_occupant_message]") to_chat(E, "If you ghost, log out or close your client now, your character will shortly be permanently removed from the round.") + E.throw_alert("cryopod", /atom/movable/screen/alert/ghost/cryo) occupant = E name = "[name] ([occupant.name])" time_entered = world.time @@ -606,6 +608,7 @@ return occupant.forceMove(get_turf(src)) + occupant.clear_alert("cryopod") occupant = null icon_state = base_icon_state name = initial(name) 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 ab6b352db2c..355dbfb687a 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 @@ -78,7 +78,7 @@ if(istype(hugger_mask) && !hugger_mask.sterile && (locate(/obj/item/organ/internal/body_egg/alien_embryo) in buckled_mob.internal_organs)) if(user && !isalien(user)) return - buckled_mob.throw_alert("ghost_nest", /atom/movable/screen/alert/ghost) + buckled_mob.throw_alert("ghost_nest", /atom/movable/screen/alert/ghost/xeno) to_chat(buckled_mob, "You may now click on the ghost prompt on your screen to leave your body. You will be alerted when you're removed from the nest.") if(tgui_alert(buckled_mob, "You may now ghost and keep respawnability, you will be notified if you leave the nest, would you like to do so?", "Ghosting", list("Yes", "No")) != "Yes") return