Giving simple_animal their own version of update_canmove(). This fixes small animals' density being always set to 1 by life().

Fixes pixel y shift when lying down as an alien.
Removes the no longer needed slime/update_icons.dm
Fixes alien icon var being reset to its initial value during every life(). I added an alt_icon var to aliens to achieve that.
Fixes alien humanoid no using the unconscious icon instead of their sleeping icon when sleeping.
This commit is contained in:
phil235
2015-03-30 22:11:05 +02:00
parent 0cef9e5539
commit 314e9424ae
7 changed files with 24 additions and 19 deletions
@@ -4,6 +4,7 @@
var/obj/item/r_store = null
var/obj/item/l_store = null
var/caste = ""
var/alt_icon = 'icons/mob/alienleap.dmi' //used to switch between the two alien icon files.
var/leap_on_click = 0
var/pounce_cooldown = 0
var/pounce_cooldown_time = 30
@@ -19,18 +19,15 @@
//If we mostly took damage from fire
if(fireloss > 125)
icon_state = "alien[caste]_husked"
pixel_y = 0
else
icon_state = "alien[caste]_dead"
pixel_y = 0
else if(stat == UNCONSCIOUS || weakened)
else if((stat == UNCONSCIOUS && !sleeping) || weakened)
icon_state = "alien[caste]_unconscious"
pixel_y = 0
else if(leap_on_click)
icon_state = "alien[caste]_pounce"
else if(lying || resting)
else if(lying || resting || sleeping)
icon_state = "alien[caste]_sleep"
else if(m_intent == "run")
icon_state = "alien[caste]_running"
@@ -38,17 +35,21 @@
icon_state = "alien[caste]_s"
if(leaping)
icon = 'icons/mob/alienleap.dmi'
var/old_icon = icon
icon = alt_icon
alt_icon = old_icon
icon_state = "alien[caste]_leap"
pixel_x = -32
pixel_y = -32
else
icon = initial(icon)
if(alt_icon != initial(alt_icon))
var/old_icon = icon
icon = alt_icon
alt_icon = old_icon
pixel_x = initial(pixel_x)
pixel_y = initial(pixel_y)
/mob/living/carbon/alien/humanoid/regenerate_icons()
..()
if (notransform) return
@@ -63,8 +64,9 @@
/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()
..()
update_icons()
/mob/living/carbon/alien/humanoid/update_hud()
@@ -7,7 +7,6 @@
var/final_pixel_y = pixel_y
var/final_dir = dir
var/changed = 0
if(lying != lying_prev)
changed++
ntransform.TurnTo(lying_prev,lying)
@@ -381,7 +381,6 @@
icon_state = icon_dead
stat = DEAD
density = 0
lying = 1
if(!gibbed)
visible_message("<span class='danger'>\the [src] stops moving...</span>")
..()
@@ -426,8 +425,7 @@
/mob/living/simple_animal/revive()
health = maxHealth
icon_state = icon_living
lying = 0
density = 1
density = initial(density)
update_canmove()
..()
@@ -478,3 +476,12 @@
return
else
..()
/mob/living/simple_animal/update_canmove()
if(paralysis || stunned || weakened || stat || resting || buckled)
drop_r_hand()
drop_l_hand()
canmove = 0
else
canmove = 1
return canmove
@@ -1,4 +0,0 @@
//no special icon processing
/mob/living/simple_animal/slime/update_transform() //They're slimes, they don't lie down.
return
+1 -1
View File
@@ -771,7 +771,7 @@ var/list/slot_equipment_priority = list( \
//Updates canmove, lying and icons. Could perhaps do with a rename but I can't think of anything to describe it.
//Robots and brains have their own version so don't worry about them
//Robots, animals and brains have their own version so don't worry about them
/mob/proc/update_canmove()
var/ko = weakened || paralysis || stat || (status_flags & FAKEDEATH)
var/buckle_lying = !(buckled && !buckled.buckle_lying)