mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Multilingual Quirk (#17632)
* new quirk * updated for new preferences * these don't need to be here
This commit is contained in:
@@ -24,3 +24,4 @@
|
|||||||
#define LANGUAGE_VOICECHANGE "voicechange"
|
#define LANGUAGE_VOICECHANGE "voicechange"
|
||||||
#define LANGUAGE_REVOLUTIONARY "revolutionary"
|
#define LANGUAGE_REVOLUTIONARY "revolutionary"
|
||||||
#define LANGUAGE_CATEARS "cat"
|
#define LANGUAGE_CATEARS "cat"
|
||||||
|
#define LANGUAGE_MULTILINGUAL "multilingual"
|
||||||
|
|||||||
@@ -364,3 +364,68 @@
|
|||||||
if(disallowed_trait)
|
if(disallowed_trait)
|
||||||
return "You have no DNA!"
|
return "You have no DNA!"
|
||||||
return FALSE
|
return FALSE
|
||||||
|
|
||||||
|
/datum/quirk/multilingual
|
||||||
|
name = "Multilingual"
|
||||||
|
desc = "You spent a portion of your life learning to understand an additional language. You may or may not be able to speak it based on your anatomy."
|
||||||
|
icon = "book"
|
||||||
|
value = 3
|
||||||
|
var/datum/language/specific
|
||||||
|
gain_text = span_notice("You have learned to understand an additional language.")
|
||||||
|
lose_text = span_notice("You have forgotten how to understand a language.")
|
||||||
|
|
||||||
|
/datum/quirk/multilingual/add()
|
||||||
|
var/mob/living/carbon/human/H = quirk_holder
|
||||||
|
if(specific)
|
||||||
|
H.grant_language(specific, TRUE, TRUE, LANGUAGE_MULTILINGUAL)
|
||||||
|
else
|
||||||
|
var/obj/item/organ/tongue/T = H.getorganslot(ORGAN_SLOT_TONGUE)
|
||||||
|
var/list/languages_possible = T.languages_possible
|
||||||
|
languages_possible = languages_possible - typecacheof(/datum/language/codespeak) - typecacheof(/datum/language/narsie) - typecacheof(/datum/language/ratvar)
|
||||||
|
languages_possible = languages_possible - H.language_holder.understood_languages
|
||||||
|
languages_possible = languages_possible - H.language_holder.blocked_languages
|
||||||
|
if(length(languages_possible))
|
||||||
|
var/datum/language/random_language = pick(languages_possible)
|
||||||
|
H.grant_language(random_language, TRUE, TRUE, LANGUAGE_MULTILINGUAL)
|
||||||
|
|
||||||
|
/datum/quirk/multilingual/check_quirk(datum/preferences/prefs)
|
||||||
|
var/species_type = prefs.read_preference(/datum/preference/choiced/species)
|
||||||
|
var/datum/species/species = new species_type
|
||||||
|
if(species && specific)
|
||||||
|
var/mob/M = new /mob // can't instantiate a language holder without an owner
|
||||||
|
var/datum/language_holder/lang = new species.species_language_holder(M)
|
||||||
|
if(length(lang.understood_languages) && (specific in lang.understood_languages))
|
||||||
|
var/datum/language/L = new specific()
|
||||||
|
return "You already know [L.name]!"
|
||||||
|
if(length(lang.blocked_languages) && (specific in lang.blocked_languages))
|
||||||
|
var/datum/language/L = new specific()
|
||||||
|
return "You are incapable of understanding [L.name]!"
|
||||||
|
return FALSE
|
||||||
|
|
||||||
|
/datum/quirk/multilingual/english
|
||||||
|
name = "Multilingual (English)"
|
||||||
|
desc = "You spent a portion of your life learning to understand English. You may or may not be able to speak it based on your anatomy."
|
||||||
|
specific = /datum/language/english
|
||||||
|
gain_text = span_notice("You have learned to understand English.")
|
||||||
|
lose_text = span_notice("You have forgotten how to understand English.")
|
||||||
|
|
||||||
|
/datum/quirk/multilingual/etherean
|
||||||
|
name = "Multilingual (Etherean)"
|
||||||
|
desc = "You spent a portion of your life learning to understand Etherean. You may or may not be able to speak it based on your anatomy."
|
||||||
|
specific = /datum/language/etherean
|
||||||
|
gain_text = span_notice("You have learned to understand Etherean.")
|
||||||
|
lose_text = span_notice("You have forgotten how to understand Etherean.")
|
||||||
|
|
||||||
|
/datum/quirk/multilingual/mothian
|
||||||
|
name = "Multilingual (Mothian)"
|
||||||
|
desc = "You spent a portion of your life learning to understand Mothian. You may or may not be able to speak it based on your anatomy."
|
||||||
|
specific = /datum/language/mothian
|
||||||
|
gain_text = span_notice("You have learned to understand Mothian.")
|
||||||
|
lose_text = span_notice("You have forgotten how to understand Mothian.")
|
||||||
|
|
||||||
|
/datum/quirk/multilingual/draconic
|
||||||
|
name = "Multilingual (Draconic)"
|
||||||
|
desc = "You spent a portion of your life learning to understand Draconic. You may or may not be able to speak it based on your anatomy."
|
||||||
|
specific = /datum/language/draconic
|
||||||
|
gain_text = span_notice("You have learned to understand Draconic.")
|
||||||
|
lose_text = span_notice("You have forgotten how to understand Draconic.")
|
||||||
|
|||||||
Reference in New Issue
Block a user