-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathspecies.dm
52 lines (39 loc) · 1.82 KB
/
species.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/// Species preference
/datum/preference/choiced/species
savefile_identifier = PREFERENCE_CHARACTER
savefile_key = "species"
priority = PREFERENCE_PRIORITY_SPECIES
randomize_by_default = FALSE
/datum/preference/choiced/species/deserialize(input, datum/preferences/preferences)
return GLOB.species_list[sanitize_inlist(input, get_choices_serialized(), SPECIES_HUMAN)]
/datum/preference/choiced/species/serialize(input)
var/datum/species/species = input
return initial(species.id)
/datum/preference/choiced/species/create_default_value()
return /datum/species/human
/datum/preference/choiced/species/create_random_value(datum/preferences/preferences)
return pick(get_choices())
/datum/preference/choiced/species/init_possible_values()
var/list/values = list()
for (var/species_id in get_selectable_species())
values += GLOB.species_list[species_id]
return values
/datum/preference/choiced/species/apply_to_human(mob/living/carbon/human/target, value)
target.set_species(value, icon_update = FALSE, pref_load = TRUE)
/datum/preference/choiced/species/compile_constant_data()
var/list/data = list()
for (var/species_id in get_selectable_species())
var/species_type = GLOB.species_list[species_id]
var/datum/species/species = new species_type()
data[species_id] = list()
data[species_id]["name"] = species.name
data[species_id]["desc"] = species.get_species_description()
data[species_id]["lore"] = species.get_species_lore()
data[species_id]["icon"] = sanitize_css_class_name(species.name)
data[species_id]["use_skintones"] = species.use_skintones
data[species_id]["possible_genders"] = species.possible_genders
data[species_id]["enabled_features"] = species.get_features()
data[species_id]["perks"] = species.get_species_perks()
data[species_id]["diet"] = species.get_species_diet()
qdel(species)
return data