Migrate scissors to the new attack chain. (#32279)

* Migrate scissors to the new attack chain.

* Add fingerprint.

* Apply suggestions from CRUNCH review

Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>
Signed-off-by: Alan <alfalfascout@users.noreply.github.com>

---------

Signed-off-by: Alan <alfalfascout@users.noreply.github.com>
Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>
This commit is contained in:
Alan
2026-08-01 06:11:08 +00:00
committed by GitHub
co-authored by CRUNCH
parent fab78d2957
commit 2d22c7faec
+44 -29
View File
@@ -8,6 +8,7 @@
w_class = WEIGHT_CLASS_SMALL
hitsound = 'sound/weapons/bladeslice.ogg'
attack_verb = list("slices", "cuts", "stabs", "jabs")
new_attack_chain = TRUE
/obj/item/scissors/barber
name = "Barber's Scissors"
@@ -16,34 +17,48 @@
attack_verb = list("beautifully sliced", "artistically cut", "smoothly stabbed", "quickly jabbed")
toolspeed = 0.75
/obj/item/scissors/attack__legacy__attackchain(mob/living/carbon/M as mob, mob/user as mob)
/obj/item/scissors/interact_with_atom(mob/living/carbon/human/target, mob/living/user, list/modifiers)
if(user.a_intent != INTENT_HELP)
..()
return
if(!(M in view(1))) //Adjacency test
..()
return
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/head/C = H.get_organ("head")
if(!C)
to_chat(user, SPAN_WARNING("[M] doesn't have a head!"))
return
//facial hair
var/f_new_style = tgui_input_list(user, "Select a facial hair style", "Grooming", H.generate_valid_facial_hairstyles())
//handle normal hair
var/h_new_style = tgui_input_list(user, "Select a hair style", "Grooming", H.generate_valid_hairstyles())
user.visible_message(SPAN_NOTICE("[user] starts cutting [M]'s hair!"), SPAN_NOTICE("You start cutting [M]'s hair!")) //arguments for this are: 1. what others see 2. what the user sees. --Fixed grammar, (TGameCo)
playsound(loc, 'sound/goonstation/misc/scissor.ogg', 100, 1)
if(do_after(user, 50 * toolspeed, target = H)) //this is the part that adds a delay. delay is in deciseconds. --Made it 5 seconds, because hair isn't cut in one second in real life, and I want at least a little bit longer time, (TGameCo)
if(!(M in view(1))) //Adjacency test
user.visible_message(SPAN_NOTICE("[user] stops cutting [M]'s hair."), SPAN_NOTICE("You stop cutting [M]'s hair."))
return
if(f_new_style)
C.f_style = f_new_style
if(h_new_style)
C.h_style = h_new_style
return ..()
H.update_hair()
H.update_fhair()
user.visible_message(SPAN_NOTICE("[user] finishes cutting [M]'s hair!"))
if(!ishuman(target))
return ..()
var/obj/item/organ/external/head/head_organ = target.get_organ("head")
if(!head_organ)
to_chat(user, SPAN_WARNING("[target] doesn't have a head!"))
return ITEM_INTERACT_COMPLETE
// Facial hair.
var/f_new_style = tgui_input_list(user, "Select a facial hair style", "Grooming", target.generate_valid_facial_hairstyles())
// Hair atop head.
var/h_new_style = tgui_input_list(user, "Select a hair style", "Grooming", target.generate_valid_hairstyles())
user.visible_message(
SPAN_NOTICE("[user] starts cutting [target]'s hair!"),
SPAN_NOTICE("You start cutting [target]'s hair!"),
SPAN_HEAR("You hear the snip snip of scissors.")
)
playsound(loc, 'sound/goonstation/misc/scissor.ogg', 100, 1)
add_fingerprint(user)
if(!do_after(user, 5 SECONDS * toolspeed, target = target))
user.visible_message(
SPAN_NOTICE("[user] stops cutting [target]'s hair."),
SPAN_NOTICE("You stop cutting [target]'s hair."),
SPAN_HEAR("The snipping stops.")
)
return ITEM_INTERACT_COMPLETE
if(f_new_style)
head_organ.f_style = f_new_style
if(h_new_style)
head_organ.h_style = h_new_style
target.update_hair()
target.update_fhair()
user.visible_message(
SPAN_NOTICE("[user] finishes cutting [target]'s hair!"),
SPAN_NOTICE("You finish cutting [target]'s hair."),
SPAN_HEAR("The snipping stops.")
)
return ITEM_INTERACT_COMPLETE