Gasping for words (#4453)

When the oxygen alert is active, there is now a 50% chance that a player will stop half way through their sentence and gasp for words.
This somewhat addresses the suggestion posted on the forum by Fortport
This commit is contained in:
Edward Lemon
2018-03-31 11:36:07 +03:00
committed by Erki
parent 902173f22b
commit afd00d021a
2 changed files with 57 additions and 0 deletions
@@ -297,4 +297,24 @@
if(length(cword))
rearranged += cword
message ="[prefix][jointext(rearranged," ")]"
if(losebreath>=5) //Gasping is a mutation, right?
var/prefix=copytext(message,1,2)
if(prefix == ";")
message = copytext(message,2)
else if(prefix in list(":","#"))
prefix += copytext(message,2,3)
message = copytext(message,3)
else
prefix=""
var/list/words = splittext(message," ")
if (prob(50))
if (words.len>1)
var/gasppoint = rand(2, words.len)
words.Cut(gasppoint)
words[words.len] = "[words[words.len]]..."
emote("gasp")
message = "[prefix][jointext(words," ")]"
return message