Files
Bubberstation/code/datums/mutations/speech.dm
SkyratBot 3585818703 [MIRROR] Pig Latin Mutation (#8012)
* Pig Latin Mutation (#61184)

* Pig Latin Mutation

Co-authored-by: tralezab <40974010+tralezab@users.noreply.github.com>
2021-09-06 07:55:13 -04:00

267 lines
10 KiB
Plaintext

//These are all minor mutations that affect your speech somehow.
//Individual ones aren't commented since their functions should be evident at a glance
/datum/mutation/human/nervousness
name = "Nervousness"
desc = "Causes the holder to stutter."
quality = MINOR_NEGATIVE
text_gain_indication = "<span class='danger'>You feel nervous.</span>"
/datum/mutation/human/nervousness/on_life(delta_time, times_fired)
if(DT_PROB(5, delta_time))
owner.stuttering = max(10, owner.stuttering)
/datum/mutation/human/wacky
name = "Wacky"
desc = "You are not a clown. You are the entire circus."
quality = MINOR_NEGATIVE
text_gain_indication = "<span class='sans'><span class='infoplain'>You feel an off sensation in your voicebox.</span></span>"
text_lose_indication = "<span class='notice'>The off sensation passes.</span>"
/datum/mutation/human/wacky/on_acquiring(mob/living/carbon/human/owner)
if(..())
return
RegisterSignal(owner, COMSIG_MOB_SAY, .proc/handle_speech)
/datum/mutation/human/wacky/on_losing(mob/living/carbon/human/owner)
if(..())
return
UnregisterSignal(owner, COMSIG_MOB_SAY)
/datum/mutation/human/wacky/proc/handle_speech(datum/source, list/speech_args)
SIGNAL_HANDLER
speech_args[SPEECH_SPANS] |= SPAN_SANS
/datum/mutation/human/mute
name = "Mute"
desc = "Completely inhibits the vocal section of the brain."
quality = NEGATIVE
text_gain_indication = "<span class='danger'>You feel unable to express yourself at all.</span>"
text_lose_indication = "<span class='danger'>You feel able to speak freely again.</span>"
/datum/mutation/human/mute/on_acquiring(mob/living/carbon/human/owner)
if(..())
return
ADD_TRAIT(owner, TRAIT_MUTE, GENETIC_MUTATION)
/datum/mutation/human/mute/on_losing(mob/living/carbon/human/owner)
if(..())
return
REMOVE_TRAIT(owner, TRAIT_MUTE, GENETIC_MUTATION)
/datum/mutation/human/unintelligible
name = "Unintelligible"
desc = "Partially inhibits the vocal center of the brain, severely distorting speech."
quality = NEGATIVE
text_gain_indication = "<span class='danger'>You can't seem to form any coherent thoughts!</span>"
text_lose_indication = "<span class='danger'>Your mind feels more clear.</span>"
/datum/mutation/human/unintelligible/on_acquiring(mob/living/carbon/human/owner)
if(..())
return
ADD_TRAIT(owner, TRAIT_UNINTELLIGIBLE_SPEECH, GENETIC_MUTATION)
/datum/mutation/human/unintelligible/on_losing(mob/living/carbon/human/owner)
if(..())
return
REMOVE_TRAIT(owner, TRAIT_UNINTELLIGIBLE_SPEECH, GENETIC_MUTATION)
/datum/mutation/human/swedish
name = "Swedish"
desc = "A horrible mutation originating from the distant past. Thought to be eradicated after the incident in 2037."
quality = MINOR_NEGATIVE
text_gain_indication = "<span class='notice'>You feel Swedish, however that works.</span>"
text_lose_indication = "<span class='notice'>The feeling of Swedishness passes.</span>"
/datum/mutation/human/swedish/on_acquiring(mob/living/carbon/human/owner)
if(..())
return
RegisterSignal(owner, COMSIG_MOB_SAY, .proc/handle_speech)
/datum/mutation/human/swedish/on_losing(mob/living/carbon/human/owner)
if(..())
return
UnregisterSignal(owner, COMSIG_MOB_SAY)
/datum/mutation/human/swedish/proc/handle_speech(datum/source, list/speech_args)
SIGNAL_HANDLER
var/message = speech_args[SPEECH_MESSAGE]
if(message)
message = replacetext(message,"w","v")
message = replacetext(message,"j","y")
message = replacetext(message,"a",pick("å","ä","æ","a"))
message = replacetext(message,"bo","bjo")
message = replacetext(message,"o",pick("ö","ø","o"))
if(prob(30))
message += " Bork[pick("",", bork",", bork, bork")]!"
speech_args[SPEECH_MESSAGE] = trim(message)
/datum/mutation/human/chav
name = "Chav"
desc = "Unknown"
quality = MINOR_NEGATIVE
text_gain_indication = "<span class='notice'>Ye feel like a reet prat like, innit?</span>"
text_lose_indication = "<span class='notice'>You no longer feel like being rude and sassy.</span>"
/datum/mutation/human/chav/on_acquiring(mob/living/carbon/human/owner)
if(..())
return
RegisterSignal(owner, COMSIG_MOB_SAY, .proc/handle_speech)
/datum/mutation/human/chav/on_losing(mob/living/carbon/human/owner)
if(..())
return
UnregisterSignal(owner, COMSIG_MOB_SAY)
/datum/mutation/human/chav/proc/handle_speech(datum/source, mob/speech_args)
SIGNAL_HANDLER
var/message = speech_args[SPEECH_MESSAGE]
if(message[1] != "*")
message = " [message]"
var/list/chav_words = strings("chav_replacement.json", "chav")
for(var/key in chav_words)
var/value = chav_words[key]
if(islist(value))
value = pick(value)
message = replacetextEx(message, " [uppertext(key)]", " [uppertext(value)]")
message = replacetextEx(message, " [capitalize(key)]", " [capitalize(value)]")
message = replacetextEx(message, " [key]", " [value]")
if(prob(30))
message += ", mate"
speech_args[SPEECH_MESSAGE] = trim(message)
/datum/mutation/human/elvis
name = "Elvis"
desc = "A terrifying mutation named after its 'patient-zero'."
quality = MINOR_NEGATIVE
locked = TRUE
text_gain_indication = "<span class='notice'>You feel pretty good, honeydoll.</span>"
text_lose_indication = "<span class='notice'>You feel a little less conversation would be great.</span>"
/datum/mutation/human/elvis/on_life(delta_time, times_fired)
switch(pick(1,2))
if(1)
if(DT_PROB(7.5, delta_time))
var/list/dancetypes = list("swinging", "fancy", "stylish", "20'th century", "jivin'", "rock and roller", "cool", "salacious", "bashing", "smashing")
var/dancemoves = pick(dancetypes)
owner.visible_message("<b>[owner]</b> busts out some [dancemoves] moves!")
if(2)
if(DT_PROB(7.5, delta_time))
owner.visible_message("<b>[owner]</b> [pick("jiggles their hips", "rotates their hips", "gyrates their hips", "taps their foot", "dances to an imaginary song", "jiggles their legs", "snaps their fingers")]!")
/datum/mutation/human/elvis/on_acquiring(mob/living/carbon/human/owner)
if(..())
return
RegisterSignal(owner, COMSIG_MOB_SAY, .proc/handle_speech)
/datum/mutation/human/elvis/on_losing(mob/living/carbon/human/owner)
if(..())
return
UnregisterSignal(owner, COMSIG_MOB_SAY)
/datum/mutation/human/elvis/proc/handle_speech(datum/source, list/speech_args)
SIGNAL_HANDLER
var/message = speech_args[SPEECH_MESSAGE]
if(message)
message = " [message] "
message = replacetext(message," i'm not "," I ain't ")
message = replacetext(message," girl ",pick(" honey "," baby "," baby doll "))
message = replacetext(message," man ",pick(" son "," buddy "," brother"," pal "," friendo "))
message = replacetext(message," out of "," outta ")
message = replacetext(message," thank you "," thank you, thank you very much ")
message = replacetext(message," thanks "," thank you, thank you very much ")
message = replacetext(message," what are you "," whatcha ")
message = replacetext(message," yes ",pick(" sure", "yea "))
message = replacetext(message," muh valids "," my kicks ")
speech_args[SPEECH_MESSAGE] = trim(message)
/datum/mutation/human/stoner
name = "Stoner"
desc = "A common mutation that severely decreases intelligence."
quality = NEGATIVE
locked = TRUE
text_gain_indication = "<span class='notice'>You feel...totally chill, man!</span>"
text_lose_indication = "<span class='notice'>You feel like you have a better sense of time.</span>"
/datum/mutation/human/stoner/on_acquiring(mob/living/carbon/human/owner)
..()
owner.grant_language(/datum/language/beachbum, TRUE, TRUE, LANGUAGE_STONER)
owner.add_blocked_language(subtypesof(/datum/language) - /datum/language/beachbum, LANGUAGE_STONER)
/datum/mutation/human/stoner/on_losing(mob/living/carbon/human/owner)
..()
owner.remove_language(/datum/language/beachbum, TRUE, TRUE, LANGUAGE_STONER)
owner.remove_blocked_language(subtypesof(/datum/language) - /datum/language/beachbum, LANGUAGE_STONER)
/datum/mutation/human/medieval
name = "Medieval"
desc = "A horrible mutation originating from the distant past, thought to have once been a common gene in all of old world Europe."
quality = MINOR_NEGATIVE
text_gain_indication = "<span class='notice'>You feel like seeking the holy grail!</span>"
text_lose_indication = "<span class='notice'>You no longer feel like seeking anything.</span>"
/datum/mutation/human/medieval/on_acquiring(mob/living/carbon/human/owner)
if(..())
return
RegisterSignal(owner, COMSIG_MOB_SAY, .proc/handle_speech)
/datum/mutation/human/medieval/on_losing(mob/living/carbon/human/owner)
if(..())
return
UnregisterSignal(owner, COMSIG_MOB_SAY)
/datum/mutation/human/medieval/proc/handle_speech(datum/source, list/speech_args)
SIGNAL_HANDLER
var/message = speech_args[SPEECH_MESSAGE]
if(message)
message = " [message] "
var/list/medieval_words = strings("medieval_replacement.json", "medieval")
var/list/startings = strings("medieval_replacement.json", "startings")
for(var/key in medieval_words)
var/value = medieval_words[key]
if(islist(value))
value = pick(value)
if(uppertext(key) == key)
value = uppertext(value)
if(capitalize(key) == key)
value = capitalize(value)
message = replacetextEx(message,regex("\b[REGEX_QUOTE(key)]\b","ig"), value)
message = trim(message)
var/chosen_starting = pick(startings)
message = "[chosen_starting] [message]"
speech_args[SPEECH_MESSAGE] = message
/datum/mutation/human/piglatin
name = "Pig Latin"
desc = "Historians say back in the 2020's humanity spoke entirely in this mystical language."
quality = MINOR_NEGATIVE
text_gain_indication = span_notice("Omethingsay eelsfay offyay.")
text_lose_indication = span_notice("The off sensation passes.")
/datum/mutation/human/piglatin/on_acquiring(mob/living/carbon/human/owner)
if(..())
return
RegisterSignal(owner, COMSIG_MOB_SAY, .proc/handle_speech)
/datum/mutation/human/piglatin/on_losing(mob/living/carbon/human/owner)
if(..())
return
UnregisterSignal(owner, COMSIG_MOB_SAY)
/datum/mutation/human/piglatin/proc/handle_speech(datum/source, list/speech_args)
SIGNAL_HANDLER
var/spoken_message = speech_args[SPEECH_MESSAGE]
spoken_message = piglatin_sentence(spoken_message)
speech_args[SPEECH_MESSAGE] = spoken_message