diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index b08580d3941..d1cddfeec1a 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -645,57 +645,4 @@ CM.update_inv_legcuffed() -/mob/living/verb/respawn() - set name = "Respawn as Mindless" - set category = "OOC" - if(usr in respawnable_list) - var/list/creatures = list("Mouse") - for(var/mob/living/simple_animal/S in living_mob_list) - if(safe_animal(S.type)) - if(!S.key) - creatures += S - var/picked = input("Please select a creature to respawn as", "Respawn as Mindless Creature") as null|anything in creatures - switch(picked) - if("Mouse") - become_mouse() - else - var/mob/living/simple_animal/picked_animal = picked - if(istype(picked_animal) && !picked_animal.key) - picked_animal.key = key - else - message_admins("Failed to check type") - else - usr << "You are not dead or you have given up your right to be respawned!" - return - - - -/mob/living/proc/become_mouse() - if(usr in respawnable_list) - var/timedifference = world.time - client.time_died_as_mouse - if(client.time_died_as_mouse && timedifference <= mouse_respawn_time * 600) - var/timedifference_text - timedifference_text = time2text(mouse_respawn_time * 600 - timedifference,"mm:ss") - src << "You may only spawn again as a mouse more than [mouse_respawn_time] minutes after your death. You have [timedifference_text] left." - return - - //find a viable mouse candidate - var/mob/living/simple_animal/mouse/host - var/obj/machinery/atmospherics/unary/vent_pump/vent_found - var/list/found_vents = list() - for(var/obj/machinery/atmospherics/unary/vent_pump/v in world) - if(!v.welded && v.z == src.z) - found_vents.Add(v) - if(found_vents.len) - vent_found = pick(found_vents) - host = new /mob/living/simple_animal/mouse(vent_found.loc) - else - src << "Unable to find any unwelded vents to spawn mice at." - - if(host) - host.ckey = src.ckey - 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." - else - usr << "You are not dead or you have given up your right to be respawned!" - return diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 706fcfcba27..9dcd90d13c3 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -922,3 +922,64 @@ mob/verb/yank_out_object() if(!pinned.len) anchored = 0 return 1 + + + +/mob/verb/respawn() + set name = "Respawn as Mindless" + set category = "OOC" + + usr in respawnable_list + if(istype(usr, /mob/dead/observer) || usr in respawnable_list) + if(istype(usr, /mob/dead/observer)) + var/mob/dead/observer/O = usr + if(!O.started_as_observer) return + + var/list/creatures = list("Mouse") + for(var/mob/living/simple_animal/S in living_mob_list) + if(safe_animal(S.type)) + if(!S.key) + creatures += S + var/picked = input("Please select a creature to respawn as", "Respawn as Mindless Creature") as null|anything in creatures + switch(picked) + if("Mouse") + become_mouse() + else + var/mob/living/simple_animal/picked_animal = picked + if(istype(picked_animal) && !picked_animal.key) + picked_animal.key = key + else + message_admins("Failed to check type") + else + usr << "You are not dead or you have given up your right to be respawned!" + return + + +/mob/proc/become_mouse() + if(usr in respawnable_list) + var/timedifference = world.time - client.time_died_as_mouse + if(client.time_died_as_mouse && timedifference <= mouse_respawn_time * 600) + var/timedifference_text + timedifference_text = time2text(mouse_respawn_time * 600 - timedifference,"mm:ss") + src << "You may only spawn again as a mouse more than [mouse_respawn_time] minutes after your death. You have [timedifference_text] left." + return + + //find a viable mouse candidate + var/mob/living/simple_animal/mouse/host + var/obj/machinery/atmospherics/unary/vent_pump/vent_found + var/list/found_vents = list() + for(var/obj/machinery/atmospherics/unary/vent_pump/v in world) + if(!v.welded && v.z == src.z) + found_vents.Add(v) + if(found_vents.len) + vent_found = pick(found_vents) + host = new /mob/living/simple_animal/mouse(vent_found.loc) + else + src << "Unable to find any unwelded vents to spawn mice at." + + if(host) + host.ckey = src.ckey + 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." + else + usr << "You are not dead or you have given up your right to be respawned!" + return \ No newline at end of file