mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-25 14:08:31 +01:00
[MIRROR] Brings the monkey back down (body horror edition/addition.) [MDB IGNORE] (#19572)
* Brings the monkey back down (body horror edition/addition.) (#73325) ## About The Pull Request Let me paint you a story. A long time ago monkeys once rested their feet on the floor, this was a time of bliss and peace. But sometime around the horrors of making monkeys subtypes of humans did an atrocity occur.  **The monkeys were moved up.** I thought this was bad, and alot of people on the forum tended to agree with me  This was do to some purpose of adjusting them so it could be easier to fit item sprites onto them instead of preforming the hours of work refractoring to make the heights of the items dynamic and adjustable. A simple pixel shift may have sufficed, but you see, such a change would NEVER allow the frankensteining of monkey and human features together. This is that refractor. In essence, the following is now true. A top_offset can now be generated for a human based on a varible on their chest and legs. By default, and as is true with human legs and chests, this variable is ZERO by default. Monkey legs and chest have NEGATIVE values proportionate and onto how much smaller their sprite is compared to humans. Other bodyparts, as well as any other accociated overlays, or clothing will automatically be offset to this axis. THIS MEANS THAT MONKEYS ARE ON THE FLOOR. But is means something else too. Something more freakish,  **What abominable monsters**, unreachable by players as long as we can't stitch monkeys and humans together (oh but just wait until the feature freeze ends) Oh but you might be thinking, if legs can make a mob go down. can it make a mob **go** **up??** **OH NO**    These lads are stepping, and have been implemented solely for proof of concept as a way to flex the system I have created and remain inaccessible without admin intervention. But really, when all is said and done, all this PR does in terms of player facing changes is move the monkey back down.  Oh and fixed monkey husked which have been broken for who knows how long.  ## Why It's Good For The Game The monkey is restored to its original position. Tools now exist to have legs and torsos of varying heights. Monkey Husking is fixed. ## Changelog 🆑 itseasytosee fix: Monkeys ues the proper husk sprites. imageadd: The monkey has been moved back down to its lower, more submissive position. refactor: Your bodyparts are now dynamically rendered at a height relevant to the length of your legs and torso, what does this mean for you? Not much to be honest, but you might see a monkey pop up a bit if you cut its legs off. admin: The Tallboy is here /🆑 --------- Co-authored-by: Fikou <23585223+Fikou@ users.noreply.github.com> Co-authored-by: san7890 <the@ san7890.com> * Brings the monkey back down (body horror edition/addition.) * Update species.dm * Delete infuser_entries.dm --------- Co-authored-by: itseasytosee <55666666+itseasytosee@users.noreply.github.com> Co-authored-by: Fikou <23585223+Fikou@ users.noreply.github.com> Co-authored-by: san7890 <the@ san7890.com> Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
This commit is contained in:
co-authored by
Fikou
san7890
itseasytosee
Gandalf
parent
ca0e0983c7
commit
d240a2a0af
@@ -117,6 +117,9 @@
|
||||
/// Only load in visual organs
|
||||
var/visual_only_organs = FALSE
|
||||
|
||||
/// Stores the result of our last known top_offset generation for optimisation purposes when drawing limb icons.
|
||||
var/last_top_offset
|
||||
|
||||
COOLDOWN_DECLARE(bleeding_message_cd)
|
||||
|
||||
|
||||
|
||||
@@ -484,7 +484,7 @@
|
||||
var/old_key = icon_render_keys?[limb.body_zone] //Checks the mob's icon render key list for the bodypart
|
||||
icon_render_keys[limb.body_zone] = (limb.is_husked) ? limb.generate_husk_key().Join() : limb.generate_icon_key().Join() //Generates a key for the current bodypart
|
||||
|
||||
if(icon_render_keys[limb.body_zone] != old_key) //If the keys match, that means the limb doesn't need to be redrawn
|
||||
if(icon_render_keys[limb.body_zone] != old_key || get_top_offset() != last_top_offset) //If the keys match, that means the limb doesn't need to be redrawn
|
||||
needs_update += limb
|
||||
|
||||
var/list/missing_bodyparts = get_missing_limbs()
|
||||
@@ -499,12 +499,18 @@
|
||||
//GENERATE NEW LIMBS
|
||||
var/list/new_limbs = list()
|
||||
for(var/obj/item/bodypart/limb as anything in bodyparts)
|
||||
if(limb in needs_update) //Checks to see if the limb needs to be redrawn
|
||||
if(limb in needs_update)
|
||||
var/bodypart_icon = limb.get_limb_icon()
|
||||
if(!istype(limb, /obj/item/bodypart/leg))
|
||||
var/top_offset = get_top_offset()
|
||||
for(var/image/image as anything in bodypart_icon)
|
||||
image.pixel_y += top_offset
|
||||
new_limbs += bodypart_icon
|
||||
limb_icon_cache[icon_render_keys[limb.body_zone]] = bodypart_icon //Caches the icon with the bodypart key, as it is new
|
||||
else
|
||||
new_limbs += limb_icon_cache[icon_render_keys[limb.body_zone]] //Pulls existing sprites from the cache
|
||||
last_top_offset = get_top_offset()
|
||||
|
||||
|
||||
remove_overlay(BODYPARTS_LAYER)
|
||||
|
||||
@@ -513,6 +519,18 @@
|
||||
|
||||
apply_overlay(BODYPARTS_LAYER)
|
||||
|
||||
/// This looks at the chest and legs of the mob and decides how much our chest, arms, and head should be adjusted. This is useful for limbs that are larger or smaller than the scope of normal human height while keeping the feet anchored to the bottom of the tile
|
||||
/mob/living/carbon/proc/get_top_offset()
|
||||
var/from_chest
|
||||
var/from_leg
|
||||
for(var/obj/item/bodypart/leg/leg_checked in bodyparts)
|
||||
if(leg_checked.top_offset > from_leg || isnull(from_leg)) // We find the tallest leg available
|
||||
from_leg = leg_checked.top_offset
|
||||
if(isnull(from_leg))
|
||||
from_leg = 0 // If we have no legs, we set this to zero to avoid any math issues that might stem from it being NULL
|
||||
for(var/obj/item/bodypart/chest/chest_checked in bodyparts) // Take the height from the chest
|
||||
from_chest = chest_checked.top_offset
|
||||
return (from_chest + from_leg) // The total hight of the chest and legs together
|
||||
|
||||
/////////////////////////
|
||||
// Limb Icon Cache 2.0 //
|
||||
|
||||
@@ -871,6 +871,9 @@ mutant_styles: The mutant style - taur bodytype, STYLE_TESHARI, etc. // SKYRAT E
|
||||
.[2] = offsets["y"]
|
||||
else
|
||||
.[2] = worn_y_offset
|
||||
if(ishuman(loc) && slot_flags != ITEM_SLOT_FEET) /// we adjust the human body for high given by body parts, execpt shoes, because they are always on the bottom
|
||||
var/mob/living/carbon/human/human_holder = loc
|
||||
.[2] += human_holder.get_top_offset()
|
||||
|
||||
//Can't think of a better way to do this, sadly
|
||||
/mob/proc/get_item_offsets_for_index(i)
|
||||
|
||||
@@ -560,6 +560,7 @@ GLOBAL_LIST_EMPTY(features_by_species)
|
||||
/*
|
||||
/datum/species/proc/handle_body(mob/living/carbon/human/species_human)
|
||||
species_human.remove_overlay(BODY_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()
|
||||
@@ -574,6 +575,7 @@ GLOBAL_LIST_EMPTY(features_by_species)
|
||||
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
|
||||
|
||||
// eyes
|
||||
@@ -589,6 +591,7 @@ GLOBAL_LIST_EMPTY(features_by_species)
|
||||
if(OFFSET_FACE in species_human.dna.species.offset_features)
|
||||
add_pixel_x = species_human.dna.species.offset_features[OFFSET_FACE][1]
|
||||
add_pixel_y = species_human.dna.species.offset_features[OFFSET_FACE][2]
|
||||
add_pixel_y += height_offset
|
||||
|
||||
if(!eye_organ)
|
||||
no_eyeslay = mutable_appearance('icons/mob/species/human/human_face.dmi', "eyes_missing", -BODY_LAYER)
|
||||
@@ -599,7 +602,8 @@ GLOBAL_LIST_EMPTY(features_by_species)
|
||||
eye_organ.refresh(call_update = FALSE)
|
||||
|
||||
if(!no_eyeslay)
|
||||
for(var/eye_overlay in eye_organ.generate_body_overlay(species_human))
|
||||
for(var/mutable_appearance/eye_overlay in eye_organ.generate_body_overlay(species_human))
|
||||
eye_overlay.pixel_y += height_offset
|
||||
standing += eye_overlay
|
||||
|
||||
// organic body markings
|
||||
@@ -614,18 +618,22 @@ GLOBAL_LIST_EMPTY(features_by_species)
|
||||
if(!HAS_TRAIT(species_human, TRAIT_HUSK))
|
||||
if(noggin && (IS_ORGANIC_LIMB(noggin)))
|
||||
var/mutable_appearance/markings_head_overlay = mutable_appearance(markings.icon, "[markings.icon_state]_head", -BODY_LAYER)
|
||||
markings_head_overlay.pixel_y += height_offset
|
||||
standing += markings_head_overlay
|
||||
|
||||
if(chest && (IS_ORGANIC_LIMB(chest)))
|
||||
var/mutable_appearance/markings_chest_overlay = mutable_appearance(markings.icon, "[markings.icon_state]_chest", -BODY_LAYER)
|
||||
markings_chest_overlay.pixel_y += height_offset
|
||||
standing += markings_chest_overlay
|
||||
|
||||
if(right_arm && (IS_ORGANIC_LIMB(right_arm)))
|
||||
var/mutable_appearance/markings_r_arm_overlay = mutable_appearance(markings.icon, "[markings.icon_state]_r_arm", -BODY_LAYER)
|
||||
markings_r_arm_overlay.pixel_y += height_offset
|
||||
standing += markings_r_arm_overlay
|
||||
|
||||
if(left_arm && (IS_ORGANIC_LIMB(left_arm)))
|
||||
var/mutable_appearance/markings_l_arm_overlay = mutable_appearance(markings.icon, "[markings.icon_state]_l_arm", -BODY_LAYER)
|
||||
markings_l_arm_overlay.pixel_y += height_offset
|
||||
standing += markings_l_arm_overlay
|
||||
|
||||
if(right_leg && (IS_ORGANIC_LIMB(right_leg)))
|
||||
@@ -648,15 +656,19 @@ GLOBAL_LIST_EMPTY(features_by_species)
|
||||
underwear_overlay = mutable_appearance(underwear.icon, underwear.icon_state, -BODY_LAYER)
|
||||
if(!underwear.use_static)
|
||||
underwear_overlay.color = species_human.underwear_color
|
||||
underwear_overlay.pixel_y += height_offset
|
||||
standing += underwear_overlay
|
||||
|
||||
if(species_human.undershirt)
|
||||
var/datum/sprite_accessory/undershirt/undershirt = GLOB.undershirt_list[species_human.undershirt]
|
||||
if(undershirt)
|
||||
var/mutable_appearance/working_shirt
|
||||
if(species_human.dna.species.sexes && species_human.physique == FEMALE)
|
||||
standing += wear_female_version(undershirt.icon_state, undershirt.icon, BODY_LAYER)
|
||||
working_shirt = wear_female_version(undershirt.icon_state, undershirt.icon, BODY_LAYER)
|
||||
else
|
||||
standing += mutable_appearance(undershirt.icon, undershirt.icon_state, -BODY_LAYER)
|
||||
working_shirt = mutable_appearance(undershirt.icon, undershirt.icon_state, -BODY_LAYER)
|
||||
working_shirt.pixel_y += height_offset
|
||||
standing += working_shirt
|
||||
|
||||
if(species_human.socks && species_human.num_legs >= 2 && !(src.bodytype & BODYTYPE_DIGITIGRADE))
|
||||
var/datum/sprite_accessory/socks/socks = GLOB.socks_list[species_human.socks]
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/// These won't appear normally in games, they are meant to for debuging the adjustment of limbs based on the height of a humans bodyparts.
|
||||
/datum/species/human/tallboy
|
||||
name = "\improper Tall Boy"
|
||||
id = SPECIES_TALLBOY
|
||||
bodypart_overrides = list(
|
||||
BODY_ZONE_L_ARM = /obj/item/bodypart/arm/left,
|
||||
BODY_ZONE_R_ARM = /obj/item/bodypart/arm/right,
|
||||
BODY_ZONE_HEAD = /obj/item/bodypart/head,
|
||||
BODY_ZONE_L_LEG = /obj/item/bodypart/leg/left/tallboy,
|
||||
BODY_ZONE_R_LEG = /obj/item/bodypart/leg/right/tallboy,
|
||||
BODY_ZONE_CHEST = /obj/item/bodypart/chest,
|
||||
)
|
||||
|
||||
/datum/species/monkey/human_legged
|
||||
id = SPECIES_MONKEY_HUMAN_LEGGED
|
||||
bodypart_overrides = list(
|
||||
BODY_ZONE_L_ARM = /obj/item/bodypart/arm/left/monkey,
|
||||
BODY_ZONE_R_ARM = /obj/item/bodypart/arm/right/monkey,
|
||||
BODY_ZONE_HEAD = /obj/item/bodypart/head/monkey,
|
||||
BODY_ZONE_L_LEG = /obj/item/bodypart/leg/left,
|
||||
BODY_ZONE_R_LEG = /obj/item/bodypart/leg/right,
|
||||
BODY_ZONE_CHEST = /obj/item/bodypart/chest/monkey,
|
||||
)
|
||||
|
||||
/datum/species/monkey/monkey_freak
|
||||
id = SPECIES_MONKEY_FREAK
|
||||
bodypart_overrides = list(
|
||||
BODY_ZONE_L_ARM = /obj/item/bodypart/arm/left,
|
||||
BODY_ZONE_R_ARM = /obj/item/bodypart/arm/right,
|
||||
BODY_ZONE_HEAD = /obj/item/bodypart/head/monkey,
|
||||
BODY_ZONE_L_LEG = /obj/item/bodypart/leg/left/monkey,
|
||||
BODY_ZONE_R_LEG = /obj/item/bodypart/leg/right/monkey,
|
||||
BODY_ZONE_CHEST = /obj/item/bodypart/chest,
|
||||
)
|
||||
|
||||
/mob/living/carbon/human/species/monkey/humand_legged
|
||||
race = /datum/species/monkey/human_legged
|
||||
|
||||
/mob/living/carbon/human/species/monkey/monkey_freak
|
||||
race = /datum/species/monkey/monkey_freak
|
||||
|
||||
/mob/living/carbon/human/species/tallboy
|
||||
race = /datum/species/human/tallboy
|
||||
@@ -92,3 +92,4 @@
|
||||
))
|
||||
|
||||
return to_add
|
||||
|
||||
|
||||
Reference in New Issue
Block a user