Skip to content

Commit

Permalink
Translator augment (#18905)
Browse files Browse the repository at this point in the history
Adds an augmented translator to the game, with which the user can
understand all human languages. I did not add a translator from xeno
languages, as it would have been very strong, given the difficulty of
translation and the peculiarities of their languages.

I have decomposed the original augment file to improve readability and
code handling. Hopefully this won't cause trouble in the future. (Sorry,
but an 800+ line file is a very large file.)
  • Loading branch information
SidVeld authored Apr 17, 2024
1 parent 952036d commit 63b5617
Show file tree
Hide file tree
Showing 37 changed files with 1,000 additions and 882 deletions.
32 changes: 31 additions & 1 deletion aurorastation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -2901,7 +2901,6 @@
#include "code\modules\organs\internal\species\tajara.dm"
#include "code\modules\organs\internal\species\unathi.dm"
#include "code\modules\organs\internal\species\vaurca.dm"
#include "code\modules\organs\subtypes\augment.dm"
#include "code\modules\organs\subtypes\autakh.dm"
#include "code\modules\organs\subtypes\diona.dm"
#include "code\modules\organs\subtypes\industrial.dm"
Expand All @@ -2915,6 +2914,37 @@
#include "code\modules\organs\subtypes\vaurca.dm"
#include "code\modules\organs\subtypes\xenos.dm"
#include "code\modules\organs\subtypes\zombie.dm"
#include "code\modules\organs\subtypes\augment\augment.dm"
#include "code\modules\organs\subtypes\augment\augment_tool.dm"
#include "code\modules\organs\subtypes\augment\augments\cohlear.dm"
#include "code\modules\organs\subtypes\augment\augments\combitool.dm"
#include "code\modules\organs\subtypes\augment\augments\corrective_lens.dm"
#include "code\modules\organs\subtypes\augment\augments\crayon.dm"
#include "code\modules\organs\subtypes\augment\augments\cyber_hair.dm"
#include "code\modules\organs\subtypes\augment\augments\cybrong_analyzer.dm"
#include "code\modules\organs\subtypes\augment\augments\drill.dm"
#include "code\modules\organs\subtypes\augment\augments\emotional_manipulator.dm"
#include "code\modules\organs\subtypes\augment\augments\enhanced_vision.dm"
#include "code\modules\organs\subtypes\augment\augments\ethanol_burner.dm"
#include "code\modules\organs\subtypes\augment\augments\eye_sensors.dm"
#include "code\modules\organs\subtypes\augment\augments\fluff.dm"
#include "code\modules\organs\subtypes\augment\augments\fuel_cell.dm"
#include "code\modules\organs\subtypes\augment\augments\gustatorial_centre.dm"
#include "code\modules\organs\subtypes\augment\augments\health_analyzer.dm"
#include "code\modules\organs\subtypes\augment\augments\language_processor.dm"
#include "code\modules\organs\subtypes\augment\augments\lighter.dm"
#include "code\modules\organs\subtypes\augment\augments\memory_inhibitor.dm"
#include "code\modules\organs\subtypes\augment\augments\pen.dm"
#include "code\modules\organs\subtypes\augment\augments\phalanx_facial_plate.dm"
#include "code\modules\organs\subtypes\augment\augments\psi_receiver.dm"
#include "code\modules\organs\subtypes\augment\augments\sight_lights.dm"
#include "code\modules\organs\subtypes\augment\augments\suspension.dm"
#include "code\modules\organs\subtypes\augment\augments\synthetic_cords.dm"
#include "code\modules\organs\subtypes\augment\augments\taste_booster.dm"
#include "code\modules\organs\subtypes\augment\augments\tesla.dm"
#include "code\modules\organs\subtypes\augment\augments\timepiece.dm"
#include "code\modules\organs\subtypes\augment\augments\translator.dm"
#include "code\modules\organs\subtypes\augment\augments\zengu_plate.dm"
#include "code\modules\organs\subtypes\parasite\_parasite.dm"
#include "code\modules\organs\subtypes\parasite\black_kois.dm"
#include "code\modules\organs\subtypes\parasite\heart_fluke.dm"
Expand Down
53 changes: 27 additions & 26 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -150,37 +150,38 @@
#define BP_TUMOUR_SPREADING "malignant tumour"

//Augment organs
#define BP_AUG_TIMEPIECE "integrated timepiece"
#define BP_AUG_TOOL "retractable combitool"
#define BP_AUG_PEN "retractable combipen"
#define BP_AUG_CRAYON "retractable crayon"
#define BP_AUG_CYBORG_ANALYZER "retractable cyborg analyzer"
#define BP_AUG_LIGHTER "retractable lighter"
#define BP_AUG_HEALTHSCAN "integrated health scanner"
#define BP_AUG_DRILL "integrated mining drill"
#define BP_AUG_GUSTATORIAL "integrated gustatorial centre"
#define BP_AUG_TESLA "tesla spine"
#define BP_AUG_EYE_SENSORS "integrated eyes sensors"
#define BP_AUG_HAIR "synthetic hair extensions"
#define BP_AUG_CORDS "synthetic vocal cords"
#define BP_AUG_COCHLEAR "cochlear implant"
#define BP_AUG_SUSPENSION "calf suspension"
#define BP_AUG_TASTE_BOOSTER "taste booster"
#define BP_AUG_RADIO "integrated radio"
#define BP_AUG_FUEL_CELL "integrated fuel cell"
#define BP_AUG_ACC_CORDS "modified synthetic vocal cords"
#define BP_AUG_AIR_ANALYZER "integrated air analyzer"
#define BP_AUG_LANGUAGE "integrated language processor"
#define BP_AUG_ETHANOL_BURNER "integrated ethanol burner"
#define BP_AUG_PSI "psionic receiver"
#define BP_AUG_CALF_OVERRIDE "calf overdrive"
#define BP_AUG_MEMORY "memory inhibitor"
#define BP_AUG_COCHLEAR "cochlear implant"
#define BP_AUG_CORDS "synthetic vocal cords"
#define BP_AUG_CORRECTIVE_LENS "corrective lenses"
#define BP_AUG_CRAYON "retractable crayon"
#define BP_AUG_CYBORG_ANALYZER "retractable cyborg analyzer"
#define BP_AUG_DRILL "integrated mining drill"
#define BP_AUG_EMOTION "emotional manipulator"
#define BP_AUG_ENCHANED_VISION "vision enhanced retinas"
#define BP_AUG_ETHANOL_BURNER "integrated ethanol burner"
#define BP_AUG_EYE_SENSORS "integrated eyes sensors"
#define BP_AUG_FUEL_CELL "integrated fuel cell"
#define BP_AUG_GLARE_DAMPENER "glare dampeners"
#define BP_AUG_GUSTATORIAL "integrated gustatorial centre"
#define BP_AUG_HAIR "synthetic hair extensions"
#define BP_AUG_HEALTHSCAN "integrated health scanner"
#define BP_AUG_LANGUAGE "integrated language processor"
#define BP_AUG_LIGHTER "retractable lighter"
#define BP_AUG_MAGBOOT "integrated mag-claws"
#define BP_AUG_MEMORY "memory inhibitor"
#define BP_AUG_PEN "retractable combipen"
#define BP_AUG_PSI "psionic receiver"
#define BP_AUG_RADIO "integrated radio"
#define BP_AUG_SIGHTLIGHTS "ocular installed sightlights"
#define BP_AUG_CORRECTIVE_LENS "corrective lenses"
#define BP_AUG_GLARE_DAMPENER "glare dampeners"
#define BP_AUG_ACC_CORDS "modified synthetic vocal cords"
#define BP_AUG_MAGBOOT "integrated mag-claws"
#define BP_AUG_SUSPENSION "calf suspension"
#define BP_AUG_TASTE_BOOSTER "taste booster"
#define BP_AUG_TESLA "tesla spine"
#define BP_AUG_TIMEPIECE "integrated timepiece"
#define BP_AUG_TRANSLATOR "universal translator"
#define BP_AUG_TOOL "retractable combitool"

//Organ defines
#define PROCESS_ACCURACY 10
Expand Down
17 changes: 11 additions & 6 deletions code/modules/mob/living/carbon/human/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@
return TRUE

//These only pertain to common. Languages are handled by mob/say_understands()
if (!speaking)
if (istype(other, /mob/living/carbon/alien/diona))
if(!speaking)
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 TRUE
if (istype(other, /mob/living/silicon))
if(istype(other, /mob/living/silicon))
return TRUE
if (istype(other, /mob/living/announcer))
if(istype(other, /mob/living/announcer))
return TRUE
if (istype(other, /mob/living/carbon/brain))
if(istype(other, /mob/living/carbon/brain))
return TRUE
if (istype(other, /mob/living/carbon/slime))
if(istype(other, /mob/living/carbon/slime))
return TRUE

//This is already covered by mob/say_understands()
Expand All @@ -58,6 +58,11 @@
// return 1
// return 0

// Try to translate with augment if it is installed and not broken.
var/obj/item/organ/internal/augment/translator/translator = internal_organs_by_name[BP_AUG_TRANSLATOR]
if(!translator?.is_broken() && (speaking.name in translator?.languages))
return TRUE

return ..()

/mob/living/carbon/human/GetVoice()
Expand Down
13 changes: 6 additions & 7 deletions code/modules/mob/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,15 @@

say_dead_direct("[pick("complains","moans","whines","laments","blubbers")], <span class='message linkify'>\"[message]\"</span>", src)

/mob/proc/say_understands(var/mob/other,var/datum/language/speaking = null)

if (src.stat == 2) //Dead
/mob/proc/say_understands(var/mob/other, var/datum/language/speaking = null)
if(src.stat == DEAD)
return TRUE

//Universal speak makes everything understandable, for obvious reasons.
else if(src.universal_speak || src.universal_understand)
// Universal speak makes everything understandable, for obvious reasons.
if(src.universal_speak || src.universal_understand)
return TRUE

//Languages are handled after.
// Languages are handled after.
if (!speaking)
if(!other)
return TRUE
Expand All @@ -76,7 +75,7 @@
if(speaking.flags & INNATE)
return TRUE

//Language check.
// Language check.
for(var/datum/language/L in src.languages)
if(speaking.name == L.name)
return TRUE
Expand Down
Loading

0 comments on commit 63b5617

Please sign in to comment.