From 1cf1a193cadf8208ee03dbdfe4687b1b20f46cc6 Mon Sep 17 00:00:00 2001 From: ikarrus Date: Thu, 14 Aug 2014 21:49:19 -0600 Subject: [PATCH 1/7] Players Jobbanned from Antagonist Roles cannot be spawned as, or converted to, them They are instead force ghosted, so it's not taken as free immunity from conversion. --- code/game/gamemodes/cult/runes.dm | 19 ++++++++++++++----- code/game/gamemodes/wizard/rightandwrong.dm | 1 + code/game/objects/items/devices/flash.dm | 9 +++++++-- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index de5f6538d5c..135c124fa1d 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -109,10 +109,15 @@ var/list/sacrificed = list() cultsinrange += C C.say("Mah[pick("'","`")]weyh pleggh at e'ntrath!") if(cultsinrange.len >= 3) - M.visible_message("\red [M] writhes in pain as the markings below him glow a bloody red.", \ - "\red AAAAAAHHHH!.", \ - "\red You hear an anguished scream.") + M.visible_message("[M] writhes in pain as the markings below him glow a bloody red.", \ + "AAAAAAHHHH!.", \ + "You hear an anguished scream.") if(is_convertable_to_cult(M.mind)) + if(jobban_isbanned(M, "Syndicate") || jobban_isbanned(M, "cultist")) + M.visible_message("A horrified look flashes across [M]'s face before their body goes limp.", \ + "Error: You are currently jobbanned from Cultist.") + M.ghostize(0) //Jobbanned players are force ghosted + return 0 ticker.mode.add_cultist(M.mind) M.mind.special_role = "Cultist" M << "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root." @@ -302,8 +307,12 @@ var/list/sacrificed = list() var/mob/dead/observer/ghost for(var/mob/dead/observer/O in loc) - if(!O.client) continue - if(O.mind && O.mind.current && O.mind.current.stat != DEAD) continue + if(!O.client) + continue + if(O.mind && O.mind.current && O.mind.current.stat != DEAD) + continue + if(!jobban_isbanned(O, "Syndicate") && !jobban_isbanned(O, "cultist")) + continue ghost = O break diff --git a/code/game/gamemodes/wizard/rightandwrong.dm b/code/game/gamemodes/wizard/rightandwrong.dm index 1cc217b188f..8789de52163 100644 --- a/code/game/gamemodes/wizard/rightandwrong.dm +++ b/code/game/gamemodes/wizard/rightandwrong.dm @@ -13,6 +13,7 @@ if(H.mind) if(H.mind.special_role == "Wizard" || H.mind.special_role == "apprentice") continue if(prob(25) && !(H.mind in ticker.mode.traitors)) + if(jobban_isbanned(H, "Syndicate") || jobban_isbanned(H, "traitor")) continue ticker.mode.traitors += H.mind H.mind.special_role = "traitor" var/datum/objective/survive/survive = new diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm index df97a6ab825..57afe7bb76b 100644 --- a/code/game/objects/items/devices/flash.dm +++ b/code/game/objects/items/devices/flash.dm @@ -84,8 +84,13 @@ // if(M.mind.has_been_rev) // revsafe = 2 if(!revsafe) - M.mind.has_been_rev = 1 - ticker.mode.add_revolutionary(M.mind) + if(jobban_isbanned(M, "Syndicate") || jobban_isbanned(M, "revolutionary")) + M << "Error: You are currently jobbanned from Revolutionary." + user << "This mind was unable to survive the rigors of conversion and has been wiped clean!" + M.ghostize(0) //Jobbanned players are force ghosted + else + M.mind.has_been_rev = 1 + ticker.mode.add_revolutionary(M.mind) else if(revsafe == 1) user << "Something seems to be blocking the flash!" else From 447213d19264d7bd027f007c8c5131fd02fed089 Mon Sep 17 00:00:00 2001 From: ikarrus Date: Sun, 17 Aug 2014 14:15:25 -0600 Subject: [PATCH 2/7] -A cult conversion attempt that fails due to the victim being jobbanned will reward the cultists with a free single-use supply talisman -Robot factories will kill the victim instead of converting if they are jobbanned from cyborg --- code/game/gamemodes/cult/runes.dm | 2 ++ code/game/machinery/transformer.dm | 15 ++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 135c124fa1d..013079a1168 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -117,6 +117,8 @@ var/list/sacrificed = list() M.visible_message("A horrified look flashes across [M]'s face before their body goes limp.", \ "Error: You are currently jobbanned from Cultist.") M.ghostize(0) //Jobbanned players are force ghosted + var/obj/item/weapon/paper/talisman/supply/recompense = new //Cultists are recompensated for the failed convert + recompense.uses = 1 return 0 ticker.mode.add_cultist(M.mind) M.mind.special_role = "Cultist" diff --git a/code/game/machinery/transformer.dm b/code/game/machinery/transformer.dm index 5f00666e819..7855500c080 100644 --- a/code/game/machinery/transformer.dm +++ b/code/game/machinery/transformer.dm @@ -59,12 +59,13 @@ playsound(src.loc, 'sound/machines/buzz-sigh.ogg', 50, 0) return - // Activate the cooldown - cooldown = 1 - update_icon() - spawn(cooldown_duration) - cooldown = 0 + // Activate the cooldown if the human isn't jobbanned + if(!jobban_isbanned(H, "Cyborg")) //Jobbanned players get killed instead + cooldown = 1 update_icon() + spawn(cooldown_duration) + cooldown = 0 + update_icon() playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) H.emote("scream") // It is painful @@ -74,6 +75,10 @@ // Sleep for a couple of ticks to allow the human to see the pain sleep(5) + if(jobban_isbanned(H, "Cyborg")) //Jobbanned players get horribly maimed instead + H.adjustBruteLoss(1000) + playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) + use_power(5000) // Use a lot of power. var/mob/living/silicon/robot/R = H.Robotize(1) // Delete the items or they'll all pile up in a single tile and lag From b0ad8cbf7badeb2d0074c6feb5adbe9024d68378 Mon Sep 17 00:00:00 2001 From: ikarrus Date: Sun, 17 Aug 2014 14:31:45 -0600 Subject: [PATCH 3/7] Missing commit --- code/game/machinery/transformer.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/game/machinery/transformer.dm b/code/game/machinery/transformer.dm index 7855500c080..1aab4cf960d 100644 --- a/code/game/machinery/transformer.dm +++ b/code/game/machinery/transformer.dm @@ -60,7 +60,7 @@ return // Activate the cooldown if the human isn't jobbanned - if(!jobban_isbanned(H, "Cyborg")) //Jobbanned players get killed instead + if(!jobban_isbanned(H, "Cyborg")) cooldown = 1 update_icon() spawn(cooldown_duration) @@ -78,6 +78,7 @@ if(jobban_isbanned(H, "Cyborg")) //Jobbanned players get horribly maimed instead H.adjustBruteLoss(1000) playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) + return use_power(5000) // Use a lot of power. var/mob/living/silicon/robot/R = H.Robotize(1) // Delete the items or they'll all pile up in a single tile and lag From bc49deca2822b6fcb917babe3775e12506f3f40a Mon Sep 17 00:00:00 2001 From: Ikarrus Date: Mon, 18 Aug 2014 22:16:04 -0600 Subject: [PATCH 4/7] Update runes.dm --- code/game/gamemodes/cult/runes.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 013079a1168..4900402384b 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -115,7 +115,7 @@ var/list/sacrificed = list() if(is_convertable_to_cult(M.mind)) if(jobban_isbanned(M, "Syndicate") || jobban_isbanned(M, "cultist")) M.visible_message("A horrified look flashes across [M]'s face before their body goes limp.", \ - "Error: You are currently jobbanned from Cultist.") + "You are currently jobbanned from Cultist.") M.ghostize(0) //Jobbanned players are force ghosted var/obj/item/weapon/paper/talisman/supply/recompense = new //Cultists are recompensated for the failed convert recompense.uses = 1 From f39b26000ed1bf01ded679fc1303bb0273388e21 Mon Sep 17 00:00:00 2001 From: Ikarrus Date: Mon, 18 Aug 2014 22:16:52 -0600 Subject: [PATCH 5/7] Update flash.dm --- code/game/objects/items/devices/flash.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm index 57afe7bb76b..4f26132613a 100644 --- a/code/game/objects/items/devices/flash.dm +++ b/code/game/objects/items/devices/flash.dm @@ -85,7 +85,7 @@ // revsafe = 2 if(!revsafe) if(jobban_isbanned(M, "Syndicate") || jobban_isbanned(M, "revolutionary")) - M << "Error: You are currently jobbanned from Revolutionary." + M << "You are currently jobbanned from Revolutionary." user << "This mind was unable to survive the rigors of conversion and has been wiped clean!" M.ghostize(0) //Jobbanned players are force ghosted else From ed8f92877805ee426c674babf2ba7cd9603d798a Mon Sep 17 00:00:00 2001 From: ikarrus Date: Tue, 19 Aug 2014 20:57:20 -0600 Subject: [PATCH 6/7] -Removed cultist recompense from attempting to convert a jobbanned player -Jobbanned players will now get replaced by a ghost that is not AFK, has it toggled on in preferences, and is not jobbanned itself -Procs that have to do with spawning an antag will now check if the candidate is jobbanned before picking them --- code/__HELPERS/game.dm | 21 +++++++++++++- code/game/gamemodes/antag_spawner.dm | 10 +++---- code/game/gamemodes/blob/blobs/core.dm | 5 +--- code/game/gamemodes/cult/runes.dm | 35 ++++++++---------------- code/game/gamemodes/game_mode.dm | 13 +-------- code/game/objects/items/devices/flash.dm | 8 +++++- code/modules/events/ninja.dm | 5 ++-- 7 files changed, 47 insertions(+), 50 deletions(-) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 12ba4ad3ff8..d4610398991 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -305,11 +305,30 @@ proc/isInSight(var/atom/A, var/atom/B) for(var/mob/dead/observer/G in player_list) if(G.client != null) if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD)) - if(!G.client.is_afk(afk_bracket) && (G.client.prefs.be_special & be_special_flag)) + if(!G.client.is_afk(afk_bracket) && (G.client.prefs.be_special & be_special_flag) && !jobban_isbanned(G, get_roletext(be_special_flag))) candidates += G.client afk_bracket += 600 // Add a minute to the bracket, for every attempt return candidates +/proc/pick_from_candidates(be_special_flag=0) + var/list/candidates = get_candidates(be_special_flag) + if(candidates.len) + var/client/C = pick(candidates) + return C + return 0 //Unable to find a valid candidate + +/proc/get_roletext(role) //Translates role flag to role text + var/roletext + switch(role) + if(BE_CHANGELING) roletext="changeling" + if(BE_TRAITOR) roletext="traitor" + if(BE_OPERATIVE) roletext="operative" + if(BE_WIZARD) roletext="wizard" + if(BE_REV) roletext="revolutionary" + if(BE_CULTIST) roletext="cultist" + if(BE_MONKEY) roletext="monkey" + return roletext + /proc/ScreenText(obj/O, maptext="", screen_loc="CENTER-7,CENTER-7", maptext_height=480, maptext_width=480) if(!isobj(O)) O = new /obj/screen/text() O.maptext = maptext diff --git a/code/game/gamemodes/antag_spawner.dm b/code/game/gamemodes/antag_spawner.dm index 1791a7319c7..f325d17a22a 100644 --- a/code/game/gamemodes/antag_spawner.dm +++ b/code/game/gamemodes/antag_spawner.dm @@ -53,10 +53,9 @@ if (used) H << "You already used this contract!" return - var/list/candidates = get_candidates(BE_WIZARD) - if(candidates.len) + var/client/C = pick_from_candidates(BE_WIZARD) + if(C) src.used = 1 - var/client/C = pick(candidates) spawn_antag(C, get_turf(H.loc), href_list["school"]) else H << "Unable to reach your apprentice! You can either attack the spellbook with the contract to refund your points, or wait and try again later." @@ -126,10 +125,9 @@ if(used) user << "The teleporter is out of power." return - var/list/borg_candicates = get_candidates(BE_OPERATIVE) - if(borg_candicates.len > 0) + var/client/C = pick_from_candidates(BE_OPERATIVE) + if(C) used = 1 - var/client/C = pick(borg_candicates) spawn_antag(C, get_turf(src.loc), "syndieborg") else user << "Unable to connect to Syndicate Command. Please wait and try again later or use the teleporter on your uplink to get your points refunded." diff --git a/code/game/gamemodes/blob/blobs/core.dm b/code/game/gamemodes/blob/blobs/core.dm index fd3ce5d5a5b..8b22ec11e44 100644 --- a/code/game/gamemodes/blob/blobs/core.dm +++ b/code/game/gamemodes/blob/blobs/core.dm @@ -72,12 +72,9 @@ qdel(overmind) var/client/C = null - var/list/candidates = list() if(!new_overmind) - candidates = get_candidates(BE_BLOB) - if(candidates.len) - C = pick(candidates) + C = pick_from_candidates(BE_BLOB) else C = new_overmind diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 4900402384b..7654c20fecd 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -114,32 +114,21 @@ var/list/sacrificed = list() "You hear an anguished scream.") if(is_convertable_to_cult(M.mind)) if(jobban_isbanned(M, "Syndicate") || jobban_isbanned(M, "cultist")) - M.visible_message("A horrified look flashes across [M]'s face before their body goes limp.", \ + M.visible_message("[M] screams horrifically before falling limp, his mind clearly broken by something he saw.", \ "You are currently jobbanned from Cultist.") M.ghostize(0) //Jobbanned players are force ghosted - var/obj/item/weapon/paper/talisman/supply/recompense = new //Cultists are recompensated for the failed convert - recompense.uses = 1 - return 0 - ticker.mode.add_cultist(M.mind) - M.mind.special_role = "Cultist" - M << "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root." - M << "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back." -/*//convert no longer gives words - //picking which word to use - if(usr.mind.cult_words.len != ticker.mode.allwords.len) // No point running if they already know everything - var/convert_word - for(var/i=1, i<=3, i++) - convert_word = pick(ticker.mode.grantwords) - if(convert_word in usr.mind.cult_words) - if(i==3) convert_word = null //NOTE: If max loops is changed ensure this condition is changed to match /Mal - else - break - if(!convert_word) - usr << "\red This Convert was unworthy of knowledge of the other side!" + var/client/C = pick_from_candidates(BE_CULTIST) //Try to find a suitable observer to replace the jobbanned player + if(C) + M.key = C.key + M << "Who are you? How did you get here? You can't seem to remember anything but..." else - usr << "\red The Geometer of Blood is pleased to see his followers grow in numbers." - ticker.mode.grant_runeword(usr, convert_word) - return 1 */ + M.resting = 0 + if(M.key) + ticker.mode.add_cultist(M.mind) + M.mind.special_role = "Cultist" + M << "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root." + M << "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back." + else M << "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root." M << "And not a single fuck was given, exterminate the cult at all costs." diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 7d6f10c52cc..7d3bdc093de 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -218,16 +218,7 @@ var/list/drafted = list() var/datum/mind/applicant = null - var/roletext - switch(role) - if(BE_CHANGELING) roletext="changeling" - if(BE_TRAITOR) roletext="traitor" - if(BE_OPERATIVE) roletext="operative" - if(BE_WIZARD) roletext="wizard" - if(BE_REV) roletext="revolutionary" - if(BE_CULTIST) roletext="cultist" - if(BE_MONKEY) roletext="monkey" - + var/roletext = get_roletext(role) // Ultimate randomizing code right here for(var/mob/new_player/player in player_list) @@ -387,8 +378,6 @@ proc/display_roundstart_logout_report() msg += "[L.name] ([ckey(D.mind.key)]), the [L.job] (Ghosted)\n" continue //Ghosted while alive - - for(var/mob/M in mob_list) if(M.client && M.client.holder) M << msg \ No newline at end of file diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm index 4f26132613a..e02d50907c0 100644 --- a/code/game/objects/items/devices/flash.dm +++ b/code/game/objects/items/devices/flash.dm @@ -88,7 +88,13 @@ M << "You are currently jobbanned from Revolutionary." user << "This mind was unable to survive the rigors of conversion and has been wiped clean!" M.ghostize(0) //Jobbanned players are force ghosted - else + var/client/C = pick_from_candidates(BE_REV) //Try to find a suitable observer to replace the jobbanned player + if(C) + M.key = C.key + M << "Who are you? How did you get here? You can't seem to remember anything but..." + else + M.resting = 0 + if(M.key) M.mind.has_been_rev = 1 ticker.mode.add_revolutionary(M.mind) else if(revsafe == 1) diff --git a/code/modules/events/ninja.dm b/code/modules/events/ninja.dm index 06c821888bc..e134d619597 100644 --- a/code/modules/events/ninja.dm +++ b/code/modules/events/ninja.dm @@ -41,10 +41,9 @@ //selecting a candidate player if(!key) - var/list/candidates = get_candidates(BE_NINJA) - if(!candidates.len) + var/client/C = pick_from_candidates(BE_NINJA) + if(!C) return kill() - var/client/C = pick(candidates) key = C.key if(!key) return kill() From dbf7392649e1ab07a1a7e5cd29edefde9034d4cd Mon Sep 17 00:00:00 2001 From: ikarrus Date: Wed, 3 Sep 2014 23:36:23 -0600 Subject: [PATCH 7/7] Every time we would have pulled a random ghost into a mob, we will poll the ghosts for volunteers first. --- code/__HELPERS/game.dm | 43 ++++++--- code/game/gamemodes/antag_spawner.dm | 15 ++- code/game/gamemodes/blob/blobs/core.dm | 23 ++--- code/game/gamemodes/cult/cult.dm | 7 +- code/game/gamemodes/cult/runes.dm | 28 +++--- code/game/objects/items/devices/flash.dm | 16 ++-- code/modules/admin/verbs/one_click_antag.dm | 91 +++---------------- code/modules/events/alien_infestation.dm | 2 +- .../carbon/alien/special/alien_embryo.dm | 14 ++- 9 files changed, 104 insertions(+), 135 deletions(-) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 1009a29da95..9d67bff3289 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -295,27 +295,42 @@ return M return null -// Will return a list of active candidates. It increases the buffer 5 times until it finds a candidate which is active within the buffer. +// Will poll ghosts for volunteers +/proc/get_candidates(be_special_flag=0, rolename=null, wait_time=200) + var/list/mob/dead/observer/volunteers = list() + var/list/client/candidates = list() + var/time_passed = world.time + + for(var/mob/dead/observer/G in player_list) + spawn(0) + if(!G.client) + return + if((G.client.prefs.be_special & be_special_flag) && !jobban_isbanned(G, get_roletext(be_special_flag)) || (be_special_flag < 0)) + switch(alert(G,"Do you want to be considered to be a [rolename ? rolename : get_roletext(be_special_flag)]?","Please answer in [wait_time/10] seconds!","Yes","No")) + if("Yes") + if((world.time-time_passed)>wait_time) + return + volunteers += G + if("No") + return + else + return + sleep(wait_time) + + for(var/mob/dead/observer/G in volunteers) + if(G.client) + candidates += G.client -/proc/get_candidates(be_special_flag=0, afk_bracket=3000) - var/list/candidates = list() - // Keep looping until we find a non-afk candidate within the time bracket (we limit the bracket to 10 minutes (6000)) - while(!candidates.len && afk_bracket < 6000) - for(var/mob/dead/observer/G in player_list) - if(G.client != null) - if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD)) - if(!G.client.is_afk(afk_bracket) && (G.client.prefs.be_special & be_special_flag) && !jobban_isbanned(G, get_roletext(be_special_flag))) - candidates += G.client - afk_bracket += 600 // Add a minute to the bracket, for every attempt return candidates -/proc/pick_from_candidates(be_special_flag=0) - var/list/candidates = get_candidates(be_special_flag) +/proc/pick_from_candidates(be_special_flag=0, rolename=null, wait_time=200) + var/list/candidates = get_candidates(be_special_flag, rolename, wait_time) if(candidates.len) var/client/C = pick(candidates) return C return 0 //Unable to find a valid candidate + /proc/get_roletext(role) //Translates role flag to role text var/roletext switch(role) @@ -326,6 +341,8 @@ if(BE_REV) roletext="revolutionary" if(BE_CULTIST) roletext="cultist" if(BE_MONKEY) roletext="monkey" + if(BE_NINJA) roletext="ninja" + if(BE_ALIEN) roletext="alien" return roletext /proc/ScreenText(obj/O, maptext="", screen_loc="CENTER-7,CENTER-7", maptext_height=480, maptext_width=480) diff --git a/code/game/gamemodes/antag_spawner.dm b/code/game/gamemodes/antag_spawner.dm index f325d17a22a..9f2ecfdccea 100644 --- a/code/game/gamemodes/antag_spawner.dm +++ b/code/game/gamemodes/antag_spawner.dm @@ -3,6 +3,7 @@ throw_range = 5 w_class = 1.0 var/used = 0 + var/polling_ghosts = 0 /obj/item/weapon/antag_spawner/proc/spawn_antag(var/client/C, var/turf/T, var/type = "") return @@ -42,7 +43,7 @@ ..() var/mob/living/carbon/human/H = usr - if(H.stat || H.restrained()) + if(H.stat || H.restrained() || polling_ghosts) return if(!istype(H, /mob/living/carbon/human)) return 1 @@ -53,7 +54,10 @@ if (used) H << "You already used this contract!" return - var/client/C = pick_from_candidates(BE_WIZARD) + H << "You send out a call for aid into the realms! It will be about 20 seconds before you get a response." + polling_ghosts = 1 + var/client/C = pick_from_candidates(BE_WIZARD, "wizard's apprentice") + polling_ghosts = 0 if(C) src.used = 1 spawn_antag(C, get_turf(H.loc), href_list["school"]) @@ -122,10 +126,15 @@ var/TC_cost = 0 /obj/item/weapon/antag_spawner/borg_tele/attack_self(mob/user as mob) + if(polling_ghosts) + return if(used) user << "The teleporter is out of power." return - var/client/C = pick_from_candidates(BE_OPERATIVE) + user << "Standby for reinforcements... ETA 20 seconds." + polling_ghosts = 1 + var/client/C = pick_from_candidates(BE_OPERATIVE, "Syndicate cyborg") + polling_ghosts = 0 if(C) used = 1 spawn_antag(C, get_turf(src.loc), "syndieborg") diff --git a/code/game/gamemodes/blob/blobs/core.dm b/code/game/gamemodes/blob/blobs/core.dm index 8b22ec11e44..a179d503ce1 100644 --- a/code/game/gamemodes/blob/blobs/core.dm +++ b/code/game/gamemodes/blob/blobs/core.dm @@ -73,16 +73,17 @@ var/client/C = null - if(!new_overmind) - C = pick_from_candidates(BE_BLOB) - else - C = new_overmind + spawn(0) + if(!new_overmind) + C = pick_from_candidates(BE_BLOB) + else + C = new_overmind - if(C) - var/mob/camera/blob/B = new(src.loc) - B.key = C.key - B.blob_core = src - src.overmind = B - return 1 - return 0 + if(C) + var/mob/camera/blob/B = new(src.loc) + B.key = C.key + B.blob_core = src + src.overmind = B + return 1 + return 0 diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm index bc51727f202..bebc960e665 100644 --- a/code/game/gamemodes/cult/cult.dm +++ b/code/game/gamemodes/cult/cult.dm @@ -103,7 +103,7 @@ // grant_runeword(cult_mind.current) // grant_secondword(cult_mind.current) update_cult_icons_added(cult_mind) - cult_mind.current << "You are a member of the cult!" + cult_mind.current << "You are a member of the cult!" memorize_cult_objectives(cult_mind) cult_mind.special_role = "Cultist" ..() @@ -131,6 +131,11 @@ // grant_runeword(cult_mind.current,"blood") // grant_runeword(cult_mind.current,"hell") +/datum/game_mode/proc/greet_cultist(mob/M) + M << "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root." + M << "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back." + + /datum/game_mode/proc/equip_cultist(mob/living/carbon/human/mob) if(!istype(mob)) return diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index d6d1e0d56a5..c98545b4f00 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -117,17 +117,19 @@ var/list/sacrificed = list() M.visible_message("[M] screams horrifically before falling limp, his mind clearly broken by something he saw.", \ "You are currently jobbanned from Cultist.") M.ghostize(0) //Jobbanned players are force ghosted - var/client/C = pick_from_candidates(BE_CULTIST) //Try to find a suitable observer to replace the jobbanned player - if(C) - M.key = C.key - M << "Who are you? How did you get here? You can't seem to remember anything but..." - else - M.resting = 0 - if(M.key) + M.resting = 1 + spawn(0) + var/client/C = pick_from_candidates(BE_CULTIST) //Try to find a suitable observer to replace the jobbanned player + if(C) + M.key = C.key + M << "Who are you? How did you get here? You can't seem to remember anything but..." + ticker.mode.add_cultist(M.mind) + M.mind.special_role = "Cultist" + ticker.mode.greet_cultist(M) + else ticker.mode.add_cultist(M.mind) M.mind.special_role = "Cultist" - M << "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root." - M << "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back." + ticker.mode.greet_cultist(M) else M << "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root." @@ -339,12 +341,11 @@ var/list/sacrificed = list() body_to_sacrifice.gib() // if(ticker.mode.name == "cult") -// ticker.mode:add_cultist(corpse_to_raise.mind) +// ticker.mode: corpse_to_raise.mind) // else // ticker.mode.cult |= corpse_to_raise.mind - corpse_to_raise << "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root." - corpse_to_raise << "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back." + ticker.mode.greet_cultist(corpse_to_raise) return @@ -435,8 +436,7 @@ var/list/sacrificed = list() ticker.mode.cult+=D.mind D.mind.special_role = "Cultist" - D << "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root." - D << "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back." + ticker.mode.greet_cultist(D) var/mob/living/user = usr while(this_rune && user && user.stat==CONSCIOUS && user.client && user.loc==this_rune.loc) diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm index 1bac924ecdb..b09865e9d6b 100644 --- a/code/game/objects/items/devices/flash.dm +++ b/code/game/objects/items/devices/flash.dm @@ -88,13 +88,15 @@ M << "You are currently jobbanned from Revolutionary." user << "This mind was unable to survive the rigors of conversion and has been wiped clean!" M.ghostize(0) //Jobbanned players are force ghosted - var/client/C = pick_from_candidates(BE_REV) //Try to find a suitable observer to replace the jobbanned player - if(C) - M.key = C.key - M << "Who are you? How did you get here? You can't seem to remember anything but..." - else - M.resting = 0 - if(M.key) + M.resting = 1 + spawn(0) + var/client/C = pick_from_candidates(BE_REV) //Try to find a suitable observer to replace the jobbanned player + if(C) + M.key = C.key + M << "Who are you? How did you get here? You can't seem to remember anything but..." + M.mind.has_been_rev = 1 + ticker.mode.add_revolutionary(M.mind) + else M.mind.has_been_rev = 1 ticker.mode.add_revolutionary(M.mind) else if(revsafe == 1) diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm index c70fed34e0c..3c6a2444b05 100644 --- a/code/modules/admin/verbs/one_click_antag.dm +++ b/code/modules/admin/verbs/one_click_antag.dm @@ -146,35 +146,10 @@ client/proc/one_click_antag() return 0 /datum/admins/proc/makeWizard() - var/list/mob/dead/observer/candidates = list() - var/mob/dead/observer/theghost = null - var/time_passed = world.time + var/client/C = pick_from_candidates(BE_WIZARD) - for(var/mob/dead/observer/G in player_list) - if(!jobban_isbanned(G, "wizard") && !jobban_isbanned(G, "Syndicate")) - spawn(0) - switch(alert(G, "Do you wish to be considered for the position of Space Wizard Foundation 'diplomat'?","Please answer in 30 seconds!","Yes","No")) - if("Yes") - if((world.time-time_passed)>300)//If more than 30 game seconds passed. - return - candidates += G - if("No") - return - else - return - - sleep(300) - - if(candidates.len) - shuffle(candidates) - for(var/mob/i in candidates) - if(!i || !i.client) continue //Dont bother removing them from the list since we only grab one wizard - - theghost = i - break - - if(theghost) - var/mob/living/carbon/human/new_character=makeBody(theghost) + if(C) + var/mob/living/carbon/human/new_character=makeBody(C.mob) new_character.mind.make_Wizard() return 1 @@ -216,42 +191,22 @@ client/proc/one_click_antag() /datum/admins/proc/makeNukeTeam() - var/list/mob/dead/observer/candidates = list() + var/list/candidates = get_candidates(BE_OPERATIVE) + var/list/mob/dead/observer/chosen = list() - var/mob/dead/observer/theghost = null - var/time_passed = world.time - - for(var/mob/dead/observer/G in player_list) - if(!jobban_isbanned(G, "operative") && !jobban_isbanned(G, "Syndicate")) - spawn(0) - switch(alert(G,"Do you wish to be considered for a nuke team being sent in?","Please answer in 30 seconds!","Yes","No")) - if("Yes") - if((world.time-time_passed)>300)//If more than 30 game seconds passed. - return - candidates += G - if("No") - return - else - return - - sleep(300) + var/client/C = null if(candidates.len) var/numagents = 5 var/agentcount = 0 for(var/i = 0, i300)//If more than 30 game seconds passed. - return - candidates += G - if("No") - return - else - return - sleep(300) - - for(var/mob/dead/observer/G in candidates) - if(!G.key) - candidates.Remove(G) + var/list/candidates = get_candidates(-1, "member of a Nanotrasen strike team") if(candidates.len >= 3) //Minimum 3 to be considered a squad //Pick the lucky players var/numagents = min(5,candidates.len) //How many commandos to spawn while(numagents && deathsquadspawn.len && candidates.len) var/spawnloc = deathsquadspawn[1] - var/mob/dead/observer/chosen_candidate = pick(candidates) + var/client/C = pick(candidates) + var/mob/dead/observer/chosen_candidate = C.mob candidates -= chosen_candidate if(!chosen_candidate.key) continue diff --git a/code/modules/events/alien_infestation.dm b/code/modules/events/alien_infestation.dm index c4c82a9cf45..b96f2d5472e 100644 --- a/code/modules/events/alien_infestation.dm +++ b/code/modules/events/alien_infestation.dm @@ -32,7 +32,7 @@ if(temp_vent.network.normal_members.len > 20) //Stops Aliens getting stuck in small networks. See: Security, Virology vents += temp_vent - var/list/candidates = get_candidates(BE_ALIEN, ALIEN_AFK_BRACKET) + var/list/candidates = get_candidates(BE_ALIEN) while(spawncount > 0 && vents.len && candidates.len) var/obj/vent = pick_n_take(vents) diff --git a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm index b895068c1c2..5c2d03085cf 100644 --- a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm +++ b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm @@ -9,6 +9,7 @@ var/const/ALIEN_AFK_BRACKET = 450 // 45 seconds icon_state = "larva0_dead" var/mob/living/affected_mob var/stage = 0 + var/polling_ghosts = 0 /obj/item/alien_embryo/New() if(istype(loc, /mob/living)) @@ -70,23 +71,20 @@ var/const/ALIEN_AFK_BRACKET = 450 // 45 seconds affected_mob << "You feel something tearing its way out of your stomach..." affected_mob.adjustToxLoss(10) affected_mob.updatehealth() - if(prob(50)) + if(prob(50) && !polling_ghosts) AttemptGrow() /obj/item/alien_embryo/proc/AttemptGrow(var/gib_on_success = 1) - var/list/candidates = get_candidates(BE_ALIEN, ALIEN_AFK_BRACKET) - var/client/C = null + polling_ghosts = 1 + var/client/C = pick_from_candidates(BE_ALIEN) + polling_ghosts = 0 // To stop clientless larva, we will check that our host has a client // if we find no ghosts to become the alien. If the host has a client // he will become the alien but if he doesn't then we will set the stage // to 2, so we don't do a process heavy check everytime. - if(candidates.len) - C = pick(candidates) - else if(affected_mob.client) - C = affected_mob.client - else + if(!C) stage = 4 // Let's try again later. return