mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 17:52:36 +00:00
## About The Pull Request This explicitly specifies `type = MESSAGE_TYPE_RADIO` in `to_chat` for various methods of communication (blood cult communion, abductor telepathy, xeno hivemind, golem resonator, blob telepathy, changeling hivemind, and binary chat), so that they will always be considered under the "Radio" category by tgchat. Also added `avoid_highlighting` to some, so they won't highlight your own messages. ## Why It's Good For The Game Makes going thru older messages find things that I accidentally missed much easier. ## Changelog 🆑 qol: Messages from blood cult communion, abductor telepathy, xeno hivemind, golem resonator, blob telepathy, changeling hivemind, and binary chat are now considered "radio" messages by the chat, so they can properly be sorted via chat tabs. qol: Your own messages in blood cult communion, abductor/xenomorph/changeling hivemind, or golem telepathy will no longer be highlighted in chat (to prevent highlight spam whenever you talk if you highlight your own name, mainly) /🆑
99 lines
3.2 KiB
Plaintext
99 lines
3.2 KiB
Plaintext
/datum/saymode
|
|
var/key
|
|
var/mode
|
|
|
|
//Return FALSE if you have handled the message. Otherwise, return TRUE and saycode will continue doing saycode things.
|
|
//user = whoever said the message
|
|
//message = the message
|
|
//language = the language.
|
|
/datum/saymode/proc/handle_message(mob/living/user, message, datum/language/language)
|
|
return TRUE
|
|
|
|
/datum/saymode/changeling
|
|
key = MODE_KEY_CHANGELING
|
|
mode = MODE_CHANGELING
|
|
|
|
/datum/saymode/changeling/handle_message(mob/living/user, message, datum/language/language)
|
|
//we can send the message
|
|
if(!user.mind)
|
|
return FALSE
|
|
if(user.mind.has_antag_datum(/datum/antagonist/fallen_changeling))
|
|
to_chat(user, span_changeling("<b>We're cut off from the hivemind! We've lost everything! EVERYTHING!!</b>"))
|
|
return FALSE
|
|
var/datum/antagonist/changeling/ling_sender = IS_CHANGELING(user)
|
|
if(!ling_sender)
|
|
return FALSE
|
|
if(HAS_TRAIT(user, TRAIT_CHANGELING_HIVEMIND_MUTE))
|
|
to_chat(user, span_warning("The poison in the air hinders our ability to interact with the hivemind."))
|
|
return FALSE
|
|
|
|
user.log_talk(message, LOG_SAY, tag="changeling [ling_sender.changelingID]")
|
|
var/msg = span_changeling("<b>[ling_sender.changelingID]:</b> [message]")
|
|
|
|
//the recipients can receive the message
|
|
for(var/datum/antagonist/changeling/ling_receiver in GLOB.antagonists)
|
|
if(!ling_receiver.owner)
|
|
continue
|
|
var/mob/living/ling_mob = ling_receiver.owner.current
|
|
//removes types that override the presence of being changeling (for example, borged lings still can't hivemind chat)
|
|
if(!isliving(ling_mob) || issilicon(ling_mob) || isbrain(ling_mob))
|
|
continue
|
|
// can't receive messages on the hivemind right now
|
|
if(HAS_TRAIT(ling_mob, TRAIT_CHANGELING_HIVEMIND_MUTE))
|
|
continue
|
|
to_chat(ling_mob, msg, type = MESSAGE_TYPE_RADIO, avoid_highlighting = ling_mob == user)
|
|
|
|
for(var/mob/dead/ghost as anything in GLOB.dead_mob_list)
|
|
to_chat(ghost, "[FOLLOW_LINK(ghost, user)] [msg]", type = MESSAGE_TYPE_RADIO)
|
|
return FALSE
|
|
|
|
/datum/saymode/xeno
|
|
key = "a"
|
|
mode = MODE_ALIEN
|
|
|
|
/datum/saymode/xeno/handle_message(mob/living/user, message, datum/language/language)
|
|
if(user.hivecheck())
|
|
user.alien_talk(message)
|
|
return FALSE
|
|
|
|
|
|
/datum/saymode/vocalcords
|
|
key = MODE_KEY_VOCALCORDS
|
|
mode = MODE_VOCALCORDS
|
|
|
|
/datum/saymode/vocalcords/handle_message(mob/living/user, message, datum/language/language)
|
|
if(iscarbon(user))
|
|
var/mob/living/carbon/C = user
|
|
var/obj/item/organ/vocal_cords/V = C.get_organ_slot(ORGAN_SLOT_VOICE)
|
|
if(V?.can_speak_with())
|
|
V.handle_speech(message) //message
|
|
V.speak_with(message) //action
|
|
return FALSE
|
|
|
|
|
|
/datum/saymode/binary //everything that uses .b (silicons, drones)
|
|
key = MODE_KEY_BINARY
|
|
mode = MODE_BINARY
|
|
|
|
/datum/saymode/binary/handle_message(mob/living/user, message, datum/language/language)
|
|
if(isdrone(user))
|
|
var/mob/living/basic/drone/drone_user = user
|
|
drone_user.drone_chat(message)
|
|
return FALSE
|
|
if(user.binarycheck())
|
|
user.robot_talk(message)
|
|
return FALSE
|
|
return FALSE
|
|
|
|
|
|
/datum/saymode/holopad
|
|
key = "h"
|
|
mode = MODE_HOLOPAD
|
|
|
|
/datum/saymode/holopad/handle_message(mob/living/user, message, datum/language/language)
|
|
if(isAI(user))
|
|
var/mob/living/silicon/ai/AI = user
|
|
AI.holopad_talk(message, language)
|
|
return FALSE
|
|
return TRUE
|