randomization!

This commit is contained in:
deathride58
2022-06-09 15:29:48 -04:00
parent 8e152c38c9
commit f30c9406cc
6 changed files with 19 additions and 3 deletions
+2
View File
@@ -82,6 +82,8 @@
for(var/path in subtypesof(/datum/bark))
var/datum/bark/B = new path()
GLOB.bark_list[B.id] = path
if(B.allow_random)
GLOB.bark_random_list[B.id] = path
// Hair Gradients - Initialise all /datum/sprite_accessory/hair_gradient into an list indexed by gradient-style name
for(var/path in subtypesof(/datum/sprite_accessory/hair_gradient))
+1
View File
@@ -45,6 +45,7 @@ GLOBAL_LIST_EMPTY(caps_list)
//Bark bits
GLOBAL_LIST_EMPTY(bark_list)
GLOBAL_LIST_EMPTY(bark_random_list)
//a way to index the right bodypart list given the type of bodypart
GLOBAL_LIST_INIT(mutant_reference_list, list(
+6
View File
@@ -19,6 +19,7 @@
// Visibility vars. Regardless of what's set below, these can still be obtained via adminbus and genetics. Rule of fun.
var/list/ckeys_allowed
var/ignore = FALSE //Controls whether or not this can be chosen in chargen
var/allow_random = FALSE //Allows chargen randomization to use this. This is mainly to restrict the pool to sounds that fit well for most characters
// So the basic jist of the sound design here: We make use primarily of shorter instrument samples for barks. We would've went with animalese instead, but doing so would've involved quite a bit of overhead to saycode.
@@ -29,26 +30,31 @@
name = "Muted String (Low)"
id = "mutedc2"
soundpath = 'sound/instruments/synthesis_samples/guitar/crisis_muted/C2.ogg'
allow_random = TRUE
/datum/bark/mutedc3
name = "Muted String (Medium)"
id = "mutedc3"
soundpath = 'sound/instruments/synthesis_samples/guitar/crisis_muted/C3.ogg'
allow_random = TRUE
/datum/bark/mutedc4
name = "Muted String (High)"
id = "mutedc4"
soundpath = 'sound/instruments/synthesis_samples/guitar/crisis_muted/C4.ogg'
allow_random = TRUE
/datum/bark/banjoc3
name = "Banjo (Medium)"
id = "banjoc3"
soundpath = 'sound/instruments/banjo/Cn3.ogg'
allow_random = TRUE
/datum/bark/banjoc4
name = "Banjo (High)"
id = "banjoc4"
soundpath = 'sound/instruments/banjo/Cn4.ogg'
allow_random = TRUE
/datum/bark/squeaky
name = "Squeaky"
+4
View File
@@ -50,6 +50,10 @@
H.dna.features["flavor_text"] = "" //Oh no.
H.dna.features["body_model"] = H.gender
H.set_bark(pick(GLOB.bark_random_list))
H.vocal_pitch = ((H.gender == MALE ? rand(60, 120) : (H.gender == FEMALE ? rand(80, 140) : rand(60,140))) / 100)
H.vocal_pitch_range = rand(10, 40) / 100
SEND_SIGNAL(H, COMSIG_HUMAN_ON_RANDOMIZE)
H.update_body(TRUE)
+3 -3
View File
@@ -1030,11 +1030,11 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
scars_list["4"] = sanitize_text(scars_list["4"])
scars_list["5"] = sanitize_text(scars_list["5"])
bark_id = sanitize_inlist(bark_id, GLOB.bark_list, initial(bark_id))
bark_id = sanitize_inlist(bark_id, GLOB.bark_list, pick(GLOB.bark_random_list))
var/datum/bark/bark_path = GLOB.bark_list[bark_id]
bark_speed = sanitize_num_clamp(bark_speed, initial(bark_path.minspeed), initial(bark_path.maxspeed), initial(bark_speed))
bark_pitch = sanitize_num_clamp(bark_pitch, initial(bark_path.minpitch), initial(bark_path.maxpitch), initial(bark_pitch))
bark_variance = sanitize_num_clamp(bark_variance, initial(bark_path.minvariance), initial(bark_path.maxvariance), initial(bark_variance))
bark_pitch = sanitize_num_clamp(bark_pitch, initial(bark_path.minpitch), initial(bark_path.maxpitch), ((gender == MALE ? rand(60, 120) : (gender == FEMALE ? rand(80, 140) : rand(60,140))) / 100))
bark_variance = sanitize_num_clamp(bark_variance, initial(bark_path.minvariance), initial(bark_path.maxvariance), (rand(10, 40) / 100))
joblessrole = sanitize_integer(joblessrole, 1, 3, initial(joblessrole))
//Validate job prefs
@@ -24,6 +24,9 @@
var/rando_race = pick(GLOB.roundstart_races)
pref_species = new rando_race()
features = random_features(pref_species?.id, gender)
bark_id = pick(GLOB.bark_random_list)
bark_pitch = ((gender == MALE ? rand(60, 120) : (gender == FEMALE ? rand(80, 140) : rand(60,140))) / 100)
bark_variance = rand(10, 40) / 100
age = rand(AGE_MIN,AGE_MAX)
/datum/preferences/proc/update_preview_icon(current_tab)