cosmetic parts addition

This commit is contained in:
sarcoph
2022-05-11 21:47:00 -08:00
parent 6a26cd5b85
commit bf112ac42f
14 changed files with 139 additions and 26 deletions
@@ -0,0 +1,29 @@
/*
COSMETIC PARTS
this system allows you to change the _base_ appearance of a limb independent
of species or markings. this, for example, allows us to create "hybrids" like a
mammal with avian legs.
keep in mind that this does not change the species of a leg! in the above example,
the mammal's bird-legs are still mammal legs. this matters in some places, like
body part transplants; mis-matched species will cause extra damage if the surgery
fails and the part is rejected. so you can't attach mammal-bird legs to avians
safely.
*/
/datum/cosmetic_part
var/name
var/icon = 'hyperstation/icons/mob/char_parts.dmi'
var/icon_state
var/support_digitigrade = TRUE
/datum/cosmetic_part/head
/datum/cosmetic_part/chest
/datum/cosmetic_part/arms
/datum/cosmetic_part/legs
/datum/cosmetic_part/legs/avian
name = "avian"
icon = 'modular_citadel/icons/mob/mutant_bodyparts.dmi'
icon_state = "avian"
@@ -0,0 +1,18 @@
/obj/item/bodypart/proc/apply_cosmetic(datum/cosmetic_part/part)
if(!is_organic_limb() || animal_origin || !part)
return
cosmetic_icon = part.icon_state
icon = part.icon
/mob/living/carbon/human/proc/handle_cosmetic_parts()
var/features = src.dna.features
var/list/body_zones = list(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)
for(var/I in body_zones)
var/zone = body_zones[I]
var/cosmetic_pref = features["cosmetic_" + zone]
if(!istype(cosmetic_pref, /datum/cosmetic_part))
continue
var/datum/cosmetic_part/part = cosmetic_pref
var/obj/item/bodypart/body_part = get_bodypart(zone)
if(body_part && part)
body_part.apply_cosmetic(part)