mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-19 02:56:14 +01:00
Character Setup Rework (#17576)
* Character Setup Rework Little tweaks Species selection done~ Merk randomize body button Body color and eye color Merk more replaced code Convert robolimbs to tgui Add a warning if flavor text/ooc notes are too short Custom preview icons for species selector! A sidequest that only took 8 hours. Also add digitigrade and blood type. Remove unused body_descriptor system completely Finish the general tab~ Reorganization to prepare for loadout page creation * Start of work on the loadout screen * Only send the data that's actually selected * Get rid of these ugly ../../../.. * Retype this to avoid conflicts * Holy shit why did this work this way * Finish loadout screen * Add copy loadout function * Finish occupation page * Move Special Roles into general tab * Fix path conflict * Move size prefs to general tab * Convert jukebox and volume settings to datum/preference * Fix a little mergery fuckery in loadout * Migrate jukebox to new range * Fix TabbedMenu tabs * Fix wordwrap for loadout screen * Kill the vore tab, just traits left to convert * Convert custom messages * Convert custom species name * Convert blood color and reagents * Move icobase to tgui * Finished * This can fuck off too * Fix a few bugs * Update index.tsx * initial for emote sound mode switch * Make show_roles actually work, hide fluff items * Fix not being able to select species * Add emote_sound_mode to body tab * Fix runtime when no active gear list is present * Add a save notification to character setup * Switch to floating * Add more search bars * Whoops forgot to add this --------- Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
@@ -1,108 +0,0 @@
|
||||
/*
|
||||
Small, mechanically supported physical customisation options.
|
||||
Also allows for per-species physical information ('his neck markings are more important than yours').
|
||||
ETA till a downstream ports this and adds boob and penis size: 2 days.
|
||||
*/
|
||||
|
||||
/mob/living/carbon/human/proc/show_descriptors_to(var/mob/user)
|
||||
if(LAZYLEN(descriptors))
|
||||
if(user == src)
|
||||
for(var/entry in descriptors)
|
||||
var/datum/mob_descriptor/descriptor = species.descriptors[entry]
|
||||
LAZYADD(., "[descriptor.get_first_person_message_start()] [descriptor.get_standalone_value_descriptor(descriptors[entry])].")
|
||||
else
|
||||
for(var/entry in descriptors)
|
||||
var/datum/mob_descriptor/descriptor = species.descriptors[entry]
|
||||
LAZYADD(., descriptor.get_comparative_value_descriptor(descriptors[entry], user, src))
|
||||
|
||||
/datum/mob_descriptor
|
||||
var/name // String ident.
|
||||
var/chargen_label // String ident for chargen.
|
||||
var/default_value // Initial value for this descriptor.
|
||||
var/comparison_offset = 0 // Used for examining similar properties between different species.
|
||||
var/comparative_value_descriptor_equivalent // String for looking at someone with roughly the same property.
|
||||
var/list/standalone_value_descriptors // String set for initial descriptor text.
|
||||
var/list/comparative_value_descriptors_smaller // String set for looking at someone smaller than you.
|
||||
var/list/comparative_value_descriptors_larger // String set for looking at someone larger than you.
|
||||
var/list/chargen_value_descriptors // Used for chargen selection of values in cases where there is a hidden meaning.
|
||||
var/skip_species_mention
|
||||
|
||||
/datum/mob_descriptor/New()
|
||||
if(!chargen_label)
|
||||
chargen_label = name
|
||||
if(!chargen_value_descriptors)
|
||||
chargen_value_descriptors = list()
|
||||
for(var/i = 1 to LAZYLEN(standalone_value_descriptors))
|
||||
chargen_value_descriptors[standalone_value_descriptors[i]] = i
|
||||
default_value = CEILING(LAZYLEN(standalone_value_descriptors) * 0.5, 1)
|
||||
..()
|
||||
|
||||
/datum/mob_descriptor/proc/get_third_person_message_start(var/datum/gender/my_gender)
|
||||
return "They are"
|
||||
// return "[my_gender.He] [my_gender.is]" // Doesn't respect ambiguous_genders species var, can't figure out a fix at the moment
|
||||
|
||||
/datum/mob_descriptor/proc/get_first_person_message_start()
|
||||
return "You are"
|
||||
|
||||
/datum/mob_descriptor/proc/get_standalone_value_descriptor(var/check_value)
|
||||
if(isnull(check_value))
|
||||
check_value = default_value
|
||||
if(check_value && LAZYLEN(standalone_value_descriptors) >= check_value)
|
||||
return standalone_value_descriptors[check_value]
|
||||
|
||||
// Build a species-specific descriptor string.
|
||||
/datum/mob_descriptor/proc/get_initial_comparison_component(var/mob/me, var/datum/gender/my_gender, var/datum/gender/other_gender, var/my_value)
|
||||
var/species_text
|
||||
if(ishuman(me) && !skip_species_mention)
|
||||
var/mob/living/carbon/human/H = me
|
||||
var/use_name = "\improper [H.species.name]"
|
||||
species_text = " for \a [use_name]"
|
||||
. = "[get_third_person_message_start(my_gender)] [get_standalone_value_descriptor(my_value)][species_text]"
|
||||
|
||||
/datum/mob_descriptor/proc/get_secondary_comparison_component(var/datum/gender/my_gender, var/datum/gender/other_gender, var/my_value, var/comparing_value)
|
||||
var/raw_value = my_value
|
||||
my_value += comparison_offset
|
||||
var/variance = abs((my_value)-comparing_value)
|
||||
if(variance < 1)
|
||||
. = "[.], [get_comparative_value_string_equivalent(raw_value, my_gender, other_gender)]"
|
||||
else
|
||||
variance = variance / LAZYLEN(standalone_value_descriptors)
|
||||
if(my_value < comparing_value)
|
||||
. = "[.], [get_comparative_value_string_smaller(variance, my_gender, other_gender)]"
|
||||
else if(my_value > comparing_value)
|
||||
. = "[.], [get_comparative_value_string_larger(variance, my_gender, other_gender)]"
|
||||
|
||||
/datum/mob_descriptor/proc/get_comparative_value_descriptor(var/my_value, var/mob/observer, var/mob/me)
|
||||
|
||||
// Store our gender info for later.
|
||||
var/datum/gender/my_gender = GLOB.gender_datums[me.get_gender()]
|
||||
var/datum/gender/other_gender = GLOB.gender_datums[observer.get_gender()]
|
||||
|
||||
. = get_initial_comparison_component(me, my_gender, other_gender, my_value)
|
||||
|
||||
// Append the same-descriptor comparison text.
|
||||
var/comparing_value
|
||||
if(ishuman(observer))
|
||||
var/mob/living/carbon/human/human_observer = observer
|
||||
if(LAZYLEN(human_observer.descriptors) && !isnull(human_observer.species.descriptors[name]) && !isnull(human_observer.descriptors[name]))
|
||||
var/datum/mob_descriptor/obs_descriptor = human_observer.species.descriptors[name]
|
||||
comparing_value = human_observer.descriptors[name] + obs_descriptor.comparison_offset
|
||||
|
||||
if(. && !isnull(comparing_value))
|
||||
. = "[.][get_secondary_comparison_component(my_gender, other_gender, my_value, comparing_value)]"
|
||||
|
||||
// We're done, add a full stop.
|
||||
. = "[.]. "
|
||||
|
||||
/datum/mob_descriptor/proc/get_comparative_value_string_equivalent(var/my_value, var/datum/gender/my_gender, var/datum/gender/other_gender)
|
||||
return comparative_value_descriptor_equivalent
|
||||
|
||||
/datum/mob_descriptor/proc/get_comparative_value_string_smaller(var/value, var/datum/gender/my_gender, var/datum/gender/other_gender)
|
||||
var/maxval = LAZYLEN(comparative_value_descriptors_smaller)
|
||||
value = CLAMP(CEILING(value * maxval, 1), 1, maxval)
|
||||
return comparative_value_descriptors_smaller[value]
|
||||
|
||||
/datum/mob_descriptor/proc/get_comparative_value_string_larger(var/value, var/datum/gender/my_gender, var/datum/gender/other_gender)
|
||||
var/maxval = LAZYLEN(comparative_value_descriptors_larger)
|
||||
value = CLAMP(CEILING(value * maxval, 1), 1, maxval)
|
||||
return comparative_value_descriptors_larger[value]
|
||||
@@ -1,45 +0,0 @@
|
||||
/datum/mob_descriptor/height
|
||||
name = "height"
|
||||
standalone_value_descriptors = list(
|
||||
"very short",
|
||||
"short",
|
||||
"of average height",
|
||||
"tall",
|
||||
"very tall"
|
||||
)
|
||||
comparative_value_descriptor_equivalent = "around the same height as you"
|
||||
comparative_value_descriptors_smaller = list(
|
||||
"slightly shorter than you",
|
||||
"shorter than you",
|
||||
"much shorter than you",
|
||||
"tiny and insignificant next to you"
|
||||
)
|
||||
comparative_value_descriptors_larger = list(
|
||||
"slightly taller than you",
|
||||
"taller than you",
|
||||
"much taller than you",
|
||||
"towering over you"
|
||||
)
|
||||
|
||||
/datum/mob_descriptor/build
|
||||
name = "build"
|
||||
comparative_value_descriptor_equivalent = "around the same build as you"
|
||||
standalone_value_descriptors = list(
|
||||
"rail thin",
|
||||
"thin",
|
||||
"of average build",
|
||||
"broad-shouldered",
|
||||
"heavily built"
|
||||
)
|
||||
comparative_value_descriptors_smaller = list(
|
||||
"a bit smaller in build than you",
|
||||
"smaller in build than you",
|
||||
"much smaller in build than you",
|
||||
"dwarfed by your height"
|
||||
)
|
||||
comparative_value_descriptors_larger = list(
|
||||
"slightly larger than you in build",
|
||||
"built larger than you",
|
||||
"built much larger than you",
|
||||
"dwarfing you"
|
||||
)
|
||||
@@ -1,27 +0,0 @@
|
||||
/datum/mob_descriptor/headtail_length
|
||||
name = "headtail length"
|
||||
chargen_label = "headtails (gender)"
|
||||
skip_species_mention = TRUE
|
||||
standalone_value_descriptors = list(
|
||||
"short",
|
||||
"long"
|
||||
)
|
||||
chargen_value_descriptors = list(
|
||||
"short (male)" = 1,
|
||||
"long (female)" = 2
|
||||
)
|
||||
|
||||
/datum/mob_descriptor/headtail_length/get_first_person_message_start()
|
||||
. = "Your headtails are"
|
||||
|
||||
/datum/mob_descriptor/headtail_length/get_third_person_message_start(var/datum/gender/my_gender)
|
||||
. = "[my_gender.His] headtails are"
|
||||
|
||||
/datum/mob_descriptor/headtail_length/get_comparative_value_string_equivalent(var/my_value, var/datum/gender/my_gender, var/datum/gender/other_gender)
|
||||
. = "indicating [other_gender.he] [other_gender.is] [my_value == 1 ? "male" : "female"] like you"
|
||||
|
||||
/datum/mob_descriptor/headtail_length/get_comparative_value_string_smaller(var/value, var/datum/gender/my_gender, var/datum/gender/other_gender)
|
||||
. = "indicating [other_gender.he] [other_gender.is] male"
|
||||
|
||||
/datum/mob_descriptor/headtail_length/get_comparative_value_string_larger(var/value, var/datum/gender/my_gender, var/datum/gender/other_gender)
|
||||
. = "indicating [other_gender.he] [other_gender.is] female"
|
||||
@@ -1,35 +0,0 @@
|
||||
/datum/mob_descriptor/vox_markings
|
||||
name = "neck markings"
|
||||
chargen_label = "neck markings (rank)"
|
||||
skip_species_mention = TRUE
|
||||
standalone_value_descriptors = list(
|
||||
"very simplistic",
|
||||
"rather simple",
|
||||
"complex",
|
||||
"moderately complex",
|
||||
"bewilderingly complex"
|
||||
)
|
||||
chargen_value_descriptors = list(
|
||||
"servitor" = 1,
|
||||
"labourer" = 2,
|
||||
"cannon fodder" = 3,
|
||||
"raider" = 4,
|
||||
"leader" = 5
|
||||
)
|
||||
comparative_value_descriptor_equivalent = "around the same importance as yours"
|
||||
comparative_value_descriptors_smaller = list(
|
||||
"slightly less important than yours",
|
||||
"much less important than yours",
|
||||
"insignificant and beneath your notice"
|
||||
)
|
||||
comparative_value_descriptors_larger = list(
|
||||
"slightly more important than yours",
|
||||
"much more important than yours",
|
||||
"commanding your unquestioning obedience and respect"
|
||||
)
|
||||
|
||||
/datum/mob_descriptor/vox_markings/get_first_person_message_start()
|
||||
. = "Your neck markings are"
|
||||
|
||||
/datum/mob_descriptor/vox_markings/get_third_person_message_start(var/datum/gender/my_gender)
|
||||
. = "[my_gender.His] neck markings are"
|
||||
@@ -454,10 +454,6 @@
|
||||
if(applying_pressure)
|
||||
msg += applying_pressure
|
||||
|
||||
var/show_descs = show_descriptors_to(user)
|
||||
if(show_descs)
|
||||
msg += span_notice("[jointext(show_descs, "<br>")]")
|
||||
|
||||
if(pose)
|
||||
if(!findtext(pose, regex("\[.?!]$"))) // Will be zero if the last character is not a member of [.?!]
|
||||
pose = addtext(pose,".") //Makes sure all emotes end with a period.
|
||||
|
||||
@@ -1321,15 +1321,6 @@
|
||||
pixel_y = default_pixel_y
|
||||
center_offset = species.center_offset
|
||||
|
||||
if(LAZYLEN(descriptors))
|
||||
descriptors = null
|
||||
|
||||
if(LAZYLEN(species.descriptors))
|
||||
descriptors = list()
|
||||
for(var/desctype in species.descriptors)
|
||||
var/datum/mob_descriptor/descriptor = species.descriptors[desctype]
|
||||
descriptors[desctype] = descriptor.default_value
|
||||
|
||||
if(vessel)
|
||||
initialize_vessel()
|
||||
|
||||
|
||||
@@ -103,8 +103,6 @@
|
||||
|
||||
var/identifying_gender // In case the human identifies as another gender than it's biological
|
||||
|
||||
var/list/descriptors // For comparative examine code
|
||||
|
||||
var/step_count = 0 // Track how many footsteps have been taken to know when to play footstep sounds
|
||||
|
||||
can_be_antagged = TRUE
|
||||
|
||||
@@ -236,8 +236,6 @@ var/static/icon/ingame_hud_med_vr = icon('icons/mob/hud_med_vr.dmi')
|
||||
|
||||
markings_len = character.markings_len
|
||||
|
||||
descriptors = character.descriptors?.Copy()
|
||||
|
||||
if (copy_flavour)
|
||||
flavor_texts = character.flavor_texts?.Copy()
|
||||
|
||||
|
||||
@@ -302,8 +302,6 @@
|
||||
|
||||
var/pass_flags = 0
|
||||
|
||||
var/list/descriptors = list()
|
||||
|
||||
//This is used in character setup preview generation (prefences_setup.dm) and human mob
|
||||
//rendering (update_icons.dm)
|
||||
var/color_mult = 0
|
||||
@@ -385,15 +383,6 @@
|
||||
else
|
||||
hud = new()
|
||||
|
||||
// Prep the descriptors for the species
|
||||
if(LAZYLEN(descriptors))
|
||||
var/list/descriptor_datums = list()
|
||||
for(var/desctype in descriptors)
|
||||
var/datum/mob_descriptor/descriptor = new desctype
|
||||
descriptor.comparison_offset = descriptors[desctype]
|
||||
descriptor_datums[descriptor.name] = descriptor
|
||||
descriptors = descriptor_datums
|
||||
|
||||
//If the species has eyes, they are the default vision organ
|
||||
if(!vision_organ && has_organ[O_EYES])
|
||||
vision_organ = O_EYES
|
||||
|
||||
@@ -405,7 +405,6 @@
|
||||
if(ticker.random_players)
|
||||
new_character.gender = pick(MALE, FEMALE)
|
||||
client.prefs.real_name = random_name(new_character.gender)
|
||||
client.prefs.randomize_appearance_and_body_for(new_character)
|
||||
else
|
||||
client.prefs.copy_to(new_character, icon_updates = TRUE)
|
||||
|
||||
|
||||
@@ -33,37 +33,6 @@
|
||||
write_preference(preference, preference.create_random_value(src))
|
||||
*/
|
||||
|
||||
//The mob should have a gender you want before running this proc. Will run fine without H
|
||||
/datum/preferences/proc/randomize_appearance_and_body_for(var/mob/living/carbon/human/H)
|
||||
var/datum/species/current_species = GLOB.all_species[species ? species : "Human"]
|
||||
set_biological_gender(pick(current_species.genders))
|
||||
|
||||
h_style = random_hair_style(biological_gender, species)
|
||||
f_style = random_facial_hair_style(biological_gender, species)
|
||||
if(current_species)
|
||||
if(current_species.appearance_flags & HAS_SKIN_TONE)
|
||||
s_tone = random_skin_tone()
|
||||
if(current_species.appearance_flags & HAS_SKIN_COLOR)
|
||||
update_preference_by_type(/datum/preference/color/human/skin_color, rgb(rand(0, 255), rand(0, 255), rand(0, 255)))
|
||||
if(current_species.appearance_flags & HAS_EYE_COLOR)
|
||||
randomize_eyes_color()
|
||||
if(current_species.appearance_flags & HAS_HAIR_COLOR)
|
||||
randomize_hair_color("hair")
|
||||
randomize_hair_color("facial")
|
||||
if(current_species.appearance_flags & HAS_UNDERWEAR)
|
||||
all_underwear.Cut()
|
||||
for(var/datum/category_group/underwear/WRC in global_underwear.categories)
|
||||
var/datum/category_item/underwear/WRI = pick(WRC.items)
|
||||
all_underwear[WRC.name] = WRI.name
|
||||
|
||||
|
||||
headset = rand(1,3)
|
||||
backbag = rand(1,6)
|
||||
pdachoice = rand(1,7)
|
||||
randomise_appearance_prefs_update(current_species = current_species)
|
||||
b_type = RANDOM_BLOOD_TYPE
|
||||
if(H)
|
||||
copy_to(H,1)
|
||||
|
||||
|
||||
/datum/preferences/proc/randomize_hair_color(var/target = "hair")
|
||||
@@ -242,7 +211,8 @@
|
||||
|
||||
if((equip_preview_mob & EQUIP_PREVIEW_LOADOUT) && !(previewJob && (equip_preview_mob & EQUIP_PREVIEW_JOB) && (previewJob.type == /datum/job/ai || previewJob.type == /datum/job/cyborg)))
|
||||
var/list/equipped_slots = list()
|
||||
for(var/thing in gear)
|
||||
var/list/active_gear_list = LAZYACCESS(gear_list, "[gear_slot]")
|
||||
for(var/thing in active_gear_list)
|
||||
var/datum/gear/G = gear_datums[thing]
|
||||
if(G)
|
||||
var/permitted = 0
|
||||
@@ -262,7 +232,7 @@
|
||||
continue
|
||||
|
||||
if(G.slot && !(G.slot in equipped_slots))
|
||||
var/metadata = gear[G.display_name]
|
||||
var/metadata = active_gear_list[G.display_name]
|
||||
if(mannequin.equip_to_slot_or_del(G.spawn_item(mannequin, metadata), G.slot))
|
||||
if(G.slot != slot_tie)
|
||||
equipped_slots += G.slot
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
/datum/preferences/randomize_appearance_and_body_for(var/mob/living/carbon/human/H)
|
||||
sensorpref = rand(1,5)
|
||||
Reference in New Issue
Block a user