From 4cbe29e2a6be4f893d86344d59273e6dd17feb94 Mon Sep 17 00:00:00 2001 From: jack-fractal Date: Sat, 15 Aug 2015 16:05:23 -0400 Subject: [PATCH] Adding possible uses string to posibrain chime. Adds a possible uses check to the posibrain chime. Will check for EITHER cyborg-ban OR machine whitelist to permit entry into posibrains. --- .../mob/living/carbon/brain/posibrain.dm | 43 ++++++++++++------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/code/modules/mob/living/carbon/brain/posibrain.dm b/code/modules/mob/living/carbon/brain/posibrain.dm index ef3624de..faf8c7bf 100644 --- a/code/modules/mob/living/carbon/brain/posibrain.dm +++ b/code/modules/mob/living/carbon/brain/posibrain.dm @@ -34,22 +34,24 @@ transfer_personality(O) reset_search() - /obj/item/device/mmi/posibrain/proc/request_player() for(var/mob/dead/observer/O in player_list) - if(O.client && O.client.prefs.be_special & BE_PAI && !jobban_isbanned(O, "Cyborg") && !jobban_isbanned(O,"nonhumandept")) - if(check_observer(O)) - O << "\blue \A [src] has been activated. (Teleport | Sign Up)" + if(check_observer(O)) + O << "\blue \A [src] has been activated. (Teleport | Sign Up)" -/obj/item/device/mmi/posibrain/proc/check_observer(var/mob/dead/observer/O) - if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted) - return 0 - if(jobban_isbanned(O, "Cyborg") || jobban_isbanned(O,"nonhumandept")) - return 0 - if(O.client) - return 1 - return 0 +/obj/item/device/mmi/posibrain/proc/check_observer(var/mob/dead/observer/test) + if (!test) // no person ? + return + if (!test.client) // is someone actually home? + return + if (!test.client.prefs.be_special & BE_PAI) // do they want to be a pAI? + return + if(test.has_enabled_antagHUD == 1 && config.antag_hud_restricted) // have they activated the antagHUD? + return + if ((jobban_isbanned(test, "Cyborg") || jobban_isbanned(test,"nonhumandept")) && !is_alien_whitelisted(test,"Machine")) // if you can't play as either role that uses posibrains, then you can't get into a posibrain + return + return TRUE /obj/item/device/mmi/posibrain/transfer_identity(var/mob/living/carbon/H) @@ -71,8 +73,20 @@ icon_state = "posibrain-occupied" return +/obj/item/device/mmi/posibrain/proc/get_possible_uses_string(var/mob/test) + if (!(jobban_isbanned(test, "Cyborg") || jobban_isbanned(test,"nonhumandept"))) + if (is_alien_whitelisted(test,"Machine")) + return "This posibrain's personality is compatible with assignment to either a tool-robot or a shell." + else + return "This posibrain's personality is compatible only with tool-robots." + else + if (is_alien_whitelisted(test,"Machine")) + return "This posibrain's personality is compatible only with shells." + else + return "This posibrain's personality is not compatible with any chassis. Something has gone wrong. Please call a bluespace technician to correct the issue." + /obj/item/device/mmi/posibrain/proc/transfer_personality(var/mob/candidate) - + var/uses = get_possible_uses_string(candidate) src.searching = 0 src.brainmob.mind = candidate.mind src.brainmob.ckey = candidate.ckey @@ -82,10 +96,9 @@ src.brainmob << "Remember, the purpose of your existence is to serve the crew and the station. Above all else, do no harm." src.brainmob << "Use say :b to speak to other artificial intelligences." src.brainmob.mind.assigned_role = "Positronic Brain" - var/turf/T = get_turf_or_move(src.loc) for (var/mob/M in viewers(T)) - M.show_message("\blue The positronic brain chimes quietly.") + M.show_message("\blue The positronic brain chimes quietly as it loads a new personality. [uses]") icon_state = "posibrain-occupied"