mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 20:47:10 +01:00
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user