diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index e20829aab85..095695e23d8 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -54,6 +54,25 @@ dizziness = 0 jitteriness = 0 + //Handle brain slugs. + var/datum/organ/external/head = get_organ("head") + var/mob/living/simple_animal/borer/B + + for(var/I in head.implants) + if(istype(I,/mob/living/simple_animal/borer)) + B = I + if(B) + if(!B.ckey && ckey && B.controlling) + B.ckey = ckey + B.controlling = 0 + if(B.host_brain.ckey) + ckey = B.host_brain.ckey + B.host_brain.ckey = null + B.host_brain.name = "host brain" + B.host_brain.real_name = "host brain" + + verbs -= /mob/living/carbon/human/proc/release_control + //Check for heist mode kill count. if(ticker.mode && ( istype( ticker.mode,/datum/game_mode/heist) ) ) //Check for last assailant's mutantrace. diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index df8dec56156..cb96be329dc 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1274,3 +1274,32 @@ mob/living/carbon/human/yank_out_object() return 1 else return 0 + +//Brain slug proc for voluntary removal of control. +/mob/living/carbon/human/proc/release_control() + + set category = "Alien" + set name = "Release Control" + set desc = "Release control of your host's body." + + var/datum/organ/external/head = get_organ("head") + var/mob/living/simple_animal/borer/B + + for(var/I in head.implants) + if(istype(I,/mob/living/simple_animal/borer)) + B = I + if(!B) + return + + if(!B.ckey && ckey && B.controlling) + src << "\red You withdraw your probosci, releasing control of [B.host_brain]" + B.host_brain << "\red Your vision swims as the alien parasite releases control of your body." + B.ckey = ckey + B.controlling = 0 + if(B.host_brain.ckey) + ckey = B.host_brain.ckey + B.host_brain.ckey = null + B.host_brain.name = "host brain" + B.host_brain.real_name = "host brain" + + verbs -= /mob/living/carbon/human/proc/release_control \ No newline at end of file diff --git a/code/modules/mob/screen.dm b/code/modules/mob/screen.dm index 514872db379..22775a6c8cd 100644 --- a/code/modules/mob/screen.dm +++ b/code/modules/mob/screen.dm @@ -606,6 +606,32 @@ var/mob/living/L = usr + //Resisting control by an alien mind. + if(istype(src.loc,/mob/living/simple_animal/borer)) + var/mob/living/simple_animal/borer/B = src.loc + var/mob/living/captive_brain/H = src + + H << "\red You begin doggedly resisting the parasite's control." + B.host << "\red You feel the captive mind of [src] begin to resist your control." + + spawn(50) + + if(!B || !H || !H.ckey) + return + + H << "\red With an immense exertion of will, you regain control of your body!" + B.host << "\red You feel control of the host brain ripped from your grasp, and retract your probosci before the wild neural impulses can damage you." + B.controlling = 0 + + B.ckey = B.host.ckey + B.host.ckey = H.ckey + + H.ckey = null + H.name = "host brain" + H.real_name = "host brain" + + return + //resisting grabs (as if it helps anyone...) if ((!( L.stat ) && L.canmove && !( L.restrained() ))) var/resisting = 0 diff --git a/code/modules/surgery/implant.dm b/code/modules/surgery/implant.dm index 0d67881f242..7e240f737e3 100644 --- a/code/modules/surgery/implant.dm +++ b/code/modules/surgery/implant.dm @@ -166,7 +166,7 @@ if (affected.implants.len) - var/obj/item/weapon/obj = affected.implants[1] + var/obj/item/obj = affected.implants[1] if(istype(obj,/obj/item/weapon/implant)) var/obj/item/weapon/implant/imp = obj @@ -181,6 +181,11 @@ user.visible_message("\blue [user] takes something out of incision on [target]'s [affected.display_name] with \the [tool].", \ "\blue You take [obj] out of incision on [target]'s [affected.display_name]s with \the [tool]." ) affected.implants -= obj + + //Handle possessive brain borers. + if(istype(obj,/mob/living/simple_animal/borer)) + target.release_control() + obj.loc = get_turf(target) if(istype(obj,/obj/item/weapon/implant)) var/obj/item/weapon/implant/imp = obj