Files
S.P.L.U.R.T-Station-13/code/modules/surgery/organs/tongue.dm
2017-10-23 08:25:30 -05:00

197 lines
6.4 KiB
Plaintext

/obj/item/organ/tongue
name = "tongue"
desc = "A fleshy muscle mostly used for lying."
icon_state = "tonguenormal"
zone = "mouth"
slot = "tongue"
attack_verb = list("licked", "slobbered", "slapped", "frenched", "tongued")
var/list/languages_possible
var/say_mod = null
var/taste_sensitivity = 15 // lower is more sensitive.
var/static/list/languages_possible_base = typecacheof(list(
/datum/language/common,
/datum/language/draconic,
/datum/language/codespeak,
/datum/language/monkey,
/datum/language/narsie,
/datum/language/beachbum,
/datum/language/ratvar
))
/obj/item/organ/tongue/Initialize(mapload)
. = ..()
languages_possible = languages_possible_base
/obj/item/organ/tongue/get_spans()
return list()
/obj/item/organ/tongue/proc/TongueSpeech(var/message)
return message
/obj/item/organ/tongue/Insert(mob/living/carbon/M, special = 0)
..()
if(say_mod && M.dna && M.dna.species)
M.dna.species.say_mod = say_mod
/obj/item/organ/tongue/Remove(mob/living/carbon/M, special = 0)
..()
if(say_mod && M.dna && M.dna.species)
M.dna.species.say_mod = initial(M.dna.species.say_mod)
/obj/item/organ/tongue/could_speak_in_language(datum/language/dt)
. = is_type_in_typecache(dt, languages_possible)
/obj/item/organ/tongue/lizard
name = "forked tongue"
desc = "A thin and long muscle typically found in reptilian races, apparently moonlights as a nose."
icon_state = "tonguelizard"
say_mod = "hisses"
taste_sensitivity = 10 // combined nose + tongue, extra sensitive
/obj/item/organ/tongue/lizard/TongueSpeech(var/message)
var/regex/lizard_hiss = new("s+", "g")
var/regex/lizard_hiSS = new("S+", "g")
if(copytext(message, 1, 2) != "*")
message = lizard_hiss.Replace(message, "sss")
message = lizard_hiSS.Replace(message, "SSS")
return message
/obj/item/organ/tongue/fly
name = "proboscis"
desc = "A freakish looking meat tube that apparently can take in liquids."
icon_state = "tonguefly"
say_mod = "buzzes"
taste_sensitivity = 25 // you eat vomit, this is a mercy
/obj/item/organ/tongue/fly/TongueSpeech(var/message)
var/regex/fly_buzz = new("z+", "g")
var/regex/fly_buZZ = new("Z+", "g")
if(copytext(message, 1, 2) != "*")
message = fly_buzz.Replace(message, "zzz")
message = fly_buZZ.Replace(message, "ZZZ")
return message
/obj/item/organ/tongue/abductor
name = "superlingual matrix"
desc = "A mysterious structure that allows for instant communication between users. Pretty impressive until you need to eat something."
icon_state = "tongueayylmao"
say_mod = "gibbers"
taste_sensitivity = 101 // ayys cannot taste anything.
/obj/item/organ/tongue/abductor/TongueSpeech(var/message)
//Hacks
var/mob/living/carbon/human/user = usr
var/rendered = "<span class='abductor'><b>[user.name]:</b> [message]</span>"
for(var/mob/living/carbon/human/H in GLOB.living_mob_list)
var/obj/item/organ/tongue/T = H.getorganslot("tongue")
if(!T || T.type != type)
continue
if(H.dna && H.dna.species.id == "abductor" && user.dna && user.dna.species.id == "abductor")
var/datum/antagonist/abductor/A = user.mind.has_antag_datum(ANTAG_DATUM_ABDUCTOR)
if(!A || !(H.mind in A.team.members))
continue
to_chat(H, rendered)
for(var/mob/M in GLOB.dead_mob_list)
var/link = FOLLOW_LINK(M, user)
to_chat(M, "[link] [rendered]")
return ""
/obj/item/organ/tongue/zombie
name = "rotting tongue"
desc = "Between the decay and the fact that it's just lying there you doubt a tongue has ever seemed less sexy."
icon_state = "tonguezombie"
say_mod = "moans"
taste_sensitivity = 32
/obj/item/organ/tongue/zombie/TongueSpeech(var/message)
var/list/message_list = splittext(message, " ")
var/maxchanges = max(round(message_list.len / 1.5), 2)
for(var/i = rand(maxchanges / 2, maxchanges), i > 0, i--)
var/insertpos = rand(1, message_list.len - 1)
var/inserttext = message_list[insertpos]
if(!(copytext(inserttext, length(inserttext) - 2) == "..."))
message_list[insertpos] = inserttext + "..."
if(prob(20) && message_list.len > 3)
message_list.Insert(insertpos, "[pick("BRAINS", "Brains", "Braaaiinnnsss", "BRAAAIIINNSSS")]...")
return jointext(message_list, " ")
/obj/item/organ/tongue/alien
name = "alien tongue"
desc = "According to leading xenobiologists the evolutionary benefit of having a second mouth in your mouth is \"that it looks badass\"."
icon_state = "tonguexeno"
say_mod = "hisses"
taste_sensitivity = 10 // LIZARDS ARE ALIENS CONFIRMED
var/static/list/languages_possible_alien = typecacheof(list(
/datum/language/xenocommon,
/datum/language/common,
/datum/language/draconic,
/datum/language/ratvar,
/datum/language/monkey))
/obj/item/organ/tongue/alien/Initialize(mapload)
. = ..()
languages_possible = languages_possible_alien
/obj/item/organ/tongue/alien/TongueSpeech(var/message)
playsound(owner, "hiss", 25, 1, 1)
return message
/obj/item/organ/tongue/bone
name = "bone \"tongue\""
desc = "Apparently skeletons alter the sounds they produce through oscillation of their teeth, hence their characteristic rattling."
icon_state = "tonguebone"
say_mod = "rattles"
attack_verb = list("bitten", "chattered", "chomped", "enamelled", "boned")
taste_sensitivity = 101 // skeletons cannot taste anything
var/chattering = FALSE
var/phomeme_type = "sans"
var/list/phomeme_types = list("sans", "papyrus")
/obj/item/organ/tongue/bone/Initialize()
. = ..()
phomeme_type = pick(phomeme_types)
/obj/item/organ/tongue/bone/TongueSpeech(var/message)
. = message
if(chattering)
//Annoy everyone nearby with your chattering.
chatter(message, phomeme_type, usr)
/obj/item/organ/tongue/bone/get_spans()
. = ..()
// Feature, if the tongue talks directly, it will speak with its span
switch(phomeme_type)
if("sans")
. |= SPAN_SANS
if("papyrus")
. |= SPAN_PAPYRUS
/obj/item/organ/tongue/bone/plasmaman
name = "plasma bone \"tongue\""
desc = "Like animated skeletons, Plasmamen vibrate their teeth in order to produce speech."
icon_state = "tongueplasma"
/obj/item/organ/tongue/bone/plasmaman/get_spans()
return
/obj/item/organ/tongue/robot
name = "robotic voicebox"
desc = "A voice synthesizer that can interface with organic lifeforms."
status = ORGAN_ROBOTIC
icon_state = "tonguerobot"
say_mod = "states"
attack_verb = list("beeped", "booped")
taste_sensitivity = 25 // not as good as an organic tongue
/obj/item/organ/tongue/robot/can_speak_in_language(datum/language/dt)
. = TRUE // THE MAGIC OF ELECTRONICS
/obj/item/organ/tongue/robot/get_spans()
return ..() | SPAN_ROBOT