From b79e4ec4a400ea5e73de639ea87e98bd1c660080 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Tue, 26 Dec 2023 11:03:43 +0000 Subject: [PATCH 1/7] DeadChat Whipser --- .../carbon/human/powers/human_powers.dm | 20 +++-- .../mob/living/carbon/xenomorph/Abilities.dm | 73 ++++++++++++------- 2 files changed, 59 insertions(+), 34 deletions(-) diff --git a/code/modules/mob/living/carbon/human/powers/human_powers.dm b/code/modules/mob/living/carbon/human/powers/human_powers.dm index be7848b2a936..be2525684aab 100644 --- a/code/modules/mob/living/carbon/human/powers/human_powers.dm +++ b/code/modules/mob/living/carbon/human/powers/human_powers.dm @@ -178,16 +178,24 @@ 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... \italic [whisper]")) + to_chat(src, SPAN_XENOWARNING(" You said: \"[whisper]\" to [target_mob]")) + for (var/mob/dead/observer/ghost as anything in GLOB.observer_list) + if(!QDELETED(ghost) && !istype(ghost,/mob/new_player)) + if(ghost.client.prefs && ghost.client.prefs.toggles_chat & CHAT_GHOSTHIVEMIND) + var/rendered_message + var/human_track = "(F)" + var/target_track = "(F)" + rendered_message = SPAN_XENOLEADER("PsychicWhisper: [src.real_name][human_track] to [target_mob.real_name][target_track], '[whisper]'") + ghost.show_message(rendered_message, SHOW_MESSAGE_AUDIBLE) return /mob/living/verb/lay_down() diff --git a/code/modules/mob/living/carbon/xenomorph/Abilities.dm b/code/modules/mob/living/carbon/xenomorph/Abilities.dm index dc44260187a7..acbb91c6cfe4 100644 --- a/code/modules/mob/living/carbon/xenomorph/Abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/Abilities.dm @@ -187,31 +187,41 @@ 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(!QDELETED(ghost) && !istype(ghost,/mob/new_player)) + if(ghost.client.prefs && ghost.client.prefs.toggles_chat & CHAT_GHOSTHIVEMIND) + var/rendered_message + var/xeno_track = "(F)" + var/target_track = "(F)" + rendered_message = SPAN_XENOLEADER("PsychicWhisper: [xeno_player.real_name][xeno_track] to [target_mob.real_name][target_track], '[whisper]'") + ghost.show_message(rendered_message, SHOW_MESSAGE_AUDIBLE) + return ..() /datum/action/xeno_action/onclick/psychic_radiance @@ -220,29 +230,36 @@ 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(!QDELETED(ghost) && !istype(ghost,/mob/new_player)) + if(ghost.client.prefs && ghost.client.prefs.toggles_chat & CHAT_GHOSTHIVEMIND) + var/rendered_message + var/xeno_track = "(F)" + rendered_message = SPAN_XENOLEADER("PsychicRadiance: [xeno_player.real_name][xeno_track] to [targetstring], '[whisper]'") + ghost.show_message(rendered_message, SHOW_MESSAGE_AUDIBLE) return ..() /datum/action/xeno_action/activable/queen_give_plasma From edf21a8e40e8c5fde61df06f893cdca2251ad7a3 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Tue, 9 Jan 2024 01:41:04 +0000 Subject: [PATCH 2/7] Can use whisper --- code/modules/mob/living/carbon/xenomorph/Abilities.dm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/modules/mob/living/carbon/xenomorph/Abilities.dm b/code/modules/mob/living/carbon/xenomorph/Abilities.dm index acbb91c6cfe4..d970d8ab7aef 100644 --- a/code/modules/mob/living/carbon/xenomorph/Abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/Abilities.dm @@ -224,6 +224,9 @@ return ..() +/datum/action/xeno_action/onclick/psychic_whisper/can_use_action() + return TRUE + /datum/action/xeno_action/onclick/psychic_radiance name = "Psychic Radiance" action_icon_state = "psychic_radiance" @@ -262,6 +265,9 @@ ghost.show_message(rendered_message, SHOW_MESSAGE_AUDIBLE) return ..() +/datum/action/xeno_action/onclick/psychic_radiance/can_use_action() + return TRUE + /datum/action/xeno_action/activable/queen_give_plasma name = "Give Plasma (400)" action_icon_state = "queen_give_plasma" From 6545e56c38f89b0cdf6848a75822b63905f9c8e2 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Tue, 9 Jan 2024 01:43:07 +0000 Subject: [PATCH 3/7] tweak --- code/modules/mob/living/carbon/xenomorph/Abilities.dm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/carbon/xenomorph/Abilities.dm b/code/modules/mob/living/carbon/xenomorph/Abilities.dm index d970d8ab7aef..344fa41cffc6 100644 --- a/code/modules/mob/living/carbon/xenomorph/Abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/Abilities.dm @@ -225,7 +225,10 @@ return ..() /datum/action/xeno_action/onclick/psychic_whisper/can_use_action() - return TRUE + var/mob/living/carbon/xenomorph/X = owner + if(X && !X.is_mob_incapacitated()) + return TRUE + return FALSE /datum/action/xeno_action/onclick/psychic_radiance name = "Psychic Radiance" @@ -266,7 +269,10 @@ return ..() /datum/action/xeno_action/onclick/psychic_radiance/can_use_action() - return TRUE + var/mob/living/carbon/xenomorph/X = owner + if(X && !X.is_mob_incapacitated()) + return TRUE + return FALSE /datum/action/xeno_action/activable/queen_give_plasma name = "Give Plasma (400)" From 8fbdd5ec908e35ebcbdf283a48aeab53c6f18624 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Tue, 9 Jan 2024 02:09:43 +0000 Subject: [PATCH 4/7] fix? --- code/modules/mob/living/carbon/xenomorph/Abilities.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/carbon/xenomorph/Abilities.dm b/code/modules/mob/living/carbon/xenomorph/Abilities.dm index 344fa41cffc6..dc02a6114c6c 100644 --- a/code/modules/mob/living/carbon/xenomorph/Abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/Abilities.dm @@ -214,7 +214,7 @@ 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(!QDELETED(ghost) && !istype(ghost,/mob/new_player)) + if(!QDELETED(ghost) && ghost.client && !istype(ghost,/mob/new_player)) if(ghost.client.prefs && ghost.client.prefs.toggles_chat & CHAT_GHOSTHIVEMIND) var/rendered_message var/xeno_track = "(F)" @@ -260,7 +260,7 @@ 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(!QDELETED(ghost) && !istype(ghost,/mob/new_player)) + if(!QDELETED(ghost) && ghost.client && !istype(ghost,/mob/new_player)) if(ghost.client.prefs && ghost.client.prefs.toggles_chat & CHAT_GHOSTHIVEMIND) var/rendered_message var/xeno_track = "(F)" From 46f54fbe9712923c445d487912c4b566dd1ec874 Mon Sep 17 00:00:00 2001 From: forest2001 Date: Wed, 10 Jan 2024 00:54:57 +0000 Subject: [PATCH 5/7] Hn --- .../mob/living/carbon/xenomorph/Abilities.dm | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/code/modules/mob/living/carbon/xenomorph/Abilities.dm b/code/modules/mob/living/carbon/xenomorph/Abilities.dm index dc02a6114c6c..ff03af964b7f 100644 --- a/code/modules/mob/living/carbon/xenomorph/Abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/Abilities.dm @@ -213,14 +213,15 @@ 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(!QDELETED(ghost) && ghost.client && !istype(ghost,/mob/new_player)) - if(ghost.client.prefs && ghost.client.prefs.toggles_chat & CHAT_GHOSTHIVEMIND) - var/rendered_message - var/xeno_track = "(F)" - var/target_track = "(F)" - rendered_message = SPAN_XENOLEADER("PsychicWhisper: [xeno_player.real_name][xeno_track] to [target_mob.real_name][target_track], '[whisper]'") - ghost.show_message(rendered_message, SHOW_MESSAGE_AUDIBLE) + 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 = "(F)" + var/target_track = "(F)" + rendered_message = SPAN_XENOLEADER("PsychicWhisper: [xeno_player.real_name][xeno_track] to [target_mob.real_name][target_track], '[whisper]'") + ghost.show_message(rendered_message, SHOW_MESSAGE_AUDIBLE) return ..() @@ -260,12 +261,13 @@ 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(!QDELETED(ghost) && ghost.client && !istype(ghost,/mob/new_player)) - if(ghost.client.prefs && ghost.client.prefs.toggles_chat & CHAT_GHOSTHIVEMIND) - var/rendered_message - var/xeno_track = "(F)" - rendered_message = SPAN_XENOLEADER("PsychicRadiance: [xeno_player.real_name][xeno_track] to [targetstring], '[whisper]'") - ghost.show_message(rendered_message, SHOW_MESSAGE_AUDIBLE) + if(!ghost.client || isnewplayer(ghost)) + continue + if(ghost.client.prefs.toggles_chat & CHAT_GHOSTHIVEMIND) + var/rendered_message + var/xeno_track = "(F)" + rendered_message = SPAN_XENOLEADER("PsychicRadiance: [xeno_player.real_name][xeno_track] to [targetstring], '[whisper]'") + ghost.show_message(rendered_message, SHOW_MESSAGE_AUDIBLE) return ..() /datum/action/xeno_action/onclick/psychic_radiance/can_use_action() From 34108e1b9a787cbcc6dfdf03593cbce51c77f8ac Mon Sep 17 00:00:00 2001 From: forest2001 Date: Wed, 10 Jan 2024 00:55:45 +0000 Subject: [PATCH 6/7] human --- .../living/carbon/human/powers/human_powers.dm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/code/modules/mob/living/carbon/human/powers/human_powers.dm b/code/modules/mob/living/carbon/human/powers/human_powers.dm index be2525684aab..b4793fd1c8fb 100644 --- a/code/modules/mob/living/carbon/human/powers/human_powers.dm +++ b/code/modules/mob/living/carbon/human/powers/human_powers.dm @@ -189,13 +189,14 @@ to_chat(target_mob, SPAN_XENOWARNING(" You hear a strange, alien voice in your head... \italic [whisper]")) to_chat(src, SPAN_XENOWARNING(" You said: \"[whisper]\" to [target_mob]")) for (var/mob/dead/observer/ghost as anything in GLOB.observer_list) - if(!QDELETED(ghost) && !istype(ghost,/mob/new_player)) - if(ghost.client.prefs && ghost.client.prefs.toggles_chat & CHAT_GHOSTHIVEMIND) - var/rendered_message - var/human_track = "(F)" - var/target_track = "(F)" - rendered_message = SPAN_XENOLEADER("PsychicWhisper: [src.real_name][human_track] to [target_mob.real_name][target_track], '[whisper]'") - ghost.show_message(rendered_message, SHOW_MESSAGE_AUDIBLE) + if(!ghost.client || isnewplayer(ghost)) + continue + if(ghost.client.prefs.toggles_chat & CHAT_GHOSTHIVEMIND) + var/rendered_message + var/human_track = "(F)" + var/target_track = "(F)" + rendered_message = SPAN_XENOLEADER("PsychicWhisper: [src.real_name][human_track] to [target_mob.real_name][target_track], '[whisper]'") + ghost.show_message(rendered_message, SHOW_MESSAGE_AUDIBLE) return /mob/living/verb/lay_down() From ef27829ab3915c714d225227aefd0e1dc594349e Mon Sep 17 00:00:00 2001 From: forest2001 Date: Mon, 22 Jan 2024 11:31:00 +0000 Subject: [PATCH 7/7] changes --- .../mob/living/carbon/human/powers/human_powers.dm | 4 ++-- code/modules/mob/living/carbon/xenomorph/Abilities.dm | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code/modules/mob/living/carbon/human/powers/human_powers.dm b/code/modules/mob/living/carbon/human/powers/human_powers.dm index df18068abad3..a96f404a1447 100644 --- a/code/modules/mob/living/carbon/human/powers/human_powers.dm +++ b/code/modules/mob/living/carbon/human/powers/human_powers.dm @@ -186,7 +186,7 @@ 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... \italic [whisper]")) + to_chat(target_mob, SPAN_XENOWARNING(" You hear a strange, alien voice in your head... [whisper]")) 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)) @@ -195,7 +195,7 @@ var/rendered_message var/human_track = "(F)" var/target_track = "(F)" - rendered_message = SPAN_XENOLEADER("PsychicWhisper: [src.real_name][human_track] to [target_mob.real_name][target_track], '[whisper]'") + rendered_message = SPAN_XENOLEADER("PsychicWhisper: [real_name][human_track] to [target_mob.real_name][target_track], '[whisper]'") ghost.show_message(rendered_message, SHOW_MESSAGE_AUDIBLE) return diff --git a/code/modules/mob/living/carbon/xenomorph/Abilities.dm b/code/modules/mob/living/carbon/xenomorph/Abilities.dm index 3fd20a0b58bf..806b0646590d 100644 --- a/code/modules/mob/living/carbon/xenomorph/Abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/Abilities.dm @@ -226,8 +226,8 @@ return ..() /datum/action/xeno_action/onclick/psychic_whisper/can_use_action() - var/mob/living/carbon/xenomorph/X = owner - if(X && !X.is_mob_incapacitated()) + var/mob/living/carbon/xenomorph/xeno = owner + if(xeno && !xeno.is_mob_incapacitated()) return TRUE return FALSE @@ -271,8 +271,8 @@ return ..() /datum/action/xeno_action/onclick/psychic_radiance/can_use_action() - var/mob/living/carbon/xenomorph/X = owner - if(X && !X.is_mob_incapacitated()) + var/mob/living/carbon/xenomorph/xeno = owner + if(xeno && !xeno.is_mob_incapacitated()) return TRUE return FALSE