Merge pull request #8968 from phil235/AlienNestPixelFix

Fix for alien nest and alien pixel shift
This commit is contained in:
Cheridan
2015-04-16 20:36:44 -05:00
14 changed files with 62 additions and 34 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
@@ -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)
@@ -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
@@ -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
@@ -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)
@@ -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()
..()
+6
View File
@@ -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)
@@ -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
@@ -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
+11 -10
View File
@@ -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)
@@ -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()
+6
View File
@@ -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