diff --git a/code/game/machinery/podmen.dm b/code/game/machinery/podmen.dm index abf5c52aa8..9b8aab80e7 100644 --- a/code/game/machinery/podmen.dm +++ b/code/game/machinery/podmen.dm @@ -23,6 +23,8 @@ Growing it to term with nothing injected will grab a ghost from the observers. * var/realName = null var/mob/living/carbon/human/source //Donor of blood, if any. gender = MALE + var/obj/machinery/hydroponics/parent + var/found_player = 0 /obj/item/seeds/replicapod/attackby(obj/item/weapon/W as obj, mob/user as mob) @@ -64,49 +66,58 @@ Growing it to term with nothing injected will grab a ghost from the observers. * /obj/item/seeds/replicapod/harvest(mob/user = usr) var/obj/machinery/hydroponics/parent = loc - var/mob/ghost - var/list/candidates = list() + var/found_player = 0 - user.visible_message("\blue You carefully begin to open the pod...","[user] carefully begins to open the pod...") + user.visible_message("\blue [user] carefully begins to open the pod...","\blue You carefully begin to open the pod...") //If a sample is injected (and revival is allowed) the plant will be controlled by the original donor. - if(source && source.mind && source.ckey && config.revival_pod_plants) - ghost = source + if(source && source.stat == 2 && source.client && source.ckey && config.revival_pod_plants) + transfer_personality(source.client) else // If no sample was injected or revival is not allowed, we grab an interested observer. - for(var/mob/dead/observer/O in player_list) - if(O.client && O.client.prefs.be_special & BE_PLANT) - var/response = alert(O, "Someone is harvesting a replica pod. Would you like to play as a Dionaea?", "Replica pod harvest", "Yes", "No", "Never for this round.") - if(response == "Yes") - candidates += O - else if(response == "Never for this round") - O.client.prefs.be_special ^= BE_PLANT + request_player() - if(!do_after(user, 100)) - return + spawn(75) //If we don't have a ghost or the ghost is now unplayed, we just give the harvester some seeds. + if(!found_player) + parent.visible_message("The pod has formed badly, and all you can do is salvage some of the seeds.") + var/seed_count = 1 - if(candidates.len) - ghost = pick(candidates) + if(prob(yield * parent.yieldmod * 20)) + seed_count++ - //If we don't have a ghost or the ghost is now unplayed, we just give the harvester some seeds. - if(!ghost || !(ghost.ckey) || ghost.stat != 2) - user << "The pod has formed badly, and all you can do is salvage some of the seeds." - var/seed_count = 1 + for(var/i=0,iYou awaken slowly, feeling your sap stir into sluggish motion as the warm air caresses your bark." + if(source && ckey && podman.ckey == ckey) + podman << "Memories of a life as [source] drift oddly through a mind unsuited for them, like a skin of oil over a fathomless lake." + podman << "You are now one of the Dionaea, a race of drifting interstellar plantlike creatures that sometimes share their seeds with human traders." + podman << "Too much darkness will send you into shock and starve you, but light will help you heal." + if(!realName) + var/newname = input(podman,"Enter a name, or leave blank for the default name.", "Name change","") as text + if (newname != "") + podman.real_name = newname - spawn(0) - podman << "\green You awaken slowly, feeling your sap stir into sluggish motion as the warm air caresses your bark." - if(source && ckey && podman.ckey == ckey) - podman << "Memories of a life as [source] drift oddly through a mind unsuited for them, like a skin of oil over a fathomless lake." - podman << "You are now one of the Dionaea, a race of drifting interstellar plantlike creatures that sometimes share their seeds with human traders." - podman << "Too much darkness will send you into shock and starve you, but light will help you heal." - - if(!realName) - var/newname = input(podman,"Enter a name, or leave blank for the default name.", "Name change","") as text - if (newname != "") - podman.real_name = newname - parent.update_tray() \ No newline at end of file + parent.visible_message("\blue The pod disgorges a fully-formed plant person!") + parent.update_tray() diff --git a/code/modules/mob/living/carbon/species.dm b/code/modules/mob/living/carbon/species.dm index 349f7edca2..8e7c9911f1 100644 --- a/code/modules/mob/living/carbon/species.dm +++ b/code/modules/mob/living/carbon/species.dm @@ -117,4 +117,4 @@ heat_level_2 = 700 heat_level_3 = 1200 - flags = NO_EAT | NO_BREATHE | REQUIRE_LIGHT | NON_GENDERED | NO_SCAN | IS_PLANT \ No newline at end of file + flags = WHITELISTED | NO_EAT | NO_BREATHE | REQUIRE_LIGHT | NON_GENDERED | NO_SCAN | IS_PLANT diff --git a/code/modules/mob/living/simple_animal/borer.dm b/code/modules/mob/living/simple_animal/borer.dm index 704a479bcd..61561f9f46 100644 --- a/code/modules/mob/living/simple_animal/borer.dm +++ b/code/modules/mob/living/simple_animal/borer.dm @@ -68,13 +68,7 @@ truename = "[pick("Primary","Secondary","Tertiary","Quaternary")] [rand(1000,9999)]" host_brain = new/mob/living/captive_brain(src) - for(var/mob/M in player_list) - if(istype(M,/mob/dead/observer)) - var/mob/dead/observer/O = M - if(O.client) - if(O.client.prefs.be_special & BE_ALIEN) - src.ckey = O.ckey - break + request_player() /mob/living/simple_animal/borer/say(var/message) @@ -384,4 +378,30 @@ mob/living/simple_animal/borer/proc/detatch() src << text("\blue You are now hiding.") else layer = MOB_LAYER - src << text("\blue You have stopped hiding.") \ No newline at end of file + src << text("\blue You have stopped hiding.") + +//Procs for grabbing players. +mob/living/simple_animal/borer/proc/request_player() + for(var/mob/dead/observer/O in player_list) + if(jobban_isbanned(O, "Syndicate")) + continue + if(O.client) + if(O.client.prefs.be_special & BE_ALIEN) + question(O.client) + +mob/living/simple_animal/borer/proc/question(var/client/C) + spawn(0) + if(!C) return + var/response = alert(C, "A cortical borer needs a player. Are you interested?", "Cortical borer request", "Yes", "No", "Never for this round") + if(!C || ckey) + return + if(response == "Yes") + transfer_personality(src) + else if (response == "Never for this round") + C.prefs.be_special ^= BE_ALIEN + +mob/living/simple_animal/borer/proc/transfer_personality(var/mob/candidate) + + src.mind = candidate.mind + src.ckey = candidate.ckey + src.mind.assigned_role = "Cortical Borer"