mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-18 21:15:21 +00:00
## About The Pull Request Due to a mental breakdown caused by unfathomable abomination that is icons folder, I swore to myself to one day clean it. Today is kind of that day. Been at it for around 6, you gotta understand I need a rest. I tracked most changes in descriptions of commits if you are looking for details. ## Why It's Good For The Game Saner spriters make better sprites. And also, just helps keep track of things. ## Changelog 🆑 image: added sprites for different variants of scrolls. image: modified couple posters with ghost pixels. /🆑 --------- Co-authored-by: OrionTheFox <76465278+OrionTheFox@users.noreply.github.com>
51 lines
1.8 KiB
Plaintext
51 lines
1.8 KiB
Plaintext
/obj/item/dyespray
|
|
name = "hair dye spray"
|
|
desc = "A spray to dye your hair any gradients you'd like."
|
|
w_class = WEIGHT_CLASS_TINY
|
|
icon = 'icons/obj/cosmetic.dmi'
|
|
icon_state = "dyespray"
|
|
|
|
/obj/item/dyespray/attack_self(mob/user)
|
|
dye(user, user)
|
|
|
|
/obj/item/dyespray/pre_attack(atom/target, mob/living/user, params)
|
|
dye(target, user)
|
|
return ..()
|
|
|
|
/**
|
|
* Applies a gradient and a gradient color to a mob.
|
|
*
|
|
* Arguments:
|
|
* * target - The mob who we will apply the gradient and gradient color to.
|
|
*/
|
|
|
|
/obj/item/dyespray/proc/dye(mob/target, mob/user)
|
|
if(!ishuman(target))
|
|
return
|
|
var/mob/living/carbon/human/human_target = target
|
|
var/beard_or_hair = tgui_alert(user, "What do you want to dye?", "Character Preference", list("Hair", "Facial Hair"))
|
|
if(!beard_or_hair || !user.can_perform_action(src, NEED_DEXTERITY))
|
|
return
|
|
|
|
var/list/choices = beard_or_hair == "Hair" ? GLOB.hair_gradients_list : GLOB.facial_hair_gradients_list
|
|
var/new_grad_style = tgui_input_list(user, "Choose a color pattern", "Character Preference", choices)
|
|
if(isnull(new_grad_style))
|
|
return
|
|
if(!user.can_perform_action(src, NEED_DEXTERITY))
|
|
return
|
|
|
|
var/new_grad_color = input(user, "Choose a secondary hair color:", "Character Preference",human_target.grad_color) as color|null
|
|
if(!new_grad_color || !user.can_perform_action(src, NEED_DEXTERITY) || !user.CanReach(target))
|
|
return
|
|
|
|
to_chat(user, span_notice("You start applying the hair dye..."))
|
|
if(!do_after(user, 3 SECONDS, target))
|
|
return
|
|
if(beard_or_hair == "Hair")
|
|
human_target.set_hair_gradient_style(new_grad_style, update = FALSE)
|
|
human_target.set_hair_gradient_color(new_grad_color, update = TRUE)
|
|
else
|
|
human_target.set_facial_hair_gradient_style(new_grad_style, update = FALSE)
|
|
human_target.set_facial_hair_gradient_color(new_grad_color, update = TRUE)
|
|
playsound(src, 'sound/effects/spray.ogg', 10, vary = TRUE)
|