diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index cf9cd2a5b467..dbf3a02c5286 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -651,20 +651,22 @@ GLOBAL_LIST_INIT(human_heights_to_offsets, list( /// Total number of layers for mob overlays /// KEEP THIS UP-TO-DATE OR SHIT WILL BREAK /// Also consider updating layers_to_offset -#define TOTAL_LAYERS 34 +#define TOTAL_LAYERS 35 /// Mutant race multiparts - Lbelly -#define ACCESSORIES_LAYER 34 +#define ACCESSORIES_LAYER 35 /// Mutations layer - Tk headglows, cold resistance glow, etc -#define MUTATIONS_LAYER 33 +#define MUTATIONS_LAYER 34 /// Mutantrace features (tail when looking south) that must appear behind the body parts -#define BODY_BEHIND_LAYER 32 +#define BODY_BEHIND_LAYER 33 /// Layer for bodyparts that should appear behind every other bodypart - Mostly, legs when facing WEST or EAST -#define BODYPARTS_LOW_LAYER 31 +#define BODYPARTS_LOW_LAYER 32 /// Layer for most bodyparts, appears above BODYPARTS_LOW_LAYER and below BODYPARTS_HIGH_LAYER -#define BODYPARTS_LAYER 30 +#define BODYPARTS_LAYER 31 /// Mutantrace features (snout, body markings) that must appear above the body parts -#define BODY_ADJ_LAYER 29 -/// Underwear, undershirts, socks, eyes, lips(makeup) +#define BODY_ADJ_LAYER 30 +// Eyes, lips(makeup) +#define FACE_LAYER 29 +/// Underwear, undershirts, socks #define BODY_LAYER 28 /// Mutations that should appear above body, body_adj and bodyparts layer (e.g. laser eyes) #define FRONT_MUTATIONS_LAYER 27 @@ -748,6 +750,7 @@ GLOBAL_LIST_INIT(layers_to_offset, list( "[ID_CARD_LAYER]" = UPPER_BODY, // unused "[ID_LAYER]" = UPPER_BODY, "[FACEMASK_LAYER]" = UPPER_BODY, + "[FACE_LAYER]" = UPPER_BODY, // These two are cached, and have their appearance shared(?), so it's safer to just not touch it "[MUTATIONS_LAYER]" = NO_MODIFY, "[FRONT_MUTATIONS_LAYER]" = NO_MODIFY, diff --git a/code/datums/mutations/body.dm b/code/datums/mutations/body.dm index 3e1926dead01..8da93b79eb30 100644 --- a/code/datums/mutations/body.dm +++ b/code/datums/mutations/body.dm @@ -125,8 +125,9 @@ /datum/mutation/human/dwarfism/on_losing(mob/living/carbon/human/owner) if(..()) return - // REMOVE_TRAIT(owner, TRAIT_DWARF, GENETIC_MUTATION) - // owner.visible_message(span_danger("[owner] suddenly grows!"), span_notice("Everything around you seems to shrink..")) + //We're leaving the size traits permanent until someone wants to separate the mutation from customization aspects + //REMOVE_TRAIT(owner, TRAIT_DWARF, GENETIC_MUTATION) + //owner.visible_message(span_danger("[owner] suddenly grows!"), span_notice("Everything around you seems to shrink..")) //Clumsiness has a very large amount of small drawbacks depending on item. /datum/mutation/human/clumsy @@ -370,27 +371,25 @@ playsound(owner,'sound/weapons/sear.ogg', 50, TRUE) /datum/mutation/human/gigantism - name = "Gigantism"//negative version of dwarfism + name = "Gigantism" desc = "The cells within the subject spread out to cover more area, making the subject appear larger." quality = MINOR_NEGATIVE difficulty = 12 conflicts = list(/datum/mutation/human/dwarfism) + locked = TRUE /datum/mutation/human/gigantism/on_acquiring(mob/living/carbon/human/owner) if(..()) return ADD_TRAIT(owner, TRAIT_GIANT, GENETIC_MUTATION) - owner.resize = 1.25 - owner.update_transform() - owner.visible_message(span_danger("[owner] suddenly grows!"), span_notice("Everything around you seems to shrink..")) + //handled in init_signals.dm /datum/mutation/human/gigantism/on_losing(mob/living/carbon/human/owner) if(..()) return - // REMOVE_TRAIT(owner, TRAIT_GIANT, GENETIC_MUTATION) - // owner.resize = 0.8 - // owner.update_transform() - // owner.visible_message(span_danger("[owner] suddenly shrinks!"), span_notice("Everything around you seems to grow..")) + //We're leaving the size traits permanent until someone wants to separate the mutation from customization aspects + //REMOVE_TRAIT(owner, TRAIT_GIANT, GENETIC_MUTATION) + //handled in init_signals.dm /datum/mutation/human/spastic name = "Spastic" diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 11e778c295c5..49d434e5cb7e 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -381,7 +381,9 @@ GLOBAL_LIST_EMPTY(preferences_datums) if (isnull(body)) create_body() else - body.wipe_state() + //body.wipe_state() + QDEL_NULL(body) + create_body() appearance = preferences.render_new_preview_appearance(body) /atom/movable/screen/map_view/char_preview/proc/create_body() diff --git a/code/modules/clothing/head/_head.dm b/code/modules/clothing/head/_head.dm index 5dbfbade1fa2..a67d65b5139d 100644 --- a/code/modules/clothing/head/_head.dm +++ b/code/modules/clothing/head/_head.dm @@ -88,6 +88,10 @@ head_icon = selected_hat.icon var/mutable_appearance/hat_adding = selected_hat.build_worn_icon(HEAD_LAYER, head_icon, FALSE, FALSE) hat_adding.pixel_y = ((current_hat * 4) - 1) + if(ismob(loc)) + if(ishuman(loc)) + var/mob/living/carbon/human/user = loc + hat_adding.pixel_y -= GLOB.human_heights_to_offsets[num2text(user.get_mob_height())][1] hat_adding.pixel_x = (rand(-1, 1)) current_hat++ . += hat_adding diff --git a/code/modules/mob/living/carbon/carbon_update_icons.dm b/code/modules/mob/living/carbon/carbon_update_icons.dm index 32490dbd6f5f..b6aad62e1072 100644 --- a/code/modules/mob/living/carbon/carbon_update_icons.dm +++ b/code/modules/mob/living/carbon/carbon_update_icons.dm @@ -333,6 +333,15 @@ if(iter_part.burnstate) damage_overlay.add_overlay("[iter_part.dmg_overlay_type]_[iter_part.body_zone]_0[iter_part.burnstate]") + var/mob/living/carbon/human/human = src + if(human) + var/height = human.get_mob_height() + if(height == HUMAN_HEIGHT_DWARF) + height += 2 + height = num2text(height) + var/offsets = GLOB.human_heights_to_offsets[height] + damage_overlay.pixel_y += offsets[1] + apply_overlay(DAMAGE_LAYER) /mob/living/carbon/update_wound_overlays() @@ -345,6 +354,15 @@ if(iter_part.bleed_overlay_icon) wound_overlay.add_overlay(iter_part.bleed_overlay_icon) + var/mob/living/carbon/human/human = src + if(human) + var/height = human.get_mob_height() + if(height == HUMAN_HEIGHT_DWARF) + height += 2 + height = num2text(height) + var/offsets = GLOB.human_heights_to_offsets[height] + wound_overlay.pixel_y += offsets[1] + apply_overlay(WOUND_LAYER) /mob/living/carbon/update_worn_mask() diff --git a/code/modules/mob/living/carbon/human/human_update_icons.dm b/code/modules/mob/living/carbon/human/human_update_icons.dm index 6343d324d147..2c371e78b7ff 100644 --- a/code/modules/mob/living/carbon/human/human_update_icons.dm +++ b/code/modules/mob/living/carbon/human/human_update_icons.dm @@ -847,7 +847,7 @@ generate/load female uniform sprites matching all previously decided variables if(HD && !(HAS_TRAIT(src, TRAIT_HUSK))) // lipstick if(lip_style && (LIPS in dna.species.species_traits)) - var/mutable_appearance/lip_overlay = mutable_appearance('icons/mob/species/human/human_face.dmi', "lips_[lip_style]", -BODY_LAYER) + var/mutable_appearance/lip_overlay = mutable_appearance('icons/mob/species/human/human_face.dmi', "lips_[lip_style]", -FACE_LAYER) lip_overlay.color = lip_color if(OFFSET_FACE in dna.species.offset_features) lip_overlay.pixel_x += dna.species.offset_features[OFFSET_FACE][1] @@ -860,7 +860,7 @@ generate/load female uniform sprites matching all previously decided variables if(parent_eyes) add_overlay(parent_eyes.generate_body_overlay(src)) else - var/mutable_appearance/missing_eyes = mutable_appearance('icons/mob/species/human/human_face.dmi', "eyes_missing", -BODY_LAYER) + var/mutable_appearance/missing_eyes = mutable_appearance('icons/mob/species/human/human_face.dmi', "eyes_missing", -FACE_LAYER) if(OFFSET_FACE in dna.species.offset_features) missing_eyes.pixel_x += dna.species.offset_features[OFFSET_FACE][1] missing_eyes.pixel_y += dna.species.offset_features[OFFSET_FACE][2] diff --git a/code/modules/mob/living/carbon/human/init_signals.dm b/code/modules/mob/living/carbon/human/init_signals.dm index 1a864b6bad96..308ade654cfe 100644 --- a/code/modules/mob/living/carbon/human/init_signals.dm +++ b/code/modules/mob/living/carbon/human/init_signals.dm @@ -3,6 +3,8 @@ RegisterSignals(src, list(SIGNAL_ADDTRAIT(TRAIT_UNKNOWN), SIGNAL_REMOVETRAIT(TRAIT_UNKNOWN)), PROC_REF(on_unknown_trait)) RegisterSignals(src, list(SIGNAL_ADDTRAIT(TRAIT_DWARF), SIGNAL_REMOVETRAIT(TRAIT_DWARF)), PROC_REF(on_dwarf_trait)) + RegisterSignals(src, list(SIGNAL_ADDTRAIT(TRAIT_GIANT)), PROC_REF(on_gain_giant_trait)) + RegisterSignals(src, list(SIGNAL_REMOVETRAIT(TRAIT_GIANT)), PROC_REF(on_lose_giant_trait)) /// Gaining or losing [TRAIT_UNKNOWN] updates our name and our sechud /mob/living/carbon/human/proc/on_unknown_trait(datum/source) @@ -19,3 +21,16 @@ regenerate_icons() // No more passtable for you, bub +/mob/living/carbon/human/proc/on_gain_giant_trait(datum/source) + SIGNAL_HANDLER + + src.resize = 1.25 + src.update_transform() + src.visible_message(span_danger("[src] suddenly grows!"), span_notice("Everything around you seems to shrink..")) + +/mob/living/carbon/human/proc/on_lose_giant_trait(datum/source) + SIGNAL_HANDLER + //We're leaving the size traits permanent until someone wants to separate the mutation from customization aspects + //src.resize = 0.8 + //src.update_transform() + //src.visible_message(span_danger("[src] suddenly shrinks!"), span_notice("Everything around you seems to grow..")) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 00ea009c117a..0551edf90cb6 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -653,23 +653,25 @@ GLOBAL_LIST_EMPTY(features_by_species) */ /datum/species/proc/handle_body(mob/living/carbon/human/species_human) species_human.remove_overlay(BODY_LAYER) + species_human.remove_overlay(FACE_LAYER) var/height_offset = species_human.get_top_offset() // From high changed by varying limb height if(HAS_TRAIT(species_human, TRAIT_INVISIBLE_MAN)) return handle_mutant_bodyparts(species_human) var/list/standing = list() + var/list/standing_face = list() var/obj/item/bodypart/head/noggin = species_human.get_bodypart(BODY_ZONE_HEAD) if(noggin && !(HAS_TRAIT(species_human, TRAIT_HUSK))) // lipstick if(species_human.lip_style && (LIPS in species_traits)) - var/mutable_appearance/lip_overlay = mutable_appearance('icons/mob/species/human/human_face.dmi', "lips_[species_human.lip_style]", -BODY_LAYER) + var/mutable_appearance/lip_overlay = mutable_appearance('icons/mob/species/human/human_face.dmi', "lips_[species_human.lip_style]", -FACE_LAYER) lip_overlay.color = species_human.lip_color if(OFFSET_FACE in species_human.dna.species.offset_features) lip_overlay.pixel_x += species_human.dna.species.offset_features[OFFSET_FACE][1] lip_overlay.pixel_y += species_human.dna.species.offset_features[OFFSET_FACE][2] lip_overlay.pixel_y += height_offset - standing += lip_overlay + standing_face += lip_overlay // eyes if(!(NOEYESPRITES in species_traits)) @@ -687,7 +689,7 @@ GLOBAL_LIST_EMPTY(features_by_species) add_pixel_y += height_offset if(!eye_organ) - no_eyeslay = mutable_appearance('icons/mob/species/human/human_face.dmi', "eyes_missing", -BODY_LAYER) + no_eyeslay = mutable_appearance('icons/mob/species/human/human_face.dmi', "eyes_missing", -FACE_LAYER) no_eyeslay.pixel_x += add_pixel_x no_eyeslay.pixel_y += add_pixel_y standing += no_eyeslay @@ -697,7 +699,7 @@ GLOBAL_LIST_EMPTY(features_by_species) if(!no_eyeslay) for(var/mutable_appearance/eye_overlay in eye_organ.generate_body_overlay(species_human)) eye_overlay.pixel_y += height_offset - standing += eye_overlay + standing_face += eye_overlay // organic body markings if(HAS_MARKINGS in species_traits) @@ -770,8 +772,11 @@ GLOBAL_LIST_EMPTY(features_by_species) if(standing.len) species_human.overlays_standing[BODY_LAYER] = standing + if(standing_face.len) + species_human.overlays_standing[FACE_LAYER] = standing_face species_human.apply_overlay(BODY_LAYER) + species_human.apply_overlay(FACE_LAYER) handle_mutant_bodyparts(species_human) /** diff --git a/code/modules/surgery/bodyparts/hair.dm b/code/modules/surgery/bodyparts/hair.dm index 4cbfa5dd585a..673af47de27b 100644 --- a/code/modules/surgery/bodyparts/hair.dm +++ b/code/modules/surgery/bodyparts/hair.dm @@ -68,6 +68,11 @@ facial_hairstyle = human_head_owner.facial_hairstyle var/atom/location = loc || owner || src + var/height = human_head_owner.get_mob_height() + if(height == HUMAN_HEIGHT_DWARF) + height += 2 + height = num2text(height) + var/offsets = GLOB.human_heights_to_offsets[height] if(facial_hairstyle && !facial_hair_hidden && (FACEHAIR in species_flags_list)) sprite_accessory = GLOB.facial_hairstyles_list[facial_hairstyle] @@ -75,11 +80,13 @@ //Create the overlay facial_overlay = mutable_appearance(sprite_accessory.icon, sprite_accessory.icon_state, -HAIR_LAYER) facial_overlay.overlays += emissive_blocker(facial_overlay.icon, facial_overlay.icon_state, location, alpha = hair_alpha) + facial_overlay.pixel_y += offsets[1] //Gradients facial_hair_gradient_style = LAZYACCESS(human_head_owner.grad_style, GRADIENT_FACIAL_HAIR_KEY) if(facial_hair_gradient_style) facial_hair_gradient_color = LAZYACCESS(human_head_owner.grad_color, GRADIENT_FACIAL_HAIR_KEY) facial_gradient_overlay = make_gradient_overlay(sprite_accessory.icon, sprite_accessory.icon_state, HAIR_LAYER, GLOB.facial_hair_gradients_list[facial_hair_gradient_style], facial_hair_gradient_color) + facial_gradient_overlay.pixel_y += offsets[1] facial_overlay.overlays += emissive_blocker(sprite_accessory.icon, sprite_accessory.icon_state, location, alpha = hair_alpha) diff --git a/code/modules/surgery/bodyparts/head.dm b/code/modules/surgery/bodyparts/head.dm index c82f0c71d5be..57001668ec8b 100644 --- a/code/modules/surgery/bodyparts/head.dm +++ b/code/modules/surgery/bodyparts/head.dm @@ -203,7 +203,7 @@ . += facial_overlay if(!eyes) - . += image('icons/mob/species/human/human_face.dmi', "eyes_missing", -BODY_LAYER, SOUTH) + . += image('icons/mob/species/human/human_face.dmi', "eyes_missing", -FACE_LAYER, SOUTH) //Applies the debrained overlay if there is no brain if(!brain) @@ -229,14 +229,14 @@ // lipstick if(lip_style) - var/image/lips_overlay = image('icons/mob/species/human/human_face.dmi', "lips_[lip_style]", -BODY_LAYER, SOUTH) + var/image/lips_overlay = image('icons/mob/species/human/human_face.dmi', "lips_[lip_style]", -FACE_LAYER, SOUTH) lips_overlay.color = lip_color . += lips_overlay // eyes if(eyes) // This is a bit of copy/paste code from eyes.dm:generate_body_overlay - var/image/eye_left = image('icons/mob/species/human/human_face.dmi', "[eyes.eye_icon_state]_l", -BODY_LAYER, SOUTH) - var/image/eye_right = image('icons/mob/species/human/human_face.dmi', "[eyes.eye_icon_state]_r", -BODY_LAYER, SOUTH) + var/image/eye_left = image('icons/mob/species/human/human_face.dmi', "[eyes.eye_icon_state]_l", -FACE_LAYER, SOUTH) + var/image/eye_right = image('icons/mob/species/human/human_face.dmi', "[eyes.eye_icon_state]_r", -FACE_LAYER, SOUTH) if(eyes.eye_color_left) eye_left.color = eyes.eye_color_left if(eyes.eye_color_right) diff --git a/code/modules/surgery/organs/eyes.dm b/code/modules/surgery/organs/eyes.dm index 9cad386b1a91..8aa349be967c 100644 --- a/code/modules/surgery/organs/eyes.dm +++ b/code/modules/surgery/organs/eyes.dm @@ -121,8 +121,8 @@ var/eye_icon = parent.dna?.species.eyes_icon || 'icons/mob/species/human/human_face.dmi' - var/mutable_appearance/eye_left = mutable_appearance(eye_icon, "[eye_icon_state]_l", -BODY_LAYER) - var/mutable_appearance/eye_right = mutable_appearance(eye_icon, "[eye_icon_state]_r", -BODY_LAYER) + var/mutable_appearance/eye_left = mutable_appearance(eye_icon, "[eye_icon_state]_l", -FACE_LAYER) + var/mutable_appearance/eye_right = mutable_appearance(eye_icon, "[eye_icon_state]_r", -FACE_LAYER) var/list/overlays = list(eye_left, eye_right) if(EYECOLOR in parent.dna?.species.species_traits) diff --git a/code/modules/unit_tests/screenshots/screenshot_humanoids__datum_species_goblin.png b/code/modules/unit_tests/screenshots/screenshot_humanoids__datum_species_goblin.png index 22204deaabb0..cfd36b779863 100644 Binary files a/code/modules/unit_tests/screenshots/screenshot_humanoids__datum_species_goblin.png and b/code/modules/unit_tests/screenshots/screenshot_humanoids__datum_species_goblin.png differ