-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3724 from MistakeNot4892/feature/grooming
Reworks combs and brushes.
- Loading branch information
Showing
41 changed files
with
362 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
|
||
/obj/item/grooming | ||
abstract_type = /obj/item/grooming | ||
icon_state = ICON_STATE_WORLD | ||
w_class = ITEM_SIZE_TINY | ||
slot_flags = SLOT_EARS | ||
material_alteration = MAT_FLAG_ALTERATION_COLOR | MAT_FLAG_ALTERATION_NAME | MAT_FLAG_ALTERATION_DESC | ||
|
||
var/message_target_other_generic = "$USER$ grooms $TARGET$ with $TOOL$." | ||
var/message_target_self_generic = "$USER$ grooms $USER_SELF$ with $TOOL$." | ||
var/message_target_other = "$USER$ grooms $TARGET$'s $DESCRIPTOR$ with $TOOL$." | ||
var/message_target_self = "$USER$ grooms $USER_HIS$ $DESCRIPTOR$ with $TOOL$." | ||
var/message_target_other_partial = "$USER$ just sort of runs $TOOL$ over $TARGET$'s $DESCRIPTOR$." | ||
var/message_target_self_partial = "$USER$ just sort of runs $TOOL$ over $USER_HIS$ $DESCRIPTOR$." | ||
var/message_target_other_missing = "$TARGET$'s $LIMB$ has nothing to groom!" | ||
var/message_target_self_missing = "Your $LIMB$ has nothing to groom!" | ||
var/grooming_flags = GROOMABLE_NONE | ||
|
||
/obj/item/grooming/Initialize() | ||
. = ..() | ||
update_icon() | ||
|
||
/obj/item/grooming/proc/replace_message_tokens(message, mob/living/user, mob/living/target, obj/item/tool, limb, descriptor) | ||
var/decl/pronouns/user_pronouns = user.get_pronouns() | ||
var/decl/pronouns/target_pronouns = target.get_pronouns() | ||
. = message | ||
. = replacetext(., "$USER$", "\the [user]") | ||
. = replacetext(., "$USER_HIS$", user_pronouns.his) | ||
. = replacetext(., "$USER_HIM$", user_pronouns.him) | ||
. = replacetext(., "$USER_SELF$", user_pronouns.self) | ||
. = replacetext(., "$TARGET$", "\the [target]") | ||
. = replacetext(., "$TARGET_HIS$", target_pronouns.his) | ||
. = replacetext(., "$TARGET_HIM$", target_pronouns.him) | ||
. = replacetext(., "$TARGET_SELF$", target_pronouns.self) | ||
. = replacetext(., "$TOOL$", "\the [tool]") | ||
. = replacetext(., "$DESCRIPTOR$", descriptor) | ||
. = replacetext(., "$LIMB$", limb) | ||
. = capitalize(.) | ||
|
||
/obj/item/grooming/proc/try_groom(mob/living/user, mob/living/target) | ||
|
||
if(!istype(user) || !istype(target) || user.incapacitated() || user.a_intent == I_HURT) | ||
return FALSE | ||
|
||
if(!length(target.get_external_organs())) | ||
return target.handle_general_grooming(user, src) | ||
|
||
var/zone = user.get_target_zone() | ||
if(!zone) | ||
return FALSE | ||
|
||
var/target_self = user == target | ||
var/obj/item/organ/external/affecting = GET_EXTERNAL_ORGAN(target, zone) | ||
if(!affecting) | ||
to_chat(user, SPAN_WARNING("[target_self ? "You are" : "\The [target] [target.get_pronouns().is]"] missing [target_self ? "your" : target.get_pronouns().his] [parse_zone(zone)].")) | ||
return TRUE | ||
|
||
var/obj/item/blocking = target.bodypart_is_covered(zone) | ||
if(blocking) | ||
to_chat(user, "\The [blocking] [blocking.get_pronouns().is] in the way!") | ||
return TRUE | ||
|
||
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) | ||
|
||
// return type is assoc list ie. list("success" = GROOMING_RESULT_PARTIAL, "descriptor" = "hair") | ||
var/list/grooming_results = affecting.get_grooming_results(src) | ||
var/show_message | ||
switch(LAZYACCESS(grooming_results, "success")) | ||
if(GROOMING_RESULT_PARTIAL) | ||
show_message = target_self ? message_target_self_partial : message_target_other_partial | ||
if(GROOMING_RESULT_SUCCESS) | ||
show_message = target_self ? message_target_self : message_target_other | ||
else | ||
show_message = target_self ? message_target_self_missing : message_target_other_missing | ||
visible_message(SPAN_NOTICE(replace_message_tokens(show_message, user, target, src, parse_zone(zone), LAZYACCESS(grooming_results, "descriptor") || "marking"))) | ||
target.add_stressor(/datum/stressor/well_groomed, 5 MINUTES) | ||
return TRUE | ||
|
||
/obj/item/grooming/attack_self(mob/user) | ||
if(try_groom(user, user)) | ||
return TRUE | ||
return ..() | ||
|
||
/obj/item/grooming/attack(mob/living/M, mob/living/user, var/target_zone, animate = TRUE) | ||
if(try_groom(user, M)) | ||
return TRUE | ||
return ..() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/obj/item/grooming/comb | ||
name = "comb" | ||
desc = "A pristine comb." | ||
icon = 'icons/obj/items/grooming/comb.dmi' | ||
material = /decl/material/solid/organic/plastic | ||
|
||
message_target_other_generic = "$USER$ tidily combs $TARGET$ with $TOOL$." | ||
message_target_self_generic = "$USER$ tidily combs $USER_SELF$ with $TOOL$." | ||
message_target_other = "$USER$ tidily combs $TARGET$'s $DESCRIPTOR$ with $TOOL$." | ||
message_target_self = "$USER$ tidily combs $USER_HIS$ $DESCRIPTOR$ with $TOOL$." | ||
grooming_flags = GROOMABLE_COMB | ||
|
||
/obj/item/grooming/comb/colorable | ||
material_alteration = MAT_FLAG_ALTERATION_NAME | MAT_FLAG_ALTERATION_DESC | ||
|
||
/obj/item/grooming/comb/colorable/random/Initialize() | ||
color = get_random_colour(lower = 150) | ||
. = ..() | ||
|
||
// Looks exactly like a butterfly knife inhand. | ||
/obj/item/grooming/comb/butterfly | ||
name = "butterfly comb" | ||
desc = "A very stylish comb that folds into a handle." | ||
icon = 'icons/obj/items/grooming/comb_butterfly.dmi' | ||
material = /decl/material/solid/metal/steel | ||
|
||
message_target_other_generic = "$USER$ uses $TOOL$ to comb $TARGET$ with incredible style and sophistication." | ||
message_target_self_generic = "$USER$ uses $TOOL$ to comb $USER_SELF$ with incredible style and sophistication. What a $USER_GUY$." | ||
message_target_other = "$USER$ uses $TOOL$ to comb $TARGET$'s hair with incredible style and sophistication." | ||
message_target_self = "$USER$ uses $TOOL$ to comb $USER_HIS$ hair with incredible style and sophistication. What a $USER_GUY$." | ||
|
||
var/opened = FALSE | ||
|
||
/obj/item/grooming/comb/butterfly/attack_self(mob/user) | ||
if(user.a_intent == I_HURT) | ||
return ..() | ||
opened = !opened | ||
if(opened) | ||
playsound(user, 'sound/weapons/flipblade.ogg', 15, 1) | ||
user.visible_message(SPAN_NOTICE("\The [user] flicks \the [src] [opened ? "open" : "closed"].")) | ||
update_icon() | ||
return TRUE | ||
|
||
/obj/item/grooming/comb/butterfly/try_groom(mob/living/user, mob/living/target) | ||
return opened && ..() | ||
|
||
/obj/item/grooming/comb/butterfly/on_update_icon() | ||
. = ..() | ||
icon_state = get_world_inventory_state() | ||
if(opened) | ||
icon_state = "[icon_state]_open" | ||
|
||
/obj/item/grooming/comb/butterfly/replace_message_tokens(message, mob/living/user, mob/living/target, obj/item/tool, limb, descriptor) | ||
message = replacetext(message, "$USER_GUY$", user.get_pronouns().informal_term) | ||
return ..() | ||
|
||
/obj/item/grooming/comb/butterfly/colorable | ||
material_alteration = MAT_FLAG_ALTERATION_NAME | MAT_FLAG_ALTERATION_DESC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/obj/item/grooming/file | ||
name = "nail file" | ||
desc = "A rugged file suitable for smoothing down unruly nails or horns." | ||
icon = 'icons/obj/items/grooming/file.dmi' | ||
material = /decl/material/solid/metal/steel | ||
|
||
message_target_other_generic = "$USER$ uses $TOOL$ to neaten $TARGET$ up." | ||
message_target_self_generic = "$USER$ uses $TOOL$ to neaten $USER_SELF$ up." | ||
message_target_other = "$USER$ carefully files down $TARGET$'s $DESCRIPTOR$ with $TOOL$." | ||
message_target_self = "$USER$ carefully files down $USER_HIS$ $DESCRIPTOR$ with $TOOL$." | ||
grooming_flags = GROOMABLE_FILE | ||
|
||
/obj/item/grooming/file/colorable | ||
material_alteration = MAT_FLAG_ALTERATION_NAME | MAT_FLAG_ALTERATION_DESC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/obj/item/grooming/brush | ||
name = "hairbrush" | ||
desc = "A surprisingly decent hairbrush with a sturdy handle and semi-soft bristles." | ||
icon = 'icons/obj/items/grooming/hairbrush.dmi' | ||
w_class = ITEM_SIZE_SMALL | ||
slot_flags = null | ||
material = /decl/material/solid/organic/plastic | ||
|
||
message_target_other_generic = "$USER$ meticulously brushes $TARGET$ with $TOOL$." | ||
message_target_self_generic = "$USER$ meticulously brushes $USER_SELF$ with $TOOL$." | ||
message_target_other = "$USER$ meticulously brushes $TARGET$'s $DESCRIPTOR$ with $TOOL$." | ||
message_target_self = "$USER$ meticulously brushes $USER_HIS$ $DESCRIPTOR$ with $TOOL$." | ||
grooming_flags = GROOMABLE_BRUSH | ||
|
||
/obj/item/grooming/brush/on_update_icon() | ||
..() | ||
var/image/I = image(icon, "[icon_state]-bristles") | ||
I.color = COLOR_GRAY40 | ||
I.appearance_flags |= RESET_COLOR | ||
add_overlay(I) | ||
|
||
/obj/item/grooming/brush/colorable | ||
material_alteration = MAT_FLAG_ALTERATION_NAME | ||
|
||
/obj/item/grooming/brush/colorable/random/Initialize() | ||
color = get_random_colour(lower = 150) | ||
. = ..() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.