diff --git a/code/game/dna/mutations/mutation_powers.dm b/code/game/dna/mutations/mutation_powers.dm index 79fe7d0fa99..aaada5d9c36 100644 --- a/code/game/dna/mutations/mutation_powers.dm +++ b/code/game/dna/mutations/mutation_powers.dm @@ -957,7 +957,7 @@ stat_allowed = CONSCIOUS invocation_type = "none" action_icon_state = "genetic_mindscan" - var/list/available_targets = list() + var/list/expanded_minds = list() /datum/spell/mindscan/create_new_targeting() return new /datum/spell_targeting/telepathic @@ -970,43 +970,50 @@ if(target.dna?.GetSEState(GLOB.remotetalkblock)) message = "You feel [user.real_name] request a response from you... (Click here to project mind.)" user.show_message("You offer your mind to [(target in user.get_visible_mobs()) ? target.name : "the unknown entity"].") - target.show_message("[message]") - available_targets += target - addtimer(CALLBACK(src, PROC_REF(removeAvailability), target), 100) + target.show_message("[message]") + expanded_minds += target + addtimer(CALLBACK(src, PROC_REF(removeAvailability), target), 10 SECONDS) /datum/spell/mindscan/proc/removeAvailability(mob/living/target) - if(target in available_targets) - available_targets -= target - if(!(target in available_targets)) + if(target in expanded_minds) + expanded_minds -= target + if(!(target in expanded_minds)) target.show_message("You feel the sensation fade...") /datum/spell/mindscan/Topic(href, href_list) - var/mob/living/user - if(href_list["user"]) - user = locateUID(href_list["user"]) - if(href_list["target"]) - if(!user) - return - var/mob/living/target = locateUID(href_list["target"]) - if(!(target in available_targets)) - return - available_targets -= target - var/say = tgui_input_text(user, "What do you wish to say?", "Scan Mind") - if(!say) - return - say = pencode_to_html(say, target, format = FALSE, fields = FALSE) - user.create_log(SAY_LOG, "Telepathically responded '[say]' using [src]", target) - log_say("(TPATH to [key_name(target)]) [say]", user) - if(target.dna?.GetSEState(GLOB.remotetalkblock)) - target.show_message("You project your mind into [user.name]: [say]") - else - target.show_message("You fill the space in your thoughts: [say]") - user.show_message("You hear [target.name]'s voice: [say]") - for(var/mob/dead/observer/G in GLOB.player_list) - G.show_message("Telepathic response from [target] ([ghost_follow_link(target, ghost=G)]) to [user] ([ghost_follow_link(user, ghost=G)]): [say]") + var/mob/living/message_source + message_source = locateUID(href_list["from"]) + if(!message_source) + return + if(!message_source || !(message_source in expanded_minds)) + return + + expanded_minds -= message_source + + var/mob/living/message_target = locateUID(href_list["to"]) + if(!message_target) + return + + var/say = tgui_input_text(message_source, "What do you wish to say?", "Expanded Mind") + if(!say) + return + say = pencode_to_html(say, message_source, format = FALSE, fields = FALSE) + + message_source.create_log(SAY_LOG, "Telepathically responded '[say]' using [src]", message_target) + log_say("(TPATH to [key_name(message_target)]) [say]", message_source) + + if(message_source.dna?.GetSEState(GLOB.remotetalkblock)) + message_source.show_message("You project your mind into [message_target]: [say]") + else + message_source.show_message("You fill the space in your thoughts: [say]") + + message_target.show_message("You hear [message_source]'s voice: [say]") + + for(var/mob/dead/observer/G in GLOB.player_list) + G.show_message("Telepathic response from [message_source] ([ghost_follow_link(message_source, ghost=G)]) to [message_target] ([ghost_follow_link(message_target, ghost=G)]): [say]") /datum/spell/mindscan/Destroy() - available_targets.Cut() + expanded_minds.Cut() return ..() /datum/mutation/grant_spell/remoteview