Language Code

This commit is contained in:
SoundScopes
2014-12-20 14:06:15 +00:00
parent 93d04366fe
commit b7e2425ef9
18 changed files with 228 additions and 316 deletions
+1
View File
@@ -605,6 +605,7 @@
#include "code\game\objects\items\stacks\tiles\plasteel.dm"
#include "code\game\objects\items\stacks\tiles\tile_types.dm"
#include "code\game\objects\items\weapons\AI_modules.dm"
#include "code\game\objects\items\weapons\cards.dm"
#include "code\game\objects\items\weapons\cards_ids.dm"
#include "code\game\objects\items\weapons\cigs_lighters.dm"
#include "code\game\objects\items\weapons\clown_items.dm"
+8 -1
View File
@@ -80,16 +80,23 @@
//Add the rest of the languages
//Because universal speak doesn't work right.
bst.add_language("Sol Common")
bst.add_language("Sinta'unathi")
bst.add_language("Siik'Maas")
bst.add_language("Skrellian")
bst.add_language("Vox-pidgin")
bst.add_language("Rootspeak")
bst.add_language("Ceti Basic")
bst.add_language("Sol Common")
bst.add_language("Tradeband")
bst.add_language("Gutter")
bst.add_language("Sini")
bst.add_language("Sign language")
bst.add_language("Xenomorph")
bst.add_language("Hivemind")
bst.add_language("Changeling")
bst.add_language("Cortical Link")
bst.add_language("Robot Talk")
bst.add_language("Drone Talk")
/* bst.bluespace_trail.set_up(src)
bst.bluespace_trail.start()
+33 -64
View File
@@ -1,68 +1,37 @@
/mob/living/carbon/alien/say(var/message)
var/verb = "says"
var/message_range = world.view
if (silent)
if(client)
if(client.prefs.muted & MUTE_IC)
src << "\red You cannot speak in IC (Muted)."
return
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
if(stat == 2)
return say_dead(message)
if(copytext(message,1,2) == "*")
return emote(copytext(message,2))
var/datum/language/speaking = null
if(length(message) >= 2)
var/channel_prefix = copytext(message, 1 ,3)
if(languages.len)
for(var/datum/language/L in languages)
if(lowertext(channel_prefix) == ":[L.key]")
verb = L.speech_verb
speaking = L
break
if(speaking)
message = trim(copytext(message,3))
message = capitalize(trim_left(message))
if(!message || stat)
return
if (length(message) >= 2)
if (department_radio_keys[copytext(message, 1, 3)] == "alientalk")
message = copytext(message, 3)
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
if (stat == 2)
return say_dead(message)
else
alien_talk(message)
else
if (copytext(message, 1, 2) != "*" && !stat)
playsound(loc, "hiss", 25, 1, 1)//So aliens can hiss while they hiss yo/N
return ..(message)
else
/mob/living/proc/alien_talk(var/message)
log_say("[key_name(src)] : [message]")
message = trim(message)
if (!message)
return
var/message_a = say_quote(message)
var/rendered = "<i><span class='game say'>Hivemind, <span class='name'>[name]</span> <span class='message'>[message_a]</span></span></i>"
for (var/mob/living/S in player_list)
if(!S.stat)
if(S.alien_talk_understand)
if(S.alien_talk_understand == alien_talk_understand)
S.show_message(rendered, 2)
else if (S.hivecheck())
S.show_message(rendered, 2)
var/list/listening = hearers(1, src)
listening -= src
listening += src
var/list/heard = list()
for (var/mob/M in listening)
if(!istype(M, /mob/living/carbon/alien) && !M.alien_talk_understand)
heard += M
if (length(heard))
var/message_b
message_b = "hsssss"
message_b = say_quote(message_b)
message_b = "<i>[message_b]</i>"
rendered = "<i><span class='game say'><span class='name'>[voice_name]</span> <span class='message'>[message_b]</span></span></i>"
for (var/mob/M in heard)
M.show_message(rendered, 2)
message = say_quote(message)
rendered = "<i><span class='game say'>Hivemind, <span class='name'>[name]</span> <span class='message'>[message_a]</span></span></i>"
for (var/mob/M in player_list)
if (istype(M, /mob/new_player))
continue
if (M.stat > 1)
M.show_message(rendered, 2)
..(message, speaking, verb, null, null, message_range, null)
@@ -132,11 +132,11 @@
/obj/item/device/mmi/posibrain/New()
src.brainmob = new(src)
src.brainmob.add_language("Binary")
src.brainmob.name = "[pick(list("PBU","HIU","SINA","ARMA","OSI"))]-[rand(100, 999)]"
src.brainmob.real_name = src.brainmob.name
src.brainmob.loc = src
src.brainmob.container = src
src.brainmob.robot_talk_understand = 1
src.brainmob.stat = 0
src.brainmob.silent = 0
// src.brainmob.brain_op_stage = 4.0
+1 -5
View File
@@ -1,3 +1,4 @@
//TODO: Convert this over for languages.
/mob/living/carbon/brain/say(var/message)
if (silent)
return
@@ -5,11 +6,6 @@
if(!(container && (istype(container, /obj/item/device/mmi) || istype(container, /obj/item/device/mmi/posibrain))))
return //No MMI, can't speak, bucko./N
else
if ((department_radio_keys[copytext(message, 1, 3)] == "binary") && (container && istype(container, /obj/item/device/mmi/posibrain)))
message = copytext(message, 3)
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
robot_talk(message)
return
if(prob(emp_damage*4))
if(prob(10))//10% chane to drop the message entirely
return
+85 -25
View File
@@ -15,9 +15,9 @@
var/message_mode = parse_message_mode(message, "headset")
if (istype(wear_mask, /obj/item/clothing/mask/muzzle) && message_mode != "changeling") //Todo: Add this to speech_problem_flag checks.
return
// if (istype(wear_mask, /obj/item/clothing/mask/muzzle) && message_mode != "changeling") //Todo: Add this to speech_problem_flag checks.
// return
//
if(copytext(message,1,2) == "*")
return emote(copytext(message,2))
@@ -33,9 +33,28 @@
//parse the language code and consume it
var/datum/language/speaking = parse_language(message)
if (speaking)
verb = speaking.speech_verb
if(speaking)
message = copytext(message,3)
else if(species.default_language)
speaking = all_languages[species.default_language]
var/ending = copytext(message, length(message))
if (speaking)
// This is broadcast to all mobs with the language,
// irrespective of distance or anything else.
if(speaking.flags & HIVEMIND)
speaking.broadcast(src,trim(message))
return
//If we've gotten this far, keep going!
verb = speaking.get_spoken_verb(ending)
else
if(ending=="!")
verb=pick("exclaims","shouts","yells")
if(ending=="?")
verb="asks"
if (istype(wear_mask, /obj/item/clothing/mask/muzzle))
return
message = capitalize(trim(message))
@@ -48,13 +67,6 @@
if(!message || stat)
return
if (!speaking)
var/ending = copytext(message, length(message))
if(ending=="!")
verb=pick("exclaims","shouts","yells")
if(ending=="?")
verb="asks"
if(speaking && speaking.flags & SIGNLANG)
message_mode = null
..(message, speaking, verb, alt_name, italics, message_range)
@@ -111,7 +123,7 @@
if("whisper")
whisper_say(message, speaking, alt_name)
return
if("binary")
/* if("binary")
if(robot_talk_understand || binarycheck())
robot_talk(message)
return
@@ -121,6 +133,7 @@
if((Changeling.mind && Changeling.mind.changeling) || istype(Changeling, /mob/dead/observer))
Changeling << "<i><font color=#800080><b>[mind.changeling.changelingID]:</b> [message]</font></i>"
return
*/
else
if(!(stunned >= 4))
if(message_mode)
@@ -134,21 +147,67 @@
var/sound/speech_sound
var/sound_vol
if((species.name == "Vox" || species.name == "Vox Armalis") && prob(20))
speech_sound = sound('sound/voice/shriek1.ogg')
if(species.speech_sounds && prob(species.speech_chance))
speech_sound = sound(pick(species.speech_sounds))
sound_vol = 50
..(message, speaking, verb, alt_name, italics, message_range, used_radios, speech_sound, sound_vol) //ohgod we should really be passing a datum here.
//speaking into radios
if(used_radios.len)
italics = 1
message_range = 1
for(var/mob/living/M in hearers(5, src))
if(M != src)
M.show_message("<span class='notice'>[src] talks into [used_radios.len ? used_radios[1] : "the radio."]</span>")
if (speech_sound)
sound_vol *= 0.5
..(message, speaking, verb, alt_name, italics, message_range, speech_sound, sound_vol) //ohgod we should really be passing a datum here.
/mob/living/carbon/human/proc/forcesay(list/append)
if(stat == CONSCIOUS)
if(client)
var/virgin = 1 //has the text been modified yet?
var/temp = winget(client, "input", "text")
if(findtextEx(temp, "Say \"", 1, 7) && length(temp) > 5) //case sensitive means
temp = replacetext(temp, ";", "") //general radio
if(findtext(trim_left(temp), ":", 6, 7)) //dept radio
temp = copytext(trim_left(temp), 8)
virgin = 0
if(virgin)
temp = copytext(trim_left(temp), 6) //normal speech
virgin = 0
while(findtext(trim_left(temp), ":", 1, 2)) //dept radio again (necessary)
temp = copytext(trim_left(temp), 3)
if(findtext(temp, "*", 1, 2)) //emotes
return
temp = copytext(trim_left(temp), 1, rand(5,8))
var/trimmed = trim_left(temp)
if(length(trimmed))
if(append)
temp += pick(append)
say(temp)
winset(client, "input", "text=[null]")
/mob/living/carbon/human/say_understands(var/mob/other,var/datum/language/speaking = null)
if(has_brain_worms()) //Brain worms translate everything. Even mice and alien speak.
return 1
if(species.can_understand(other))
return 1
//These only pertain to common. Languages are handled by mob/say_understands()
if (!speaking)
if (istype(other, /mob/living/carbon/monkey/diona))
if(other.languages.len >= 2) //They've sucked down some blood and can speak common now.
if (istype(other, /mob/living/carbon/alien/diona))
if(other.languages.len >= 2) //They've sucked down some blood and can speak common now.
return 1
if (istype(other, /mob/living/silicon))
return 1
@@ -203,16 +262,17 @@
/mob/living/carbon/human/say_quote(var/message, var/datum/language/speaking = null)
var/verb = "says"
var/ending = copytext(message, length(message))
if(ending=="!")
verb=pick("exclaims","shouts","yells")
else if(ending=="?")
verb="asks"
if(speaking)
verb = speaking.get_spoken_verb(ending)
else
if(ending == "!")
verb=pick("exclaims","shouts","yells")
else if(ending == "?")
verb="asks"
return verb
/mob/living/carbon/human/proc/handle_speech_problems(var/message)
var/list/returns[3]
var/verb = "says"
+15 -41
View File
@@ -10,12 +10,12 @@ var/list/department_radio_keys = list(
":e" = "Engineering", "#e" = "Engineering", ".e" = "Engineering",
":s" = "Security", "#s" = "Security", ".s" = "Security",
":w" = "whisper", "#w" = "whisper", ".w" = "whisper",
":b" = "binary", "#b" = "binary", ".b" = "binary",
":a" = "alientalk", "#a" = "alientalk", ".a" = "alientalk",
// ":b" = "binary", "#b" = "binary", ".b" = "binary",
// ":a" = "alientalk", "#a" = "alientalk", ".a" = "alientalk",
":t" = "Syndicate", "#t" = "Syndicate", ".t" = "Syndicate",
":u" = "Supply", "#u" = "Supply", ".u" = "Supply",
":g" = "changeling", "#g" = "changeling", ".g" = "changeling",
":d" = "dronechat", "#d" = "dronechat", ".d" = "dronechat",
// ":g" = "changeling", "#g" = "changeling", ".g" = "changeling",
// ":d" = "dronechat", "#d" = "dronechat", ".d" = "dronechat",
":R" = "right ear", "#R" = "right ear", ".R" = "right ear",
":L" = "left ear", "#L" = "left ear", ".L" = "left ear",
@@ -27,12 +27,12 @@ var/list/department_radio_keys = list(
":E" = "Engineering", "#E" = "Engineering", ".E" = "Engineering",
":S" = "Security", "#S" = "Security", ".S" = "Security",
":W" = "whisper", "#W" = "whisper", ".W" = "whisper",
":B" = "binary", "#B" = "binary", ".B" = "binary",
":A" = "alientalk", "#A" = "alientalk", ".A" = "alientalk",
// ":B" = "binary", "#B" = "binary", ".B" = "binary",
// ":A" = "alientalk", "#A" = "alientalk", ".A" = "alientalk",
":T" = "Syndicate", "#T" = "Syndicate", ".T" = "Syndicate",
":U" = "Supply", "#U" = "Supply", ".U" = "Supply",
":G" = "changeling", "#G" = "changeling", ".G" = "changeling",
":D" = "dronechat", "#D" = "dronechat", ".D" = "dronechat",
// ":G" = "changeling", "#G" = "changeling", ".G" = "changeling",
// ":D" = "dronechat", "#D" = "dronechat", ".D" = "dronechat",
//kinda localization -- rastaf0
//same keys as above, but on russian keyboard layout. This file uses cp1251 as encoding.
@@ -46,20 +46,21 @@ var/list/department_radio_keys = list(
":ó" = "Engineering", "#ó" = "Engineering", ".ó" = "Engineering",
":û" = "Security", "#û" = "Security", ".û" = "Security",
":ö" = "whisper", "#ö" = "whisper", ".ö" = "whisper",
":è" = "binary", "#è" = "binary", ".è" = "binary",
":ô" = "alientalk", "#ô" = "alientalk", ".ô" = "alientalk",
// ":è" = "binary", "#è" = "binary", ".è" = "binary",
// ":ô" = "alientalk", "#ô" = "alientalk", ".ô" = "alientalk",
":å" = "Syndicate", "#å" = "Syndicate", ".å" = "Syndicate",
":é" = "Supply", "#é" = "Supply", ".é" = "Supply",
":ï" = "changeling", "#ï" = "changeling", ".ï" = "changeling"
// ":ï" = "changeling", "#ï" = "changeling", ".ï" = "changeling"
)
/mob/living/proc/binarycheck()
if (istype(src, /mob/living/silicon/pai))
return
if (issilicon(src))
return 1
// if (issilicon(src))
// return 1
if (!ishuman(src))
return
var/mob/living/carbon/human/H = src
if (H.l_ear || H.r_ear)
var/obj/item/device/radio/headset/dongle
@@ -70,20 +71,7 @@ var/list/department_radio_keys = list(
if(!istype(dongle)) return
if(dongle.translate_binary) return 1
/mob/living/proc/hivecheck()
if (isalien(src)) return 1
if (!ishuman(src)) return
var/mob/living/carbon/human/H = src
if (H.l_ear || H.r_ear)
var/obj/item/device/radio/headset/dongle
if(istype(H.l_ear,/obj/item/device/radio/headset))
dongle = H.l_ear
else
dongle = H.r_ear
if(!istype(dongle)) return
if(dongle.translate_binary) return 1
/mob/living/say(var/message, var/datum/language/speaking = null, var/verb="says", var/alt_name="", var/italics=0, var/message_range = world.view, var/list/used_radios = list(), var/sound/speech_sound, var/sound_vol)
/mob/living/say(var/message, var/datum/language/speaking = null, var/verb="says", var/alt_name="", var/italics=0, var/message_range = world.view, var/sound/speech_sound, var/sound_vol)
var/turf/T = get_turf(src)
@@ -98,20 +86,6 @@ var/list/department_radio_keys = list(
log_say("[name]/[key] : [message]")
return 1
//speaking into radios
if(used_radios.len)
italics = 1
message_range = 1
if (!istype(src, /mob/living/silicon/ai)) // Atlantis: Prevents nearby people from hearing the AI when it talks using it's integrated radio.
for(var/mob/living/M in hearers(5, src))
if(M != src)
M.show_message("<span class='notice'>[src] talks into [used_radios.len ? used_radios[1] : "the radio."]</span>")
if (speech_sound)
src.playsound_local(get_turf(src), speech_sound, sound_vol * 0.5, 1)
speech_sound = null //so we don't play it twice.
//make sure the air can transmit speech
var/datum/gas_mixture/environment = T.return_air()
if(environment)
+11 -39
View File
@@ -82,7 +82,7 @@ var/list/ai_verbs_default = list(
var/centcomm_message_cooldown = 0
/mob/living/silicon/ai/proc/add_ai_verbs()
src.verbs += ai_verbs_default
src.verbs |= ai_verbs_default
/mob/living/silicon/ai/proc/remove_ai_verbs()
src.verbs -= ai_verbs_default
@@ -130,11 +130,17 @@ var/list/ai_verbs_default = list(
add_ai_verbs(src)
//Languages
add_language("Sol Common", 0)
add_language("Robot Talk", 1)
add_language("Sinta'unathi", 0)
add_language("Siik'tajr", 0)
add_language("Siik'Maas", 0)
add_language("Skrellian", 0)
add_language("Tradeband", 1)
add_language("Vox-pidgin", 0)
add_language("Rootspeak", 0)
add_language("Ceti Basic", 0)
add_language("Sol Common", 0)
add_language("Tradeband", 0)
add_language("Gutter", 0)
if(!safety)//Only used by AIize() to successfully spawn an AI.
@@ -504,41 +510,7 @@ var/list/ai_verbs_default = list(
updatehealth()
return 2
/mob/living/silicon/ai/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
if (!ticker)
M << "You cannot attack people before the game has started."
return
if (istype(loc, /turf) && istype(loc.loc, /area/start))
M << "No attacking people at spawn, you jackass."
return
switch(M.a_intent)
if ("help")
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\blue [M] caresses [src]'s plating with its scythe like arm."), 1)
else //harm
var/damage = rand(10, 20)
if (prob(90))
playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1)
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[] has slashed at []!</B>", M, src), 1)
if(prob(8))
flick("noise", flash)
adjustBruteLoss(damage)
updatehealth()
else
playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[] took a swipe at []!</B>", M, src), 1)
return
/mob/living/silicon/ai/attack_animal(mob/living/simple_animal/M as mob)
/mob/living/silicon/ai/attack_animal(mob/living/M as mob)
if(M.melee_damage_upper == 0)
M.emote("[M.friendly] [src]")
else
+5 -2
View File
@@ -3,7 +3,6 @@
icon = 'icons/mob/pai.dmi'
icon_state = "repairbot"
robot_talk_understand = 0
emote_type = 2 // pAIs emotes are heard, not seen, so they can be seen through a container (eg. person)
small = 1
pass_flags = 1
@@ -473,4 +472,8 @@
pose = addtext(pose,".") //Makes sure all emotes end with a period.
msg += "\nIt is [pose]"
usr << msg
usr << msg
// No binary for pAIs.
/mob/living/silicon/pai/binarycheck()
return 0
@@ -229,7 +229,7 @@ var/datum/paiController/paiController // Global handler for pAI candidates
M << browse(dat, "window=paiRecruit;size=580x580;")
/datum/paiController/proc/findPAI(var/obj/item/device/paicard/p, var/mob/user)
requestRecruits()
requestRecruits(user)
var/list/available = list()
for(var/datum/paiCandidate/c in paiController.pai_candidates)
if(c.ready)
@@ -345,7 +345,8 @@ var/datum/paiController/paiController // Global handler for pAI candidates
user << browse(dat, "window=findPai")
/datum/paiController/proc/requestRecruits()
/datum/paiController/proc/requestRecruits(var/mob/user)
inquirer = user
for(var/mob/dead/observer/O in player_list)
if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
continue
@@ -693,13 +693,16 @@
if(translator_on)
translator_on = 0
remove_language("Sign language")
remove_language("Sinta'unathi")
// remove_language("Siik'tajr")
remove_language("Siik'Maas")
remove_language("Skrellian")
remove_language("Vox-pidgin")
remove_language("Rootspeak")
remove_language("Sign language")
remove_language("Ceti Basic")
remove_language("Sol Common")
remove_language("Tradeband")
remove_language("Gutter")
src << "\blue Translator Module toggled OFF."
@@ -707,11 +710,14 @@
translator_on = 1
add_language("Sinta'unathi")
// add_language("Siik'tajr")
add_language("Siik'Maas")
add_language("Skrellian")
add_language("Vox-pidgin")
add_language("Rootspeak")
add_language("Sign language")
add_language("Ceti Basic")
add_language("Sol Common")
add_language("Tradeband")
add_language("Gutter")
add_language("Sign language", 0)
src << "\blue Translator Module toggled ON."
@@ -130,6 +130,10 @@
var/datum/robot_component/C = components[module_name]
return C && C.installed == 1 && C.toggled && C.is_powered()
// Returns component by it's string name
/mob/living/silicon/robot/proc/get_component(var/component_name)
var/datum/robot_component/C = components[component_name]
return C
/obj/item/broken_device
name = "broken component"
icon = 'icons/obj/robot_component.dmi'
@@ -13,6 +13,7 @@
lawupdate = 0
density = 1
req_access = list(access_engine, access_robotics)
local_transmit = 1
// We need to keep track of a few module items so we don't need to do list operations
// every time we need them. These get set in New() after the module is chosen.
@@ -31,6 +32,9 @@
..()
verbs += /mob/living/proc/ventcrawl
verbs += /mob/living/proc/hide
remove_language("Robot Talk")
add_language("Robot Talk", 0)
add_language("Drone Talk", 1)
if(camera && "Robots" in camera.network)
camera.network.Add("Engineering")
@@ -89,57 +93,6 @@
/mob/living/silicon/robot/drone/pick_module()
return
//Drones can only use binary and say emotes. NOTHING else.
//TBD, fix up boilerplate. ~ Z
/mob/living/silicon/robot/drone/say(var/message)
if (!message)
return
if (src.client)
if(client.prefs.muted & MUTE_IC)
src << "You cannot send IC messages (muted)."
return
if (src.client.handle_spam_prevention(message,MUTE_IC))
return
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
if (stat == 2)
return say_dead(message)
if(copytext(message,1,2) == "*")
return emote(copytext(message,2))
else if(length(message) >= 2)
if(parse_message_mode(message, "NONE") == "dronechat")
if(!is_component_functioning("radio"))
src << "\red Your radio transmitter isn't functional."
return
for (var/mob/living/S in living_mob_list)
if(istype(S, /mob/living/silicon/robot/drone))
S << "<i><span class='game say'>Drone Talk, <span class='name'>[name]</span><span class='message'> transmits, \"[trim(copytext(message,3))]\"</span></span></i>"
for (var/mob/M in dead_mob_list)
if(!istype(M,/mob/new_player) && !istype(M,/mob/living/carbon/brain))
M << "<i><span class='game say'>Drone Talk, <span class='name'>[name]</span><span class='message'> transmits, \"[trim(copytext(message,3))]\"</span></span></i>"
else
var/list/listeners = hearers(5,src)
listeners |= src
for(var/mob/living/silicon/robot/drone/D in listeners)
if(D.client) D << "<b>[src]</b> transmits, \"[message]\""
for (var/mob/M in player_list)
if (istype(M, /mob/new_player))
continue
else if(M.stat == 2 && M.client.prefs.toggles & CHAT_GHOSTEARS)
if(M.client) M << "<b>[src]</b> transmits, \"[message]\""
//Drones cannot be upgraded with borg modules so we need to catch some items before they get used in ..().
/mob/living/silicon/robot/drone/attackby(obj/item/weapon/W as obj, mob/user as mob)
@@ -71,6 +71,8 @@
spark_system.set_up(5, 0, src)
spark_system.attach(src)
add_language("Robot Talk", 1)
ident = rand(1, 999)
updatename("Default")
updateicon()
@@ -1302,3 +1304,10 @@
return
else
src << "Your icon has been set. You now require a module reset to change it."
/mob/living/silicon/robot/binarycheck()
if(is_component_functioning("comms"))
var/datum/robot_component/RC = get_component("comms")
use_power(RC.energy_consumption)
return 1
return 0
@@ -58,11 +58,12 @@
/obj/item/weapon/robot_module/proc/add_languages(var/mob/living/silicon/robot/R)
//full set of languages
R.add_language("Sol Common", 1)
R.add_language("Tradeband", 1)
R.add_language("Tradeband", 0)
R.add_language("Sinta'unathi", 0)
R.add_language("Siik'tajr", 0)
R.add_language("Siik'Maas", 0)
R.add_language("Skrellian", 0)
R.add_language("Gutter", 0)
R.add_language("Rootspeak", 0)
/obj/item/weapon/robot_module/standard
@@ -317,8 +318,7 @@
//full set of languages
R.add_language("Sol Common", 1)
R.add_language("Sinta'unathi", 1)
R.add_language("Siik'maas", 1)
R.add_language("Siik'tajr", 0)
R.add_language("Siik'Maas", 1)
R.add_language("Skrellian", 1)
R.add_language("Rootspeak", 1)
R.add_language("Tradeband", 1)
@@ -339,8 +339,7 @@
add_languages(var/mob/living/silicon/robot/R)
R.add_language("Sol Common", 1)
R.add_language("Sinta'unathi", 1)
R.add_language("Siik'maas", 1)
R.add_language("Siik'tajr", 0)
R.add_language("Siik'Maas", 1)
R.add_language("Skrellian", 1)
R.add_language("Rootspeak", 1)
R.add_language("Tradeband", 1)
+24 -71
View File
@@ -54,7 +54,6 @@
var/mob/living/silicon/robot/R = src
var/mob/living/silicon/pai/P = src
//Must be concious to speak
if (stat)
return
@@ -69,17 +68,35 @@
else
message = trim(copytext(message,3))
if(message_mode && bot_type == IS_ROBOT && message_mode != "binary" && !R.is_component_functioning("radio"))
src << "\red Your radio isn't functional at this time."
return
//parse language key and consume it
var/datum/language/speaking = parse_language(message)
if (speaking)
verb = speaking.speech_verb
message = copytext(message,3)
if(speaking.flags & HIVEMIND)
speaking.broadcast(src,trim(message))
return
// Currently used by drones.
if(local_transmit)
var/list/listeners = hearers(5,src)
listeners |= src
for(var/mob/living/silicon/D in listeners)
if(D.client && istype(D,src.type))
D << "<b>[src]</b> transmits, \"[message]\""
for (var/mob/M in player_list)
if (istype(M, /mob/new_player))
continue
else if(M.stat == 2 && M.client.prefs.toggles & CHAT_GHOSTEARS)
if(M.client) M << "<b>[src]</b> transmits, \"[message]\""
return
if(message_mode && bot_type == IS_ROBOT && !R.is_component_functioning("radio"))
src << "\red Your radio isn't functional at this time."
return
switch(message_mode)
if("department")
@@ -94,17 +111,6 @@
P.radio.talk_into(src,message,message_mode,verb,speaking)
return 1
if("binary")
switch(bot_type)
if(IS_ROBOT)
if(!R.is_component_functioning("comms"))
src << "\red Your binary communications component isn't functional."
return
if(IS_PAI)
src << "You do not appear to have that function"
return
robot_talk(message)
return 1
if("general")
switch(bot_type)
@@ -124,7 +130,7 @@
return 1
else
if(message_mode && message_mode in radiochannels)
if(message_mode)
switch(bot_type)
if(IS_AI)
if (AI.aiRadio.disabledAi)
@@ -177,59 +183,6 @@
return
return 1
/mob/living/proc/robot_talk(var/message)
log_say("[key_name(src)] : [message]")
message = trim(message)
if (!message)
return
var/verb = say_quote(message)
var/rendered = "<i><span class='game say'>Robotic Talk, <span class='name'>[name]</span> <span class='message'>[verb], \"[message]\"</span></span></i>"
for (var/mob/living/S in living_mob_list)
if(S.robot_talk_understand && (S.robot_talk_understand == robot_talk_understand)) // This SHOULD catch everything caught by the one below, but I'm not going to change it.
if(istype(S , /mob/living/silicon/ai))
var/renderedAI = "<i><span class='game say'>Robotic Talk, <a href='byond://?src=\ref[S];track2=\ref[S];track=\ref[src];trackname=[html_encode(src.name)]'><span class='name'>[name]</span></a> <span class='message'>[verb], \"[message]\"</span></span></i>"
S.show_message(renderedAI, 2)
else
S.show_message(rendered, 2)
else if (S.binarycheck())
if(istype(S , /mob/living/silicon/ai))
var/renderedAI = "<i><span class='game say'>Robotic Talk, <a href='byond://?src=\ref[S];track2=\ref[S];track=\ref[src];trackname=[html_encode(src.name)]'><span class='name'>[name]</span></a> <span class='message'>[verb], \"[message]\"</span></span></i>"
S.show_message(renderedAI, 2)
else
S.show_message(rendered, 2)
var/list/listening = hearers(1, src)
listening -= src
var/list/heard = list()
for (var/mob/M in listening)
if(!istype(M, /mob/living/silicon) && !M.robot_talk_understand)
heard += M
if (length(heard))
var/message_beep
verb = "beeps"
message_beep = "beep beep beep"
rendered = "<i><span class='game say'><span class='name'>[voice_name]</span> <span class='message'>[verb], \"[message_beep]\"</span></span></i>"
for (var/mob/M in heard)
M.show_message(rendered, 2)
rendered = "<i><span class='game say'>Robotic Talk, <span class='name'>[name]</span> <span class='message'>[verb], \"[message]\"</span></span></i>"
for (var/mob/M in dead_mob_list)
if(!istype(M,/mob/new_player) && !istype(M,/mob/living/carbon/brain)) //No meta-evesdropping
M.show_message(rendered, 2)
#undef IS_AI
#undef IS_ROBOT
#undef IS_PAI
+9 -2
View File
@@ -1,6 +1,5 @@
/mob/living/silicon
gender = NEUTER
robot_talk_understand = 1
voice_name = "synthesized voice"
var/syndicate = 0
var/datum/ai_laws/laws = null//Now... THEY ALL CAN ALL HAVE LAWS
@@ -14,6 +13,10 @@
var/speak_query = "queries"
var/pose //Yes, now AIs can pose too.
var/obj/item/device/camera/siliconcam/aiCamera = null //photography
var/local_transmit //If set, can only speak to others of the same type within a short range.
/mob/living/silicon/New()
..()
add_language("Ceti Basic")
/mob/living/silicon/proc/show_laws()
return
@@ -164,6 +167,7 @@
/mob/living/silicon/add_language(var/language, var/can_speak=1)
if (..(language) && can_speak)
speech_synthesizer_langs.Add(all_languages[language])
return 1
/mob/living/silicon/remove_language(var/rem_language)
..(rem_language)
@@ -197,4 +201,7 @@
set desc = "Sets an extended description of your character's features."
set category = "IC"
flavor_text = copytext(sanitize(input(usr, "Please enter your new flavour text.", "Flavour text", null) as text), 1)
flavor_text = copytext(sanitize(input(usr, "Please enter your new flavour text.", "Flavour text", null) as text), 1)
/mob/living/silicon/binarycheck()
return 1
-2
View File
@@ -87,8 +87,6 @@
return 1
if (istype(other, src.type) || istype(src, other.type))
return 1
if(src.alien_talk_understand && other.alien_talk_understand)
return 1
return 0
//Language check.