Files
1467508036 Teshari Specific Limb Damage States and Bloody Clothing (#6038)
## About The Pull Request
Teshari have long had to deal with ill-fitting overlays applied to them.
I have chosen to bite the bullet and do the labour by creating species
specific states for:
- bloody clothes
- damaged clothes
- body wounds
- bleeding animations

How it works is simple: if our icon override exists for our species, we
use it. If it doesn't exist, we default back to the original. What this
means is that future species overrides can be added without code
changes.

## Why It's Good For The Game
<img width="91" height="85" alt="image"
src="https://github.com/user-attachments/assets/30f1c91a-27aa-441e-9026-8d441855e7b9"
/>

This sucks! They look like they're wearing clown shoes for crying out
loud!


<img width="88" height="91" alt="image"
src="https://github.com/user-attachments/assets/0aa2febd-728b-4108-b64d-56173958cf27"
/>

This doesn't suck!

</details>

## Changelog

🆑 Robwo
fix: Teshari can now get properly bloody and bruised.
/🆑

---------

Co-authored-by: Alexis <catmc8565@gmail.com>
Co-authored-by: Waterpig <49160555+Maia-J@users.noreply.github.com>
2026-08-15 18:12:22 +02:00

98 lines
3.8 KiB
Plaintext

/obj/item/clothing/gloves
name = "gloves"
gender = PLURAL //Carn: for grammarically correct text-parsing
w_class = WEIGHT_CLASS_SMALL
icon = 'icons/obj/clothing/gloves.dmi'
inhand_icon_state = "greyscale_gloves"
lefthand_file = 'icons/mob/inhands/clothing/gloves_lefthand.dmi'
righthand_file = 'icons/mob/inhands/clothing/gloves_righthand.dmi'
abstract_type = /obj/item/clothing/gloves
greyscale_colors = null
greyscale_config_inhand_left = /datum/greyscale_config/gloves_inhand_left
greyscale_config_inhand_right = /datum/greyscale_config/gloves_inhand_right
siemens_coefficient = 0.5
body_parts_covered = HANDS
slot_flags = ITEM_SLOT_GLOVES
drop_sound = 'sound/items/handling/glove_drop.ogg'
pickup_sound = 'sound/items/handling/glove_pick_up.ogg'
attack_verb_continuous = list("challenges")
attack_verb_simple = list("challenge")
strip_delay = 2 SECONDS
equip_delay_other = 4 SECONDS
article = "a pair of"
// Path variable. If defined, will produced the type through interaction with wirecutters.
var/cut_type = null
/// Used for handling bloody gloves leaving behind bloodstains on objects. Will be decremented whenever a bloodstain is left behind, and be incremented when the gloves become bloody.
var/transfer_blood = 0
/obj/item/clothing/gloves/apply_fantasy_bonuses(bonus)
. = ..()
siemens_coefficient = modify_fantasy_variable("siemens_coefficient", siemens_coefficient, -bonus / 10)
/obj/item/clothing/gloves/remove_fantasy_bonuses(bonus)
siemens_coefficient = reset_fantasy_variable("siemens_coefficient", siemens_coefficient)
return ..()
/obj/item/clothing/gloves/wash(clean_types)
. = ..()
if((clean_types & CLEAN_TYPE_BLOOD) && transfer_blood > 0)
transfer_blood = 0
. |= COMPONENT_CLEANED|COMPONENT_CLEANED_GAIN_XP
/obj/item/clothing/gloves/suicide_act(mob/living/user)
user.visible_message(span_suicide("\the [src] are forcing [user]'s hands around [user.p_their()] neck! It looks like the gloves are possessed!"))
return OXYLOSS
/obj/item/clothing/gloves/worn_overlays(mutable_appearance/standing, isinhands = FALSE, icon_file, bodyshape = NONE)
. = ..()
if(isinhands)
return
if(damaged_clothes)
//BUBBER EDIT BEGIN - Species specific damage states.
//. += mutable_appearance('icons/effects/item_damage.dmi', "damagedgloves") //ORIGINAL
var/mob/living/carbon/human/wearer = loc
if(ishuman(wearer) && icon_exists('modular_zubbers/icons/effects/item_damage_species.dmi', "damagedgloves_[wearer.dna.species.id]"))
. += mutable_appearance('modular_zubbers/icons/effects/item_damage_species.dmi', "damagedgloves_[wearer.dna.species.id]")
else
. += mutable_appearance('icons/effects/item_damage.dmi', "damagedgloves")
//BUBBER EDIT END
/obj/item/clothing/gloves/separate_worn_overlays(mutable_appearance/standing, mutable_appearance/draw_target, isinhands, icon_file, bodyshape = NONE)
. = ..()
if (isinhands)
return
var/blood_overlay = get_blood_overlay("glove", bodyshape)
if (blood_overlay)
. += blood_overlay
/obj/item/clothing/gloves/update_clothes_damaged_state(damaged_state = CLOTHING_DAMAGED)
..()
if(ismob(loc))
var/mob/M = loc
M.update_worn_gloves()
/obj/item/clothing/gloves/proc/can_cut_with(obj/item/tool)
if(!cut_type)
return FALSE
if(icon_state != initial(icon_state))
return FALSE // We don't want to cut dyed gloves.
return TRUE
/obj/item/clothing/gloves/attackby(obj/item/tool, mob/user, list/modifiers, list/attack_modifiers)
. = ..()
if(.)
return
if(tool.tool_behaviour != TOOL_WIRECUTTER && !tool.get_sharpness())
return
if (!can_cut_with(tool))
return
balloon_alert(user, "cutting off fingertips...")
if(!do_after(user, 3 SECONDS, target=src, extra_checks = CALLBACK(src, PROC_REF(can_cut_with), tool)))
return
balloon_alert(user, "cut fingertips off")
qdel(src)
user.put_in_hands(new cut_type)
return TRUE