From e05976e1b9b0940a4ff38ecc9098205794daecb2 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Mon, 19 Aug 2013 11:53:03 -0700 Subject: [PATCH 1/5] Confirmation prompt for borers. --- .../modules/mob/living/simple_animal/borer.dm | 36 ++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/code/modules/mob/living/simple_animal/borer.dm b/code/modules/mob/living/simple_animal/borer.dm index 4ea4a23553f..d68aaec7330 100644 --- a/code/modules/mob/living/simple_animal/borer.dm +++ b/code/modules/mob/living/simple_animal/borer.dm @@ -67,13 +67,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) @@ -367,4 +361,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" \ No newline at end of file From 6d8bb8dfe66fdb5b5e84494c973ad74f007790c9 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Mon, 19 Aug 2013 11:53:24 -0700 Subject: [PATCH 2/5] Hopefully a fix for Dionaea weirdness regarding pods. --- code/game/machinery/podmen.dm | 95 +++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 43 deletions(-) diff --git a/code/game/machinery/podmen.dm b/code/game/machinery/podmen.dm index abf5c52aa81..9b8aab80e76 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() From 320a009e2dcc9b59e123fb2392d3f5e7d977f54b Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Mon, 19 Aug 2013 12:38:48 -0700 Subject: [PATCH 3/5] Made Dionaea whitelisted. --- code/modules/mob/living/carbon/species.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/species.dm b/code/modules/mob/living/carbon/species.dm index e2638d01c39..ec5e3cd4032 100644 --- a/code/modules/mob/living/carbon/species.dm +++ b/code/modules/mob/living/carbon/species.dm @@ -93,4 +93,4 @@ deform = 'icons/mob/human_races/r_def_plant.dmi' attack_verb = "slash" - 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 \ No newline at end of file From 809c17710dfc17ccf914033d3ff356611abfd289 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Mon, 19 Aug 2013 15:46:40 -0700 Subject: [PATCH 4/5] Borer prompt will now actually work without runtimes. --- code/modules/mob/living/simple_animal/borer.dm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/simple_animal/borer.dm b/code/modules/mob/living/simple_animal/borer.dm index d68aaec7330..b457f4b15b1 100644 --- a/code/modules/mob/living/simple_animal/borer.dm +++ b/code/modules/mob/living/simple_animal/borer.dm @@ -379,12 +379,16 @@ mob/living/simple_animal/borer/proc/question(var/client/C) if(!C || ckey) return if(response == "Yes") - transfer_personality(src) + transfer_personality(C) else if (response == "Never for this round") C.prefs.be_special ^= BE_ALIEN -mob/living/simple_animal/borer/proc/transfer_personality(var/mob/candidate) +mob/living/simple_animal/borer/proc/transfer_personality(var/client/candidate) - src.mind = candidate.mind + if(!candidate) + return + + src.mind = candidate.mob.mind src.ckey = candidate.ckey - src.mind.assigned_role = "Cortical Borer" \ No newline at end of file + if(src.mind) + src.mind.assigned_role = "Cortical Borer" \ No newline at end of file From 67f3f5a3c4508e9d14ccc22f9aaa28cfe2110f22 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Mon, 19 Aug 2013 15:58:08 -0700 Subject: [PATCH 5/5] Podmen prompt/spawn should work now. --- code/game/machinery/podmen.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/podmen.dm b/code/game/machinery/podmen.dm index 9b8aab80e76..da3fbb72347 100644 --- a/code/game/machinery/podmen.dm +++ b/code/game/machinery/podmen.dm @@ -23,7 +23,7 @@ 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/obj/machinery/hydroponics/parent = null var/found_player = 0 /obj/item/seeds/replicapod/attackby(obj/item/weapon/W as obj, mob/user as mob) @@ -65,7 +65,7 @@ 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 + parent = loc var/found_player = 0 user.visible_message("\blue [user] carefully begins to open the pod...","\blue You carefully begin to open the pod...")