From ddb52452a100b765446f5a4130d5fbf0c29c45ee Mon Sep 17 00:00:00 2001 From: Giacomand Date: Wed, 8 Jan 2014 18:50:38 +0000 Subject: [PATCH] Final whispers will use the Elipses proc for extra tension. The Elipses proc got a new argument which disables replacing words with ..., and instead just adds them. --- code/modules/flufftext/TextFilters.dm | 7 ++++--- code/modules/mob/living/carbon/human/whisper.dm | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/code/modules/flufftext/TextFilters.dm b/code/modules/flufftext/TextFilters.dm index 1447ac7662a..674c0a68feb 100644 --- a/code/modules/flufftext/TextFilters.dm +++ b/code/modules/flufftext/TextFilters.dm @@ -62,7 +62,7 @@ proc/NewStutter(phrase,stunned) proc/Stagger(mob/M,d) //Technically not a filter, but it relates to drunkenness. step(M, pick(d,turn(d,90),turn(d,-90))) -proc/Ellipsis(original_msg, chance = 50) +proc/Ellipsis(original_msg, chance = 50, keep_words) if(chance <= 0) return "..." if(chance >= 100) return original_msg @@ -75,8 +75,9 @@ proc/Ellipsis(original_msg, chance = 50) for(var/w in words) if(prob(chance)) new_words += "..." - else - new_words += w + if(!keep_words) + continue + new_words += w new_msg = dd_list2text(new_words," ") diff --git a/code/modules/mob/living/carbon/human/whisper.dm b/code/modules/mob/living/carbon/human/whisper.dm index 05aa7540805..6e0492e2346 100644 --- a/code/modules/mob/living/carbon/human/whisper.dm +++ b/code/modules/mob/living/carbon/human/whisper.dm @@ -51,6 +51,7 @@ // If we cut our message short, abruptly end it with a-.. var/message_len = length(message) message = copytext(message, 1, health_diff) + "[message_len > health_diff ? "-.." : "..."]" + message = Ellipsis(message, 10, 1) whispers = "whispers in their final breath" var/italics = 1