diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index bd077204f00..181d2a5140c 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -425,66 +425,8 @@ if(pressure <= LAVALAND_EQUIPMENT_EFFECT_PRESSURE) . = TRUE -proc/pollCandidates(Question, be_special_type, antag_age_check = FALSE, poll_time = 300, ignore_respawnability = FALSE, min_hours = 0, flashwindow = TRUE, check_antaghud = TRUE) - var/roletext = be_special_type ? get_roletext(be_special_type) : null - var/list/mob/dead/observer/candidates = list() - var/time_passed = world.time - if(!Question) - Question = "Would you like to be a special role?" - - for(var/mob/dead/observer/G in (ignore_respawnability ? GLOB.player_list : GLOB.respawnable_list)) - if(!G.key || !G.client) - continue - if(be_special_type) - if(!(be_special_type in G.client.prefs.be_special)) - continue - if(antag_age_check) - if(!player_old_enough_antag(G.client, be_special_type)) - continue - if(roletext) - if(jobban_isbanned(G, roletext) || jobban_isbanned(G, "Syndicate")) - continue - if(config.use_exp_restrictions && min_hours) - if(G.client.get_exp_type_num(EXP_TYPE_LIVING) < min_hours * 60) - continue - if(check_antaghud && cannotPossess(G)) - continue - spawn(0) - G << 'sound/misc/notice2.ogg'//Alerting them to their consideration - if(flashwindow) - window_flash(G.client) - var/ans = alert(G,Question,"Please answer in [poll_time/10] seconds!","No","Yes","Not This Round") - if(!G?.client) - return - switch(ans) - if("Yes") - to_chat(G, "Choice registered: Yes.") - if((world.time-time_passed)>poll_time)//If more than 30 game seconds passed. - to_chat(G, "Sorry, you were too late for the consideration!") - G << 'sound/machines/buzz-sigh.ogg' - return - candidates += G - if("No") - to_chat(G, "Choice registered: No.") - return - if("Not This Round") - to_chat(G, "Choice registered: No.") - to_chat(G, "You will no longer receive notifications for the role '[roletext]' for the rest of the round.") - G.client.prefs.be_special -= be_special_type - return - else - return - sleep(poll_time) - - //Check all our candidates, to make sure they didn't log off during the 30 second wait period. - for(var/mob/dead/observer/G in candidates) - if(!G.key || !G.client) - candidates.Remove(G) - - return candidates - -/proc/pollCandidatesWithVeto(adminclient, adminusr, max_slots, Question, be_special_type, antag_age_check = 0, poll_time = 300, ignore_respawnability = 0, min_hours = 0, flashwindow = TRUE, check_antaghud = TRUE) - var/list/willing_ghosts = pollCandidates(Question, be_special_type, antag_age_check, poll_time, ignore_respawnability, min_hours, flashwindow, check_antaghud) +/proc/pollCandidatesWithVeto(adminclient, adminusr, max_slots, Question, be_special_type, antag_age_check = FALSE, poll_time = 300, ignore_respawnability = FALSE, min_hours = FALSE, flashwindow = TRUE, check_antaghud = TRUE, source) + var/list/willing_ghosts = SSghost_spawns.poll_candidates(Question, be_special_type, antag_age_check, poll_time, ignore_respawnability, min_hours, flashwindow, check_antaghud, source) var/list/selected_ghosts = list() if(!willing_ghosts.len) return selected_ghosts diff --git a/code/controllers/subsystem/ghost_spawns.dm b/code/controllers/subsystem/ghost_spawns.dm index 84282bf3176..5c85ecf76c6 100644 --- a/code/controllers/subsystem/ghost_spawns.dm +++ b/code/controllers/subsystem/ghost_spawns.dm @@ -40,7 +40,7 @@ SUBSYSTEM_DEF(ghost_spawns) * * min_hours - The amount of hours needed for a potential candidate to be eligible * * flash_window - Whether the poll should flash a potential candidate's game window * * check_antaghud - Whether to filter out potential candidates who enabled AntagHUD - * * source - The atom or atom prototype to display as an icon in the alert + * * source - The atom, atom prototype, icon or mutable appearance to display as an icon in the alert */ /datum/controller/subsystem/ghost_spawns/proc/poll_candidates(question = "Would you like to play a special role?", role, antag_age_check = FALSE, poll_time = 30 SECONDS, ignore_respawnability = FALSE, min_hours = 0, flash_window = TRUE, check_antaghud = TRUE, source) log_debug("Polling candidates [role ? "for [get_roletext(role)]" : "\"[question]\""] for [poll_time / 10] seconds") diff --git a/code/game/gamemodes/blob/blobs/core.dm b/code/game/gamemodes/blob/blobs/core.dm index be794b9092b..b4c01609653 100644 --- a/code/game/gamemodes/blob/blobs/core.dm +++ b/code/game/gamemodes/blob/blobs/core.dm @@ -104,10 +104,18 @@ var/mob/C = null var/list/candidates = list() if(!new_overmind) + // Create icon + var/mutable_appearance/MA = new + var/mutable_appearance/MA1 = new(icon, "blob") + MA1.color = overmind ? overmind.blob_reagent_datum.color : color + MA.overlays += MA1 + var/mutable_appearance/MA2 = new(icon, "blob_core_overlay") + MA.overlays += MA2 + // sendit if(is_offspring) - candidates = pollCandidates("Do you want to play as a blob offspring?", ROLE_BLOB, 1) + candidates = SSghost_spawns.poll_candidates("Do you want to play as a blob offspring?", ROLE_BLOB, TRUE, source = MA) else - candidates = pollCandidates("Do you want to play as a blob?", ROLE_BLOB, 1) + candidates = SSghost_spawns.poll_candidates("Do you want to play as a blob?", ROLE_BLOB, TRUE, source = MA) if(length(candidates)) C = pick(candidates) diff --git a/code/game/gamemodes/blob/powers.dm b/code/game/gamemodes/blob/powers.dm index 6f2eed39499..ec354d4d1c4 100644 --- a/code/game/gamemodes/blob/powers.dm +++ b/code/game/gamemodes/blob/powers.dm @@ -237,7 +237,7 @@ blobber.AIStatus = AI_OFF blobber.LoseTarget() spawn() - var/list/candidates = pollCandidates("Do you want to play as a blobbernaut?", ROLE_BLOB, 1, 100) + var/list/candidates = SSghost_spawns.poll_candidates("Do you want to play as a blobbernaut?", ROLE_BLOB, TRUE, 10 SECONDS, source = blobber) if(candidates.len) var/mob/C = pick(candidates) if(C) diff --git a/code/game/gamemodes/miniantags/guardian/guardian.dm b/code/game/gamemodes/miniantags/guardian/guardian.dm index f647ae5a6d1..0bb48fc55ed 100644 --- a/code/game/gamemodes/miniantags/guardian/guardian.dm +++ b/code/game/gamemodes/miniantags/guardian/guardian.dm @@ -246,7 +246,7 @@ src.verbs -= /mob/living/proc/guardian_reset for(var/mob/living/simple_animal/hostile/guardian/G in GLOB.mob_list) if(G.summoner == src) - var/list/mob/dead/observer/candidates = pollCandidates("Do you want to play as [G.real_name]?", ROLE_GUARDIAN, 0, 100) + var/list/mob/dead/observer/candidates = SSghost_spawns.poll_candidates("Do you want to play as [G.real_name]?", ROLE_GUARDIAN, FALSE, 10 SECONDS, source = G) var/mob/dead/observer/new_stand = null if(candidates.len) new_stand = pick(candidates) @@ -312,7 +312,7 @@ used = FALSE return to_chat(user, "[use_message]") - var/list/mob/dead/observer/candidates = pollCandidates("Do you want to play as the [mob_name] of [user.real_name]?", ROLE_GUARDIAN, 0, 100) + var/list/mob/dead/observer/candidates = SSghost_spawns.poll_candidates("Do you want to play as the [mob_name] of [user.real_name]?", ROLE_GUARDIAN, FALSE, 10 SECONDS, source = /mob/living/simple_animal/hostile/guardian) var/mob/dead/observer/theghost = null if(candidates.len) diff --git a/code/game/gamemodes/miniantags/morph/morph_event.dm b/code/game/gamemodes/miniantags/morph/morph_event.dm index e9465492a27..7fc9e134195 100644 --- a/code/game/gamemodes/miniantags/morph/morph_event.dm +++ b/code/game/gamemodes/miniantags/morph/morph_event.dm @@ -3,7 +3,7 @@ /datum/event/spawn_morph/proc/get_morph() spawn() - var/list/candidates = pollCandidates("Do you want to play as a morph?", ROLE_MORPH, 1) + var/list/candidates = SSghost_spawns.poll_candidates("Do you want to play as a morph?", ROLE_MORPH, TRUE, source = /mob/living/simple_animal/hostile/morph) if(!candidates.len) key_of_morph = null return kill() diff --git a/code/game/gamemodes/miniantags/revenant/revenant.dm b/code/game/gamemodes/miniantags/revenant/revenant.dm index f86f018757e..3e77dda7e3e 100644 --- a/code/game/gamemodes/miniantags/revenant/revenant.dm +++ b/code/game/gamemodes/miniantags/revenant/revenant.dm @@ -140,7 +140,7 @@ giveObjectivesandGoals() giveSpells() else - var/list/mob/dead/observer/candidates = pollCandidates("Do you want to play as a revenant?", poll_time = 15 SECONDS) + var/list/mob/dead/observer/candidates = SSghost_spawns.poll_candidates("Do you want to play as a revenant?", poll_time = 15 SECONDS, source = /mob/living/simple_animal/revenant) var/mob/dead/observer/theghost = null if(candidates.len) theghost = pick(candidates) @@ -396,7 +396,7 @@ spawn() if(!key_of_revenant) message_admins("The new revenant's old client either could not be found or is in a new, living mob - grabbing a random candidate instead...") - var/list/candidates = pollCandidates("Do you want to play as a revenant?", ROLE_REVENANT, 1) + var/list/candidates = SSghost_spawns.poll_candidates("Do you want to play as a revenant?", ROLE_REVENANT, TRUE, source = /mob/living/simple_animal/revenant) if(!candidates.len) qdel(R) message_admins("No candidates were found for the new revenant. Oh well!") diff --git a/code/game/gamemodes/miniantags/revenant/revenant_spawn_event.dm b/code/game/gamemodes/miniantags/revenant/revenant_spawn_event.dm index 5e5f0f87a79..aa76f3620ac 100644 --- a/code/game/gamemodes/miniantags/revenant/revenant_spawn_event.dm +++ b/code/game/gamemodes/miniantags/revenant/revenant_spawn_event.dm @@ -13,7 +13,7 @@ return spawn() - var/list/candidates = pollCandidates("Do you want to play as a revenant?", ROLE_REVENANT, 1) + var/list/candidates = SSghost_spawns.poll_candidates("Do you want to play as a revenant?", ROLE_REVENANT, TRUE, source = /mob/living/simple_animal/revenant) if(!candidates.len) key_of_revenant = null return kill() diff --git a/code/game/gamemodes/miniantags/slaughter/slaughter.dm b/code/game/gamemodes/miniantags/slaughter/slaughter.dm index d7e53bdae28..e58be201521 100644 --- a/code/game/gamemodes/miniantags/slaughter/slaughter.dm +++ b/code/game/gamemodes/miniantags/slaughter/slaughter.dm @@ -157,7 +157,7 @@ /mob/living/simple_animal/slaughter/cult/New() ..() spawn(5) - var/list/demon_candidates = pollCandidates("Do you want to play as a slaughter demon?", ROLE_DEMON, 1, 100) + var/list/demon_candidates = SSghost_spawns.poll_candidates("Do you want to play as a slaughter demon?", ROLE_DEMON, TRUE, 10 SECONDS, source = /mob/living/simple_animal/slaughter/cult) if(!demon_candidates.len) visible_message("[src] disappears in a flash of red light!") qdel(src) diff --git a/code/game/gamemodes/wizard/artefact.dm b/code/game/gamemodes/wizard/artefact.dm index 09b228bdd0c..551cbd04ef1 100644 --- a/code/game/gamemodes/wizard/artefact.dm +++ b/code/game/gamemodes/wizard/artefact.dm @@ -50,7 +50,8 @@ to_chat(H, "You already used this contract!") return used = 1 - var/list/candidates = pollCandidates("Do you want to play as the wizard apprentice of [H.real_name]?", ROLE_WIZARD, 1) + var/mutable_appearance/source = new('icons/obj/cardboard_cutout.dmi', "cutout_wizard") + var/list/candidates = SSghost_spawns.poll_candidates("Do you want to play as the wizard apprentice of [H.real_name]?", ROLE_WIZARD, TRUE, source = source) if(candidates.len) var/mob/C = pick(candidates) new /obj/effect/particle_effect/smoke(H.loc) @@ -307,7 +308,8 @@ GLOBAL_LIST_EMPTY(multiverse) if(M.assigned == assigned) M.cooldown = cooldown - var/list/candidates = pollCandidates("Do you want to play as the wizard apprentice of [user.real_name]?", ROLE_WIZARD, 1, 100) + var/mutable_appearance/source = new('icons/obj/cardboard_cutout.dmi', "cutout_wizard") + var/list/candidates = SSghost_spawns.poll_candidates("Do you want to play as the wizard apprentice of [user.real_name]?", ROLE_WIZARD, TRUE, 10 SECONDS, source = source) if(candidates.len) var/mob/C = pick(candidates) spawn_copy(C.client, get_turf(user.loc), user) diff --git a/code/game/gamemodes/wizard/raginmages.dm b/code/game/gamemodes/wizard/raginmages.dm index cc52b431249..b189c98524f 100644 --- a/code/game/gamemodes/wizard/raginmages.dm +++ b/code/game/gamemodes/wizard/raginmages.dm @@ -118,7 +118,8 @@ return FALSE making_mage = TRUE - var/list/mob/dead/observer/candidates = pollCandidates("Do you want to play as a raging Space Wizard?", ROLE_WIZARD, TRUE, poll_time = 20 SECONDS) + var/mutable_appearance/source = new('icons/obj/cardboard_cutout.dmi', "cutout_wizard") + var/list/mob/dead/observer/candidates = SSghost_spawns.poll_candidates("Do you want to play as a raging Space Wizard?", ROLE_WIZARD, TRUE, poll_time = 20 SECONDS, source = source) var/mob/dead/observer/harry = null message_admins("SWF is still pissed, sending another wizard - [max_mages - mages_made] left.") diff --git a/code/game/gamemodes/wizard/soulstone.dm b/code/game/gamemodes/wizard/soulstone.dm index 4bda254d930..aab4318c774 100644 --- a/code/game/gamemodes/wizard/soulstone.dm +++ b/code/game/gamemodes/wizard/soulstone.dm @@ -363,7 +363,7 @@ break if(!chosen_ghost) //Failing that, we grab a ghost - var/list/consenting_candidates = pollCandidates("Would you like to play as a Shade?", ROLE_CULTIST, FALSE, poll_time = 100) + var/list/consenting_candidates = SSghost_spawns.poll_candidates("Would you like to play as a Shade?", ROLE_CULTIST, FALSE, poll_time = 10 SECONDS, source = /mob/living/simple_animal/shade) if(consenting_candidates.len) chosen_ghost = pick(consenting_candidates) if(!T) diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index 7af5d7a998f..78cef6997bc 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -180,7 +180,7 @@ if(player_spiders && !selecting_player) selecting_player = 1 spawn() - var/list/candidates = pollCandidates("Do you want to play as a spider?", ROLE_GSPIDER, 1) + var/list/candidates = SSghost_spawns.poll_candidates("Do you want to play as a spider?", ROLE_GSPIDER, TRUE, source = S) if(candidates.len) var/mob/C = pick(candidates) diff --git a/code/game/objects/items/weapons/holy_weapons.dm b/code/game/objects/items/weapons/holy_weapons.dm index 4efb6994e8d..26e30ba8619 100644 --- a/code/game/objects/items/weapons/holy_weapons.dm +++ b/code/game/objects/items/weapons/holy_weapons.dm @@ -255,7 +255,7 @@ possessed = TRUE - var/list/mob/dead/observer/candidates = pollCandidates("Do you want to play as the spirit of [user.real_name]'s blade?", ROLE_PAI, 0, 100) + var/list/mob/dead/observer/candidates = SSghost_spawns.poll_candidates("Do you want to play as the spirit of [user.real_name]'s blade?", ROLE_PAI, FALSE, 10 SECONDS, source = src) var/mob/dead/observer/theghost = null if(candidates.len) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index ac8adc5fdf0..8f82cf4dd47 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1833,7 +1833,7 @@ var/petchoice = input("Select pet type", "Pets") as null|anything in pets if(isnull(petchoice)) return - var/list/mob/dead/observer/candidates = pollCandidates("Play as the special event pet [H]?", poll_time = 200, min_hours = 10) + var/list/mob/dead/observer/candidates = SSghost_spawns.poll_candidates("Play as the special event pet [H]?", poll_time = 20 SECONDS, min_hours = 10, source = petchoice) var/mob/dead/observer/theghost = null if(candidates.len) var/mob/living/simple_animal/pet/P = new petchoice(H.loc) @@ -3437,7 +3437,8 @@ return var/datum/outfit/O = hunter_outfits[dresscode] message_admins("[key_name_admin(mob)] is sending a ([dresscode]) to [killthem ? "assassinate" : "protect"] [key_name_admin(H)]...") - var/list/candidates = pollCandidates("Play as a [killthem ? "murderous" : "protective"] [dresscode]?", ROLE_TRAITOR, 1) + var/mutable_appearance/source = new('icons/obj/cardboard_cutout.dmi', "cutout_traitor") + var/list/candidates = SSghost_spawns.poll_candidates("Play as a [killthem ? "murderous" : "protective"] [dresscode]?", ROLE_TRAITOR, TRUE, source = source) if(!candidates.len) to_chat(usr, "ERROR: Could not create eventmob. No valid candidates.") return diff --git a/code/modules/admin/verbs/gimmick_team.dm b/code/modules/admin/verbs/gimmick_team.dm index 37afe35ef6a..66d8807577a 100644 --- a/code/modules/admin/verbs/gimmick_team.dm +++ b/code/modules/admin/verbs/gimmick_team.dm @@ -52,7 +52,7 @@ players_to_spawn += candidate else to_chat(src, "Polling candidates...") - players_to_spawn = pollCandidates("Do you want to play as an event character?") + players_to_spawn = SSghost_spawns.poll_candidates("Do you want to play as an event character?") if(!players_to_spawn.len) to_chat(src, "Nobody volunteered.") diff --git a/code/modules/admin/verbs/infiltratorteam_syndicate.dm b/code/modules/admin/verbs/infiltratorteam_syndicate.dm index 54ddf85045e..d4ea1a0dd2e 100644 --- a/code/modules/admin/verbs/infiltratorteam_syndicate.dm +++ b/code/modules/admin/verbs/infiltratorteam_syndicate.dm @@ -55,7 +55,8 @@ GLOBAL_VAR_INIT(sent_syndicate_infiltration_team, 0) infiltrators += candidate else to_chat(src, "Polling candidates...") - infiltrators = pollCandidates("Do you want to play as a SYNDICATE INFILTRATOR?", ROLE_TRAITOR, 1) + var/mutable_appearance/ma = new('icons/mob/simple_human.dmi', "syndicate") + infiltrators = SSghost_spawns.poll_candidates("Do you want to play as a SYNDICATE INFILTRATOR?", ROLE_TRAITOR, TRUE, source = ma) if(!infiltrators.len) to_chat(src, "Nobody volunteered.") diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm index 3e89a6ac18d..5d9d218c90e 100644 --- a/code/modules/admin/verbs/one_click_antag.dm +++ b/code/modules/admin/verbs/one_click_antag.dm @@ -137,7 +137,8 @@ client/proc/one_click_antag() var/confirm = alert("Are you sure?", "Confirm creation", "Yes", "No") if(confirm != "Yes") return 0 - var/list/candidates = pollCandidates("Do you wish to be considered for the position of a Wizard Foundation 'diplomat'?", "wizard") + var/mutable_appearance/ma = new('icons/mob/simple_human.dmi', "wizard") + var/list/candidates = SSghost_spawns.poll_candidates("Do you wish to be considered for the position of a Wizard Foundation 'diplomat'?", "wizard", source = ma) log_admin("[key_name(owner)] tried making a Wizard with One-Click-Antag") message_admins("[key_name_admin(owner)] tried making a Wizard with One-Click-Antag") diff --git a/code/modules/admin/verbs/striketeam.dm b/code/modules/admin/verbs/striketeam.dm index 0b84c96e71a..b3ea2924709 100644 --- a/code/modules/admin/verbs/striketeam.dm +++ b/code/modules/admin/verbs/striketeam.dm @@ -37,7 +37,8 @@ GLOBAL_VAR_INIT(sent_strike_team, 0) break // Find ghosts willing to be DS - var/list/commando_ghosts = pollCandidatesWithVeto(src, usr, COMMANDOS_POSSIBLE, "Join the DeathSquad?",, 21, 600, 1, GLOB.role_playtime_requirements[ROLE_DEATHSQUAD], TRUE, FALSE) + var/mutable_appearance/source = new('icons/obj/cardboard_cutout.dmi', "cutout_deathsquad") + var/list/commando_ghosts = pollCandidatesWithVeto(src, usr, COMMANDOS_POSSIBLE, "Join the DeathSquad?",, 21, 60 SECONDS, TRUE, GLOB.role_playtime_requirements[ROLE_DEATHSQUAD], TRUE, FALSE, source = source) if(!commando_ghosts.len) to_chat(usr, "Nobody volunteered to join the DeathSquad.") return diff --git a/code/modules/admin/verbs/striketeam_syndicate.dm b/code/modules/admin/verbs/striketeam_syndicate.dm index 12df7467cbc..405c1d3c3d2 100644 --- a/code/modules/admin/verbs/striketeam_syndicate.dm +++ b/code/modules/admin/verbs/striketeam_syndicate.dm @@ -45,7 +45,7 @@ GLOBAL_VAR_INIT(sent_syndicate_strike_team, 0) break // Find ghosts willing to be SST - var/list/commando_ghosts = pollCandidatesWithVeto(src, usr, SYNDICATE_COMMANDOS_POSSIBLE, "Join the Syndicate Strike Team?",, 21, 600, 1, GLOB.role_playtime_requirements[ROLE_DEATHSQUAD], TRUE, FALSE) + var/list/commando_ghosts = pollCandidatesWithVeto(src, usr, SYNDICATE_COMMANDOS_POSSIBLE, "Join the Syndicate Strike Team?",, 21, 60 SECONDS, TRUE, GLOB.role_playtime_requirements[ROLE_DEATHSQUAD], TRUE, FALSE) if(!commando_ghosts.len) to_chat(usr, "Nobody volunteered to join the SST.") return diff --git a/code/modules/antagonists/_common/antag_datum.dm b/code/modules/antagonists/_common/antag_datum.dm index 4a6fe7d6640..41333760f2d 100644 --- a/code/modules/antagonists/_common/antag_datum.dm +++ b/code/modules/antagonists/_common/antag_datum.dm @@ -73,7 +73,7 @@ GLOBAL_LIST_EMPTY(antagonists) /datum/antagonist/proc/replace_banned_player() set waitfor = FALSE - var/list/mob/dead/observer/candidates = pollCandidates("Do you want to play as a [name]?", job_rank, TRUE, 50) + var/list/mob/dead/observer/candidates = SSghost_spawns.poll_candidates("Do you want to play as a [name]?", job_rank, TRUE, 5 SECONDS) if(LAZYLEN(candidates)) var/mob/dead/observer/C = pick(candidates) to_chat(owner, "Your mob has been taken over by a ghost! Appeal your job ban if you want to avoid this in the future!") diff --git a/code/modules/antagonists/_common/antag_spawner.dm b/code/modules/antagonists/_common/antag_spawner.dm index beefc41735b..7f7b874643a 100644 --- a/code/modules/antagonists/_common/antag_spawner.dm +++ b/code/modules/antagonists/_common/antag_spawner.dm @@ -46,7 +46,8 @@ checking = TRUE to_chat(user, "You activate [src] and wait for confirmation.") - var/list/nuke_candidates = pollCandidates("Do you want to play as a [rolename]?", ROLE_OPERATIVE, TRUE, 150) + var/mutable_appearance/ma = new('icons/mob/simple_human.dmi', "syndicate_space_sword") + var/list/nuke_candidates = SSghost_spawns.poll_candidates("Do you want to play as a [rolename]?", ROLE_OPERATIVE, TRUE, 15 SECONDS, source = ma) if(LAZYLEN(nuke_candidates)) checking = FALSE if(QDELETED(src) || !check_usability(user)) @@ -180,7 +181,7 @@ var/type = "slaughter" if(demon_type == /mob/living/simple_animal/slaughter/laughter) type = "laughter" - var/list/candidates = pollCandidates("Do you want to play as a [type] demon summoned by [user.real_name]?", ROLE_DEMON, 1, 100) + var/list/candidates = SSghost_spawns.poll_candidates("Do you want to play as a [type] demon summoned by [user.real_name]?", ROLE_DEMON, TRUE, 10 SECONDS, source = demon_type) if(candidates.len > 0) var/mob/C = pick(candidates) @@ -252,7 +253,7 @@ used = TRUE to_chat(user, "You break the seal on the bottle, calling upon the dire sludge to awaken...") - var/list/candidates = pollCandidates("Do you want to play as a magical morph awakened by [user.real_name]?", ROLE_MORPH, 1, 100) + var/list/candidates = SSghost_spawns.poll_candidates("Do you want to play as a magical morph awakened by [user.real_name]?", ROLE_MORPH, 1, 10 SECONDS, source = morph_type) if(candidates.len > 0) var/mob/C = pick(candidates) diff --git a/code/modules/awaymissions/mission_code/academy.dm b/code/modules/awaymissions/mission_code/academy.dm index 7cddddd8b08..65c64edd83f 100644 --- a/code/modules/awaymissions/mission_code/academy.dm +++ b/code/modules/awaymissions/mission_code/academy.dm @@ -193,7 +193,7 @@ servant_mind.objectives += O servant_mind.transfer_to(H) - var/list/mob/dead/observer/candidates = pollCandidates("Do you want to play as the servant of [user.real_name]?", ROLE_WIZARD, poll_time = 300) + var/list/mob/dead/observer/candidates = SSghost_spawns.poll_candidates("Do you want to play as the servant of [user.real_name]?", ROLE_WIZARD, poll_time = 30 SECONDS, source = H) if(LAZYLEN(candidates)) var/mob/dead/observer/C = pick(candidates) message_admins("[ADMIN_LOOKUPFLW(C)] was spawned as Dice Servant") diff --git a/code/modules/events/abductor.dm b/code/modules/events/abductor.dm index 7fe60e8b77f..4ad8fb4eb90 100644 --- a/code/modules/events/abductor.dm +++ b/code/modules/events/abductor.dm @@ -9,7 +9,7 @@ makeAbductorTeam() /datum/event/abductor/proc/makeAbductorTeam() - var/list/mob/dead/observer/candidates = pollCandidates("Do you wish to be considered for an Abductor Team?", ROLE_ABDUCTOR, 1) + var/list/mob/dead/observer/candidates = SSghost_spawns.poll_candidates("Do you wish to be considered for an Abductor Team?", ROLE_ABDUCTOR, TRUE) if(candidates.len >= 2) //Oh god why we can't have static functions diff --git a/code/modules/events/alien_infestation.dm b/code/modules/events/alien_infestation.dm index 8c01d5c7cc2..23e4e266819 100644 --- a/code/modules/events/alien_infestation.dm +++ b/code/modules/events/alien_infestation.dm @@ -23,7 +23,7 @@ vents += temp_vent spawn() - var/list/candidates = pollCandidates("Do you want to play as an alien?", ROLE_ALIEN, 1) + var/list/candidates = SSghost_spawns.poll_candidates("Do you want to play as an alien?", ROLE_ALIEN, TRUE, source = /mob/living/carbon/alien/larva) while(spawncount > 0 && vents.len && candidates.len) var/obj/vent = pick_n_take(vents) diff --git a/code/modules/events/sentience.dm b/code/modules/events/sentience.dm index 918746f4595..b18f9d0129c 100644 --- a/code/modules/events/sentience.dm +++ b/code/modules/events/sentience.dm @@ -4,7 +4,7 @@ processing = FALSE //so it won't fire again in next tick var/ghostmsg = "Do you want to awaken as a sentient being?" - var/list/candidates = pollCandidates(ghostmsg, ROLE_SENTIENT, 1) + var/list/candidates = SSghost_spawns.poll_candidates(ghostmsg, ROLE_SENTIENT, TRUE) var/list/potential = list() var/sentience_type = SENTIENCE_ORGANIC diff --git a/code/modules/events/slaughterevent.dm b/code/modules/events/slaughterevent.dm index ac265adb420..23d0dd8f2dd 100644 --- a/code/modules/events/slaughterevent.dm +++ b/code/modules/events/slaughterevent.dm @@ -3,7 +3,7 @@ /datum/event/spawn_slaughter/proc/get_slaughter(var/end_if_fail = 0) spawn() - var/list/candidates = pollCandidates("Do you want to play as a slaughter demon?", ROLE_DEMON, 1) + var/list/candidates = SSghost_spawns.poll_candidates("Do you want to play as a slaughter demon?", ROLE_DEMON, TRUE, source = /mob/living/simple_animal/slaughter) if(!candidates.len) key_of_slaughter = null return kill() diff --git a/code/modules/events/traders.dm b/code/modules/events/traders.dm index 0beeb3691e2..f7b354daa65 100644 --- a/code/modules/events/traders.dm +++ b/code/modules/events/traders.dm @@ -34,7 +34,7 @@ GLOBAL_LIST_INIT(unused_trade_stations, list("sol")) trader_objectives = forge_trader_objectives() spawn() - var/list/candidates = pollCandidates("Do you want to play as a trader?", ROLE_TRADER, 1) + var/list/candidates = SSghost_spawns.poll_candidates("Do you want to play as a trader?", ROLE_TRADER, TRUE) var/index = 1 while(spawn_count > 0 && candidates.len > 0) if(index > spawnlocs.len) 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 5d828e7c181..79ed90a61b8 100644 --- a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm +++ b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm @@ -70,7 +70,7 @@ return polling = 1 spawn() - var/list/candidates = pollCandidates("Do you want to play as an alien?", ROLE_ALIEN, 0) + var/list/candidates = SSghost_spawns.poll_candidates("Do you want to play as an alien?", ROLE_ALIEN, FALSE, source = /mob/living/carbon/alien/larva) var/mob/C = null // To stop clientless larva, we will check that our host has a client diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 5fb5bcb06c8..ff01fbe5cc9 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -113,7 +113,7 @@ var/question = "Do you want to play as [M.real_name ? M.real_name : M.name][M.job ? " ([M.job])" : ""]" if(alert("Do you want to show the antag status?","Show antag status","Yes","No") == "Yes") question += ", [M.mind?.special_role ? M.mind?.special_role : "No special role"]" - var/list/mob/dead/observer/candidates = pollCandidates("[question]?", poll_time = 100, min_hours = minhours) + var/list/mob/dead/observer/candidates = SSghost_spawns.poll_candidates("[question]?", poll_time = 10 SECONDS, min_hours = minhours, source = M) var/mob/dead/observer/theghost = null if(LAZYLEN(candidates)) diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index 7c35730f4aa..ac7249a8b63 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -198,7 +198,7 @@ being_used = 1 var/ghostmsg = "Play as [SM.name], pet of [user.name]?" - var/list/candidates = pollCandidates(ghostmsg, ROLE_SENTIENT, 0, 100) + var/list/candidates = SSghost_spawns.poll_candidates(ghostmsg, ROLE_SENTIENT, FALSE, 10 SECONDS, source = M) if(!src) return diff --git a/code/modules/response_team/ert.dm b/code/modules/response_team/ert.dm index a25be3814a7..f2d559e8b1f 100644 --- a/code/modules/response_team/ert.dm +++ b/code/modules/response_team/ert.dm @@ -63,7 +63,7 @@ GLOBAL_VAR_INIT(ert_request_answered, FALSE) GLOB.active_team.setSlots(commander_slots, security_slots, medical_slots, engineering_slots, janitor_slots, paranormal_slots, cyborg_slots) GLOB.send_emergency_team = TRUE - var/list/ert_candidates = shuffle(pollCandidates("Join the Emergency Response Team?",, GLOB.responseteam_age, 600, 1, GLOB.role_playtime_requirements[ROLE_ERT])) + var/list/ert_candidates = shuffle(SSghost_spawns.poll_candidates("Join the Emergency Response Team?",, GLOB.responseteam_age, 60 SECONDS, TRUE, GLOB.role_playtime_requirements[ROLE_ERT])) if(!ert_candidates.len) GLOB.active_team.cannot_send_team() GLOB.send_emergency_team = FALSE