From 7cb0b6fafe61dd2e8092389c8a35ce2fc3cae9f0 Mon Sep 17 00:00:00 2001 From: Ansari Date: Wed, 23 May 2018 21:13:09 +0800 Subject: [PATCH] Add number of antags to create option to some one-click antag. Add make_vampire() function, fixes some typos --- code/datums/mind.dm | 21 +- .../game/gamemodes/autotraitor/autotraitor.dm | 2 +- .../gamemodes/changeling/evolution_menu.dm | 2 +- code/modules/admin/topic.dm | 2 +- code/modules/admin/verbs/one_click_antag.dm | 456 ++++++++++-------- 5 files changed, 267 insertions(+), 216 deletions(-) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 08bd6252d99..89e8249ee95 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -483,9 +483,11 @@ var/new_memo = copytext(input("Write new memory", "Memory", memory) as null|message,1,MAX_MESSAGE_LEN) if(isnull(new_memo)) return - memory = new_memo - log_admin("[key_name(usr)] has edited [key_name(current)]'s memory") - message_admins("[key_name_admin(usr)] has edited [key_name_admin(current)]'s memory") + var/confirmed = alert(usr, "Are you sure?", "Edit Memory", "Yes", "No") + if(confirmed == "Yes") // Because it is too easy to accidentally wipe someone's memory + memory = new_memo + log_admin("[key_name(usr)] has edited [key_name(current)]'s memory") + message_admins("[key_name_admin(usr)] has edited [key_name_admin(current)]'s memory") else if(href_list["obj_edit"] || href_list["obj_add"]) var/datum/objective/objective @@ -1294,7 +1296,7 @@ if(H) qdel(H) -/datum/mind/proc/make_Tratior() +/datum/mind/proc/make_Traitor() if(!(src in ticker.mode.traitors)) ticker.mode.traitors += src special_role = SPECIAL_ROLE_TRAITOR @@ -1334,7 +1336,16 @@ ticker.mode.equip_syndicate(current) -/datum/mind/proc/make_Changling() +/datum/mind/proc/make_Vampire() + if(!(src in ticker.mode.vampires)) + ticker.mode.vampires += src + ticker.mode.grant_vampire_powers(current) + special_role = SPECIAL_ROLE_VAMPIRE + ticker.mode.forge_vampire_objectives(src) + ticker.mode.greet_vampire(src) + ticker.mode.update_change_icons_added(src) + +/datum/mind/proc/make_Changeling() if(!(src in ticker.mode.changelings)) ticker.mode.changelings += src ticker.mode.grant_changeling_powers(current) diff --git a/code/game/gamemodes/autotraitor/autotraitor.dm b/code/game/gamemodes/autotraitor/autotraitor.dm index 93fe05ffa10..eb32bed006d 100644 --- a/code/game/gamemodes/autotraitor/autotraitor.dm +++ b/code/game/gamemodes/autotraitor/autotraitor.dm @@ -191,7 +191,7 @@ //message_admins("The probability of a new traitor is [traitor_prob]%") if(prob(traitor_prob)) message_admins("New traitor roll passed. Making a new Traitor.") - character.mind.make_Tratior() //TEMP: Add proper checks for loyalty here. uc_guy + character.mind.make_Traitor() //TEMP: Add proper checks for loyalty here. uc_guy //else //message_admins("New traitor roll failed. No new traitor.") //else diff --git a/code/game/gamemodes/changeling/evolution_menu.dm b/code/game/gamemodes/changeling/evolution_menu.dm index d690f095236..a7af2b94482 100644 --- a/code/game/gamemodes/changeling/evolution_menu.dm +++ b/code/game/gamemodes/changeling/evolution_menu.dm @@ -20,7 +20,7 @@ var/list/sting_paths /obj/effect/proc_holder/changeling/evolution_menu/proc/create_menu(var/datum/changeling/changeling) var/dat - dat +="Changling Evolution Menu" + dat +="Changeling Evolution Menu" //javascript, the part that does most of the work~ dat += {" diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index bc5f67d49a8..218b1df27ae 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -43,7 +43,7 @@ to_chat(usr, "Unfortunately there weren't enough candidates available.") if("2") log_admin("[key_name(usr)] has spawned a changeling.") - if(!src.makeChanglings()) + if(!src.makeChangelings()) to_chat(usr, "Unfortunately there weren't enough candidates available.") if("3") log_admin("[key_name(usr)] has spawned revolutionaries.") diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm index b3f0a1a15a8..9e83071ff7d 100644 --- a/code/modules/admin/verbs/one_click_antag.dm +++ b/code/modules/admin/verbs/one_click_antag.dm @@ -35,35 +35,43 @@ client/proc/one_click_antag() var/list/mob/living/carbon/human/candidates = list() var/mob/living/carbon/human/H = null - log_admin("[key_name(owner)] tried making Traitors with One-Click-Antag") - message_admins("[key_name_admin(owner)] tried making Traitors with One-Click-Antag") + var/antnum = input(owner, "How many traitors you want to create? (0 - 5)","Amount:", 0) as num + var/confirmed = alert(owner, "Are you sure?", "Confirm creation", "Yes", "No") - for(var/mob/living/carbon/human/applicant in player_list) - if(ROLE_TRAITOR in applicant.client.prefs.be_special) - if(player_old_enough_antag(applicant.client,ROLE_TRAITOR)) - if(!applicant.stat) - if(applicant.mind) - if(!applicant.mind.special_role) - if(!jobban_isbanned(applicant, "traitor") && !jobban_isbanned(applicant, "Syndicate")) - if(!(applicant.mind.assigned_role in temp.restricted_jobs)) - if(!(applicant.client.prefs.species in temp.protected_species)) - candidates += applicant + if(!antnum) + return + if(antnum > 5 || antnum <= 0) + return + if(confirmed == "Yes") + log_admin("[key_name(owner)] tried making [antnum] Traitors with One-Click-Antag") + message_admins("[key_name_admin(owner)] tried making [antnum] Traitors with One-Click-Antag") - if(candidates.len) - var/numTratiors = min(candidates.len, 3) + for(var/mob/living/carbon/human/applicant in player_list) + if(ROLE_TRAITOR in applicant.client.prefs.be_special) + if(player_old_enough_antag(applicant.client,ROLE_TRAITOR)) + if(!applicant.stat) + if(applicant.mind) + if(!applicant.mind.special_role) + if(!jobban_isbanned(applicant, "traitor") && !jobban_isbanned(applicant, "Syndicate")) + if(!(applicant.mind.assigned_role in temp.restricted_jobs)) + if(!(applicant.client.prefs.species in temp.protected_species)) + candidates += applicant - for(var/i = 0, i 5 || antnum <= 0) + return + if(confirmed == "Yes") + log_admin("[key_name(owner)] tried making Changelings with One-Click-Antag") + message_admins("[key_name_admin(owner)] tried making Changelings with One-Click-Antag") - for(var/i = 0, i 5 || antnum <= 0) + return + if(confirmed == "Yes") + log_admin("[key_name(owner)] tried making [antnum] Revolutionaries with One-Click-Antag") + message_admins("[key_name_admin(owner)] tried making [antnum] Revolutionaries with One-Click-Antag") - for(var/i = 0, i300)//If more than 30 game seconds passed. + + if(!antnum) + return + if(antnum > 10 || antnum <= 0) + return + if(confirmed == "Yes") + log_admin("[key_name(owner)] tried making a [antnum] person Nuke Op Team with One-Click-Antag") + message_admins("[key_name_admin(owner)] tried making a [antnum] person Nuke Op Team with One-Click-Antag") + + for(var/mob/G in respawnable_list) + if(istype(G) && G.client && (ROLE_OPERATIVE in G.client.prefs.be_special)) + if(!jobban_isbanned(G, "operative") && !jobban_isbanned(G, "Syndicate")) + if(player_old_enough_antag(G.client,ROLE_OPERATIVE)) + 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 - candidates += G - if("No") - return - else - return - sleep(300) + sleep(300) - if(candidates.len) - var/numagents = 5 - var/agentcount = 0 + if(candidates.len) + var/agentcount = 0 - for(var/i = 0, i 10 || antnum <= 0) + return + if(confirmed == "Yes") + log_admin("[key_name(owner)] tried making a [antnum] person Death Squad with One-Click-Antag") + message_admins("[key_name_admin(owner)] tried making a [antnum] person Death Squad with One-Click-Antag") - var/syndicate_leader_selected = 0 //when the leader is chosen. The last person spawned. + var/syndicate_leader_selected = 0 //when the leader is chosen. The last person spawned. - //Generates a list of commandos from active ghosts. Then the user picks which characters to respawn as the commandos. - for(var/mob/G in respawnable_list) - if(!jobban_isbanned(G, "Syndicate")) - spawn(0) - switch(alert(G,"Do you wish to be considered for an elite syndicate strike 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) + //Generates a list of commandos from active ghosts. Then the user picks which characters to respawn as the commandos. + for(var/mob/G in respawnable_list) + if(!jobban_isbanned(G, "Syndicate")) + spawn(0) + switch(alert(G,"Do you wish to be considered for an elite syndicate strike 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) - for(var/mob/dead/observer/G in candidates) - if(!G.key) - candidates.Remove(G) + for(var/mob/dead/observer/G in candidates) + if(!G.key) + candidates.Remove(G) - if(candidates.len) - var/numagents = 6 - //Spawns commandos and equips them. - for(var/obj/effect/landmark/L in /area/syndicate_mothership/elite_squad) - if(numagents<=0) - break - if(L.name == "Syndicate-Commando") - syndicate_leader_selected = numagents == 1?1:0 + if(candidates.len) + //Spawns commandos and equips them. + for(var/obj/effect/landmark/L in /area/syndicate_mothership/elite_squad) + if(antnum <= 0) + break + if(L.name == "Syndicate-Commando") + syndicate_leader_selected = antnum == 1?1:0 - var/mob/living/carbon/human/new_syndicate_commando = create_syndicate_death_commando(L, syndicate_leader_selected) + var/mob/living/carbon/human/new_syndicate_commando = create_syndicate_death_commando(L, syndicate_leader_selected) + + while((!theghost || !theghost.client) && candidates.len) + theghost = pick(candidates) + candidates.Remove(theghost) + + if(!theghost) + qdel(new_syndicate_commando) + break + + new_syndicate_commando.key = theghost.key + new_syndicate_commando.internal = new_syndicate_commando.s_store + new_syndicate_commando.update_action_buttons_icon() + + //So they don't forget their code or mission. - while((!theghost || !theghost.client) && candidates.len) - theghost = pick(candidates) - candidates.Remove(theghost) + to_chat(new_syndicate_commando, "You are an Elite Syndicate. [!syndicate_leader_selected ? "commando" : "LEADER"] in the service of the Syndicate. \nYour current mission is: [input]") - if(!theghost) - qdel(new_syndicate_commando) - break - - new_syndicate_commando.key = theghost.key - new_syndicate_commando.internal = new_syndicate_commando.s_store - new_syndicate_commando.update_action_buttons_icon() - - //So they don't forget their code or mission. - - - to_chat(new_syndicate_commando, "You are an Elite Syndicate. [!syndicate_leader_selected ? "commando" : "LEADER"] in the service of the Syndicate. \nYour current mission is: [input]") - - numagents-- - if(numagents >= 6) - return 0 - - for(var/obj/effect/landmark/L in /area/shuttle/syndicate_elite) - if(L.name == "Syndicate-Commando-Bomb") - new /obj/effect/spawner/newbomb/timer/syndicate(L.loc) + antnum-- + for(var/obj/effect/landmark/L in /area/shuttle/syndicate_elite) + if(L.name == "Syndicate-Commando-Bomb") + new /obj/effect/spawner/newbomb/timer/syndicate(L.loc) return 1 @@ -534,33 +569,38 @@ client/proc/one_click_antag() var/list/mob/living/carbon/human/candidates = list() var/mob/living/carbon/human/H = null - log_admin("[key_name(owner)] tried making Vampires with One-Click-Antag") - message_admins("[key_name_admin(owner)] tried making Vampires with One-Click-Antag") + var/antnum = input(owner, "How many vampires you want to create? (0 - 5)","Amount:", 0) as num + var/confirmed = alert(owner, "Are you sure?", "Confirm creation", "Yes", "No") - for(var/mob/living/carbon/human/applicant in player_list) - if(ROLE_VAMPIRE in applicant.client.prefs.be_special) - if(player_old_enough_antag(applicant.client,ROLE_VAMPIRE)) - if(!applicant.stat) - if(applicant.mind) - if(!applicant.mind.special_role) - if(!jobban_isbanned(applicant, "vampire") && !jobban_isbanned(applicant, "Syndicate")) - if(!(applicant.job in temp.restricted_jobs)) - if(!(applicant.client.prefs.species in temp.protected_species)) - candidates += applicant + if(!antnum) + return + if(antnum > 5 || antnum <= 0) + return + if(confirmed == "Yes") + log_admin("[key_name(owner)] tried making Vampires with One-Click-Antag") + message_admins("[key_name_admin(owner)] tried making Vampires with One-Click-Antag") - if(candidates.len) - var/numVampires = min(candidates.len, 3) + for(var/mob/living/carbon/human/applicant in player_list) + if(ROLE_VAMPIRE in applicant.client.prefs.be_special) + if(player_old_enough_antag(applicant.client,ROLE_VAMPIRE)) + if(!applicant.stat) + if(applicant.mind) + if(!applicant.mind.special_role) + if(!jobban_isbanned(applicant, "vampire") && !jobban_isbanned(applicant, "Syndicate")) + if(!(applicant.job in temp.restricted_jobs)) + if(!(applicant.client.prefs.species in temp.protected_species)) + candidates += applicant - for(var/i = 0, i