diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm index 85107a4deb7..957f0665266 100644 --- a/code/game/machinery/syndicatebeacon.dm +++ b/code/game/machinery/syndicatebeacon.dm @@ -111,7 +111,7 @@ anchored = 0 density = 1 - layer = MOB_LAYER - 0.1 //so people can't hide it and it's REALLY OBVIOUS + layer = MOB_LAYER - 0.2 //so people can't hide it and it's REALLY OBVIOUS stat = 0 var/active = 0 diff --git a/code/game/machinery/syndicatebomb.dm b/code/game/machinery/syndicatebomb.dm index a0ef6a5fc31..bff628e32d3 100644 --- a/code/game/machinery/syndicatebomb.dm +++ b/code/game/machinery/syndicatebomb.dm @@ -6,7 +6,7 @@ anchored = 0 density = 0 - layer = MOB_LAYER - 0.1 //so people can't hide it and it's REALLY OBVIOUS + layer = MOB_LAYER - 0.2 //so people can't hide it and it's REALLY OBVIOUS unacidable = 1 var/datum/wires/syndicatebomb/wires = null diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 88b7cc77e2d..2e9ddccfaaf 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -16,7 +16,7 @@ opacity = 1 ///opaque. Menacing. anchored = 1 //no pulling around. unacidable = 1 //and no deleting hoomans inside - layer = MOB_LAYER //icon draw layer + layer = MOB_LAYER - 0.2//icon draw layer infra_luminosity = 15 //byond implementation is bugged. force = 5 var/can_move = 1 diff --git a/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm b/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm index 15c26a7a058..91b89fb8637 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm @@ -55,12 +55,12 @@ if(M == buckled_mob) M.pixel_y = 0 M.pixel_x = initial(M.pixel_x) + 2 - overlays += image('icons/mob/alien.dmi', "nestoverlay", layer=6) + M.layer = MOB_LAYER - 0.3 + overlays += image('icons/mob/alien.dmi', "nestoverlay", layer=MOB_LAYER - 0.2) else - M.pixel_x = initial(M.pixel_x) - M.pixel_y = initial(M.pixel_y) - if(M.lying) - M.pixel_y = M.lying_pixel_offset + M.pixel_x = M.get_standard_pixel_x_offset(M.lying) + M.pixel_y = M.get_standard_pixel_y_offset(M.lying) + M.layer = initial(M.layer) overlays.Cut() /obj/structure/stool/bed/nest/attackby(obj/item/weapon/W as obj, mob/user as mob, params) diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm index 3a4588dcb3b..950e27b42eb 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -68,9 +68,8 @@ else density = 0 icon_state = "down" - M.pixel_y = initial(M.pixel_y) - if(M.lying) - M.pixel_y = M.lying_pixel_offset + M.pixel_x = M.get_standard_pixel_x_offset(M.lying) + M.pixel_y = M.get_standard_pixel_y_offset(M.lying) /obj/item/roller diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index 03afa9e94ed..79c1960f3a8 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -12,7 +12,6 @@ ventcrawler = 2 languages = ALIEN verb_say = "hisses" - lying_pixel_offset = 0 var/nightvision = 1 var/storedPlasma = 250 var/max_plasma = 500 @@ -205,6 +204,10 @@ Des: Removes all infected images from the alien. /mob/living/carbon/alien/canBeHandcuffed() return 1 +/mob/living/carbon/alien/get_standard_pixel_y_offset(lying = 0) + return initial(pixel_y) + + #undef HEAT_DAMAGE_LEVEL_1 #undef HEAT_DAMAGE_LEVEL_2 #undef HEAT_DAMAGE_LEVEL_3 diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm index 310fa31f610..40c3574d756 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm @@ -130,3 +130,19 @@ /mob/living/carbon/alien/humanoid/cuff_resist(obj/item/I) playsound(src, 'sound/voice/hiss5.ogg', 40, 1, 1) //Alien roars when starting to break free ..(I, cuff_break = 1) + +/mob/living/carbon/alien/humanoid/get_standard_pixel_y_offset(lying = 0) + if(leaping) + return -32 + else if(custom_pixel_y_offset) + return custom_pixel_y_offset + else + return initial(pixel_y) + +/mob/living/carbon/alien/humanoid/get_standard_pixel_x_offset(lying = 0) + if(leaping) + return -32 + else if(custom_pixel_x_offset) + return custom_pixel_x_offset + else + return initial(pixel_x) \ No newline at end of file diff --git a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm index 2ccc95f56cf..85a63338919 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm @@ -14,7 +14,6 @@ for(var/image/I in overlays_standing) overlays += I - if(stat == DEAD) //If we mostly took damage from fire if(fireloss > 125) @@ -35,9 +34,10 @@ icon_state = "alien[caste]_s" if(leaping) - var/old_icon = icon - icon = alt_icon - alt_icon = old_icon + if(alt_icon == initial(alt_icon)) + var/old_icon = icon + icon = alt_icon + alt_icon = old_icon icon_state = "alien[caste]_leap" pixel_x = -32 pixel_y = -32 @@ -46,9 +46,8 @@ var/old_icon = icon icon = alt_icon alt_icon = old_icon - pixel_x = initial(pixel_x) - pixel_y = initial(pixel_y) - + pixel_x = get_standard_pixel_x_offset(lying) + pixel_y = get_standard_pixel_y_offset(lying) /mob/living/carbon/alien/humanoid/regenerate_icons() ..() diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 6a5c8adf054..afd060e9fc3 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -495,3 +495,9 @@ var/const/GALOSHES_DONT_HELP = 8 /mob/living/carbon/proc/is_mouth_covered(head_only = 0, mask_only = 0) if( (!mask_only && head && (head.flags & HEADCOVERSMOUTH)) || (!head_only && wear_mask && (wear_mask.flags & MASKCOVERSMOUTH)) ) return 1 + +/mob/living/carbon/get_standard_pixel_y_offset(lying = 0) + if(lying) + return -6 + else + return initial(pixel_y) diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index b694d7c2ca5..14510956dab 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -22,5 +22,4 @@ var/co2overloadtime = null var/temperature_resistance = T0C+75 - lying_pixel_offset = -6 //offset for pixel_y when lying down. has_limbs = 1 diff --git a/code/modules/mob/living/carbon/update_icons.dm b/code/modules/mob/living/carbon/update_icons.dm index 1136f3533bb..40c8b4f11e2 100644 --- a/code/modules/mob/living/carbon/update_icons.dm +++ b/code/modules/mob/living/carbon/update_icons.dm @@ -11,11 +11,11 @@ changed++ ntransform.TurnTo(lying_prev,lying) if(lying == 0) //Lying to standing - final_pixel_y = initial(pixel_y) + final_pixel_y = get_standard_pixel_y_offset() else //if(lying != 0) if(lying_prev == 0) //Standing to lying - pixel_y = initial(pixel_y) - final_pixel_y = lying_pixel_offset + pixel_y = get_standard_pixel_y_offset() + final_pixel_y = get_standard_pixel_y_offset(lying) if(dir & (EAST|WEST)) //Facing east or west final_dir = pick(NORTH, SOUTH) //So you fall on your side rather than your face or ass diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 858fb020252..f6e909e9f25 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -672,9 +672,7 @@ Sorry Giacom. Please don't be mad :( animate(src, pixel_y = pixel_y + 2, time = 10, loop = -1) floating = 1 else if(!on && floating) - var/final_pixel_y = initial(pixel_y) - if(lying && !buckled) - final_pixel_y = lying_pixel_offset + var/final_pixel_y = get_standard_pixel_y_offset(lying) animate(src, pixel_y = final_pixel_y, time = 10) floating = 0 @@ -772,9 +770,7 @@ Sorry Giacom. Please don't be mad :( /mob/living/do_attack_animation(atom/A) - var/final_pixel_y = initial(pixel_y) - if(lying && !buckled) - final_pixel_y = lying_pixel_offset + var/final_pixel_y = get_standard_pixel_y_offset(lying) ..(A, final_pixel_y) floating = 0 // If we were without gravity, the bouncing animation got stopped, so we make sure to restart it in next life(). @@ -782,11 +778,10 @@ Sorry Giacom. Please don't be mad :( var/amplitude = min(4, (jitteriness/100) + 1) var/pixel_x_diff = rand(-amplitude, amplitude) var/pixel_y_diff = rand(-amplitude/3, amplitude/3) - var/final_pixel_y = initial(pixel_y) - if(lying && !buckled) - final_pixel_y = lying_pixel_offset + var/final_pixel_x = get_standard_pixel_x_offset(lying) + var/final_pixel_y = get_standard_pixel_y_offset(lying) animate(src, pixel_x = pixel_x + pixel_x_diff, pixel_y = pixel_y + pixel_y_diff , time = 2, loop = 6) - animate(pixel_x = initial(pixel_x) , pixel_y = final_pixel_y , time = 2) + animate(pixel_x = final_pixel_x , pixel_y = final_pixel_y , time = 2) floating = 0 // If we were without gravity, the bouncing animation got stopped, so we make sure to restart it in next life(). /mob/living/proc/get_temperature(var/datum/gas_mixture/environment) @@ -814,3 +809,9 @@ Sorry Giacom. Please don't be mad :( loc_temp = environment.temperature return loc_temp + +/mob/living/proc/get_standard_pixel_x_offset(lying = 0) + return initial(pixel_x) + +/mob/living/proc/get_standard_pixel_y_offset(lying = 0) + return initial(pixel_y) diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 394626546c8..c75676e4115 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -41,6 +41,5 @@ var/mob_size = MOB_SIZE_HUMAN var/metabolism_efficiency = 1 //more or less efficiency to metabolize helpful/harmful reagents and regulate body temperature.. var/list/image/staticOverlays = list() - var/lying_pixel_offset = 0 //offset for pixel_y when the mob is lying down. var/has_limbs = 0 //does the mob have distinct limbs?(arms,legs, chest,head) var/list/datum/action/actions = list() \ No newline at end of file diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 719b48b01d1..5fc8a5c44f4 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -790,6 +790,12 @@ var/list/slot_equipment_priority = list( \ fall(ko) canmove = !(ko || resting || stunned || buckled) density = !lying + if(lying) + if(layer == initial(layer)) //to avoid special cases like hiding larvas. + layer = MOB_LAYER - 0.2 //so mob lying always appear behind standing mobs + else + if(layer == MOB_LAYER - 0.2) + layer = initial(layer) update_transform() lying_prev = lying return canmove