clothing
Vars | |
clothing_flags | Flags for clothing |
---|---|
clothing_traits | Trait modification, lazylist of traits to add/take away, on equipment/drop in the correct slot |
damage_by_parts | How much clothing damage has been dealt to each of the limbs of the clothing, assuming it covers more than one limb |
fallback_colors | Needs to follow this syntax: either a list() with the x and y coordinates of the pixel you want to get the colour from, or a hexcolour. Colour one replaces red, two replaces blue, and three replaces green in the icon state. |
fallback_icon_state | Needs to be a RGB-greyscale format icon state in all species' fallback icon files. |
fiber_name | An alternative name to be used for fibers, forensics stuffs |
flash_protect | What level of bright light protection item has. |
limb_integrity | How much integrity is in a specific limb before that limb is disabled (for use in /obj/item/clothing/proc/take_damage_zone, and only if we cover multiple zones.) Set to 0 to disable shredding. |
moth_snack | A lazily initiated "food" version of the clothing for moths |
repairable_by | What items can be consumed to repair this clothing (must by an /obj/item/stack) |
zones_disabled | How many zones (body parts, not precise) we have disabled so far, for naming purposes |
Procs | |
armor_to_protection_class | Rounds armor_value down to the nearest 10, divides it by 10 and then converts it to Roman numerals. |
attach_clothing_traits | Inserts a trait (or multiple traits) into the clothing traits list |
bristle | If we're a clothing with at least 1 shredded/disabled zone, give the wearer a periodic heads up letting them know their clothes are damaged |
detach_clothing_traits | Removes a trait (or multiple traits) from the clothing traits list |
disable_zone | disable_zone() is used to disable a given bodypart's protection on our clothing item, mainly from /obj/item/clothing/proc/take_damage_zone |
generate_fallback_clothing | Generates a 'fallback' sprite from fallback_colors and fallback_icon_state , then adds it to GLOB.fallback_clothing_icons . |
repair | Set the clothing's integrity back to 100%, remove all damage to bodyparts, and generally fix it up |
take_damage_zone | take_damage_zone() is used for dealing damage to specific bodyparts on a worn piece of clothing, meant to be called from [/obj/item/bodypart/proc/check_woundings_mods] |
wear_fallback_version | Returns a mutable_appearance of this clothing's fallback sprite. |
Var Details
clothing_flags
Flags for clothing
clothing_traits
Trait modification, lazylist of traits to add/take away, on equipment/drop in the correct slot
damage_by_parts
How much clothing damage has been dealt to each of the limbs of the clothing, assuming it covers more than one limb
fallback_colors
Needs to follow this syntax: either a list()
with the x and y coordinates of the pixel you want to get the colour from, or a hexcolour. Colour one replaces red, two replaces blue, and three replaces green in the icon state.
fallback_icon_state
Needs to be a RGB-greyscale format icon state in all species' fallback icon files.
fiber_name
An alternative name to be used for fibers, forensics stuffs
flash_protect
What level of bright light protection item has.
limb_integrity
How much integrity is in a specific limb before that limb is disabled (for use in /obj/item/clothing/proc/take_damage_zone, and only if we cover multiple zones.) Set to 0 to disable shredding.
moth_snack
A lazily initiated "food" version of the clothing for moths
repairable_by
What items can be consumed to repair this clothing (must by an /obj/item/stack)
zones_disabled
How many zones (body parts, not precise) we have disabled so far, for naming purposes
Proc Details
armor_to_protection_class
Rounds armor_value down to the nearest 10, divides it by 10 and then converts it to Roman numerals.
Arguments:
- armor_value - Number we're converting
attach_clothing_traits
Inserts a trait (or multiple traits) into the clothing traits list
If worn, then we will also give the wearer the trait as if equipped
This is so you can add clothing traits without worrying about needing to equip or unequip them to gain effects
bristle
If we're a clothing with at least 1 shredded/disabled zone, give the wearer a periodic heads up letting them know their clothes are damaged
detach_clothing_traits
Removes a trait (or multiple traits) from the clothing traits list
If worn, then we will also remove the trait from the wearer as if unequipped
This is so you can add clothing traits without worrying about needing to equip or unequip them to gain effects
disable_zone
disable_zone() is used to disable a given bodypart's protection on our clothing item, mainly from /obj/item/clothing/proc/take_damage_zone
This proc disables all protection on the specified bodypart for this piece of clothing: it'll be as if it doesn't cover it at all anymore (because it won't!) If every possible bodypart has been disabled on the clothing, we put it out of commission entirely and mark it as shredded, whereby it will have to be repaired in order to equip it again. Also note we only consider it damaged if there's more than one bodypart disabled.
Arguments:
- def_zone: The bodypart zone we're disabling
- damage_type: Only really relevant for the verb for describing the breaking, and maybe atom_destruction()
generate_fallback_clothing
Generates a 'fallback' sprite from fallback_colors
and fallback_icon_state
, then adds it to GLOB.fallback_clothing_icons
.
The fallback sprite is created by getting each colour specified in [fallback_colors], then mapping each of them to the red, green, and blue sections of the sprite specified by [fallback_icon_state].
Arguments:
- file2use - The normal
icon
for this item. - state2use - The normal
icon_state
for this item. - species_file - The /datum/species/var/fallback_clothing_path of the species trying to wear this item.
- list_key - The key that this icon will be saved under in the global list. (Either ["path/to/file.dmi-jumpsuit"], or ["#ffe14d-jumpsuit"] if GAGS is used)
repair
Set the clothing's integrity back to 100%, remove all damage to bodyparts, and generally fix it up
take_damage_zone
take_damage_zone() is used for dealing damage to specific bodyparts on a worn piece of clothing, meant to be called from [/obj/item/bodypart/proc/check_woundings_mods]
This proc only matters when a bodypart that this clothing is covering is harmed by a direct attack (being on fire or in space need not apply), and only if this clothing covers more than one bodypart to begin with. No point in tracking damage by zone for a hat, and I'm not cruel enough to let you fully break them in a few shots. Also if limb_integrity is 0, then this clothing doesn't have bodypart damage enabled so skip it.
Arguments:
- def_zone: The bodypart zone in question
- damage_amount: Incoming damage
- damage_type: BRUTE or BURN
- armor_penetration: If the attack had armor_penetration
wear_fallback_version
Returns a mutable_appearance of this clothing's fallback sprite.
If a sprite for this item hasn't already been generated, a new one is made in [generate_fallback_clothing], and added to GLOB.fallback_clothing_icons
.
Arguments:
- file2use - The normal
icon
for this item. - state2use - The normal
icon_state
for this item. - layer - The layer that the final sprite should be rendered on.
- species_file - The /datum/species/var/fallback_clothing_path of the species trying to wear this item.