Merge pull request #5285 from Fox-McCloud/cleanup

Cleans up MakeWizard
This commit is contained in:
TheDZD
2016-08-02 13:34:58 -04:00
committed by GitHub
3 changed files with 4 additions and 66 deletions
+4 -28
View File
@@ -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