From e8e05d96ef3fc62887bf6ae0e062f3d6475155b7 Mon Sep 17 00:00:00 2001 From: Eli Atonis Date: Tue, 26 Jul 2022 07:13:07 +1000 Subject: [PATCH] Ghost spawning as mice from trash piles Added the ability for observers to click on trash piles to trigger the mouse spawn prompt. Doing so spawns them on the pile with the same "crawls out of the trash" message a normal mouse would trigger. --- code/game/objects/structures/trash_pile_vr.dm | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/code/game/objects/structures/trash_pile_vr.dm b/code/game/objects/structures/trash_pile_vr.dm index 037facb0ec..d1e9a0593e 100644 --- a/code/game/objects/structures/trash_pile_vr.dm +++ b/code/game/objects/structures/trash_pile_vr.dm @@ -84,6 +84,49 @@ else return ..() +/obj/structure/trash_pile/attack_ghost(mob/observer/user as mob) + if(config.disable_player_mice) + to_chat(user, "Spawning as a mouse is currently disabled.") + return + + //VOREStation Add Start + if(jobban_isbanned(user, "GhostRoles")) + to_chat(user, "You cannot become a mouse because you are banned from playing ghost roles.") + return + //VOREStation Add End + + if(!user.MayRespawn(1)) + return + + var/turf/T = get_turf(src) + if(!T || (T.z in using_map.admin_levels)) + to_chat(user, "You may not spawn as a mouse on this Z-level.") + return + + var/timedifference = world.time - user.client.time_died_as_mouse + if(user.client.time_died_as_mouse && timedifference <= mouse_respawn_time * 600) + var/timedifference_text + timedifference_text = time2text(mouse_respawn_time * 600 - timedifference,"mm:ss") + to_chat(user, "You may only spawn again as a mouse more than [mouse_respawn_time] minutes after your death. You have [timedifference_text] left.") + return + + var/response = tgui_alert(user, "Are you -sure- you want to become a mouse?","Are you sure you want to squeek?",list("Squeek!","Nope!")) + if(response != "Squeek!") return //Hit the wrong key...again. + + var/mob/living/simple_mob/animal/passive/mouse/host + host = new /mob/living/simple_mob/animal/passive/mouse(get_turf(src)) + + if(host) + if(config.uneducated_mice) + host.universal_understand = 0 + announce_ghost_joinleave(src, 0, "They are now a mouse.") + host.ckey = user.ckey + to_chat(host, "You are now a mouse. Try to avoid interaction with players, and do not give hints away that you are more than a simple rodent.") + + var/atom/A = get_holder_at_turf_level(src) + A.visible_message("[host] crawls out of \the [src].") + return + /obj/structure/trash_pile/attack_hand(mob/user) //Human mob if(ishuman(user))