-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathgender.dm
30 lines (23 loc) · 974 Bytes
/
gender.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/// Gender preference
/datum/preference/choiced/gender
savefile_identifier = PREFERENCE_CHARACTER
savefile_key = "gender"
priority = PREFERENCE_PRIORITY_GENDER
/datum/preference/choiced/gender/init_possible_values()
return list(MALE, FEMALE, PLURAL, NEUTER)
/datum/preference/choiced/gender/create_informed_default_value(datum/preferences/preferences)
var/datum/species/species_type = preferences.read_preference(/datum/preference/choiced/species)
var/datum/species/species = new species_type
var/list/possible_genders = species.possible_genders
if(possible_genders.len < 1)
stack_trace("[species_type.type] has no possible genders!")
qdel(species)
return list(PLURAL)
qdel(species)
return pick(possible_genders)
/datum/preference/choiced/gender/apply_to_human(mob/living/carbon/human/target, value)
var/datum/species/S = target.dna.species
if(!(value in S.possible_genders))
target.gender = pick(S.possible_genders)
else
target.gender = value