Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Psychic Radiance for humans #7087

Merged
merged 9 commits into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 32 additions & 7 deletions code/modules/mob/living/carbon/human/human_abilities.dm
Original file line number Diff line number Diff line change
Expand Up @@ -129,31 +129,56 @@


/datum/action/human_action/psychic_whisper
name = "Psychic Whipser"
name = "Psychic Whisper"
action_icon_state = "cultist_channel_hivemind"

/datum/action/human_action/psychic_whisper/action_activate()
. = ..()
if(!ishuman(owner))
return
return FALSE
var/mob/living/carbon/human/human_owner = owner

if(human_owner.client.prefs.muted & MUTE_IC)
to_chat(human_owner, SPAN_DANGER("You cannot whisper (muted)."))
return
return FALSE

if(human_owner.stat == DEAD)
to_chat(human_owner, SPAN_WARNING("You cannot talk while dead."))
return FALSE

var/list/target_list = list()
for(var/mob/living/carbon/possible_target in view(7, human_owner))
if(possible_target == human_owner || !possible_target.client)
if(possible_target == human_owner || !possible_target.client)
continue
target_list += possible_target

var/mob/living/carbon/target_mob = tgui_input_list(human_owner, "Target", "Send a Psychic Whisper to whom?", target_list, theme = "hive_status")
if(!target_mob)
return
var/mob/living/carbon/target_mob = tgui_input_list(human_owner, "Target", "Send a Psychic Whisper to whom?", target_list, theme = "wizard")
if(!target_mob)
return FALSE

human_owner.psychic_whisper(target_mob)


/datum/action/human_action/psychic_radiance
name = "Psychic Radiance"
action_icon_state = "cultist_channel_hivemind"

/datum/action/xeno_action/onclick/psychic_radiance/use_ability(atom/A)
. = ..()
if(!ishuman(owner))
return FALSE
var/mob/living/carbon/human/human_owner = owner

if(human_owner.client.prefs.muted & MUTE_IC)
to_chat(human_owner, SPAN_DANGER("You cannot whisper (muted)."))
return FALSE

if(human_owner.stat == DEAD)
to_chat(human_owner, SPAN_WARNING("You cannot talk while dead."))
return FALSE

human_owner.psychic_radiance()

/*
CULT
*/
Expand Down
61 changes: 53 additions & 8 deletions code/modules/mob/living/carbon/human/powers/human_powers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
M.gib(create_cause_data("gutting", usr))

/mob/living/carbon/human/proc/commune()
set category = "Abilities"
set category = "Abilities.Psychic"
set name = "Commune with creature"
set desc = "Send a telepathic message to an unlucky recipient."

Expand Down Expand Up @@ -181,23 +181,68 @@
/mob/living/carbon/human/proc/psychic_whisper(mob/target_mob as mob in oview())
set name = "Psychic Whisper"
set desc = "Whisper silently to someone over a distance."
set category = "Abilities"
set category = "Abilities.Psychic"

if(stat == DEAD)
to_chat(src, SPAN_WARNING("You cannot talk while dead."))
return FALSE

var/whisper = strip_html(input("Message:", "Psychic Whisper") as text|null)
var/whisper = tgui_input_text(src, "What do you wish to say?", "Psychic Whisper")
if(whisper)
log_say("PsychicWhisper: [key_name(src)]->[target_mob.key] : [whisper] (AREA: [get_area_name(loc)])")
to_chat(target_mob, SPAN_XENOWARNING(" You hear a strange, alien voice in your head... <i>[SPAN_PSYTALK(whisper)]</i>"))
to_chat(src, SPAN_XENOWARNING(" You said: \"[whisper]\" to [target_mob]"))
for (var/mob/dead/observer/ghost as anything in GLOB.observer_list)
if(!ghost.client || isnewplayer(ghost))
if(!istype(target_mob, /mob/living/carbon/xenomorph))
to_chat(target_mob, SPAN_XENOQUEEN("You hear a strange, alien voice in your head... \"[SPAN_PSYTALK(whisper)]\""))
else
to_chat(target_mob, SPAN_XENOQUEEN("You hear the voice of [src] resonate in your head... \"[SPAN_PSYTALK(whisper)]\""))
to_chat(src, SPAN_XENOWARNING("You said: \"[whisper]\" to [target_mob]"))
FOR_DVIEW(var/mob/dead/observer/ghost, 12, src, SEE_INVISIBLE_OBSERVER)
if(!isobserver(ghost) || !ghost.client)
continue
if(ghost.client.prefs.toggles_chat & CHAT_GHOSTHIVEMIND)
var/rendered_message
var/human_track = "(<a href='byond://?src=\ref[ghost];track=\ref[src]'>F</a>)"
var/target_track = "(<a href='byond://?src=\ref[ghost];track=\ref[target_mob]'>F</a>)"
rendered_message = SPAN_XENOLEADER("PsychicWhisper: [real_name][human_track] to [target_mob.real_name][target_track], <span class='normal'>'[SPAN_PSYTALK(whisper)]'</span>")
ghost.show_message(rendered_message, SHOW_MESSAGE_AUDIBLE)
return
return FALSE

/mob/living/carbon/human/proc/psychic_radiance()
set name = "Psychic Radiance"
set desc = "Whisper silently to multiple people over a distance."
set category = "Abilities.Psychic"

if(stat == DEAD)
to_chat(src, SPAN_WARNING("You cannot talk while dead."))
return FALSE

var/whisper = tgui_input_text(src, "What do you wish to say?", "Psychic Radiance")
var/list/target_list = list()
if(!whisper)
return FALSE
FOR_DVIEW(var/mob/living/possible_target, 12, src, HIDE_INVISIBLE_OBSERVER)
if(possible_target == src || !possible_target.client)
continue
target_list += possible_target
if(!istype(possible_target, /mob/living/carbon/xenomorph))
to_chat(possible_target, SPAN_XENOQUEEN("You hear a strange, alien voice in your head... \"[SPAN_PSYTALK(whisper)]\""))
else
to_chat(possible_target, SPAN_XENOQUEEN("You hear the voice of [src] resonate in your head... \"[SPAN_PSYTALK(whisper)]\""))
FOR_DVIEW_END
if(!length(target_list))
to_chat(src, SPAN_XENOWARNING("There is no one around to hear you..."))
return FALSE
var/targetstring = english_list(target_list)
to_chat(src, SPAN_XENONOTICE("You said: \"[whisper]\" to [targetstring]"))
log_say("PsychicRadiance: [key_name(src)]->[targetstring] : [whisper] (AREA: [get_area_name(src)])")
FOR_DVIEW(var/mob/dead/observer/ghost, 12, src, SEE_INVISIBLE_OBSERVER)
if(!isobserver(ghost) || !ghost.client)
continue
if(ghost.client.prefs.toggles_chat & CHAT_GHOSTHIVEMIND)
var/rendered_message
var/human_track = "(<a href='byond://?src=\ref[ghost];track=\ref[src]'>F</a>)"
rendered_message = SPAN_XENOLEADER("PsychicRadiance: [real_name][human_track] to [targetstring], <span class='normal'>'[SPAN_PSYTALK(whisper)]'</span>")
ghost.show_message(rendered_message, SHOW_MESSAGE_AUDIBLE)
return TRUE

/mob/living/verb/lay_down()
set name = "Rest"
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/xenomorph/Abilities.dm
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
if(!xeno_player.check_state(TRUE))
return

var/whisper = strip_html(input("Message:", "Psychic Whisper") as text|null)
var/whisper = tgui_input_text(xeno_player, "What do you wish to say?", "Psychic Whisper")
if(whisper)
log_say("PsychicWhisper: [key_name(xeno_player)]->[target_mob.key] : [whisper] (AREA: [get_area_name(target_mob)])")
if(!istype(target_mob, /mob/living/carbon/xenomorph))
Expand Down Expand Up @@ -246,7 +246,7 @@
if(!xeno_player.check_state(TRUE))
return
var/list/target_list = list()
var/whisper = strip_html(input("Message:", "Psychic Radiance") as text|null)
var/whisper = tgui_input_text(xeno_player, "What do you wish to say?", "Psychic Radiance")
if(!whisper || !xeno_player.check_state(TRUE))
return
FOR_DVIEW(var/mob/living/possible_target, 12, xeno_player, HIDE_INVISIBLE_OBSERVER)
Expand Down
Loading