From 6b868e69b3eefacb7c0a52e0e8f874feb1cd4046 Mon Sep 17 00:00:00 2001 From: "only.lurking@gmail.com" Date: Fri, 9 Sep 2011 00:58:28 +0000 Subject: [PATCH] No more pAI recruit window spam. Added a toggle option to be a pAI (much like you can for aliens.) Changed popup window into an alert() and added a "never for this round" button in it. Can permanently set whether or not you want to be a pAI in your save (might not work as intended, only did mild testing, I cannot into bitwise operations.) git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2162 316c924e-a436-60f5-8080-3fe189b3f50e --- code/defines/client.dm | 1 + code/modules/mob/dead/observer/observer.dm | 11 +++++++++++ code/modules/mob/living/silicon/pai/recruit.dm | 8 +++++--- code/modules/mob/new_player/preferences.dm | 2 ++ code/modules/mob/new_player/savefile.dm | 3 +++ code/setup.dm | 3 ++- 6 files changed, 24 insertions(+), 4 deletions(-) diff --git a/code/defines/client.dm b/code/defines/client.dm index 19a2025e6de..7c43a5e1e03 100644 --- a/code/defines/client.dm +++ b/code/defines/client.dm @@ -35,6 +35,7 @@ var/midis = 1 //Check if midis should be played for someone -- Urist var/bubbles = 1 //Check if bubbles should be displayed for someone -- Doohl var/be_alien = 0 //Check if that guy wants to be an alien -- Urist + var/be_pai = 1 //Consider client when searching for players to recruit as a pAI -- TLE var/vote = null diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index bd3f4434023..9eeb5acde76 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -216,6 +216,17 @@ var/list/karma_spenders = list() client.be_alien = 1 src << "You are now included in alien candidate lists until end of round." +/mob/dead/observer/verb/toggle_pai_candidate() + set name = "Toggle Be pAI Candidate" + set category = "Ghost" + set desc = "Receive a pop-up request when a pAI device requests a new personality. (toggle)" + if(client.be_pai) + client.be_pai = 0 + src << "You will no longer receive pAI recruitment pop-ups this round." + else + client.be_pai = 1 + src << "You will now be considered a viable candidate when a pAI device requests a new personality, effective until the end of this round." + /mob/dead/observer/memory() set hidden = 1 src << "\red You are dead! You have no mind to store memory!" diff --git a/code/modules/mob/living/silicon/pai/recruit.dm b/code/modules/mob/living/silicon/pai/recruit.dm index 9026b74447f..d42d9bcc80a 100644 --- a/code/modules/mob/living/silicon/pai/recruit.dm +++ b/code/modules/mob/living/silicon/pai/recruit.dm @@ -17,7 +17,7 @@ var/datum/paiController/paiController // Global handler for pAI candidates var/list/pai_candidates = list() var/list/asked = list() - var/askDelay = 10 * 60 * 5 // Five minutes + var/askDelay = 10 * 60 * 1 // One minute [ms * sec * min] Topic(href, href_list[]) if(href_list["download"]) @@ -173,12 +173,14 @@ var/datum/paiController/paiController // Global handler for pAI candidates for(var/datum/paiCandidate/c in paiController.pai_candidates) if(c.key == O.key) hasSubmitted = 1 - if(!hasSubmitted) + if(!hasSubmitted && O.client.be_pai) spawn question(O.client) proc/question(var/client/C) asked.Add(C.key) asked[C.key] = world.time - var/response = input(C, "Someone is requesting a pAI personality. Would you like to play as a personal AI?", "pAI Request") in list ("Yes", "No") + var/response = alert(C, "Someone is requesting a pAI personality. Would you like to play as a personal AI?", "pAI Request", "Yes", "No", "Never for this round") if(response == "Yes") recruitWindow(C.mob) + else if (response == "Never for this round") + C.be_pai = 0 \ No newline at end of file diff --git a/code/modules/mob/new_player/preferences.dm b/code/modules/mob/new_player/preferences.dm index bcd5f8e4eb5..e9ef8c6ac67 100644 --- a/code/modules/mob/new_player/preferences.dm +++ b/code/modules/mob/new_player/preferences.dm @@ -10,6 +10,7 @@ var/global/list/special_roles = list( //keep synced with the defines BE_* in set "malf AI" = IS_MODE_COMPILED("malfunction"), "revolutionary" = IS_MODE_COMPILED("revolution"), "alien candidate" = 1, //always show + "pai candidate" = 1, // -- TLE "cultist" = IS_MODE_COMPILED("cult"), "infested monkey" = IS_MODE_COMPILED("monkey"), ) @@ -956,6 +957,7 @@ datum/preferences character.client.bubbles = bubbles character.client.ooccolor = ooccolor character.client.be_alien = be_special&BE_ALIEN + character.client.be_pai = be_special&BE_PAI /* diff --git a/code/modules/mob/new_player/savefile.dm b/code/modules/mob/new_player/savefile.dm index 60698afe355..5957b6f99ae 100644 --- a/code/modules/mob/new_player/savefile.dm +++ b/code/modules/mob/new_player/savefile.dm @@ -50,6 +50,7 @@ datum/preferences/proc/savefile_save(mob/user) F["ooccolor"] << src.ooccolor // Urist F["lastchangelog"] << src.lastchangelog // rastaf0 + return 1 // loads the savefile corresponding to the mob's ckey @@ -120,8 +121,10 @@ datum/preferences/proc/savefile_load(mob/user, var/silent = 1) be_special |= BE_MALF be_special |= BE_REV F["be_alien"] >> tmp + F["be_pai"] >> tmp if (tmp) be_special |= BE_ALIEN + be_special |= BE_PAI del(F) fdel(path) savefile_save(user) diff --git a/code/setup.dm b/code/setup.dm index 33af8fa97bf..a7fe5388c81 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -189,10 +189,11 @@ var/const #define BE_ALIEN (1<<6) #define BE_CULTIST (1<<7) #define BE_MONKEY (1<<8) +#define BE_PAI (1<<9) //#define BE_CIVILIAN (1<<15) //well, I must stop here. --rastaf0 -var/list/accessable_z_levels = list("1" = 10, "3" = 15, "4" = 60, "5" = 15) //This list contains the z-level numbers which can be accessed via space travel and the percentual chances to get there. (Exceptions: extended, sandbox and nuke) -Errorage +var/list/accessable_z_levels = list("1" = 10, "3" = 15, "4" = 60, "5" = 15) //This list contains the z-level numbers which can be accessed via space travel and the percentile chances to get there. (Exceptions: extended, sandbox and nuke) -Errorage #define IS_MODE_COMPILED(MODE) (ispath(text2path("/datum/game_mode/"+(MODE))))