[MIRROR] Convert species, organ_data, and rlimb_data to TG (#12570)

This commit is contained in:
CHOMPStation2StaffMirrorBot
2026-03-21 14:19:04 +01:00
committed by GitHub
parent 30f5891bfa
commit 80fcaab9dc
32 changed files with 343 additions and 193 deletions
+9 -10
View File
@@ -31,7 +31,6 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/grad_style = "none" //Gradient style
var/f_style = "Shaved" //Face hair type
var/s_tone = -75 //Skin tone
var/species = SPECIES_HUMAN //Species datum to use.
var/species_preview //Used for the species selection window.
var/list/alternate_languages = list() //Secondary language(s)
var/list/language_prefixes = list() //Language prefix keys
@@ -87,8 +86,6 @@ GLOBAL_LIST_EMPTY(preferences_datums)
// maps each organ to either null(intact), "cyborg" or "amputated"
// will probably not be able to do this for head and torso ;)
var/list/organ_data = list()
var/list/rlimb_data = list()
var/list/player_alt_titles = new() // the default name of a job like JOB_MEDICAL_DOCTOR
var/list/body_markings = list() // "name" = "#rgbcolor" //VOREStation Edit: "name" = list(BP_HEAD = list("on" = <enabled>, "color" = "#rgbcolor"), BP_TORSO = ...)
@@ -159,7 +156,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
// Didn't load a character, so let's randomize
set_biological_gender(pick(MALE, FEMALE))
update_preference_by_type(/datum/preference/name/real_name, random_name(read_preference(/datum/preference/choiced/gender/identifying), species))
update_preference_by_type(/datum/preference/name/real_name, random_name(read_preference(/datum/preference/choiced/gender/identifying), read_preference(/datum/preference/choiced/species)))
b_type = RANDOM_BLOOD_TYPE
if(client)
@@ -298,10 +295,10 @@ GLOBAL_LIST_EMPTY(preferences_datums)
player_setup.sanitize_setup()
// This needs to happen before anything else becuase it sets some variables.
character.set_species(species)
character.set_species(read_preference(/datum/preference/choiced/species))
// Special Case: This references variables owned by two different datums, so do it here.
if(read_preference(/datum/preference/toggle/human/name_is_always_random))
update_preference_by_type(/datum/preference/name/real_name, random_name(read_preference(/datum/preference/choiced/gender/identifying), species))
update_preference_by_type(/datum/preference/name/real_name, random_name(read_preference(/datum/preference/choiced/gender/identifying), read_preference(/datum/preference/choiced/species)))
// Ask the preferences datums to apply their own settings to the new mob
player_setup.copy_to_mob(character)
@@ -515,6 +512,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
// Destroy/cyborgize organs and limbs.
if (convert_to_prosthetics) //should only really be run for proteans
var/list/pref_organ_data = read_preference(/datum/preference/organ_data)
var/list/pref_rlimb_data = read_preference(/datum/preference/rlimb_data)
var/list/organs_to_edit = list()
for (var/name in list(BP_TORSO, BP_HEAD, BP_GROIN, BP_L_ARM, BP_R_ARM, BP_L_HAND, BP_R_HAND, BP_L_LEG, BP_R_LEG, BP_L_FOOT, BP_R_FOOT))
var/obj/item/organ/external/O = character.organs_by_name[name]
@@ -525,16 +524,16 @@ GLOBAL_LIST_EMPTY(preferences_datums)
else
organs_to_edit.Insert(x+(O.robotic == ORGAN_NANOFORM ? 1 : 0), name)
for(var/name in organs_to_edit)
var/status = organ_data[name]
var/status = pref_organ_data[name]
var/obj/item/organ/external/O = character.organs_by_name[name]
if(O)
if(status == "amputated")
continue
else if(status == "cyborg")
O.robotize(rlimb_data[name])
O.robotize(pref_rlimb_data[name])
else
var/bodytype
var/datum/species/selected_species = GLOB.all_species[species]
var/datum/species/selected_species = GLOB.all_species[read_preference(/datum/preference/choiced/species)]
if(selected_species.selects_bodytype && custom_base) //Everyone technically has custom_base set to HUMAN, but only some species actually select it.
bodytype = custom_base
else
@@ -621,7 +620,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
character.species?.blood_color = blood_color
var/datum/species/selected_species = GLOB.all_species[species]
var/datum/species/selected_species = GLOB.all_species[read_preference(/datum/preference/choiced/species)]
var/bodytype_selected
if(selected_species.selects_bodytype && custom_base)
bodytype_selected = custom_base