Adds Linguist and Polyglot traits

This commit is contained in:
Casey
2022-06-26 14:02:20 -04:00
committed by CHOMPStation2
parent 2531f1d482
commit ecf834c452
4 changed files with 91 additions and 3 deletions

View File

@@ -186,4 +186,18 @@
/datum/trait/positive/cocoon_tf/apply(var/datum/species/S,var/mob/living/carbon/human/H)
..(S,H)
H.verbs |= /mob/living/carbon/human/proc/enter_cocoon
H.verbs |= /mob/living/carbon/human/proc/enter_cocoon
/datum/trait/positive/linguist
name = "Linguist"
desc = "Allows you to have more languages."
cost = 1
var_changes = list("num_alternate_languages" = 5)
var_changes_pref = list("extra_languages" = 2)
/datum/trait/positive/polyglot
name = "Polyglot"
desc = "Allows you to have a lot more languages."
cost = 2
var_changes = list("num_alternate_languages" = 7)
var_changes_pref = list("extra_languages" = 4)

View File

@@ -6,6 +6,7 @@
var/sort = TRAIT_SORT_NORMAL // Sort order, 1 before 2 before 3 etc. Alphabetical is used for same-group traits.
var/category = 0 // What category this trait is. -1 is Negative, 0 is Neutral, 1 is Positive
var/list/var_changes // A list to apply to the custom species vars.
var/list/var_changes_pref // A list to apply to the preference vars.
var/list/excludes // Store a list of paths of traits to exclude, but done automatically if they change the same vars.
var/can_take = ORGANICS|SYNTHETICS // Can freaking synths use those.
var/list/banned_species // A list of species that can't take this trait
@@ -20,7 +21,23 @@
S.vars[V] = var_changes[V]
return
//Applying trait to preferences rather than just us.
/datum/trait/proc/apply_pref(var/datum/preferences/P)
ASSERT(P)
if(var_changes_pref)
for(var/V in var_changes_pref)
P.vars[V] = var_changes_pref[V]
return
//Similar to the above, but for removing. Probably won't be called often/ever.
/datum/trait/proc/remove(var/datum/species/S)
ASSERT(S)
return
//Similar to the above, but for removing.
/datum/trait/proc/remove_pref(var/datum/preferences/P)
ASSERT(P)
if(var_changes_pref)
for(var/V in var_changes_pref)
P.vars[V] = initial(P.vars[V])
return