Skip to content

Commit

Permalink
Psychic Whisper Deadchat and Use (#5407)
Browse files Browse the repository at this point in the history
# About the pull request
Allows Psychic whisper to be used while lying down. Also broadcasts the
content to deadchat.

<!-- Remove this text and explain what the purpose of your PR is.

Mention if you have tested your changes. If you changed a map, make sure
you used the mapmerge tool.
If this is an Issue Correction, you can type "Fixes Issue #169420" to
link the PR to the corresponding Issue number #169420.

Remember: something that is self-evident to you might not be to others.
Explain your rationale fully, even if you feel it goes without saying.
-->

# Explain why it's good for the game
Sad when deadchat see a queen staring at a mob not knowing she's talking
in their head. Also I "fixed" not using it lying down before, but
evidently did a bad job.
# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
:cl:
add: Psychic Whisper now broadcasts to deadchat too.
fix: Psychic Whisper can now be used while lying down.
/:cl:
  • Loading branch information
realforest2001 committed Jan 23, 2024
1 parent 369c55b commit e992409
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 34 deletions.
21 changes: 15 additions & 6 deletions code/modules/mob/living/carbon/human/powers/human_powers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -178,16 +178,25 @@
to_chat(H, SPAN_DANGER("Your nose begins to bleed..."))
H.drip(1)

/mob/living/carbon/human/proc/psychic_whisper(mob/M as mob in oview())
/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"

var/msg = strip_html(input("Message:", "Psychic Whisper") as text|null)
if(msg)
log_say("PsychicWhisper: [key_name(src)]->[M.key] : [msg]")
to_chat(M, SPAN_XENOWARNING(" You hear a strange, alien voice in your head... \italic [msg]"))
to_chat(src, SPAN_XENOWARNING(" You said: \"[msg]\" to [M]"))
var/whisper = strip_html(input("Message:", "Psychic Whisper") as text|null)
if(whisper)
log_say("PsychicWhisper: [key_name(src)]->[target_mob.key] : [whisper]")
to_chat(target_mob, SPAN_XENOWARNING(" You hear a strange, alien voice in your head... <i>[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))
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'>'[whisper]'</span>")
ghost.show_message(rendered_message, SHOW_MESSAGE_AUDIBLE)
return

/mob/living/verb/lay_down()
Expand Down
87 changes: 59 additions & 28 deletions code/modules/mob/living/carbon/xenomorph/Abilities.dm
Original file line number Diff line number Diff line change
Expand Up @@ -187,64 +187,95 @@
plasma_cost = 0

/datum/action/xeno_action/onclick/psychic_whisper/use_ability(atom/A)
var/mob/living/carbon/xenomorph/X = owner
if(X.client.prefs.muted & MUTE_IC)
to_chat(X, SPAN_DANGER("You cannot whisper (muted)."))
var/mob/living/carbon/xenomorph/xeno_player = owner
if(xeno_player.client.prefs.muted & MUTE_IC)
to_chat(xeno_player, SPAN_DANGER("You cannot whisper (muted)."))
return
if(!X.check_state(TRUE))
if(!xeno_player.check_state(TRUE))
return
var/list/target_list = list()
for(var/mob/living/possible_target in view(7, X))
if(possible_target == X || !possible_target.client) continue
for(var/mob/living/carbon/possible_target in view(7, xeno_player))
if(possible_target == xeno_player || !possible_target.client) continue
target_list += possible_target

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

if(!X.check_state(TRUE))
if(!xeno_player.check_state(TRUE))
return

var/msg = strip_html(input("Message:", "Psychic Whisper") as text|null)
if(msg)
log_say("PsychicWhisper: [key_name(X)]->[M.key] : [msg]")
if(!istype(M, /mob/living/carbon/xenomorph))
to_chat(M, SPAN_XENOQUEEN("You hear a strange, alien voice in your head. \"[msg]\""))
var/whisper = strip_html(input("Message:", "Psychic Whisper") as text|null)
if(whisper)
log_say("PsychicWhisper: [key_name(xeno_player)]->[target_mob.key] : [whisper]")
if(!istype(target_mob, /mob/living/carbon/xenomorph))
to_chat(target_mob, SPAN_XENOQUEEN("You hear a strange, alien voice in your head. \"[whisper]\""))
else
to_chat(M, SPAN_XENOQUEEN("You hear the voice of [X] resonate in your head. \"[msg]\""))
to_chat(X, SPAN_XENONOTICE("You said: \"[msg]\" to [M]"))
to_chat(target_mob, SPAN_XENOQUEEN("You hear the voice of [xeno_player] resonate in your head. \"[whisper]\""))
to_chat(xeno_player, SPAN_XENONOTICE("You said: \"[whisper]\" to [target_mob]"))

for(var/mob/dead/observer/ghost as anything in GLOB.observer_list)
if(!ghost.client || isnewplayer(ghost))
continue
if(ghost.client.prefs.toggles_chat & CHAT_GHOSTHIVEMIND)
var/rendered_message
var/xeno_track = "(<a href='byond://?src=\ref[ghost];track=\ref[xeno_player]'>F</a>)"
var/target_track = "(<a href='byond://?src=\ref[ghost];track=\ref[target_mob]'>F</a>)"
rendered_message = SPAN_XENOLEADER("PsychicWhisper: [xeno_player.real_name][xeno_track] to [target_mob.real_name][target_track], <span class='normal'>'[whisper]'</span>")
ghost.show_message(rendered_message, SHOW_MESSAGE_AUDIBLE)

return ..()

/datum/action/xeno_action/onclick/psychic_whisper/can_use_action()
var/mob/living/carbon/xenomorph/xeno = owner
if(xeno && !xeno.is_mob_incapacitated())
return TRUE
return FALSE

/datum/action/xeno_action/onclick/psychic_radiance
name = "Psychic Radiance"
action_icon_state = "psychic_radiance"
plasma_cost = 100

/datum/action/xeno_action/onclick/psychic_radiance/use_ability(atom/A)
var/mob/living/carbon/xenomorph/X = owner
if(X.client.prefs.muted & MUTE_IC)
to_chat(X, SPAN_DANGER("You cannot whisper (muted)."))
var/mob/living/carbon/xenomorph/xeno_player = owner
if(xeno_player.client.prefs.muted & MUTE_IC)
to_chat(xeno_player, SPAN_DANGER("You cannot whisper (muted)."))
return
if(!X.check_state(TRUE))
if(!xeno_player.check_state(TRUE))
return
var/list/target_list = list()
var/msg = strip_html(input("Message:", "Psychic Radiance") as text|null)
if(!msg || !X.check_state(TRUE))
var/whisper = strip_html(input("Message:", "Psychic Radiance") as text|null)
if(!whisper || !xeno_player.check_state(TRUE))
return
for(var/mob/living/possible_target in view(12, X))
if(possible_target == X || !possible_target.client)
for(var/mob/living/possible_target in view(12, xeno_player))
if(possible_target == xeno_player || !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. \"[msg]\""))
to_chat(possible_target, SPAN_XENOQUEEN("You hear a strange, alien voice in your head. \"[whisper]\""))
else
to_chat(possible_target, SPAN_XENOQUEEN("You hear the voice of [X] resonate in your head. \"[msg]\""))
to_chat(possible_target, SPAN_XENOQUEEN("You hear the voice of [xeno_player] resonate in your head. \"[whisper]\""))
if(!length(target_list))
return
var/targetstring = english_list(target_list)
to_chat(X, SPAN_XENONOTICE("You said: \"[msg]\" to [targetstring]"))
log_say("PsychicRadiance: [key_name(X)]->[targetstring] : [msg]")
to_chat(xeno_player, SPAN_XENONOTICE("You said: \"[whisper]\" to [targetstring]"))
log_say("PsychicRadiance: [key_name(xeno_player)]->[targetstring] : [whisper]")
for (var/mob/dead/observer/ghost as anything in GLOB.observer_list)
if(!ghost.client || isnewplayer(ghost))
continue
if(ghost.client.prefs.toggles_chat & CHAT_GHOSTHIVEMIND)
var/rendered_message
var/xeno_track = "(<a href='byond://?src=\ref[ghost];track=\ref[xeno_player]'>F</a>)"
rendered_message = SPAN_XENOLEADER("PsychicRadiance: [xeno_player.real_name][xeno_track] to [targetstring], <span class='normal'>'[whisper]'</span>")
ghost.show_message(rendered_message, SHOW_MESSAGE_AUDIBLE)
return ..()

/datum/action/xeno_action/onclick/psychic_radiance/can_use_action()
var/mob/living/carbon/xenomorph/xeno = owner
if(xeno && !xeno.is_mob_incapacitated())
return TRUE
return FALSE

/datum/action/xeno_action/activable/queen_give_plasma
name = "Give Plasma (400)"
action_icon_state = "queen_give_plasma"
Expand Down

0 comments on commit e992409

Please sign in to comment.