diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 9c8f042264c2..e603f3013041 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -40,7 +40,7 @@ if(href_list["makeAntag"]) switch(href_list["makeAntag"]) if("1") - log_admin("[key_name(usr)] has spawned a traitor.") + log_admin("[key_name(usr)] has spawned traitors.") if(!makeTraitors()) to_chat(usr, "Unfortunately there weren't enough candidates available.") if("2") @@ -71,6 +71,10 @@ log_admin("[key_name(usr)] has spawned mindflayers.") if(!makeMindflayers()) to_chat(usr, "Unfortunately there weren't enough candidates available.") + if("9") + log_admin("[key_name(usr)] has spawned event characters.") + if(!makeEventCharacters()) + to_chat(usr, "Unfortunately there weren't enough candidates available.") else if(href_list["dbsearchckey"] || href_list["dbsearchadmin"] || href_list["dbsearchip"] || href_list["dbsearchcid"] || href_list["dbsearchbantype"]) var/adminckey = href_list["dbsearchadmin"] diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm index 665c1bac2b9f..6a8a54778fc5 100644 --- a/code/modules/admin/verbs/one_click_antag.dm +++ b/code/modules/admin/verbs/one_click_antag.dm @@ -21,6 +21,7 @@ Make Vampires
Make Abductor Team (Requires Ghosts)
Make Mindflayers
+ Make Event Characters
"} usr << browse(dat, "window=oneclickantag;size=400x400") return @@ -311,6 +312,64 @@ qdel(temp) return TRUE +/datum/admins/proc/makeEventCharacters() + var/list/mob/living/carbon/human/candidates = list() + var/mob/living/carbon/human/H = null + + var/antnum = input(owner, "How many event characters you want to create? Enter 0 to cancel","Amount:", 0) as num + if(!antnum || antnum <= 0) + return FALSE + + var/datum/game_mode/traitor/temp = new() + var/no_mindshields = input(owner, "Avoid mindshielded characters?") in list("Yes", "No", "Cancel") + if(no_mindshields == "Cancel") + qdel(temp) + return FALSE + else if(no_mindshields == "Yes") + temp.restricted_jobs += temp.protected_jobs + + var/respect_traitor = input(owner, "Require traitor willingness?") in list("Yes", "No", "Cancel") + var/role = null + if(respect_traitor == "Cancel") + qdel(temp) + return FALSE + else if(respect_traitor == "Yes") + role = ROLE_TRAITOR + + var/give_objective = input(owner, "Give them a shared custom objective?") in list("Yes", "No", "Cancel") + var/objective = null + if(give_objective == "Cancel") + qdel(temp) + return FALSE + else if(give_objective == "Yes") + objective = sanitize(copytext_char(input("Custom objective:", "Objective", "") as text|null, 1, MAX_MESSAGE_LEN)) + if(!length(objective)) + qdel(temp) + return FALSE + + log_admin("[key_name(owner)] tried making [antnum] event characters with One-Click-Antag") + message_admins("[key_name_admin(owner)] tried making [antnum] event characters with One-Click-Antag") + + for(var/mob/living/carbon/human/applicant in GLOB.player_list) + if(CandCheck(role, applicant, temp)) + candidates += applicant + qdel(temp) + + if(length(candidates)) + var/num_event_chars = min(length(candidates), antnum) + + for(var/i in 1 to num_event_chars) + H = pick(candidates) + if(!isnull(objective)) + var/datum/objective/O = new() + O.explanation_text = objective + O.needs_target = FALSE + H.mind.add_mind_objective(O) + H.mind.add_antag_datum(/datum/antagonist/eventmisc) + candidates.Remove(H) + return TRUE + return FALSE + /datum/admins/proc/makeThunderdomeTeams() // Not strictly an antag, but this seemed to be the best place to put it. var/max_thunderdome_players = 10 var/team_to_assign_to = "Green"