Skip to content

Commit

Permalink
Merge pull request #141 from Mirag1993/Мердж-с-оффами
Browse files Browse the repository at this point in the history
Add a warning for last words. (shiptest-ss13#2476)
  • Loading branch information
MysticalFaceLesS authored Nov 14, 2023
2 parents ce11e0c + b73009e commit eb2e3e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion code/datums/components/edit_complainer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
SIGNAL_HANDLER

var/atom/movable/master = parent
master.say(pick(say_lines))
master.visible_message(pick(say_lines))
6 changes: 5 additions & 1 deletion code/modules/mob/living/living_say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,20 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
saymode = null
message_mods -= RADIO_EXTENSION
message_range = 1
src.log_talk(message, LOG_WHISPER, custom_say_emote = message_mods[MODE_CUSTOM_SAY_EMOTE])
var/logged_message = message
if(stat == HARD_CRIT) //This is cheaper than checking for MODE_WHISPER_CRIT message mod
var/health_diff = round(-HEALTH_THRESHOLD_DEAD + health)
// If we cut our message short, abruptly end it with a-..
var/message_len = length_char(message)
message = copytext_char(message, 1, health_diff) + "[message_len > health_diff ? "-.." : "..."]"
message = Ellipsis(message, 10, 1)
last_words = message
var/final_warning = alert(usr, "Your dying words will be \"[last_words]\", continue?", "Succumb", "Cancel", "Continue")
if(final_warning == "Cancel" || QDELETED(src))
return
message_mods[WHISPER_MODE] = MODE_WHISPER_CRIT
succumbed = TRUE
src.log_talk(logged_message, LOG_WHISPER, custom_say_emote = message_mods[MODE_CUSTOM_SAY_EMOTE])
else
src.log_talk(message, LOG_SAY, forced_by=forced, custom_say_emote = message_mods[MODE_CUSTOM_SAY_EMOTE])

Expand Down

0 comments on commit eb2e3e9

Please sign in to comment.