232 lines
6.7 KiB
Plaintext
232 lines
6.7 KiB
Plaintext
/obj/item/bodypart/head
|
|
name = BODY_ZONE_HEAD
|
|
desc = "Didn't make sense not to live for fun, your brain gets smart but your head gets dumb."
|
|
icon = 'icons/mob/human_parts.dmi'
|
|
icon_state = "default_human_head"
|
|
max_damage = 200
|
|
body_zone = BODY_ZONE_HEAD
|
|
body_part = HEAD
|
|
w_class = WEIGHT_CLASS_BULKY //Quite a hefty load
|
|
slowdown = 1 //Balancing measure
|
|
throw_range = 2 //No head bowling
|
|
px_x = 0
|
|
px_y = -8
|
|
stam_damage_coeff = 1
|
|
max_stamina_damage = 0 //Setting this to 0 since this has the same exact effects as the chest when disabled
|
|
|
|
var/mob/living/brain/brainmob = null //The current occupant.
|
|
var/obj/item/organ/brain/brain = null //The brain organ
|
|
|
|
//Limb appearance info:
|
|
var/real_name = "" //Replacement name
|
|
//Hair colour and style
|
|
var/hair_color = "000"
|
|
var/hair_style = "Bald"
|
|
var/hair_alpha = 255
|
|
//Facial hair colour and style
|
|
var/facial_hair_color = "000"
|
|
var/facial_hair_style = "Shaved"
|
|
//Eye Colouring
|
|
|
|
var/obj/item/organ/eyes/eyes = null
|
|
|
|
var/lip_style = null
|
|
var/lip_color = "white"
|
|
//If the head is a special sprite
|
|
var/custom_head
|
|
|
|
wound_resistance = 10
|
|
scars_covered_by_clothes = FALSE
|
|
|
|
/obj/item/bodypart/head/can_dismember(obj/item/I)
|
|
if(owner && !((owner.stat == DEAD) || owner.InFullCritical()))
|
|
return FALSE
|
|
return ..()
|
|
|
|
/obj/item/bodypart/head/drop_organs(mob/user)
|
|
var/turf/T = get_turf(src)
|
|
if(!is_robotic_limb())
|
|
playsound(T, 'sound/misc/splort.ogg', 50, 1, -1)
|
|
for(var/obj/item/I in src)
|
|
if(I == brain)
|
|
if(user)
|
|
user.visible_message("<span class='warning'>[user] saws [src] open and pulls out a brain!</span>", "<span class='notice'>You saw [src] open and pull out a brain.</span>")
|
|
if(brainmob)
|
|
brainmob.container = null
|
|
brainmob.forceMove(brain)
|
|
brain.brainmob = brainmob
|
|
brainmob = null
|
|
brain.forceMove(T)
|
|
brain = null
|
|
update_icon_dropped()
|
|
else
|
|
if(istype(I, /obj/item/reagent_containers/pill))
|
|
for(var/datum/action/item_action/hands_free/activate_pill/AP in I.actions)
|
|
qdel(AP)
|
|
I.forceMove(T)
|
|
|
|
/obj/item/bodypart/head/update_limb(dropping_limb, mob/living/carbon/source)
|
|
var/mob/living/carbon/C
|
|
if(source)
|
|
C = source
|
|
else
|
|
C = owner
|
|
|
|
real_name = C.real_name
|
|
if(HAS_TRAIT(C, TRAIT_HUSK))
|
|
real_name = "Unknown"
|
|
hair_style = "Bald"
|
|
facial_hair_style = "Shaved"
|
|
lip_style = null
|
|
|
|
else if(!animal_origin)
|
|
var/mob/living/carbon/human/H = C
|
|
var/datum/species/S = H.dna.species
|
|
|
|
//Facial hair
|
|
if(H.facial_hair_style && (FACEHAIR in S.species_traits))
|
|
facial_hair_style = H.facial_hair_style
|
|
if(S.hair_color)
|
|
if(S.hair_color == "mutcolor")
|
|
facial_hair_color = H.dna.features["mcolor"]
|
|
else
|
|
facial_hair_color = S.hair_color
|
|
else
|
|
facial_hair_color = H.facial_hair_color
|
|
hair_alpha = S.hair_alpha
|
|
else
|
|
facial_hair_style = "Shaved"
|
|
facial_hair_color = "000"
|
|
hair_alpha = 255
|
|
//Hair
|
|
if(H.hair_style && (HAIR in S.species_traits))
|
|
hair_style = H.hair_style
|
|
if(S.hair_color)
|
|
if(S.hair_color == "mutcolor")
|
|
hair_color = H.dna.features["mcolor"]
|
|
else
|
|
hair_color = S.hair_color
|
|
else
|
|
hair_color = H.hair_color
|
|
hair_alpha = S.hair_alpha
|
|
else
|
|
hair_style = "Bald"
|
|
hair_color = "000"
|
|
hair_alpha = initial(hair_alpha)
|
|
// lipstick
|
|
if(H.lip_style && (LIPS in S.species_traits))
|
|
lip_style = H.lip_style
|
|
lip_color = H.lip_color
|
|
else
|
|
lip_style = null
|
|
lip_color = "white"
|
|
..()
|
|
|
|
/obj/item/bodypart/head/update_icon_dropped()
|
|
if(custom_head)
|
|
return
|
|
var/list/standing = get_limb_icon(1)
|
|
if(!standing.len)
|
|
icon_state = initial(icon_state)//no overlays found, we default back to initial icon.
|
|
return
|
|
for(var/image/I in standing)
|
|
I.pixel_x = px_x
|
|
I.pixel_y = px_y
|
|
add_overlay(standing)
|
|
|
|
/obj/item/bodypart/head/get_limb_icon(dropped)
|
|
if(custom_head)
|
|
return
|
|
cut_overlays()
|
|
. = ..()
|
|
if(dropped) //certain overlays only appear when the limb is being detached from its owner.
|
|
|
|
if(!is_robotic_limb(FALSE)) //having a robotic head hides certain features.
|
|
//facial hair
|
|
if(facial_hair_style)
|
|
var/datum/sprite_accessory/S = GLOB.facial_hair_styles_list[facial_hair_style]
|
|
if(S)
|
|
var/image/facial_overlay = image(S.icon, "[S.icon_state]", -HAIR_LAYER, SOUTH)
|
|
facial_overlay.color = "#" + facial_hair_color
|
|
facial_overlay.alpha = hair_alpha
|
|
. += facial_overlay
|
|
|
|
//Applies the debrained overlay if there is no brain
|
|
if(!brain)
|
|
var/image/debrain_overlay = image(layer = -HAIR_LAYER, dir = SOUTH)
|
|
if(animal_origin == ALIEN_BODYPART)
|
|
debrain_overlay.icon = 'icons/mob/animal_parts.dmi'
|
|
debrain_overlay.icon_state = "debrained_alien"
|
|
else if(animal_origin == LARVA_BODYPART)
|
|
debrain_overlay.icon = 'icons/mob/animal_parts.dmi'
|
|
debrain_overlay.icon_state = "debrained_larva"
|
|
else if(!(NOBLOOD in species_flags_list))
|
|
debrain_overlay.icon = 'icons/mob/human_parts.dmi'
|
|
debrain_overlay.icon_state = "debrained"
|
|
. += debrain_overlay
|
|
else
|
|
var/datum/sprite_accessory/S2 = GLOB.hair_styles_list[hair_style]
|
|
if(S2)
|
|
var/image/hair_overlay = image(S2.icon, "[S2.icon_state]", -HAIR_LAYER, SOUTH)
|
|
hair_overlay.color = "#" + hair_color
|
|
hair_overlay.alpha = hair_alpha
|
|
. += hair_overlay
|
|
|
|
|
|
// lipstick
|
|
if(lip_style)
|
|
var/image/lips_overlay = image('icons/mob/lips.dmi', "lips_[lip_style]", -BODY_LAYER, SOUTH)
|
|
lips_overlay.color = lip_color
|
|
. += lips_overlay
|
|
|
|
// eyes
|
|
if(eyes)
|
|
var/left_state = DEFAULT_LEFT_EYE_STATE
|
|
var/right_state = DEFAULT_RIGHT_EYE_STATE
|
|
if(owner && owner.dna.species)
|
|
var/eye_type = owner.dna.species.eye_type
|
|
if(GLOB.eye_types[eye_type])
|
|
left_state = eye_type + "_left_eye"
|
|
right_state = eye_type + "_right_eye"
|
|
if(left_state != DEFAULT_NO_EYE_STATE)
|
|
var/image/left_eye = image('icons/mob/hair.dmi', left_state, -BODY_LAYER, SOUTH)
|
|
if(eyes.left_eye_color)
|
|
left_eye.color = "#" + eyes.left_eye_color
|
|
. += left_eye
|
|
if(right_state != DEFAULT_NO_EYE_STATE)
|
|
var/image/right_eye = image('icons/mob/hair.dmi', right_state, -BODY_LAYER, SOUTH)
|
|
if(eyes.right_eye_color)
|
|
right_eye.color = "#" + eyes.right_eye_color
|
|
. += right_eye
|
|
else
|
|
var/eyes_overlay = image('icons/mob/hair.dmi', "eyes_missing", -BODY_LAYER, SOUTH)
|
|
. += eyes_overlay
|
|
|
|
/obj/item/bodypart/head/monkey
|
|
icon = 'icons/mob/animal_parts.dmi'
|
|
icon_state = "default_monkey_head"
|
|
animal_origin = MONKEY_BODYPART
|
|
|
|
/obj/item/bodypart/head/alien
|
|
icon = 'icons/mob/animal_parts.dmi'
|
|
icon_state = "alien_head"
|
|
px_x = 0
|
|
px_y = 0
|
|
dismemberable = 0
|
|
max_damage = 500
|
|
animal_origin = ALIEN_BODYPART
|
|
|
|
/obj/item/bodypart/head/devil
|
|
dismemberable = 0
|
|
max_damage = 5000
|
|
animal_origin = DEVIL_BODYPART
|
|
|
|
/obj/item/bodypart/head/larva
|
|
icon = 'icons/mob/animal_parts.dmi'
|
|
icon_state = "larva_head"
|
|
px_x = 0
|
|
px_y = 0
|
|
dismemberable = 0
|
|
max_damage = 50
|
|
animal_origin = LARVA_BODYPART
|