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

Singing & emote runechat fix while sleeping #55

Merged
merged 3 commits into from
Sep 7, 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
3 changes: 3 additions & 0 deletions code/__DEFINES/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
#define SPAN_COMMAND "command_headset"
#define SPAN_CLOWN "clown"

#define SPAN_SINGING "singing"
#define MODE_SING "%"

#define SPAN_GEN "say"
#define SPAN_DWARF "dwarf"
#define SPAN_ELF "elf"
Expand Down
2 changes: 1 addition & 1 deletion code/datums/brain_damage/phobia.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions code/modules/language/language.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 8 additions & 1 deletion code/modules/mob/living/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
. = ..()

Expand Down
6 changes: 3 additions & 3 deletions code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -250,7 +250,7 @@ GLOBAL_VAR_INIT(mobids, 1)
if(audible_message_flags & EMOTE_MESSAGE)
message = "<b>[src]</b> [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)

Expand Down Expand Up @@ -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

Expand Down
10 changes: 3 additions & 7 deletions code/modules/mob/mob_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/paperwork/paper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
1 change: 1 addition & 0 deletions interface/stylesheet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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;}
Expand Down
Loading