From 9ec1576bf602bca5ab59170600d01339e94dfe2b Mon Sep 17 00:00:00 2001 From: Cooeen Date: Sat, 7 Sep 2024 10:29:33 +0200 Subject: [PATCH 1/3] Singing --- code/__DEFINES/say.dm | 4 ++++ code/game/atoms_movable.dm | 1 + code/modules/language/language.dm | 1 + code/modules/mob/living/say.dm | 9 ++++++++- code/modules/mob/say.dm | 2 ++ interface/stylesheet.dm | 1 + 6 files changed, 17 insertions(+), 1 deletion(-) diff --git a/code/__DEFINES/say.dm b/code/__DEFINES/say.dm index 975fb5d4b..31afb4563 100644 --- a/code/__DEFINES/say.dm +++ b/code/__DEFINES/say.dm @@ -55,6 +55,10 @@ #define SPAN_COMMAND "command_headset" #define SPAN_CLOWN "clown" +#define SPAN_SINGING "singing" +#define span_singing(str) ("" + str + "") +#define MODE_SING "%" + #define SPAN_GEN "say" #define SPAN_DWARF "dwarf" #define SPAN_ELF "elf" diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index c07bab83b..b67094b22 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -16,6 +16,7 @@ var/verb_ask = "asks" var/verb_exclaim = "exclaims" var/verb_whisper = "whispers" + var/verb_sing = "sings" var/verb_yell = "yells" var/speech_span var/inertia_dir = 0 diff --git a/code/modules/language/language.dm b/code/modules/language/language.dm index 72588f4c4..e66d47202 100644 --- a/code/modules/language/language.dm +++ b/code/modules/language/language.dm @@ -11,6 +11,7 @@ var/ask_verb = "asks" // Used when sentence ends in a ? var/exclaim_verb = "exclaims" // Used when sentence ends in a ! var/whisper_verb = "whispers" // Optional. When not specified speech_verb + quietly/softly is used instead. + var/sing_verb = "sings" // Used for singing. var/list/signlang_verb = list("signs", "gestures") // list of emotes that might be displayed if this language has NONVERBAL or SIGNLANG flags var/key // Character used to speak in language // If key is null, then the language isn't real or learnable. diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 02943d67c..560808052 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -86,7 +86,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list( var/static/list/unconscious_allowed_modes = list(MODE_CHANGELING = TRUE, MODE_ALIEN = TRUE) var/talk_key = get_key(message) - var/static/list/one_character_prefix = list(MODE_HEADSET = TRUE, MODE_ROBOT = TRUE, MODE_WHISPER = TRUE) + var/static/list/one_character_prefix = list(MODE_HEADSET = TRUE, MODE_ROBOT = TRUE, MODE_WHISPER = TRUE, MODE_SING = TRUE) var/ic_blocked = FALSE if(client && !forced && CHAT_FILTER_CHECK(message)) @@ -218,6 +218,11 @@ GLOBAL_LIST_INIT(department_radio_keys, list( else spans |= L.spans + if(message_mode == MODE_SING) + var/randomnote = pick("\u2669", "\u266A", "\u266B") + message = "[randomnote] [message] [randomnote]" + spans |= SPAN_SINGING + var/radio_return = radio(message, message_mode, spans, language) if(radio_return & ITALICS) spans |= SPAN_ITALICS @@ -451,6 +456,8 @@ GLOBAL_LIST_INIT(department_radio_keys, list( . = "stammers" else if(derpspeech) . = "gibbers" + else if(message_mode == MODE_SING) + . = verb_sing else . = ..() diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm index 252918833..629c6ed4a 100644 --- a/code/modules/mob/say.dm +++ b/code/modules/mob/say.dm @@ -138,6 +138,8 @@ var/key = copytext(message, 1, 2) if(key == "#") return MODE_WHISPER + else if(key == "%") + return MODE_SING else if(key == ";") return MODE_HEADSET else if(length(message) > 2 && (key in GLOB.department_radio_prefixes)) diff --git a/interface/stylesheet.dm b/interface/stylesheet.dm index c82fb06da..c427888ad 100644 --- a/interface/stylesheet.dm +++ b/interface/stylesheet.dm @@ -140,6 +140,7 @@ h1.alert, h2.alert {color: #c9c1ba;font-family: Pterra, TrueType;} .extremelybig {font-size: 220%;} .greentext {color: #00FF00;} .redtext {color: #FF0000;} +.singing {font-family: "Trebuchet MS", cursive, sans-serif; font-style: italic;} .clown {color: #FF69Bf; font-size: 3; font-family: "Comic Sans MS", cursive, sans-serif; font-weight: bold;} .his_grace {color: #15D512; font-family: "Courier New", cursive, sans-serif; font-style: italic;} .hypnophrase {color: #3bb5d3; font-weight: bold; animation: hypnocolor 1500ms infinite;} From 0c17fcfd85cd4ef25562b2b233d11e4cecd29bee Mon Sep 17 00:00:00 2001 From: Cooeen Date: Sat, 7 Sep 2024 14:01:31 +0200 Subject: [PATCH 2/3] Fix visible emotes while blind --- code/datums/brain_damage/phobia.dm | 2 +- code/modules/mob/mob.dm | 6 +++--- code/modules/mob/mob_helpers.dm | 10 +++------- code/modules/paperwork/paper.dm | 2 +- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/code/datums/brain_damage/phobia.dm b/code/datums/brain_damage/phobia.dm index 996021850..a75ff92f7 100644 --- a/code/datums/brain_damage/phobia.dm +++ b/code/datums/brain_damage/phobia.dm @@ -40,7 +40,7 @@ ..() if(HAS_TRAIT(owner, TRAIT_FEARLESS)) return - if(is_blind(owner)) + if(owner.is_blind()) return if(world.time > next_check && world.time > next_scare) next_check = world.time + 50 diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 113cb529c..18abbf249 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -220,7 +220,7 @@ GLOBAL_VAR_INIT(mobids, 1) if(!msg) continue - if(visible_message_flags & EMOTE_MESSAGE) + if(visible_message_flags & EMOTE_MESSAGE && !M.is_blind()) M.create_chat_message(src, raw_message = raw_msg, runechat_flags = visible_message_flags) M.show_message(msg, MSG_VISUAL, blind_message, MSG_AUDIBLE) @@ -250,7 +250,7 @@ GLOBAL_VAR_INIT(mobids, 1) if(audible_message_flags & EMOTE_MESSAGE) message = "[src] [message]" for(var/mob/M in hearers) - if(audible_message_flags & EMOTE_MESSAGE) + if(audible_message_flags & EMOTE_MESSAGE && M.can_hear()) M.create_chat_message(src, raw_message = raw_msg, runechat_flags = audible_message_flags) M.show_message(message, MSG_AUDIBLE, deaf_message, MSG_VISUAL) @@ -443,7 +443,7 @@ GLOBAL_VAR_INIT(mobids, 1) // shift-click catcher may issue examinate() calls for out-of-sight turfs return - if(is_blind(src)) + if(is_blind()) to_chat(src, span_warning("Something is there but I can't see it!")) return diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 04ec45c91..a85fba03d 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -689,13 +689,9 @@ aimheight = 1 ///Checks if passed through item is blind -/proc/is_blind(A) - if(ismob(A)) - var/mob/B = A - if(HAS_TRAIT(B, TRAIT_BLIND)) - return TRUE - return B.eye_blind - return FALSE +/mob/proc/is_blind(A) + SHOULD_BE_PURE(TRUE) + return eye_blind ? TRUE : HAS_TRAIT(src, TRAIT_BLIND) ///Is the mob hallucinating? /mob/proc/hallucinating() diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 452c221bf..714d8f26e 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -417,7 +417,7 @@ if(mailer) return ..() - if(is_blind(user)) + if(user.is_blind()) return ..() if(istype(P, /obj/item/pen) || istype(P, /obj/item/natural/thorn)|| istype(P, /obj/item/natural/feather)) From b1db3d57809875ec037aa93c65404ab232cd4756 Mon Sep 17 00:00:00 2001 From: Cooeen Date: Sat, 7 Sep 2024 14:51:41 +0200 Subject: [PATCH 3/3] This is not necessary --- code/__DEFINES/say.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/__DEFINES/say.dm b/code/__DEFINES/say.dm index 31afb4563..94cbbfd34 100644 --- a/code/__DEFINES/say.dm +++ b/code/__DEFINES/say.dm @@ -56,7 +56,6 @@ #define SPAN_CLOWN "clown" #define SPAN_SINGING "singing" -#define span_singing(str) ("" + str + "") #define MODE_SING "%" #define SPAN_GEN "say"