diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 5b561406f23..df4737591a9 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -128,3 +128,5 @@ #define LIGHT_COLOR_PINK "#FF33CC" #define LIGHT_COLOR_WHITE "#FFFFFF" + +#define RESIZE_DEFAULT_SIZE 1 \ No newline at end of file diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm index ecfb45eaa8b..194e64100e2 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm @@ -26,18 +26,17 @@ large = 1 /mob/living/carbon/alien/humanoid/sentinel/large/update_icons() - lying_prev = lying //so we don't update overlays for lying/standing unless our stance changes again update_hud() //TODO: remove the need for this to be here overlays.Cut() - if(lying) - if(resting) icon_state = "prat_sleep" - else icon_state = "prat_l" - for(var/image/I in overlays_lying) - overlays += I + if(stat == DEAD) + icon_state = "prat_dead" + else if(stat == UNCONSCIOUS || lying || resting) + icon_state = "prat_sleep" else icon_state = "prat_s" - for(var/image/I in overlays_standing) - overlays += I + + for(var/image/I in overlays_standing) + overlays += I /mob/living/carbon/alien/humanoid/sentinel/New() var/datum/reagents/R = new/datum/reagents(100) diff --git a/code/modules/mob/living/carbon/alien/humanoid/empress.dm b/code/modules/mob/living/carbon/alien/humanoid/empress.dm index 6e10ad90d9c..6d20f4e1e45 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/empress.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/empress.dm @@ -20,18 +20,19 @@ pixel_x = -32 /mob/living/carbon/alien/humanoid/empress/large/update_icons() - lying_prev = lying //so we don't update overlays for lying/standing unless our stance changes again + update_hud() //TODO: remove the need for this to be here overlays.Cut() - if(lying) - if(resting) icon_state = "empress_sleep" - else icon_state = "empress_l" - for(var/image/I in overlays_lying) - overlays += I + + if(stat == DEAD) + icon_state = "empress_dead" + else if(stat == UNCONSCIOUS || lying || resting) + icon_state = "empress_sleep" else icon_state = "empress_s" - for(var/image/I in overlays_standing) - overlays += I + + for(var/image/I in overlays_standing) + overlays += I /mob/living/carbon/alien/humanoid/empress/New() var/datum/reagents/R = new/datum/reagents(100) diff --git a/code/modules/mob/living/carbon/alien/humanoid/queen.dm b/code/modules/mob/living/carbon/alien/humanoid/queen.dm index c90ba2c2b58..eb32d6b974f 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/queen.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/queen.dm @@ -78,18 +78,18 @@ large = 1 /mob/living/carbon/alien/humanoid/queen/large/update_icons() - lying_prev = lying //so we don't update overlays for lying/standing unless our stance changes again update_hud() //TODO: remove the need for this to be here overlays.Cut() - if(lying) - if(resting) icon_state = "queen_sleep" - else icon_state = "queen_l" - for(var/image/I in overlays_lying) - overlays += I + + if(stat == DEAD) + icon_state = "queen_dead" + else if(stat == UNCONSCIOUS || lying || resting) + icon_state = "queen_sleep" else icon_state = "queen_s" - for(var/image/I in overlays_standing) - overlays += I + + for(var/image/I in overlays_standing) + overlays += I /* 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 e9e4fd88608..549b2ce6c93 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm @@ -9,7 +9,6 @@ ///////////////////////////////// /mob/living/carbon/alien/humanoid - var/list/overlays_lying[X_TOTAL_LAYERS] var/list/overlays_standing[X_TOTAL_LAYERS] /mob/living/carbon/alien/humanoid/update_icons() @@ -63,7 +62,13 @@ update_hud() update_icons() update_fire() + update_transform() +/mob/living/carbon/alien/humanoid/update_transform() //The old method of updating lying/standing was update_icons(). Aliens still expect that. + if(lying > 0) + lying = 90 //Anything else looks retarded + ..() + update_icons() /mob/living/carbon/alien/humanoid/update_hud() @@ -74,32 +79,24 @@ client.screen |= contents /mob/living/carbon/alien/humanoid/update_fire() - overlays -= overlays_lying[X_FIRE_LAYER] overlays -= overlays_standing[X_FIRE_LAYER] if(on_fire) - overlays_lying[X_FIRE_LAYER] = image("icon"='icons/mob/OnFire.dmi', "icon_state"="Lying", "layer"= -X_FIRE_LAYER) overlays_standing[X_FIRE_LAYER] = image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing", "layer"= -X_FIRE_LAYER) - if(src.lying) - overlays += overlays_lying[X_FIRE_LAYER] - else - overlays += overlays_standing[X_FIRE_LAYER] + overlays += overlays_standing[X_FIRE_LAYER] return else - overlays_lying[X_FIRE_LAYER] = null overlays_standing[X_FIRE_LAYER] = null /mob/living/carbon/alien/humanoid/update_inv_wear_suit(var/update_icons=1) if(wear_suit) var/t_state = wear_suit.item_state if(!t_state) t_state = wear_suit.icon_state - var/image/lying = image("icon" = 'icons/mob/mob.dmi', "icon_state" = "[t_state]2") var/image/standing = image("icon" = 'icons/mob/mob.dmi', "icon_state" = "[t_state]") if(wear_suit.blood_DNA) var/t_suit = "suit" if( istype(wear_suit, /obj/item/clothing/suit/armor) ) t_suit = "armor" - lying.overlays += image("icon" = 'icons/effects/blood.dmi', "icon_state" = "[t_suit]blood2") standing.overlays += image("icon" = 'icons/effects/blood.dmi', "icon_state" = "[t_suit]blood") //TODO @@ -109,10 +106,8 @@ drop_r_hand() drop_l_hand() - overlays_lying[X_SUIT_LAYER] = lying overlays_standing[X_SUIT_LAYER] = standing else - overlays_lying[X_SUIT_LAYER] = null overlays_standing[X_SUIT_LAYER] = null if(update_icons) update_icons() @@ -121,16 +116,12 @@ if (head) var/t_state = head.item_state if(!t_state) t_state = head.icon_state - var/image/lying = image("icon" = 'icons/mob/mob.dmi', "icon_state" = "[t_state]2") var/image/standing = image("icon" = 'icons/mob/mob.dmi', "icon_state" = "[t_state]") if(head.blood_DNA) - lying.overlays += image("icon" = 'icons/effects/blood.dmi', "icon_state" = "helmetblood2") standing.overlays += image("icon" = 'icons/effects/blood.dmi', "icon_state" = "helmetblood") head.screen_loc = ui_alien_head - overlays_lying[X_HEAD_LAYER] = lying overlays_standing[X_HEAD_LAYER] = standing else - overlays_lying[X_HEAD_LAYER] = null overlays_standing[X_HEAD_LAYER] = null if(update_icons) update_icons() @@ -164,12 +155,10 @@ //Call when target overlay should be added/removed /mob/living/carbon/alien/humanoid/update_targeted(var/update_icons=1) if (targeted_by && target_locked) - overlays_lying[TARGETED_LAYER] = target_locked overlays_standing[TARGETED_LAYER] = target_locked else if (!targeted_by && target_locked) del(target_locked) if (!targeted_by) - overlays_lying[TARGETED_LAYER] = null overlays_standing[TARGETED_LAYER] = null if(update_icons) update_icons() diff --git a/code/modules/mob/living/carbon/alien/larva/update_icons.dm b/code/modules/mob/living/carbon/alien/larva/update_icons.dm index 3ab3fb3b382..104811c4fc1 100644 --- a/code/modules/mob/living/carbon/alien/larva/update_icons.dm +++ b/code/modules/mob/living/carbon/alien/larva/update_icons.dm @@ -12,11 +12,14 @@ if(stat == DEAD) icon_state = "larva[state]_dead" - else if (handcuffed || legcuffed) + else if (handcuffed || legcuffed) //This should be an overlay. Who made this an icon_state? icon_state = "larva[state]_cuff" + else if(stat == UNCONSCIOUS || lying || resting) + icon_state = "larva[state]_sleep" else if (stunned) icon_state = "larva[state]_stun" - else if(lying || resting) - icon_state = "larva[state]_sleep" else icon_state = "larva[state]" + +/mob/living/carbon/alien/larva/update_transform() //All this is handled in update_icons() + return update_icons() \ No newline at end of file diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 92c166ecbf5..f128416eb03 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -661,4 +661,11 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump, return 0 /mob/living/carbon/is_muzzled() - return(istype(src.wear_mask, /obj/item/clothing/mask/muzzle)) \ No newline at end of file + return(istype(src.wear_mask, /obj/item/clothing/mask/muzzle)) + +/mob/living/carbon/get_standard_pixel_y_offset(lying = 0) + if(lying) + if(buckled) return initial(pixel_y) + return -6 + else + return initial(pixel_y) \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 7361b4b5a75..ac83f3115d4 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -153,16 +153,15 @@ Please contact me on #coderbus IRC. ~Carn x //this proc is messy as I was forced to include some old laggy cloaking code to it so that I don't break cloakers //I'll work on removing that stuff by rewriting some of the cloaking stuff at a later date. /mob/living/carbon/human/update_icons() - lying_prev = lying //so we don't update overlays for lying/standing unless our stance changes again + update_hud() //TODO: remove the need for this - overlays.Cut() var/stealth = 0 - //cloaking devices. //TODO: get rid of this :< for(var/obj/item/weapon/cloaking_device/S in list(l_hand,r_hand,belt,l_store,r_store)) if(S.active) stealth = 1 break + if(stealth) icon = 'icons/mob/human.dmi' icon_state = "body_cloaked" @@ -172,17 +171,13 @@ Please contact me on #coderbus IRC. ~Carn x if(istype(I)) overlays += I else icon = stand_icon - for(var/image/I in overlays_standing) - overlays += I - if(lying) - var/matrix/M = matrix() - M.Turn(90) - M.Translate(1,-6) - src.transform = M - else - var/matrix/M = matrix() - src.transform = M + if(overlays.len != overlays_standing.len) + overlays.Cut() + for(var/thing in overlays_standing) + if(thing) overlays += thing + + update_transform() var/global/list/damage_icon_parts = list() diff --git a/code/modules/mob/living/carbon/update_icons.dm b/code/modules/mob/living/carbon/update_icons.dm new file mode 100644 index 00000000000..02fe01c39a1 --- /dev/null +++ b/code/modules/mob/living/carbon/update_icons.dm @@ -0,0 +1,31 @@ +//LOOK G-MA, I'VE JOINED CARBON PROCS THAT ARE IDENTICAL IN ALL CASES INTO ONE PROC, I'M BETTER THAN LIFE() +//I thought about mob/living but silicons and simple_animals don't want this just yet. +//Right now just handles lying down, but could handle other cases later. +//IMPORTANT: Multiple animate() calls do not stack well, so try to do them all at once if you can. +/mob/living/carbon/update_transform() + var/matrix/ntransform = matrix(transform) //aka transform.Copy() + var/final_pixel_y = pixel_y + var/final_dir = dir + var/changed = 0 + if(lying != lying_prev) + changed++ + ntransform.TurnTo(lying_prev,lying) + if(lying == 0) //Lying to standing + final_pixel_y = get_standard_pixel_y_offset() + else //if(lying != 0) + if(lying_prev == 0) //Standing to lying + 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 + + lying_prev = lying //so we don't try to animate until there's been another change. + + if(resize != RESIZE_DEFAULT_SIZE) + changed++ + ntransform.Scale(resize) + resize = RESIZE_DEFAULT_SIZE + + if(changed) + animate(src, transform = ntransform, time = 2, pixel_y = final_pixel_y, dir = final_dir, easing = EASE_IN|EASE_OUT) + floating = 0 // If we were without gravity, the bouncing animation got stopped, so we make sure we restart it in next life(). \ No newline at end of file diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 3c5c9b62a15..9dfe7d8d725 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -892,3 +892,9 @@ 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) floating = 0 // If we were without gravity, the bouncing animation got stopped, so we make sure we restart the bouncing after the next movement. + +/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) \ No newline at end of file diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 861df0c1c38..5d6b03d03ab 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -490,6 +490,18 @@ /mob/living/simple_animal/update_fire() return +/mob/living/simple_animal/update_transform() + var/matrix/ntransform = matrix(transform) //aka transform.Copy() + var/changed = 0 + + if(resize != RESIZE_DEFAULT_SIZE) + changed++ + ntransform.Scale(resize) + resize = RESIZE_DEFAULT_SIZE + + if(changed) + animate(src, transform = ntransform, time = 2, easing = EASE_IN|EASE_OUT) + /mob/living/simple_animal/revive() ..() health = maxHealth diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 0d766fa162b..db1fda16915 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1057,7 +1057,7 @@ var/list/slot_equipment_priority = list( \ if(istype(buckled, /obj/vehicle)) var/obj/vehicle/V = buckled if(stat || weakened || paralysis || resting || sleeping || (status_flags & FAKEDEATH)) - lying = 1 + lying = 90 canmove = 0 pixel_y = V.mob_offset_y - 5 else @@ -1070,13 +1070,13 @@ var/list/slot_equipment_priority = list( \ if( istype(buckled,/obj/structure/stool/bed/chair) ) lying = 0 else - lying = 1 + lying = 90 else if(buckled && is_movable) anchored = 0 canmove = 1 lying = 0 else if( stat || weakened || paralysis || resting || sleeping || (status_flags & FAKEDEATH)) - lying = 1 + lying = 90 canmove = 0 else if( stunned ) canmove = 0 @@ -1102,9 +1102,8 @@ var/list/slot_equipment_priority = list( \ if(update_icon) //forces a full overlay update update_icon = 0 regenerate_icons() - else if( lying != lying_prev ) - update_icons() - + update_transform() + lying_prev = lying return canmove /mob/proc/fall(var/forced) diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 583075472e0..394d098fdc8 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -232,3 +232,5 @@ var/list/active_genes=list() var/last_movement = -100 // Last world.time the mob actually moved of its own accord. + + var/resize = 1 //Badminnery resize \ No newline at end of file diff --git a/code/modules/mob/update_icons.dm b/code/modules/mob/update_icons.dm index ef0c3461fd7..0362ffa6097 100644 --- a/code/modules/mob/update_icons.dm +++ b/code/modules/mob/update_icons.dm @@ -69,3 +69,6 @@ mob/proc/update_inv_wear_pda() /mob/proc/update_targeted() return + +/mob/proc/update_transform() + return \ No newline at end of file diff --git a/icons/mob/alien.dmi b/icons/mob/alien.dmi index a5e120020a2..71ec10e420b 100644 Binary files a/icons/mob/alien.dmi and b/icons/mob/alien.dmi differ diff --git a/icons/mob/alienhuge.dmi b/icons/mob/alienhuge.dmi index 93eae9e1ec8..0ebb470822e 100644 Binary files a/icons/mob/alienhuge.dmi and b/icons/mob/alienhuge.dmi differ diff --git a/icons/mob/alienlarge.dmi b/icons/mob/alienlarge.dmi index 340eba5337f..d6726914c20 100644 Binary files a/icons/mob/alienlarge.dmi and b/icons/mob/alienlarge.dmi differ diff --git a/paradise.dme b/paradise.dme index 7d95b27c84f..f8c265f4d4a 100644 --- a/paradise.dme +++ b/paradise.dme @@ -1256,6 +1256,7 @@ #include "code\modules\mob\living\carbon\life.dm" #include "code\modules\mob\living\carbon\shock.dm" #include "code\modules\mob\living\carbon\superheroes.dm" +#include "code\modules\mob\living\carbon\update_icons.dm" #include "code\modules\mob\living\carbon\alien\alien.dm" #include "code\modules\mob\living\carbon\alien\alien_defenses.dm" #include "code\modules\mob\living\carbon\alien\death.dm"