Added a drunk variable and a text filter specifically for drunk talking, originally coded by Aryn.

This commit is contained in:
cib
2011-12-09 16:44:13 -08:00
parent 3a27c74b46
commit d970d2b4f9
12 changed files with 199 additions and 127 deletions
@@ -136,6 +136,7 @@
src.stat = 2
if (src.stuttering) src.stuttering--
if (src.drunk) src.drunk--
if (src.eye_blind)
src.eye_blind--
@@ -137,6 +137,7 @@
src.stat = 2
if (src.stuttering) src.stuttering--
if (src.drunk) src.drunk--
if (src.eye_blind)
src.eye_blind--
@@ -452,6 +452,7 @@
src.stat = 2
if (src.stuttering) src.stuttering--
if (src.drunk) src.drunk--
if (src.eye_blind)
src.eye_blind--
@@ -138,6 +138,7 @@
src.stat = 2
if (src.stuttering) src.stuttering--
if (src.drunk) src.drunk--
if (src.eye_blind)
src.eye_blind--
@@ -379,6 +379,7 @@
stat = 2
if (stuttering) stuttering--
if (drunk) drunk--
if (eye_blind)
eye_blind--
@@ -198,6 +198,7 @@
stat = 2
if (stuttering) stuttering--
if (drunk) drunk--
if (eye_blind)
eye_blind--
@@ -715,6 +715,7 @@
silent = 0
if (stuttering) stuttering--
if (drunk) drunk--
if (eye_blind)
eye_blind--
@@ -451,6 +451,7 @@
src.stat = 2
if (src.stuttering) src.stuttering--
if (src.drunk) src.drunk--
if (src.eye_blind)
src.eye_blind--
+3 -1
View File
@@ -138,7 +138,9 @@
if(!stuttering && prob(15))
message = stutter(message)
if (stuttering)
if (drunk)
message = Intoxicated(message)
else if (stuttering)
message = stutter(message)
/* //qw do not have beesease atm.
+59
View File
@@ -157,6 +157,65 @@ proc/isorgan(A)
p++
return t
proc/Intoxicated(phrase)
phrase = html_decode(phrase)
var
leng=lentext(phrase)
counter=lentext(phrase)
newphrase="";newletter=""
while(counter>=1)
newletter=copytext(phrase,(leng-counter)+1,(leng-counter)+2)
if(rand(1,3)==3)
if(lowertext(newletter)=="o") newletter="u"
if(lowertext(newletter)=="s") newletter="ch"
if(lowertext(newletter)=="a") newletter="ah"
if(lowertext(newletter)=="c") newletter="k"
switch(rand(1,15))
if(1,3,5,8) newletter="[lowertext(newletter)]"
if(2,4,6,15) newletter="[uppertext(newletter)]"
if(7) newletter+="'"
if(9,10) newletter="<b>[newletter]</b>"
if(11,12) newletter="<big>[newletter]</big>"
if(13) newletter="<small>[newletter]</small>"
newphrase+="[newletter]";counter-=1
return newphrase
proc/NewStutter(phrase,stunned)
phrase = html_decode(phrase)
var/list/split_phrase = dd_text2list(phrase," ") //Split it up into words.
var/list/unstuttered_words = split_phrase.Copy()
var/i = rand(1,3)
if(stunned) 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(dd_list2text(split_phrase," "))
/proc/stutter(n)
var/te = html_decode(n)