This commit is contained in:
Timothy Teakettle
2022-08-05 15:44:40 +01:00
parent 7ed2ee82bf
commit 818e564c92
9 changed files with 125 additions and 75 deletions
@@ -345,7 +345,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
var/obj/item/organ/stomach/stomach = C.getorganslot(ORGAN_SLOT_STOMACH)
var/obj/item/organ/tail/tail = C.getorganslot(ORGAN_SLOT_TAIL)
var/should_have_brain = TRUE
var/should_have_brain = !(HAS_TRAIT(C, TRAIT_DULLAHAN))
var/should_have_heart = !(NOBLOOD in species_traits)
var/should_have_lungs = ((TRAIT_AUXILIARY_LUNGS in inherent_traits) || !(TRAIT_NOBREATH in inherent_traits))
var/should_have_appendix = !(TRAIT_NOHUNGER in inherent_traits)
@@ -803,7 +803,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
H.apply_overlay(HAIR_LAYER)
/datum/species/proc/handle_body(mob/living/carbon/human/H)
/datum/species/proc/handle_body(mob/living/carbon/human/H, block_recursive_calls = FALSE)
H.remove_overlay(BODY_LAYER)
var/list/standing = list()
@@ -825,10 +825,9 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
// eyes
if(!(NOEYES in species_traits))
var/has_eyes = H.getorganslot(ORGAN_SLOT_EYES)
if(!has_eyes && !H.GetComponent(/datum/component/dullahan))
var/has_eyes = H.getorganslot(ORGAN_SLOT_EYES) || HAS_TRAIT(H, TRAIT_DULLAHAN) // if they are a dullahan just assume eyes exist
if(!has_eyes)
standing += mutable_appearance('icons/mob/eyes.dmi', "eyes_missing", -BODY_LAYER)
message_admins("EYES MISSING APPLIED 2")
else
var/left_state = DEFAULT_LEFT_EYE_STATE
var/right_state = DEFAULT_RIGHT_EYE_STATE
@@ -899,9 +898,9 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
H.overlays_standing[BODY_LAYER] = standing
H.apply_overlay(BODY_LAYER)
handle_mutant_bodyparts(H)
handle_mutant_bodyparts(H, null, block_recursive_calls)
/datum/species/proc/handle_mutant_bodyparts(mob/living/carbon/human/H, forced_colour)
/datum/species/proc/handle_mutant_bodyparts(mob/living/carbon/human/H, forced_colour, block_recursive_calls = FALSE)
var/list/bodyparts_to_add = mutant_bodyparts.Copy()
H.remove_overlay(BODY_BEHIND_LAYER)
@@ -1216,6 +1215,11 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
H.apply_overlay(BODY_FRONT_LAYER)
H.apply_overlay(HORNS_LAYER)
if(!block_recursive_calls)
var/datum/component/dullahan/D = H.GetComponent(/datum/component/dullahan)
if(D && D.dullahan_head)
D.dullahan_head.update_appearance()
/*
* Equip the outfit required for life. Replaces items currently worn.
*/
@@ -82,38 +82,9 @@
decoy_override = TRUE
organ_flags = ORGAN_NO_SPOIL//Do not decay
/obj/item/organ/tongue/dullahan
zone = "abstract"
accents = list(/datum/accent/dullahan)
/obj/item/organ/ears/dullahan
zone = "abstract"
/obj/item/organ/eyes/dullahan
name = "head vision"
desc = "An abstraction."
actions_types = list(/datum/action/item_action/organ_action/dullahan)
zone = "abstract"
tint = INFINITY // used to switch the vision perspective to the head on species_gain().
/datum/action/item_action/organ_action/dullahan
name = "Toggle Perspective"
desc = "Switch between seeing normally from your head, or blindly from your body."
/datum/action/item_action/organ_action/dullahan/Trigger()
. = ..()
var/obj/item/organ/eyes/dullahan/DE = target
if(DE.tint)
DE.tint = 0
else
DE.tint = INFINITY
if(ishuman(owner))
var/mob/living/carbon/human/H = owner
if(isdullahan(H))
var/datum/species/dullahan/D = H.dna.species
D.update_vision_perspective(H)
/obj/item/dullahan_relay
name = "dullahan relay"
var/mob/living/owner
@@ -58,14 +58,14 @@ There are several things that need to be remembered:
dna.species.handle_hair(src)
//used when putting/removing clothes that hide certain mutant body parts to just update those and not update the whole body.
/mob/living/carbon/human/proc/update_mutant_bodyparts()
/mob/living/carbon/human/proc/update_mutant_bodyparts(block_recursive_calls = FALSE)
if(!HAS_TRAIT(src, TRAIT_HUMAN_NO_RENDER))
dna.species.handle_mutant_bodyparts(src)
dna.species.handle_mutant_bodyparts(src, null, block_recursive_calls)
/mob/living/carbon/human/update_body(update_genitals = FALSE)
/mob/living/carbon/human/update_body(update_genitals = FALSE, block_recursive_calls = FALSE)
if(!HAS_TRAIT(src, TRAIT_HUMAN_NO_RENDER))
remove_overlay(BODY_LAYER)
dna.species.handle_body(src)
dna.species.handle_body(src, block_recursive_calls)
..()
if(update_genitals)
update_genitals()
@@ -75,24 +75,24 @@ There are several things that need to be remembered:
/* --------------------------------------- */
//For legacy support.
/mob/living/carbon/human/regenerate_icons()
/mob/living/carbon/human/regenerate_icons(block_recursive_calls = FALSE)
if(!HAS_TRAIT(src, TRAIT_HUMAN_NO_RENDER))
if(!..())
icon_render_key = null //invalidate bodyparts cache
update_body(TRUE)
update_body(TRUE, block_recursive_calls)
update_hair()
update_inv_w_uniform()
update_inv_w_uniform(block_recursive_calls)
update_inv_wear_id()
update_inv_gloves()
update_inv_glasses()
update_inv_ears()
update_inv_shoes()
update_inv_s_store()
update_inv_wear_mask()
update_inv_head()
update_inv_wear_mask(block_recursive_calls)
update_inv_head(block_recursive_calls)
update_inv_belt()
update_inv_back()
update_inv_wear_suit()
update_inv_wear_suit(block_recursive_calls)
update_inv_pockets()
update_inv_neck()
update_transform()
@@ -123,7 +123,7 @@ There are several things that need to be remembered:
apply_overlay(ANTAG_LAYER)
/mob/living/carbon/human/update_inv_w_uniform()
/mob/living/carbon/human/update_inv_w_uniform(block_recursive_calls = FALSE)
if(!HAS_TRAIT(src, TRAIT_HUMAN_NO_RENDER))
remove_overlay(UNIFORM_LAYER)
@@ -173,7 +173,7 @@ There are several things that need to be remembered:
overlays_standing[UNIFORM_LAYER] = uniform_overlay
apply_overlay(UNIFORM_LAYER)
update_mutant_bodyparts()
update_mutant_bodyparts(block_recursive_calls)
/mob/living/carbon/human/update_inv_wear_id()
if(!HAS_TRAIT(src, TRAIT_HUMAN_NO_RENDER))
@@ -349,7 +349,7 @@ There are several things that need to be remembered:
overlays_standing[SUIT_STORE_LAYER] = s_store_overlay
apply_overlay(SUIT_STORE_LAYER)
/mob/living/carbon/human/update_inv_head()
/mob/living/carbon/human/update_inv_head(block_recursive_calls = FALSE)
if(!HAS_TRAIT(src, TRAIT_HUMAN_NO_RENDER))
remove_overlay(HEAD_LAYER)
@@ -387,7 +387,7 @@ There are several things that need to be remembered:
head_overlay.pixel_y += dna.species.offset_features[OFFSET_HEAD][2]
overlays_standing[HEAD_LAYER] = head_overlay
apply_overlay(HEAD_LAYER)
update_mutant_bodyparts()
update_mutant_bodyparts(block_recursive_calls)
/mob/living/carbon/human/update_inv_belt()
if(!HAS_TRAIT(src, TRAIT_HUMAN_NO_RENDER))
@@ -411,7 +411,7 @@ There are several things that need to be remembered:
overlays_standing[BELT_LAYER] = belt_overlay
apply_overlay(BELT_LAYER)
/mob/living/carbon/human/update_inv_wear_suit()
/mob/living/carbon/human/update_inv_wear_suit(block_recursive_calls = FALSE)
if(!HAS_TRAIT(src, TRAIT_HUMAN_NO_RENDER))
remove_overlay(SUIT_LAYER)
@@ -471,7 +471,7 @@ There are several things that need to be remembered:
suit_overlay = center_image(suit_overlay, dimension_x, dimension_y)
overlays_standing[SUIT_LAYER] = suit_overlay
update_hair()
update_mutant_bodyparts()
update_mutant_bodyparts(block_recursive_calls)
apply_overlay(SUIT_LAYER)
@@ -498,7 +498,7 @@ There are several things that need to be remembered:
update_observer_view(r_store)
/mob/living/carbon/human/update_inv_wear_mask()
/mob/living/carbon/human/update_inv_wear_mask(block_recursive_calls = FALSE)
if(!HAS_TRAIT(src, TRAIT_HUMAN_NO_RENDER))
remove_overlay(FACEMASK_LAYER)
@@ -537,7 +537,7 @@ There are several things that need to be remembered:
mask_overlay.pixel_y += dna.species.offset_features[OFFSET_FACEMASK][2]
overlays_standing[FACEMASK_LAYER] = mask_overlay
apply_overlay(FACEMASK_LAYER)
update_mutant_bodyparts() //e.g. upgate needed because mask now hides lizard snout
update_mutant_bodyparts(block_recursive_calls) //e.g. upgate needed because mask now hides lizard snout
/mob/living/carbon/human/update_inv_back()
if(!HAS_TRAIT(src, TRAIT_HUMAN_NO_RENDER))
@@ -791,9 +791,8 @@ use_mob_overlay_icon: if FALSE, it will always use the default_icon_file even if
// eyes
if(!(NOEYES in dna.species.species_traits))
var/has_eyes = getorganslot(ORGAN_SLOT_EYES)
if(!has_eyes && !GetComponent(/datum/component/dullahan))
if(!has_eyes && !HAS_TRAIT(src, TRAIT_DULLAHAN))
add_overlay(mutable_appearance('icons/mob/eyes.dmi', "eyes_missing", -BODY_LAYER))
message_admins("EYES MISSING APPLIED")
else
var/left_state = DEFAULT_LEFT_EYE_STATE
var/right_state = DEFAULT_RIGHT_EYE_STATE
@@ -142,7 +142,7 @@
update_icon_dropped()
C.update_health_hud() //update the healthdoll
C.update_body()
C.update_body(FALSE, TRUE) // block recursive calls because we dont want to crash, i.e. don't tell a dullahan to update when dropping its limb
C.update_hair()
C.update_mobility()
@@ -370,7 +370,7 @@
update_disabled()
C.updatehealth()
C.update_body()
C.update_body(FALSE, TRUE) // again block recursive calls because dullahans will try update their icons by regenerating their head
C.update_hair()
C.update_damage_overlays()
C.update_mobility()
+2 -3
View File
@@ -134,7 +134,7 @@
I.pixel_y = px_y
add_overlay(standing)
/obj/item/bodypart/head/get_limb_icon(dropped, ignore_brain = FALSE, ignore_eyes = FALSE)
/obj/item/bodypart/head/get_limb_icon(dropped, ignore_brain = FALSE)
if(custom_head)
return
cut_overlays()
@@ -181,7 +181,7 @@
. += lips_overlay
// eyes
if(eyes || ignore_eyes)
if(eyes || ignore_brain)
var/left_state = DEFAULT_LEFT_EYE_STATE
var/right_state = DEFAULT_RIGHT_EYE_STATE
if(owner && owner.dna.species)
@@ -203,7 +203,6 @@
. += right_eye
else
var/eyes_overlay = image('icons/mob/hair.dmi', "eyes_missing", -BODY_LAYER, SOUTH)
message_admins("EYES MISSING ALSO IGNORE EYES IS [ignore_eyes]")
. += eyes_overlay
/obj/item/bodypart/head/monkey