From a8c61da0d62198210130306dd3b5e3ce779c2625 Mon Sep 17 00:00:00 2001 From: Fox-McCloud Date: Mon, 1 Aug 2016 21:58:20 -0400 Subject: [PATCH] Cleans up MakeWizard --- code/__HELPERS/timed_alerts.dm | 37 --------------------- code/modules/admin/verbs/one_click_antag.dm | 32 +++--------------- paradise.dme | 1 - 3 files changed, 4 insertions(+), 66 deletions(-) delete mode 100644 code/__HELPERS/timed_alerts.dm diff --git a/code/__HELPERS/timed_alerts.dm b/code/__HELPERS/timed_alerts.dm deleted file mode 100644 index 97e92900288..00000000000 --- a/code/__HELPERS/timed_alerts.dm +++ /dev/null @@ -1,37 +0,0 @@ -/client/var/timed_alert/timed_alert - -/client/proc/timed_alert(question as text, title as text, default as text, time = 300, \ - choice1 as text, choice2 as text, choice3 as text) - - if(timed_alert) del(timed_alert) - var/timed_alert/ref_alert = new - timed_alert = ref_alert - - var/ref_result - - ref_result = ref_alert.timed_alert(src, question, title, time, choice1, choice2, choice3) - if(!ref_result) ref_result = default - - if(ref_alert) del(ref_alert) - - return ref_result - - -/mob/proc/timed_alert(question as text, title as text, default as text, time as num, \ - choice1 as text, choice2 as text, choice3 as text) - - if(client) return client.timed_alert(question, title, default, time, choice1, choice2, choice3) - return - - - -/timed_alert/proc/timed_alert(client/ref_client, question, title, time, choice1, choice2, choice3) - if(!ref_client) return - spawn (time) del(src) // When src is deleted, the proc ends immediately. The alert itself closes. - - var/ref_answer - ref_answer = alert(ref_client, question, title, choice1, choice2, choice3) - - if(!ref_client || !ref_answer) return - else return ref_answer - diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm index 5506b3b9076..8da22a71b62 100644 --- a/code/modules/admin/verbs/one_click_antag.dm +++ b/code/modules/admin/verbs/one_click_antag.dm @@ -146,40 +146,16 @@ client/proc/one_click_antag() return 0 /datum/admins/proc/makeWizard() - var/list/mob/candidates = list() - var/mob/theghost = null - var/time_passed = world.time - for(var/mob/G in respawnable_list) - if(istype(G) && G.client && (ROLE_WIZARD in G.client.prefs.be_special)) - if(!jobban_isbanned(G, "wizard") && !jobban_isbanned(G, "Syndicate")) - if(player_old_enough_antag(G.client,ROLE_WIZARD)) - spawn(0) - switch(G.timed_alert("Do you wish to be considered for the position of Space Wizard Foundation 'diplomat'?","Please answer in 30 seconds!","No",300,"Yes","No"))//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) + var/list/candidates = pollCandidates("Do you wish to be considered for the position of a Wizard Foundation 'diplomat'?", "wizard") if(candidates.len) - candidates = shuffle(candidates) - for(var/mob/dead/observer/i in candidates) - if(!i || !i.client) continue //Dont bother removing them from the list since we only grab one wizard + var/mob/dead/observer/selected = pick(candidates) + candidates -= selected - theghost = i - break - - if(theghost) - var/mob/living/carbon/human/new_character=makeBody(theghost) + var/mob/living/carbon/human/new_character = makeBody(selected) new_character.mind.make_Wizard() return 1 - return 0 diff --git a/paradise.dme b/paradise.dme index 6c8dd8d73bf..050e18920fe 100644 --- a/paradise.dme +++ b/paradise.dme @@ -64,7 +64,6 @@ #include "code\__HELPERS\sanitize_values.dm" #include "code\__HELPERS\text.dm" #include "code\__HELPERS\time.dm" -#include "code\__HELPERS\timed_alerts.dm" #include "code\__HELPERS\type2type.dm" #include "code\__HELPERS\unsorted.dm" #include "code\_DATASTRUCTURES\heap.dm"