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

85 lines
4.2 KiB
Plaintext

/obj/item/clothing/head
name = BODY_ZONE_HEAD
icon = 'icons/obj/clothing/head/default.dmi'
worn_icon = 'icons/mob/clothing/head/default.dmi'
lefthand_file = 'icons/mob/inhands/clothing/hats_lefthand.dmi'
righthand_file = 'icons/mob/inhands/clothing/hats_righthand.dmi'
abstract_type = /obj/item/clothing/head
body_parts_covered = HEAD
slot_flags = ITEM_SLOT_HEAD
///Special throw_impact for hats to frisbee hats at people to place them on their heads/attempt to de-hat them.
/obj/item/clothing/head/throw_impact(atom/hit_atom, datum/thrownthing/thrownthing)
. = ..()
///if the thrown object's target zone isn't the head
if(thrownthing.target_zone != BODY_ZONE_HEAD)
return
///ignore any hats with the tinfoil counter-measure enabled
if(clothing_flags & ANTI_TINFOIL_MANEUVER)
return
///if the hat happens to be capable of holding contents and has something in it. mostly to prevent super cheesy stuff like stuffing a mini-bomb in a hat and throwing it
if(LAZYLEN(contents))
return
if(iscarbon(hit_atom))
var/mob/living/carbon/H = hit_atom
var/obj/item/WH = H.get_item_by_slot(ITEM_SLOT_HEAD)
if(istype(WH))
///check if the item has NODROP
if(HAS_TRAIT(WH, TRAIT_NODROP))
H.visible_message(span_warning("[src] bounces off [H]'s [WH.name]!"), span_warning("[src] bounces off your [WH.name], falling to the floor."))
return
///check if the item is an actual clothing head item, since some non-clothing items can be worn
if(istype(WH, /obj/item/clothing/head))
var/obj/item/clothing/head/WHH = WH
///SNUG_FIT hats are immune to being knocked off
if(WHH.clothing_flags & SNUG_FIT)
H.visible_message(span_warning("[src] bounces off [H]'s [WHH.name]!"), span_warning("[src] bounces off your [WHH.name], falling to the floor."))
return
///if the hat manages to knock something off
if(H.dropItemToGround(WH))
H.visible_message(span_warning("[src] knocks [WH] off [H]'s head!"), span_warning("[WH] is suddenly knocked off your head by [src]!"))
if(H.equip_to_slot_if_possible(src, ITEM_SLOT_HEAD, 0, 1, 1))
H.visible_message(span_notice("[src] lands neatly on [H]'s head!"), span_notice("[src] lands perfectly onto your head!"))
H.update_held_items() //force update hands to prevent ghost sprites appearing when throw mode is on
return
if(iscyborg(hit_atom))
var/mob/living/silicon/robot/R = hit_atom
var/obj/item/worn_hat = R.hat
if(worn_hat && HAS_TRAIT(worn_hat, TRAIT_NODROP))
R.visible_message(span_warning("[src] bounces off [worn_hat], without an effect!"), span_warning("[src] bounces off your mighty [worn_hat.name], falling to the floor in defeat."))
return
if(is_type_in_typecache(src, GLOB.blacklisted_borg_hats))//hats in the borg's blacklist bounce off
R.visible_message(span_warning("[src] bounces off [R]!"), span_warning("[src] bounces off you, falling to the floor."))
return
else
R.visible_message(span_notice("[src] lands neatly on top of [R]!"), span_notice("[src] lands perfectly on top of you."))
R.place_on_head(src) //hats aren't designed to snugly fit borg heads or w/e so they'll always manage to knock eachother off
/obj/item/clothing/head/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', "damagedhelmet") //ORIGINAL
var/mob/living/carbon/human/wearer = loc
if(ishuman(wearer) && icon_exists('modular_zubbers/icons/effects/item_damage_species.dmi', "damagedhelmet_[wearer.dna.species.id]"))
. += mutable_appearance('modular_zubbers/icons/effects/item_damage_species.dmi', "damagedhelmet_[wearer.dna.species.id]")
else
. += mutable_appearance('icons/effects/item_damage.dmi', "damagedhelmet")
//BUBBER EDIT END
/obj/item/clothing/head/separate_worn_overlays(mutable_appearance/standing, mutable_appearance/draw_target, isinhands, icon_file, bodyshape = NONE)
. = ..()
if (isinhands)
return
var/blood_overlay = get_blood_overlay("helmet", bodyshape)
if (blood_overlay)
. += blood_overlay
/obj/item/clothing/head/update_clothes_damaged_state(damaged_state = CLOTHING_DAMAGED)
..()
if(ismob(loc))
var/mob/M = loc
M.update_worn_head()