Files
Bubberstation/code/modules/admin/create_mob.dm
mcbalaam bf1c46a173 Adds a TGUI spawn panel for badmining time (#90943)
## About The Pull Request

### Adds this TGUI spawn panel with a lot of stuff


![image](https://github.com/user-attachments/assets/f2ce34e9-3bd3-488e-bc48-cb5930b865ba)

### Adds two useful admining hotkeys

`Ctrl + Shift + LMB` on an atom opens the View Variables window

`Ctrl + LMB` on a mob opens the Player Panel window

This PR is an upgrade/continuation/upstreaming of the following PR by
@Ez-Briz: https://github.com/ss220club/BandaStation/pull/1242

## Why It's Good For The Game

### Icon and object previews!


https://github.com/user-attachments/assets/894c4383-0455-4ba8-9cc1-7fb0d8dff6c7

### Introducing Fuzzy Search!


![image](https://github.com/user-attachments/assets/e5d6e3d7-8328-49c1-991b-7eee75895e10)

### Easier datum marking and recalling!


https://github.com/user-attachments/assets/4934ecca-18aa-45ce-83af-1fe90263b534

### Targeted spawn and quick targeted droppods (Build Mode Lite™️) (RMB
to disengage)!


https://github.com/user-attachments/assets/38eb6e08-74bf-471c-8bd5-61e1b219086b

### Weaponize your tiders with a hover of a mouse!


https://github.com/user-attachments/assets/9840d0ed-d20d-4d48-91e0-2dc1eaf17e36

The options are persistent between opens and even rounds, using local
`storage`, which means you won't have to readjust your panel every time
you close it!

...and it doesn't end there.

## WIP things:

- [x] implement fuzzy search (requires
https://github.com/tgstation/tgui-core/pull/166 to be merged);
- [x] add a modal window to adjust description, icon file/state/size and
badmin flags;
- [x] clean the code up;

## Changelog

🆑 mcbalaam, Ez-Briz
admin: Added a new TGUI spawn panel, removing it's ancestors - HTML
"Create X" panels
/🆑
2025-09-24 01:05:27 +02:00

50 lines
2.6 KiB
Plaintext

/**
* Fully randomizes everything about a human, including DNA and name.
*/
/proc/randomize_human(mob/living/carbon/human/human, randomize_mutations = FALSE)
human.gender = human.dna.species.sexes ? pick(MALE, FEMALE, PLURAL, NEUTER) : PLURAL
human.physique = human.gender
human.real_name = human.generate_random_mob_name()
human.name = human.get_visible_name()
human.set_hairstyle(random_hairstyle(human.gender), update = FALSE)
human.set_facial_hairstyle(random_facial_hairstyle(human.gender), update = FALSE)
human.set_haircolor("#[random_color()]", update = FALSE)
human.set_facial_haircolor(human.hair_color, update = FALSE)
human.set_eye_color(random_eye_color())
human.skin_tone = pick(GLOB.skin_tones)
human.dna.species.randomize_active_underwear_only(human)
// Needs to be called towards the end to update all the UIs just set above
human.dna.initialize_dna(newblood_type = random_human_blood_type(), create_mutation_blocks = randomize_mutations, randomize_features = TRUE)
// Snowflake for Ethereals
human.updatehealth()
human.updateappearance(mutcolor_update = TRUE)
/**
* Randomizes a human, but produces someone who looks exceedingly average (by most standards).
*
* (IE, no wacky hair styles / colors)
*/
/proc/randomize_human_normie(mob/living/carbon/human/human, randomize_mutations = FALSE, update_body = TRUE)
// Sorry enbys but statistically you are not average enough
human.gender = human.dna.species.sexes ? pick(MALE, FEMALE) : PLURAL
human.physique = human.gender
human.real_name = human.generate_random_mob_name()
human.name = human.get_visible_name()
human.set_eye_color(random_eye_color())
human.skin_tone = pick(GLOB.skin_tones)
// No underwear generation handled here
var/picked_color = random_hair_color()
human.set_haircolor(picked_color, update = FALSE)
human.set_facial_haircolor(picked_color, update = FALSE)
var/datum/sprite_accessory/hairstyle = SSaccessories.hairstyles_list[random_hairstyle(human.gender)]
if(hairstyle && hairstyle.natural_spawn && !hairstyle.locked)
human.set_hairstyle(hairstyle.name, update = FALSE)
var/datum/sprite_accessory/facial_hair = SSaccessories.facial_hairstyles_list[random_facial_hairstyle(human.gender)]
if(facial_hair && facial_hair.natural_spawn && !facial_hair.locked)
human.set_facial_hairstyle(facial_hair.name, update = FALSE)
// Normal DNA init stuff, these can generally be wacky but we care less, they're aliens after all
human.dna.initialize_dna(newblood_type = random_human_blood_type(), create_mutation_blocks = randomize_mutations, randomize_features = TRUE)
human.updatehealth()
if(update_body)
human.updateappearance(mutcolor_update = TRUE)