Merge pull request #13710 from dearmochi/overhaul-event-mob-selection

Overhaul event mob selection
This commit is contained in:
AffectedArc07
2020-08-18 10:55:24 +01:00
committed by GitHub
36 changed files with 413 additions and 125 deletions
+3 -2
View File
@@ -1947,7 +1947,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)
@@ -3573,7 +3573,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, "<span class='warning'>ERROR: Could not create eventmob. No valid candidates.</span>")
return
+2 -3
View File
@@ -39,6 +39,7 @@
if(alert("Do you want these characters automatically classified as antagonists?",,"Yes","No")=="Yes")
is_syndicate = 1
var/datum/outfit/O = outfit_list[dresscode]
var/list/players_to_spawn = list()
if(pick_manually)
var/list/possible_ghosts = list()
@@ -52,14 +53,12 @@
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 \a [O.name]?")
if(!players_to_spawn.len)
to_chat(src, "Nobody volunteered.")
return 0
var/datum/outfit/O = outfit_list[dresscode]
var/players_spawned = 0
for(var/mob/thisplayer in players_to_spawn)
var/mob/living/carbon/human/H = new /mob/living/carbon/human(T)
@@ -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.")
+2 -1
View File
@@ -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")
+2 -1
View File
@@ -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, "<span class='userdanger'>Nobody volunteered to join the DeathSquad.</span>")
return
@@ -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, "<span class='userdanger'>Nobody volunteered to join the SST.</span>")
return
@@ -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!")
@@ -46,7 +46,8 @@
checking = TRUE
to_chat(user, "<span class='notice'>You activate [src] and wait for confirmation.</span>")
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, "<span class='notice'>You break the seal on the bottle, calling upon the dire sludge to awaken...</span>")
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)
@@ -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")
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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)
+3 -3
View File
@@ -12,14 +12,14 @@
if(!T)
return kill()
var/list/candidates = pollCandidates("Do you want to play as a blob infested mouse?", ROLE_BLOB, 1)
if(!candidates.len)
var/list/candidates = SSghost_spawns.poll_candidates("Do you want to play as a blob infested mouse?", ROLE_BLOB, TRUE, source = /mob/living/simple_animal/mouse/blobinfected)
if(!length(candidates))
return kill()
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in GLOB.all_vent_pumps)
if(is_station_level(temp_vent.loc.z) && !temp_vent.welded)
if(temp_vent.parent.other_atmosmch.len > 50)
if(length(temp_vent.parent.other_atmosmch) > 50)
vents += temp_vent
var/obj/vent = pick(vents)
+1 -2
View File
@@ -3,8 +3,7 @@
/datum/event/sentience/start()
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("Do you want to awaken as a sentient being?", ROLE_SENTIENT, TRUE)
var/list/potential = list()
var/sentience_type = SENTIENCE_ORGANIC
+1 -1
View File
@@ -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()
+1 -1
View File
@@ -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 Sol Trader?", ROLE_TRADER, TRUE)
var/index = 1
while(spawn_count > 0 && candidates.len > 0)
if(index > spawnlocs.len)
@@ -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
+1 -1
View File
@@ -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))
@@ -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
+1 -1
View File
@@ -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