Files
Bubberstation/code/modules/client/preferences/species.dm
SkyratBot 0a1f06a2d1 [MIRROR] This tail refactor turned into an organ refactor. Funny how that works. [MDB IGNORE] (#14017)
* This tail refactor turned into an organ refactor. Funny how that works.

* Firstly, fixing all the conflicts.

* Fixes all our maps (hopefully)

* Actually, this should fix pod people hair :)

* Almost everything is working, just two major things to fix

* Fixed a certain kind of external organ

* Cleaning up some more stuff

* Turned tail_cat into tail because why the fuck are they separate?

* Moved all the tails into tails.dmi because that was just dumb to have like 3 in a different file

* Adds relevant_layers to organs to help with rendering

* Makes stored_feature_id also check mutant_bodyparts

* Fixes the icon_state names of ALL the tails (pain)

* Fixes wagging, gotta refactor most mutant bodyparts later on

* I Love Added Failures

* Fixed some organs that slipped through my searches

* This could possibly fix the CI for this?

* It doesn't look like it did fix it

* This will make it pass, even if it's ugly as sin.

* Fixed Felinids having a weird ghost tail

* Fixes instances of snouts and tails not being properly colored

Co-authored-by: Kapu1178 <75460809+Kapu1178@users.noreply.github.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
2022-06-11 23:20:16 -04:00

74 lines
2.7 KiB
Plaintext

/// 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]
//SKYRAT EDIT ADDITION
for (var/species_id in get_customizable_races())
values += GLOB.species_list[species_id]
//SKYRAT EDIT END
return values
/datum/preference/choiced/species/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/prefs)
target.set_species(value, FALSE, FALSE, prefs?.features.Copy(), prefs?.mutant_bodyparts.Copy(), prefs?.body_markings.Copy()) // SKYRAT EDIT - Customization
//SKYRAT EDIT ADDITION
target.dna.update_body_size()
for(var/organ_key in list(ORGAN_SLOT_VAGINA, ORGAN_SLOT_PENIS, ORGAN_SLOT_BREASTS, ORGAN_SLOT_ANUS))
var/obj/item/organ/external/genital/gent = target.getorganslot(organ_key)
if(gent)
gent.aroused = prefs.arousal_preview
gent.update_sprite_suffix()
if(prefs && length(prefs.augments))
for(var/key in prefs.augments)
var/datum/augment_item/aug = GLOB.augment_items[prefs.augments[key]]
aug.apply(target, prefs = prefs)
//SKYRAT EDIT END
/datum/preference/choiced/species/compile_constant_data()
var/list/data = list()
for (var/species_id in (get_selectable_species() + get_customizable_races())) //SKYRAT EDIT CHANGE
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]["sexes"] = species.sexes
data[species_id]["enabled_features"] = species.get_features()
data[species_id]["perks"] = species.get_species_perks()
data[species_id]["diet"] = species.get_species_diet()
data[species_id]["veteran_only"] = species.veteran_only // SKYRAT EDIT ADDITION - Veteran races
qdel(species)
return data