This commit is contained in:
timothyteakettle
2020-08-21 03:48:30 +01:00
parent a0823ea54b
commit 709ddb4e58
5 changed files with 23 additions and 3 deletions

View File

@@ -246,6 +246,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
/// Which of the 5 persistent scar slots we randomly roll to load for this round, if enabled. Actually rolled in [/datum/preferences/proc/load_character(slot)]
var/scars_index = 1
var/chosen_limb_id //body sprite selected to load for the users limbs, null means default, is sanitized when loaded
/datum/preferences/New(client/C)
parent = C
@@ -521,6 +523,10 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "</td>"
mutant_category = 0
if(length(pref_species.allowed_limb_ids))
dat += "<h3>Body sprite</h3>"
dat += "<a style='display:block;width:100px' href='?_src_=prefs;preference=bodysprite;task=input'>[pref_species.mutant_bodyparts["limbs_id"]]</a>"
if(mutant_category)
dat += "</td>"
mutant_category = 0
@@ -2119,6 +2125,11 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/selected_custom_speech_verb = input(user, "Choose your desired speech verb (none means your species speech verb)", "Character Preference") as null|anything in GLOB.speech_verbs
if(selected_custom_speech_verb)
custom_speech_verb = selected_custom_speech_verb
if("bodysprite")
var/selected_body_sprite = input(user, "Choose your desired body sprite", "Character Preference") as null|anything in pref_species.allowed_limb_ids
if(selected_body_sprite)
chosen_limb_id = selected_body_sprite //this gets sanitized before loading
else
switch(href_list["preference"])
//CITADEL PREFERENCES EDIT - I can't figure out how to modularize these, so they have to go here. :c -Pooj
@@ -2510,6 +2521,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
character.dna.features = features.Copy()
character.set_species(chosen_species, icon_update = FALSE, pref_load = TRUE)
if(chosen_limb_id && (chosen_limb_id in character.dna.species.allowed_limb_ids))
character.dna.species.mutant_bodyparts["limbs_id"] = chosen_limb_id
character.dna.real_name = character.real_name
character.dna.nameless = character.nameless
character.dna.custom_species = character.custom_species

View File

@@ -114,6 +114,9 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
/// Our default override for typing indicator state
var/typing_indicator_state
//the ids you can use for your species, if empty, it means default only and not changeable
var/list/allowed_limb_ids
///////////
// PROCS //
///////////
@@ -121,7 +124,9 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
/datum/species/New()
if(!limbs_id) //if we havent set a limbs id to use, just use our own id
limbs_id = id
mutant_bodyparts["limbs_id"] = id //done this way to be non-intrusive to the existing system
else
mutant_bodyparts["limbs_id"] = limbs_id
..()
//update our mutant bodyparts to include unlocked ones

View File

@@ -17,3 +17,5 @@
tail_type = "mam_tail"
wagging_type = "mam_waggingtail"
species_type = "furry"
allowed_limb_ids = list("lizard","pod","mammal","human","insect")

View File

@@ -660,7 +660,7 @@ use_mob_overlay_icon: if FALSE, it will always use the default_icon_file even if
//produces a key based on the human's limbs
/mob/living/carbon/human/generate_icon_render_key()
. = "[dna.species.limbs_id]"
. = "[dna.species.mutant_bodyparts["limbs_id"]]"
if(dna.check_mutation(HULK))
. += "-coloured-hulk"

View File

@@ -598,7 +598,7 @@
var/datum/species/S = H.dna.species
base_bp_icon = S?.icon_limbs || DEFAULT_BODYPART_ICON
species_id = S.limbs_id
species_id = S.mutant_bodyparts["limbs_id"]
species_flags_list = H.dna.species.species_traits
//body marking memes