Different method of pAI/Posibrain recruiting.

Conflicts:
	code/modules/mob/living/carbon/brain/posibrain.dm
	code/modules/mob/living/silicon/pai/recruit.dm
	html/changelog.html
This commit is contained in:
Rob Nelson
2014-01-31 22:02:42 -08:00
committed by ZomgPonies
parent 522e153bff
commit 438e84c301
3 changed files with 86 additions and 28 deletions
@@ -559,5 +559,22 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
pos = A.loc
sleep(15)
following = null
if (href_list["jump"])
var/mob/target = locate(href_list["jump"])
var/mob/A = usr;
A << "Teleporting to [target]..."
//var/mob/living/silicon/ai/A = locate(href_list["track2"]) in mob_list
if(target && target != usr)
spawn(0)
var/turf/pos = get_turf(A)
var/turf/T=get_turf(target)
if(T != pos)
if(!T)
return
if(!client)
return
loc = T
following = null
..()
//END TELEPORT HREF CODE
@@ -10,7 +10,8 @@
construction_time = 75
var/searching = 0
var/askDelay = 10 * 60 * 1
mob/living/carbon/brain/brainmob = null
//var/mob/living/carbon/brain/brainmob = null
var/list/ghost_volunteers[0]
req_access = list(access_robotics)
locked = 0
mecha = null//This does not appear to be used outside of reference in mecha.dm.
@@ -21,19 +22,26 @@
//Start the process of searching for a new user.
user << "\blue You carefully locate the manual activation switch and start the positronic brain's boot process."
icon_state = "posibrain-searching"
ghost_volunteers.Cut()
src.searching = 1
src.request_player()
spawn(600) reset_search()
proc/request_player()
for(var/mob/O in respawnable_list)
if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
continue
if(jobban_isbanned(O, "pAI"))
continue
if(O.client)
if(O.client.prefs.be_special & BE_PAI)
question(O.client)
for(var/mob/dead/observer/O in player_list)
if(O.client && O.client.prefs.be_special & BE_PAI)
if(check_observer(O))
O << "\blue <b>\A [src] has been activated. (<a href='?src=\ref[O];jump=\ref[src]'>Teleport</a> | <a href='?src=\ref[src];signup=\ref[O]'>Sign Up</a>)"
//question(O.client)
proc/check_observer(var/mob/dead/observer/O)
if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
return 0
if(jobban_isbanned(O, "pAI"))
return 0
if(O.client)
return 1
return 0
proc/question(var/client/C)
spawn(0)
@@ -90,6 +98,30 @@
for (var/mob/M in viewers(T))
M.show_message("\blue The positronic brain buzzes quietly, and the golden lights fade away. Perhaps you could try again?")
Topic(href,href_list)
if("signup" in href_list)
var/mob/dead/observer/O = locate(href_list["signup"])
if(!O) return
volunteer(O)
proc/volunteer(var/mob/dead/observer/O)
if(!searching)
O << "Not looking for a ghost, yet."
return
if(!istype(O))
O << "\red NO."
return
if(O in ghost_volunteers)
O << "\blue Removed from registration list."
ghost_volunteers.Remove(O)
return
if(!check_observer(O))
O << "\red You cannot be \a [src]."
return
O.<< "\blue You've been added to the list of ghosts that may become this [src]. Click again to unvolunteer."
ghost_volunteers.Add(O)
/obj/item/device/mmi/posibrain/examine()
set src in oview()
@@ -141,3 +173,11 @@
dead_mob_list -= src.brainmob
..()
/obj/item/device/mmi/posibrain/attack_ghost(var/mob/dead/observer/O)
if(searching)
volunteer(O)
else
var/turf/T = get_turf_or_move(src.loc)
for (var/mob/M in viewers(T))
M.show_message("\blue The positronic brain pings softly.")
+20 -19
View File
@@ -12,8 +12,6 @@ var/datum/paiController/paiController // Global handler for pAI candidates
var/comments
var/ready = 0
/datum/paiController
var/list/pai_candidates = list()
var/list/asked = list()
@@ -21,6 +19,13 @@ var/datum/paiController/paiController // Global handler for pAI candidates
var/askDelay = 10 * 60 * 1 // One minute [ms * sec * min]
Topic(href, href_list[])
if("signup" in href_list)
var/mob/dead/observer/O = locate(href_list["signup"])
if(!O) return
if(!check_recruit(O)) return
recruitWindow(O)
return
if(href_list["download"])
var/datum/paiCandidate/candidate = locate(href_list["candidate"])
var/obj/item/device/paicard/card = locate(href_list["device"])
@@ -190,23 +195,19 @@ var/datum/paiController/paiController // Global handler for pAI candidates
user << browse(dat, "window=findPai")
proc/requestRecruits()
for(var/mob/O in respawnable_list)
if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
continue
if(jobban_isbanned(O, "pAI"))
continue
if(asked.Find(O.key))
if(world.time < asked[O.key] + askDelay)
continue
else
asked.Remove(O.key)
if(O.client)
var/hasSubmitted = 0
for(var/datum/paiCandidate/c in paiController.pai_candidates)
if(c.key == O.key)
hasSubmitted = 1
if(!hasSubmitted && (O.client.prefs.be_special & BE_PAI))
question(O.client)
for(var/mob/dead/observer/O in player_list)
if(O.client && O.client.prefs.be_special & BE_PAI)
if(check_recruit(O))
O << "\blue <b>A pAI card is looking for personalities. (<a href='?src=\ref[src];signup=\ref[O]'>Sign Up</a>)</b>"
//question(O.client)
proc/check_recruit(var/mob/dead/observer/O)
if(jobban_isbanned(O, "pAI"))
return 0
if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
return 0
if(O.client)
return 1
return 0
proc/question(var/client/C)
spawn(0)