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 594ce58d2d4..60753b802b2 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 @@ -44,12 +44,14 @@ /obj/structure/stool/bed/nest/post_buckle_mob(mob/living/M) if(M == buckled_mob) - M.pixel_y += 6 - M.pixel_x += 2 + M.pixel_y = initial(M.pixel_y) + 6 + M.pixel_x = initial(M.pixel_x) + 2 overlays += image('icons/mob/alien.dmi', "nestoverlay", layer=6) else - M.pixel_x -= 2 + M.pixel_x = initial(M.pixel_x) M.pixel_y = initial(M.pixel_y) + if(M.lying) + M.pixel_y = M.lying_pixel_offset 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 b81baa63d7b..3a4588dcb3b 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -59,10 +59,8 @@ icon = 'icons/obj/rollerbed.dmi' icon_state = "down" anchored = 0 - var/const/buckled_pixel_y_offset = 6 //Mobs buckled will have their pixel_y offset by this much - -/obj/structure/stool/bed/roller/post_buckle_mob(mob/M) +/obj/structure/stool/bed/roller/post_buckle_mob(mob/living/M) if(M == buckled_mob) density = 1 icon_state = "up" @@ -72,7 +70,7 @@ icon_state = "down" M.pixel_y = initial(M.pixel_y) if(M.lying) - M.pixel_y -= buckled_pixel_y_offset + M.pixel_y = M.lying_pixel_offset /obj/item/roller diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index da83251d5ce..ccc42c33a0a 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -12,6 +12,7 @@ ventcrawler = 2 languages = ALIEN verb_say = "hisses" + lying_pixel_offset = 0 var/nightvision = 1 var/storedPlasma = 250 var/max_plasma = 500 diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm index 98067011363..4ace45627ab 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm @@ -54,6 +54,7 @@ /mob/living/carbon/alien/humanoid/hunter/proc/toggle_leap(var/message = 1) leap_on_click = !leap_on_click leap_icon.icon_state = "leap_[leap_on_click ? "on":"off"]" + update_icons() if(message) src << "You will now [leap_on_click ? "leap at":"slash at"] enemies!" else diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index 1f96e677eaf..2afddf617fa 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -22,3 +22,5 @@ var/co2overloadtime = null var/temperature_resistance = T0C+75 + + lying_pixel_offset = -6 //offset for pixel_y when lying down. diff --git a/code/modules/mob/living/carbon/update_icons.dm b/code/modules/mob/living/carbon/update_icons.dm index 49d0e2a8296..1136f3533bb 100644 --- a/code/modules/mob/living/carbon/update_icons.dm +++ b/code/modules/mob/living/carbon/update_icons.dm @@ -15,7 +15,7 @@ else //if(lying != 0) if(lying_prev == 0) //Standing to lying pixel_y = initial(pixel_y) - final_pixel_y -= 6 + final_pixel_y = lying_pixel_offset 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 8ad4fa5796c..2435b21d701 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -323,6 +323,7 @@ Sorry Giacom. Please don't be mad :( else if(alert(src, "You sure you want to sleep for a while?", "Sleep", "Yes", "No") == "Yes") usr.sleeping = 20 //Short nap + update_canmove() /mob/proc/get_contents() @@ -332,6 +333,7 @@ Sorry Giacom. Please don't be mad :( resting = !resting src << "You are now [resting ? "resting" : "getting up"]." + update_canmove() //Recursive function to find everything a mob is holding. /mob/living/get_contents(var/obj/item/weapon/storage/Storage = null) @@ -777,7 +779,10 @@ Sorry Giacom. Please don't be mad :( animate(src, pixel_y = pixel_y + 2, time = 10, loop = -1) floating = 1 else if(!on && floating) - animate(src, pixel_y = initial(pixel_y), time = 10) + var/final_pixel_y = initial(pixel_y) + if(lying && !buckled) + final_pixel_y = lying_pixel_offset + animate(src, pixel_y = final_pixel_y, time = 10) floating = 0 //called when the mob receives a bright flash @@ -840,9 +845,12 @@ Sorry Giacom. Please don't be mad :( return -/atom/movable/proc/do_attack_animation(atom/A) +/atom/movable/proc/do_attack_animation(atom/A, end_pixel_y) var/pixel_x_diff = 0 var/pixel_y_diff = 0 + var/final_pixel_y = initial(pixel_y) + if(end_pixel_y) + final_pixel_y = end_pixel_y var/direction = get_dir(src, A) switch(direction) if(NORTH) @@ -865,20 +873,27 @@ Sorry Giacom. Please don't be mad :( if(SOUTHWEST) pixel_x_diff = -8 pixel_y_diff = -8 + animate(src, pixel_x = pixel_x + pixel_x_diff, pixel_y = pixel_y + pixel_y_diff, time = 2) - animate(pixel_x = initial(pixel_x), pixel_y = initial(pixel_y), time = 2) + animate(pixel_x = initial(pixel_x), pixel_y = final_pixel_y, time = 2) /mob/living/do_attack_animation(atom/A) - ..() + var/final_pixel_y = initial(pixel_y) + if(lying && !buckled) + final_pixel_y = lying_pixel_offset + ..(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(). /mob/living/proc/do_jitter_animation(jitteriness) 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 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 = initial(pixel_y) , time = 2) + animate(pixel_x = initial(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) diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index f949030014d..a9e6d1863c4 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -42,4 +42,6 @@ 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() \ No newline at end of file + var/list/image/staticOverlays = list() + + var/lying_pixel_offset = 0 //offset for pixel_y when the mob is lying down. \ No newline at end of file