From d48afddebddc6e84d5030ce196d00fbfeea4b587 Mon Sep 17 00:00:00 2001 From: PrismaticGynoid Date: Thu, 24 Aug 2017 17:14:02 -0700 Subject: [PATCH 1/2] Brain transplants don't remove languages Brains now retain languages from the mob they were removed from, rather than forgetting them. Languages are also retained when a brain is transplanted into a new body. AIs, as well as cyborgs/robots/drones, will load languages from your currently-active preferences when they spawn (just like humanoid mobs do). Brains removed from cyborgs/robots/drones will retain their original languages regardless of the current module, and will no longer have access to binary, as they lack a binary communication device. Brains in MMIs can now speak EAL if they know it, and additionally fixes #2832 - sign language will no longer be usable when lacking both hands. Also fixes silicons being told the wrong language prefix by the known languages window, as it was still showing ':', leading to much confusion among new borg players. Known issues: AIs who can use sign language can use it even without a holopad - I'm not sure how to have it check for that. This could be seen as a non-issue, as signs could conceivably be displayed on the AI's screen. AIs signing over holopad will also have the language verbs overridden by the synth speech verbs (states/queries/declares). I'm pretty sure this has something to do with the already-existing bug that all languages can be understood by everyone when an AI speaks them over holopad. --- code/game/machinery/computer/ai_core.dm | 2 ++ code/game/objects/items/robot/robot_parts.dm | 3 +++ code/modules/mob/language/generic.dm | 6 +++++- code/modules/mob/living/carbon/brain/MMI.dm | 3 ++- code/modules/mob/living/carbon/brain/brain.dm | 2 +- code/modules/mob/living/silicon/robot/robot.dm | 7 +++++++ code/modules/mob/living/silicon/silicon.dm | 2 +- .../mob/living/simple_animal/animals/spiderbot.dm | 1 + code/modules/mob/transform_procs.dm | 10 ++++++++++ code/modules/organs/internal/brain.dm | 2 ++ code/modules/organs/subtypes/machine.dm | 8 +++++++- code/modules/surgery/robotics.dm | 1 + html/changelogs/PrismaticGynoid-forgottenlanguages.yml | 7 +++++++ 13 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 html/changelogs/PrismaticGynoid-forgottenlanguages.yml diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm index 80633f4ea4..5c7ece8d05 100644 --- a/code/game/machinery/computer/ai_core.dm +++ b/code/game/machinery/computer/ai_core.dm @@ -176,6 +176,8 @@ var/mob/living/silicon/ai/A = new /mob/living/silicon/ai ( loc, laws, brain ) if(A) //if there's no brain, the mob is deleted and a structure/AIcore is created A.rename_self("ai", 1) + for(var/datum/language/L in brain.brainmob.languages) + A.add_language(L.name) feedback_inc("cyborg_ais_created",1) qdel(src) diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index ebdd95791d..f113e5f153 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -208,6 +208,9 @@ O.job = "Cyborg" + for(var/datum/language/L in M.brainmob.languages) + O.add_language(L.name) + O.cell = chest.cell O.cell.loc = O W.loc = O//Should fix cybros run time erroring when blown up. It got deleted before, along with the frame. diff --git a/code/modules/mob/language/generic.dm b/code/modules/mob/language/generic.dm index ce0abbb948..fb63092d7f 100644 --- a/code/modules/mob/language/generic.dm +++ b/code/modules/mob/language/generic.dm @@ -120,4 +120,8 @@ signlang_verb = list("gestures") colour = "say_quote" key = "s" - flags = SIGNLANG|NO_STUTTER|NONVERBAL \ No newline at end of file + flags = SIGNLANG|NO_STUTTER|NONVERBAL + +/datum/language/sign/can_speak_special(var/mob/speaker) + var/obj/item/organ/external/hand/hands = locate() in speaker //you can't sign without hands + return (hands || !iscarbon(speaker)) diff --git a/code/modules/mob/living/carbon/brain/MMI.dm b/code/modules/mob/living/carbon/brain/MMI.dm index d3cab94007..ef236bb16e 100644 --- a/code/modules/mob/living/carbon/brain/MMI.dm +++ b/code/modules/mob/living/carbon/brain/MMI.dm @@ -176,7 +176,8 @@ /obj/item/device/mmi/digital/New() src.brainmob = new(src) - src.brainmob.add_language("Robot Talk") +// src.brainmob.add_language("Robot Talk") //you need a binary communication device for that + src.brainmob.add_language(LANGUAGE_GALCOM) src.brainmob.add_language(LANGUAGE_EAL) src.brainmob.loc = src src.brainmob.container = src diff --git a/code/modules/mob/living/carbon/brain/brain.dm b/code/modules/mob/living/carbon/brain/brain.dm index 2905b4fe4d..a146f991e1 100644 --- a/code/modules/mob/living/carbon/brain/brain.dm +++ b/code/modules/mob/living/carbon/brain/brain.dm @@ -58,7 +58,7 @@ return canmove /mob/living/carbon/brain/isSynthetic() - return istype(loc, /obj/item/device/mmi/digital) + return istype(loc, /obj/item/device/mmi) /mob/living/carbon/brain/binarycheck() return isSynthetic() diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index a6e0140b41..25d334b9c9 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -102,6 +102,7 @@ spark_system.attach(src) add_language("Robot Talk", 1) + add_language(LANGUAGE_GALCOM, 1) add_language(LANGUAGE_EAL, 1) wires = new(src) @@ -219,6 +220,12 @@ var/turf/T = get_turf(loc)//To hopefully prevent run time errors. if(T) mmi.loc = T if(mmi.brainmob) + var/obj/item/weapon/robot_module/M = locate() in contents + if(M) + mmi.brainmob.languages = M.original_languages + else + mmi.brainmob.languages = languages + mmi.brainmob.remove_language("Robot Talk") mind.transfer_to(mmi.brainmob) else src << "Oops! Something went very wrong, your MMI was unable to receive your mind. You have been ghosted. Please make a bug report so we can fix this bug." diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index b74b7d6cf7..84aa81af69 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -232,7 +232,7 @@ default_str = " - set default" var/synth = (L in speech_synthesizer_langs) - dat += "[L.name] (:[L.key])[synth ? default_str : null]
Speech Synthesizer: [synth ? "YES" : "NOT SUPPORTED"]
[L.desc]

" + dat += "[L.name] ([get_language_prefix()][L.key])[synth ? default_str : null]
Speech Synthesizer: [synth ? "YES" : "NOT SUPPORTED"]
[L.desc]

" src << browse(dat, "window=checklanguage") return diff --git a/code/modules/mob/living/simple_animal/animals/spiderbot.dm b/code/modules/mob/living/simple_animal/animals/spiderbot.dm index 79e796d7ff..c22aaadd56 100644 --- a/code/modules/mob/living/simple_animal/animals/spiderbot.dm +++ b/code/modules/mob/living/simple_animal/animals/spiderbot.dm @@ -149,6 +149,7 @@ src.mind.key = M.brainmob.key src.ckey = M.brainmob.ckey src.name = "spider-bot ([M.brainmob.name])" + src.languages = M.brainmob.languages /mob/living/simple_animal/spiderbot/proc/explode() //When emagged. src.visible_message("\The [src] makes an odd warbling noise, fizzles, and explodes!") diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index 085f601aef..20ad7f43c6 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -77,6 +77,11 @@ else O.key = key + if(O.client && O.client.prefs) + var/datum/preferences/B = O.client.prefs + for(var/language in B.alternate_languages) + O.add_language(language) + if(move) var/obj/loc_landmark for(var/obj/effect/landmark/start/sloc in landmarks_list) @@ -154,6 +159,11 @@ O.mmi.transfer_identity(src) + if(O.client && O.client.prefs) + var/datum/preferences/B = O.client.prefs + for(var/language in B.alternate_languages) + O.add_language(language) + callHook("borgify", list(O)) O.Namepick() diff --git a/code/modules/organs/internal/brain.dm b/code/modules/organs/internal/brain.dm index e0809e32b5..77ead516c3 100644 --- a/code/modules/organs/internal/brain.dm +++ b/code/modules/organs/internal/brain.dm @@ -82,6 +82,8 @@ if(H.mind) H.mind.transfer_to(brainmob) + brainmob.languages = H.languages + brainmob << "You feel slightly disoriented. That's normal when you're just \a [initial(src.name)]." callHook("debrain", list(brainmob)) diff --git a/code/modules/organs/subtypes/machine.dm b/code/modules/organs/subtypes/machine.dm index 45b0b8be28..439e9f7b2e 100644 --- a/code/modules/organs/subtypes/machine.dm +++ b/code/modules/organs/subtypes/machine.dm @@ -62,6 +62,8 @@ stored_mmi.icon_state = "mmi_full" icon_state = stored_mmi.icon_state + stored_mmi.brainmob.languages = owner.languages + if(owner && owner.stat == DEAD) owner.stat = 0 dead_mob_list -= owner @@ -91,6 +93,8 @@ stored_mmi.icon_state = "posibrain-occupied" icon_state = stored_mmi.icon_state + stored_mmi.brainmob.languages = owner.languages + /obj/item/organ/internal/mmi_holder/robot name = "digital brain interface" brain_type = /obj/item/device/mmi/digital/robot @@ -99,4 +103,6 @@ /obj/item/organ/internal/mmi_holder/robot/update_from_mmi() ..() stored_mmi.icon_state = "mainboard" - icon_state = stored_mmi.icon_state \ No newline at end of file + icon_state = stored_mmi.icon_state + + stored_mmi.brainmob.languages = owner.languages diff --git a/code/modules/surgery/robotics.dm b/code/modules/surgery/robotics.dm index 87e37e043e..09db2e3146 100644 --- a/code/modules/surgery/robotics.dm +++ b/code/modules/surgery/robotics.dm @@ -421,6 +421,7 @@ if(M.brainmob && M.brainmob.mind) M.brainmob.mind.transfer_to(target) + target.languages = M.brainmob.languages spawn(0) //Name yourself on your own damn time var/new_name = "" diff --git a/html/changelogs/PrismaticGynoid-forgottenlanguages.yml b/html/changelogs/PrismaticGynoid-forgottenlanguages.yml new file mode 100644 index 0000000000..dd3abb10e3 --- /dev/null +++ b/html/changelogs/PrismaticGynoid-forgottenlanguages.yml @@ -0,0 +1,7 @@ +author: PrismaticGynoid +delete-after: True +changes: + - tweak: "You now keep your languages when removed from/transplanted into a body." + - tweak: "AIs and borgs load languages from preferences when spawning." + - bugfix: "Fixed sign language being usable while lacking both hands." + From 9c1bb565222587c4648530986a03cf0f3d70aa03 Mon Sep 17 00:00:00 2001 From: PrismaticGynoid Date: Thu, 24 Aug 2017 17:14:02 -0700 Subject: [PATCH 2/2] Brain transplants, synthetics, and languages Brains now retain languages from the mob they were removed from, rather than forgetting them. Languages are also retained when a brain is transplanted into a new body. AIs, as well as cyborgs/robots/drones, will load languages from your currently-active preferences when they spawn (just like humanoid mobs do). Brains removed from cyborgs/robots/drones will retain their original languages regardless of the current module. Brains in MMIs can now speak EAL if they know it, and additionally fixes #2832 - sign language will no longer be usable when lacking both hands. Also fixes silicons being told the wrong language prefix by the known languages window, as it was still showing ':', leading to much confusion among new borg players. Known issues: AIs who can use sign language can use it even without a holopad - I'm not sure how to have it check for that. This could be seen as a non-issue, as signs could conceivably be displayed on the AI's screen. AIs signing over holopad will also have the language verbs overridden by the synth speech verbs (states/queries/declares). I'm pretty sure this has something to do with the already-existing bug that all languages can be understood by everyone when an AI speaks them over holopad. --- code/game/machinery/computer/ai_core.dm | 2 ++ code/game/objects/items/robot/robot_parts.dm | 3 +++ code/modules/mob/language/generic.dm | 6 +++++- code/modules/mob/living/carbon/brain/MMI.dm | 1 + code/modules/mob/living/carbon/brain/brain.dm | 2 +- code/modules/mob/living/silicon/robot/robot.dm | 7 +++++++ code/modules/mob/living/silicon/silicon.dm | 2 +- .../mob/living/simple_animal/animals/spiderbot.dm | 1 + code/modules/mob/transform_procs.dm | 10 ++++++++++ code/modules/organs/internal/brain.dm | 2 ++ code/modules/organs/subtypes/machine.dm | 8 +++++++- code/modules/surgery/robotics.dm | 1 + html/changelogs/PrismaticGynoid-forgottenlanguages.yml | 7 +++++++ 13 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 html/changelogs/PrismaticGynoid-forgottenlanguages.yml diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm index 80633f4ea4..5c7ece8d05 100644 --- a/code/game/machinery/computer/ai_core.dm +++ b/code/game/machinery/computer/ai_core.dm @@ -176,6 +176,8 @@ var/mob/living/silicon/ai/A = new /mob/living/silicon/ai ( loc, laws, brain ) if(A) //if there's no brain, the mob is deleted and a structure/AIcore is created A.rename_self("ai", 1) + for(var/datum/language/L in brain.brainmob.languages) + A.add_language(L.name) feedback_inc("cyborg_ais_created",1) qdel(src) diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index ebdd95791d..f113e5f153 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -208,6 +208,9 @@ O.job = "Cyborg" + for(var/datum/language/L in M.brainmob.languages) + O.add_language(L.name) + O.cell = chest.cell O.cell.loc = O W.loc = O//Should fix cybros run time erroring when blown up. It got deleted before, along with the frame. diff --git a/code/modules/mob/language/generic.dm b/code/modules/mob/language/generic.dm index ce0abbb948..fb63092d7f 100644 --- a/code/modules/mob/language/generic.dm +++ b/code/modules/mob/language/generic.dm @@ -120,4 +120,8 @@ signlang_verb = list("gestures") colour = "say_quote" key = "s" - flags = SIGNLANG|NO_STUTTER|NONVERBAL \ No newline at end of file + flags = SIGNLANG|NO_STUTTER|NONVERBAL + +/datum/language/sign/can_speak_special(var/mob/speaker) + var/obj/item/organ/external/hand/hands = locate() in speaker //you can't sign without hands + return (hands || !iscarbon(speaker)) diff --git a/code/modules/mob/living/carbon/brain/MMI.dm b/code/modules/mob/living/carbon/brain/MMI.dm index d3cab94007..344745673a 100644 --- a/code/modules/mob/living/carbon/brain/MMI.dm +++ b/code/modules/mob/living/carbon/brain/MMI.dm @@ -177,6 +177,7 @@ /obj/item/device/mmi/digital/New() src.brainmob = new(src) src.brainmob.add_language("Robot Talk") + src.brainmob.add_language(LANGUAGE_GALCOM) src.brainmob.add_language(LANGUAGE_EAL) src.brainmob.loc = src src.brainmob.container = src diff --git a/code/modules/mob/living/carbon/brain/brain.dm b/code/modules/mob/living/carbon/brain/brain.dm index 2905b4fe4d..a146f991e1 100644 --- a/code/modules/mob/living/carbon/brain/brain.dm +++ b/code/modules/mob/living/carbon/brain/brain.dm @@ -58,7 +58,7 @@ return canmove /mob/living/carbon/brain/isSynthetic() - return istype(loc, /obj/item/device/mmi/digital) + return istype(loc, /obj/item/device/mmi) /mob/living/carbon/brain/binarycheck() return isSynthetic() diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index a6e0140b41..25d334b9c9 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -102,6 +102,7 @@ spark_system.attach(src) add_language("Robot Talk", 1) + add_language(LANGUAGE_GALCOM, 1) add_language(LANGUAGE_EAL, 1) wires = new(src) @@ -219,6 +220,12 @@ var/turf/T = get_turf(loc)//To hopefully prevent run time errors. if(T) mmi.loc = T if(mmi.brainmob) + var/obj/item/weapon/robot_module/M = locate() in contents + if(M) + mmi.brainmob.languages = M.original_languages + else + mmi.brainmob.languages = languages + mmi.brainmob.remove_language("Robot Talk") mind.transfer_to(mmi.brainmob) else src << "Oops! Something went very wrong, your MMI was unable to receive your mind. You have been ghosted. Please make a bug report so we can fix this bug." diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index b74b7d6cf7..84aa81af69 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -232,7 +232,7 @@ default_str = " - set default" var/synth = (L in speech_synthesizer_langs) - dat += "[L.name] (:[L.key])[synth ? default_str : null]
Speech Synthesizer: [synth ? "YES" : "NOT SUPPORTED"]
[L.desc]

" + dat += "[L.name] ([get_language_prefix()][L.key])[synth ? default_str : null]
Speech Synthesizer: [synth ? "YES" : "NOT SUPPORTED"]
[L.desc]

" src << browse(dat, "window=checklanguage") return diff --git a/code/modules/mob/living/simple_animal/animals/spiderbot.dm b/code/modules/mob/living/simple_animal/animals/spiderbot.dm index 79e796d7ff..c22aaadd56 100644 --- a/code/modules/mob/living/simple_animal/animals/spiderbot.dm +++ b/code/modules/mob/living/simple_animal/animals/spiderbot.dm @@ -149,6 +149,7 @@ src.mind.key = M.brainmob.key src.ckey = M.brainmob.ckey src.name = "spider-bot ([M.brainmob.name])" + src.languages = M.brainmob.languages /mob/living/simple_animal/spiderbot/proc/explode() //When emagged. src.visible_message("\The [src] makes an odd warbling noise, fizzles, and explodes!") diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index 085f601aef..20ad7f43c6 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -77,6 +77,11 @@ else O.key = key + if(O.client && O.client.prefs) + var/datum/preferences/B = O.client.prefs + for(var/language in B.alternate_languages) + O.add_language(language) + if(move) var/obj/loc_landmark for(var/obj/effect/landmark/start/sloc in landmarks_list) @@ -154,6 +159,11 @@ O.mmi.transfer_identity(src) + if(O.client && O.client.prefs) + var/datum/preferences/B = O.client.prefs + for(var/language in B.alternate_languages) + O.add_language(language) + callHook("borgify", list(O)) O.Namepick() diff --git a/code/modules/organs/internal/brain.dm b/code/modules/organs/internal/brain.dm index e0809e32b5..77ead516c3 100644 --- a/code/modules/organs/internal/brain.dm +++ b/code/modules/organs/internal/brain.dm @@ -82,6 +82,8 @@ if(H.mind) H.mind.transfer_to(brainmob) + brainmob.languages = H.languages + brainmob << "You feel slightly disoriented. That's normal when you're just \a [initial(src.name)]." callHook("debrain", list(brainmob)) diff --git a/code/modules/organs/subtypes/machine.dm b/code/modules/organs/subtypes/machine.dm index 45b0b8be28..439e9f7b2e 100644 --- a/code/modules/organs/subtypes/machine.dm +++ b/code/modules/organs/subtypes/machine.dm @@ -62,6 +62,8 @@ stored_mmi.icon_state = "mmi_full" icon_state = stored_mmi.icon_state + stored_mmi.brainmob.languages = owner.languages + if(owner && owner.stat == DEAD) owner.stat = 0 dead_mob_list -= owner @@ -91,6 +93,8 @@ stored_mmi.icon_state = "posibrain-occupied" icon_state = stored_mmi.icon_state + stored_mmi.brainmob.languages = owner.languages + /obj/item/organ/internal/mmi_holder/robot name = "digital brain interface" brain_type = /obj/item/device/mmi/digital/robot @@ -99,4 +103,6 @@ /obj/item/organ/internal/mmi_holder/robot/update_from_mmi() ..() stored_mmi.icon_state = "mainboard" - icon_state = stored_mmi.icon_state \ No newline at end of file + icon_state = stored_mmi.icon_state + + stored_mmi.brainmob.languages = owner.languages diff --git a/code/modules/surgery/robotics.dm b/code/modules/surgery/robotics.dm index 87e37e043e..09db2e3146 100644 --- a/code/modules/surgery/robotics.dm +++ b/code/modules/surgery/robotics.dm @@ -421,6 +421,7 @@ if(M.brainmob && M.brainmob.mind) M.brainmob.mind.transfer_to(target) + target.languages = M.brainmob.languages spawn(0) //Name yourself on your own damn time var/new_name = "" diff --git a/html/changelogs/PrismaticGynoid-forgottenlanguages.yml b/html/changelogs/PrismaticGynoid-forgottenlanguages.yml new file mode 100644 index 0000000000..dd3abb10e3 --- /dev/null +++ b/html/changelogs/PrismaticGynoid-forgottenlanguages.yml @@ -0,0 +1,7 @@ +author: PrismaticGynoid +delete-after: True +changes: + - tweak: "You now keep your languages when removed from/transplanted into a body." + - tweak: "AIs and borgs load languages from preferences when spawning." + - bugfix: "Fixed sign language being usable while lacking both hands." +