everything but mob stuff
This commit is contained in:
@@ -1,64 +0,0 @@
|
||||
|
||||
|
||||
//is this shit even used at all
|
||||
/proc/NewStutter(phrase,stun)
|
||||
phrase = html_decode(phrase)
|
||||
|
||||
var/list/split_phrase = splittext(phrase," ") //Split it up into words.
|
||||
|
||||
var/list/unstuttered_words = split_phrase.Copy()
|
||||
var/i = rand(1,3)
|
||||
if(stun) i = split_phrase.len
|
||||
for(,i > 0,i--) //Pick a few words to stutter on.
|
||||
|
||||
if (!unstuttered_words.len)
|
||||
break
|
||||
var/word = pick(unstuttered_words)
|
||||
unstuttered_words -= word //Remove from unstuttered words so we don't stutter it again.
|
||||
var/index = split_phrase.Find(word) //Find the word in the split phrase so we can replace it.
|
||||
|
||||
//Search for dipthongs (two letters that make one sound.)
|
||||
var/first_sound = copytext(word,1,3)
|
||||
var/first_letter = copytext(word,1,2)
|
||||
if(lowertext(first_sound) in list("ch","th","sh"))
|
||||
first_letter = first_sound
|
||||
|
||||
//Repeat the first letter to create a stutter.
|
||||
var/rnum = rand(1,3)
|
||||
switch(rnum)
|
||||
if(1)
|
||||
word = "[first_letter]-[word]"
|
||||
if(2)
|
||||
word = "[first_letter]-[first_letter]-[word]"
|
||||
if(3)
|
||||
word = "[first_letter]-[word]"
|
||||
|
||||
split_phrase[index] = word
|
||||
|
||||
return sanitize(jointext(split_phrase," "))
|
||||
|
||||
/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, keep_words)
|
||||
if(chance <= 0)
|
||||
return "..."
|
||||
if(chance >= 100)
|
||||
return original_msg
|
||||
|
||||
var/list
|
||||
words = splittext(original_msg," ")
|
||||
new_words = list()
|
||||
|
||||
var/new_msg = ""
|
||||
|
||||
for(var/w in words)
|
||||
if(prob(chance))
|
||||
new_words += "..."
|
||||
if(!keep_words)
|
||||
continue
|
||||
new_words += w
|
||||
|
||||
new_msg = jointext(new_words," ")
|
||||
|
||||
return new_msg
|
||||
Reference in New Issue
Block a user