Skip to content

Commit

Permalink
refixes dummie mannequinnneds
Browse files Browse the repository at this point in the history
  • Loading branch information
Superlagg committed Jul 7, 2023
1 parent e97e908 commit bfa63cf
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 47 deletions.
22 changes: 20 additions & 2 deletions code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1672,5 +1672,23 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
return LAZYACCESS(first_last, 1)
return rname



/// Makes a gaussian distribution, returning a positive integer
/proc/GaussianReacharound(mean, stddev, min, max)
var/cool_input = gaussian(mean, stddev)
cool_input = abs(cool_input)
cool_input = round(cool_input)
cool_input = clamp(cool_input, min, max)
return cool_input

/proc/GaussianListPicker(list/input, mean, stddev)
if(!LAZYLEN(input))
return
var/index = GaussianReacharound(mean, stddev, 0, LAZYLEN(input))
var/output = LAZYACCESS(input, index)
if(!output)
output = pick(input) // shruggaroni
return output

/proc/GaussianRangePicker(min, max, mean, stddev)
var/index = GaussianReacharound(mean, stddev, min, max)
return index
43 changes: 27 additions & 16 deletions code/controllers/subsystem/dummies.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ SUBSYSTEM_DEF(dummy) // who ya callin dummy, dummy?
var/list/naked_player_cache = list()
/// Pictures of everyone at various moments, clothed~
/// list("ckey" = list(image, image, image))
var/list/very_naked_player_cache = list()
/// Pictures of everyone at various moments, clothed~
/// list("ckey" = list(image, image, image))
var/list/clothed_player_cache = list()
/// Pictures of everyone at various moments, clothed~
/// list("ckey" = list(image, image, image))
Expand Down Expand Up @@ -73,7 +76,8 @@ SUBSYSTEM_DEF(dummy) // who ya callin dummy, dummy?
random_clothes,
copy_equipment,
genitals,
cache = TRUE
cache = TRUE,
underwear = TRUE,
)
var/image_key = generate_key(slotkey, spec, clothes, template, client_or_prefs, loadout, random_body, random_species, random_clothes, copy_equipment, genitals, cache)
if(LAZYACCESS(image_cache, image_key))
Expand All @@ -88,34 +92,39 @@ SUBSYSTEM_DEF(dummy) // who ya callin dummy, dummy?
else if (istype(client_or_prefs, /datum/preferences))
var/datum/preferences/P = client_or_prefs
clint = P.parent
else if(istype(template) && template.client)
clint = template.client
if(!template && ishuman(clint.mob))
template = clint.mob

if(istype(clint))
var/datum/preferences/P = clint.prefs
P?.copy_to(mannequin)
if(istype(template))
copy_human_mob(template, mannequin)
if(copy_equipment)
copy_equipped(template, mannequin)
else if(istype(clint))
var/datum/preferences/P = clint.prefs
P.copy_to(mannequin)
if(copy_equipment && ishuman(clint.mob))
copy_equipped(clint.mob, mannequin)
else
if(random_species && !ispath(spec))
spec = pick(list(/datum/species/human, /datum/species/lizard, /datum/species/mammal))
if(ispath(spec))
mannequin.set_species(spec)
if(random_body)
randomize_human(mannequin, spec, random_clothes, genitals)
if(copy_equipment && (istype(template) || istype(clint)))
copy_equipped(template, mannequin)
else
if(random_clothes && !ispath(clothes))
randomize_human(mannequin, spec, underwear, genitals)
if(random_clothes)
if(!ispath(clothes))
clothes = pick(subtypesof(/datum/outfit/job))
if(ispath(clothes))
else
random_clothes = FALSE
clothes = new clothes()
clothes.equip(mannequin, TRUE, clint)
if(!genitals)
for(var/obj/item/organ/genital/nad in mannequin.internal_organs)
qdel(nad) // say bye to ur naddies
if(!underwear)
mannequin.underwear = "Nude"
mannequin.socks = "Nude"
mannequin.undershirt = "Nude"

mannequin.update_body(TRUE)
mannequin.update_hair()
Expand Down Expand Up @@ -262,10 +271,7 @@ SUBSYSTEM_DEF(dummy) // who ya callin dummy, dummy?
return LAZYACCESS(image_cache, slutkey)
return get_dummy_image("PLAYER", template = H, client_or_prefs = clont, copy_equipment = equipped)

/datum/controller/subsystem/dummy/proc/capture_snapshot_of_players(obey_cooldown)
if(obey_cooldown && !COOLDOWN_FINISHED(src, snapshot_cooldown))
return
COOLDOWN_START(src, snapshot_cooldown, 5 MINUTES)
/datum/controller/subsystem/dummy/proc/capture_snapshot_of_players()
for(var/client/C in GLOB.clients)
snapshot_player(C)

Expand All @@ -282,17 +288,22 @@ SUBSYSTEM_DEF(dummy) // who ya callin dummy, dummy?
H = C.mob
if(!ishuman(H))
return
if(!LAZYACCESS(very_naked_player_cache, "[C.ckey]%%[H.real_name]"))
very_naked_player_cache["[C.ckey]%%[H.real_name]"] = list()
if(!LAZYACCESS(naked_player_cache, "[C.ckey]%%[H.real_name]"))
naked_player_cache["[C.ckey]%%[H.real_name]"] = list()
if(!LAZYACCESS(clothed_player_cache, "[C.ckey]%%[H.real_name]"))
clothed_player_cache["[C.ckey]%%[H.real_name]"] = list()
if(!LAZYACCESS(randomclothed_player_cache, "[C.ckey]%%[H.real_name]"))
randomclothed_player_cache["[C.ckey]%%[H.real_name]"] = list()
var/image/naked = get_dummy_image("PLAYER", template = H, client_or_prefs = C, random_body = FALSE, random_species = FALSE, random_clothes = FALSE)
var/image/supernaked = get_dummy_image("PLAYER", template = H, client_or_prefs = C, random_body = FALSE, random_species = FALSE, random_clothes = FALSE, underwear = FALSE, genitals = TRUE)
var/image/clothed = get_dummy_image("PLAYER", template = H, client_or_prefs = C, random_body = FALSE, random_species = FALSE, random_clothes = FALSE, copy_equipment = TRUE)
var/image/clothed2 = get_dummy_image("PLAYER", template = H, client_or_prefs = C, random_body = FALSE, random_species = FALSE, random_clothes = TRUE)
if(naked)
naked_player_cache["[C.ckey]%%[H.real_name]"] |= naked
if(supernaked)
very_naked_player_cache["[C.ckey]%%[H.real_name]"] |= supernaked
if(clothed)
clothed_player_cache["[C.ckey]%%[H.real_name]"] |= clothed
if(clothed2)
Expand Down
14 changes: 10 additions & 4 deletions code/game/objects/items/mannequin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
var/my_ckey
var/my_name
var/nude = TRUE
var/very_nude = FALSE
var/random_clothes = FALSE

/obj/item/ckey_mannequin/clothed
Expand All @@ -171,6 +172,9 @@
/obj/item/ckey_mannequin/clothed/random
random_clothes = TRUE

/obj/item/ckey_mannequin/very_nude
very_nude = TRUE

/obj/item/ckey_mannequin/attack_hand(mob/user, act_intent, attackchain_flags)
if(!attune_to(user))
return ..()
Expand All @@ -187,13 +191,13 @@
visible_message("[user] touches [src], and it transforms!")
my_ckey = user.ckey
my_name = user.real_name
SSdummy.snapshot_player(my_ckey)
START_PROCESSING(SSobj, src)
update_icon()
return TRUE

/obj/item/ckey_mannequin/process()
update_icon()
if(prob(1))
if(prob(5))
switch(rand(1,5))
if(1)
step_rand(src)
Expand All @@ -205,6 +209,7 @@
TOGGLE_VAR(nude)
if(5)
TOGGLE_VAR(random_clothes)
update_icon()

/obj/item/ckey_mannequin/update_overlays()
. = ..()
Expand All @@ -215,10 +220,11 @@
name = initial(name)
desc = initial(desc)
return
SSdummy.snapshot_player(my_ckey)
var/list/imglist
var/list/cool_list
if(nude)
if(very_nude)
cool_list = SSdummy.very_naked_player_cache
else if(nude)
cool_list = SSdummy.naked_player_cache
else if(random_clothes)
cool_list = SSdummy.randomclothed_player_cache
Expand Down
50 changes: 27 additions & 23 deletions code/modules/admin/create_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,26 @@

user << browse(create_panel_helper(create_mob_html), "window=create_mob;size=425x475")

/proc/randomize_human(mob/living/carbon/human/H, species, undies = TRUE, genitals = TRUE)
/mob/living/carbon/human/proc/randomize(species, undies, genitals)
return randomize_human(src, species, undies, genitals)

/proc/randomize_human(mob/living/carbon/human/H, species, undies = TRUE, genitals)
if(!ishuman(H))
return
H.gender = pick(MALE, FEMALE)
H.real_name = random_unique_name(H.gender)
H.name = H.real_name
if(undies)
H.underwear = random_underwear(H.gender)
H.undershirt = random_undershirt(H.gender)
H.socks = random_socks(H.gender)
else
H.underwear = "Nude"
H.undershirt = "Nude"
H.socks = "Nude"
H.undie_color = random_short_color()
H.shirt_color = random_short_color()
H.socks_color = random_short_color()
H.dna.skin_tone_override = null
H.skin_tone = random_skin_tone()
H.hair_style = random_hair_style(H.gender)
Expand Down Expand Up @@ -122,36 +130,32 @@
var/static/belly_size_max
if(!belly_size_max)
belly_size_max = CONFIG_GET(number/belly_max_size_prefs)
var/inner_genital_color
var/outer_genital_color
if(species_type == "human")
inner_genital_color = H.dna.features["mcolor"]
outer_genital_color = H.dna.features["mcolor"]
else
inner_genital_color = H.dna.features["mcolor2"]
outer_genital_color = H.dna.features["mcolor"]
if(prob(50))
H.dna.features["has_butt"] = TRUE
H.dna.features["butt_color"] = outer_genital_color
H.dna.features["butt_size"] = WeightedCascadingPickerRange(butt_size_min, butt_size_max, 2, TRUE)
if(prob(50))
H.dna.features["has_belly"] = TRUE
H.dna.features["belly_color"] = inner_genital_color
H.dna.features["belly_size"] = WeightedCascadingPickerRange(belly_size_min, belly_size_max, 3, TRUE)
H.dna.features["belly_shape"] = pick(GLOB.belly_shapes_list)
if(H.gender == FEMALE || prob(5))
H.dna.features["butt_color"] = H.dna.features["mcolor"]
H.dna.features["butt_size"] = GaussianRangePicker(butt_size_min, butt_size_max, 4, 3)
if(prob(80))
H.dna.features["has_belly"] = TRUE
H.dna.features["belly_color"] = H.dna.features["mcolor"]
H.dna.features["belly_size"] = GaussianRangePicker(belly_size_min, belly_size_max, 4, 3)
H.dna.features["belly_shape"] = pick(GLOB.belly_shapes_list)
if(H.gender == FEMALE || H.gender == NEUTER || H.gender == PLURAL || prob(10))
H.dna.features["has_vag"] = TRUE // they only get the normal vag cus the rest are scary D:
H.dna.features["vag_color"] = inner_genital_color
H.dna.features["vag_color"] = H.dna.features["mcolor"]

H.dna.features["has_womb"] = TRUE

H.dna.features["has_breasts"] = TRUE
H.dna.features["breasts_color"] = inner_genital_color
H.dna.features["breasts_size"] = WeightedCascadingPicker(boob_cup_sizes, 1.5, TRUE)
if(H.gender == MALE || prob(5))
H.dna.features["breasts_color"] = H.dna.features["mcolor"]
H.dna.features["breasts_size"] = GaussianListPicker(boob_cup_sizes, 5, 2) // The wasteland has a buxomness epidemic
if(H.gender == MALE || H.gender == NEUTER || H.gender == PLURAL || prob(10))
H.dna.features["has_balls"] = TRUE
H.dna.features["balls_color"] = inner_genital_color
H.dna.features["balls_color"] = H.dna.features["mcolor"]

H.dna.features["has_cock"] = TRUE
H.dna.features["cock_size"] = WeightedCascadingPickerRange(penis_inches_min, penis_inches_max, 3, TRUE)
H.dna.features["cock_size"] = GaussianRangePicker(penis_inches_min, penis_inches_max, 7, 3) // fuck it, everyone's got a HUUUUUGE COCK =3
H.dna.features["cock_shape"] = pick(GLOB.cock_shapes_list)
H.give_genitals(TRUE)
SEND_SIGNAL(H, COMSIG_HUMAN_ON_RANDOMIZE)

H.update_body(TRUE)
Expand Down
6 changes: 4 additions & 2 deletions code/modules/awaymissions/corpse.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
var/important_info = ""
var/faction = null
var/permanent = FALSE //If true, the spawner will not disappear upon running out of uses.
var/random = FALSE //Don't set a name or gender, just go random
var/random = TRUE //Don't set a name or gender, just go random
var/antagonist_type
var/objectives = null
var/uses = 1 //how many times can we spawn from it. set to -1 for infinite.
Expand Down Expand Up @@ -96,6 +96,8 @@
if(!mob_gender)
mob_gender = pick(MALE, FEMALE)
M.gender = mob_gender
else
randomize_human(M, null, prob(50), TRUE)
if(faction)
M.faction = list(faction)
if(disease)
Expand Down Expand Up @@ -336,7 +338,7 @@
name = "Cook"
outfit = /datum/outfit/job/wasteland/f13wastelander
random
/obj/effect/mob_spawn/human/doctor
name = "Doctor"
outfit = /datum/outfit/job/doctor
Expand Down

0 comments on commit bfa63cf

Please sign in to comment.