[MANUAL MIRROR] SPECIES NUKING 2023: Head flags 2: Electric Boogaloo (#76298) [MDB IGNORE] (#22506)

SPECIES NUKING 2023: Head flags 2: Electric Boogaloo (#76298)

Continues the work I started on
https://github.com/tgstation/tgstation/pull/76074
Fixes https://github.com/tgstation/tgstation/issues/73782

Implements a bunch of wrapper procs for hair style, facial hair style,
etc etc the whole nine yards.
Fixes many issues, especially with gradients because I did sloppy tired
code that didn't work there.
Makes head/get_limb_icon() not a disgusting mess (well, at least makes
it less of a disgusting mess).

Actually makes hair and lips depend entirely on the bodypart.

🆑
refactor: Head rendering code has been updated significantly... Again.
Please report any issues with hair, facial hair, lipstick and such.
/🆑

Co-authored-by: ChungusGamer666 <82850673+ChungusGamer666@users.noreply.github.com>
This commit is contained in:
GoldenAlpharex
2023-07-16 18:16:12 -04:00
committed by GitHub
co-authored by ChungusGamer666
parent 6ab09f4f28
commit db83be17da
49 changed files with 553 additions and 463 deletions
+4 -8
View File
@@ -154,11 +154,9 @@
/obj/item/razor/proc/shave(mob/living/carbon/human/skinhead, location = BODY_ZONE_PRECISE_MOUTH)
if(location == BODY_ZONE_PRECISE_MOUTH)
skinhead.facial_hairstyle = "Shaved"
skinhead.set_facial_hairstyle("Shaved", update = TRUE)
else
skinhead.hairstyle = "Skinhead"
skinhead.update_body_parts()
skinhead.set_hairstyle("Skinhead", update = TRUE)
playsound(loc, 'sound/items/welder2.ogg', 20, TRUE)
/obj/item/razor/attack(mob/target_mob, mob/living/user, params)
@@ -194,8 +192,7 @@
user.visible_message(span_notice("[user] tries to change [human_target]'s facial hairstyle using [src]."), span_notice("You try to change [human_target]'s facial hairstyle using [src]."))
if(new_style && do_after(user, 6 SECONDS, target = human_target))
user.visible_message(span_notice("[user] successfully changes [human_target]'s facial hairstyle using [src]."), span_notice("You successfully change [human_target]'s facial hairstyle using [src]."))
human_target.facial_hairstyle = new_style
human_target.update_body_parts(update_limb_data = TRUE)
human_target.set_facial_hairstyle(new_style, update = TRUE)
return
else
return
@@ -248,8 +245,7 @@
user.visible_message(span_notice("[user] tries to change [human_target]'s hairstyle using [src]."), span_notice("You try to change [human_target]'s hairstyle using [src]."))
if(new_style && do_after(user, 6 SECONDS, target = human_target))
user.visible_message(span_notice("[user] successfully changes [human_target]'s hairstyle using [src]."), span_notice("You successfully change [human_target]'s hairstyle using [src]."))
human_target.hairstyle = new_style
human_target.update_body_parts(update_limb_data = TRUE)
human_target.set_hairstyle(new_style, update = TRUE)
return
else
if(!get_location_accessible(human_target, location))
+5 -7
View File
@@ -47,11 +47,9 @@
to_chat(user, span_notice("You start applying the hair dye..."))
if(!do_after(user, 3 SECONDS, target))
return
var/gradient_key = beard_or_hair == "Hair" ? GRADIENT_HAIR_KEY : GRADIENT_FACIAL_HAIR_KEY
LAZYSETLEN(human_target.grad_style, GRADIENTS_LEN)
LAZYSETLEN(human_target.grad_color, GRADIENTS_LEN)
human_target.grad_style[gradient_key] = new_grad_style
human_target.grad_color[gradient_key] = sanitize_hexcolor(new_grad_color)
playsound(src, 'sound/effects/spray.ogg', 5, TRUE, 5)
human_target.update_body_parts()
if(beard_or_hair == "Hair")
human_target.set_hair_gradient(new_grad_style, new_grad_color, update = TRUE)
else
human_target.set_facial_hair_gradient(new_grad_style, new_grad_color, update = TRUE)
playsound(src, 'sound/effects/spray.ogg', 10, vary = TRUE)
*/
+10 -11
View File
@@ -41,9 +41,10 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/mirror/broken, 28)
return TRUE //no tele-grooming
if(HAS_TRAIT(hairdresser, TRAIT_SHAVED))
to_chat(hairdresser, span_notice("If only growing back facial hair were that easy for you..."))
hairdresser.facial_hairstyle = new_style
return TRUE
hairdresser.set_facial_hairstyle(new_style, update = TRUE)
else
hairdresser.facial_hairstyle = "Shaved"
hairdresser.set_facial_hairstyle("Shaved", update = TRUE)
//handle normal hair
var/new_style = tgui_input_list(user, "Select a hairstyle", "Grooming", GLOB.hairstyles_list)
@@ -53,10 +54,9 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/mirror/broken, 28)
return TRUE //no tele-grooming
if(HAS_TRAIT(hairdresser, TRAIT_BALD))
to_chat(hairdresser, span_notice("If only growing back hair were that easy for you..."))
return TRUE
hairdresser.hairstyle = new_style
hairdresser.update_body_parts()
hairdresser.set_hairstyle(new_style, update = TRUE)
*/
/obj/structure/mirror/examine_status(mob/user)
@@ -235,9 +235,9 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/mirror/broken, 28)
amazed_human.update_mutations_overlay() // no hulk lizard
if("gender")
if(!(amazed_human.gender in list("male", "female"))) //blame the patriarchy
if(!(amazed_human.gender in list(MALE, FEMALE))) //blame the patriarchy
return TRUE
if(amazed_human.gender == "male")
if(amazed_human.gender == MALE)
if(tgui_alert(amazed_human, "Become a Witch?", "Confirmation", list("Yes", "No")) == "Yes")
if(!user.can_perform_action(src, FORBID_TELEKINESIS_REACH))
return TRUE
@@ -246,7 +246,6 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/mirror/broken, 28)
to_chat(amazed_human, span_notice("Man, you feel like a woman!"))
else
return TRUE
else
if(tgui_alert(amazed_human, "Become a Warlock?", "Confirmation", list("Yes", "No")) == "Yes")
if(!user.can_perform_action(src, FORBID_TELEKINESIS_REACH))
@@ -271,12 +270,12 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/mirror/broken, 28)
if(!user.can_perform_action(src, FORBID_TELEKINESIS_REACH))
return TRUE
if(new_hair_color)
amazed_human.hair_color = sanitize_hexcolor(new_hair_color)
amazed_human.set_haircolor(sanitize_hexcolor(new_hair_color), update = FALSE)
amazed_human.dna.update_ui_block(DNA_HAIR_COLOR_BLOCK)
if(amazed_human.gender == "male")
if(amazed_human.gender == MALE)
var/new_face_color = input(amazed_human, "Choose your facial hair color", "Hair Color", amazed_human.facial_hair_color) as color|null
if(new_face_color)
amazed_human.facial_hair_color = sanitize_hexcolor(new_face_color)
amazed_human.set_facial_haircolor(sanitize_hexcolor(new_face_color), update = FALSE)
amazed_human.dna.update_ui_block(DNA_FACIAL_HAIR_COLOR_BLOCK)
amazed_human.update_body_parts()
amazed_human.update_mutant_bodyparts(force_update = TRUE) /// SKYRAT EDIT - Mirrors are no longer scared of colored ears