Applies the change to PAI's

This commit is contained in:
AnturK
2016-07-25 22:13:30 +02:00
parent 24ca50148d
commit 69dcf5bd98
2 changed files with 6 additions and 32 deletions
+4 -31
View File
@@ -5,10 +5,7 @@ var/datum/subsystem/pai/SSpai
init_order = 20
flags = SS_NO_FIRE|SS_NO_INIT
var/askDelay = 600
var/const/NEVER_FOR_THIS_ROUND = -1
var/list/candidates = list()
var/list/asked = list()
/datum/subsystem/pai/New()
NEW_SS_GLOBAL(SSpai)
@@ -181,34 +178,10 @@ var/datum/subsystem/pai/SSpai
user << browse(dat, "window=findPai")
/datum/subsystem/pai/proc/requestRecruits()
for(var/mob/dead/observer/O in player_list)
if(jobban_isbanned(O, ROLE_PAI))
continue
if(asked[O.ckey])
if(world.time < asked[O.ckey] + askDelay || asked[O.ckey] == NEVER_FOR_THIS_ROUND)
continue
else
asked.Remove(O.ckey)
if(O.client)
var/hasSubmitted = 0
for(var/datum/paiCandidate/c in SSpai.candidates)
if(c.key == O.key)
hasSubmitted = 1
if(!hasSubmitted && (ROLE_PAI in O.client.prefs.be_special))
question(O.client)
/datum/subsystem/pai/proc/question(client/C)
set waitfor = 0
if(!C)
return
asked[C.ckey] = world.time
var/response = tgalert(C, "Someone is requesting a pAI personality. Would you like to play as a personal AI?", "pAI Request", "Yes", "No", "Never for this round", StealFocus=0, Timeout=askDelay)
if(!C)
return //handle logouts that happen whilst the alert is waiting for a response.
if(response == "Yes")
recruitWindow(C.mob)
else if (response == "Never for this round")
asked[C.ckey] = NEVER_FOR_THIS_ROUND
var/list/candidates = pollCandidates("Someone is requesting a pAI personality. Would you like to play as a personal AI?", ROLE_PAI, null, ROLE_PAI,300, ignore_list = pai_ignore)
for(var/V in candidates)
recruitWindow(V)
return
/datum/paiCandidate
var/name