refactors mice

This commit is contained in:
Fox McCloud
2019-08-30 22:02:41 -04:00
parent 12345d178b
commit 97ff6bb33c
3 changed files with 19 additions and 26 deletions
@@ -57,27 +57,21 @@
/mob/living/simple_animal/mouse/handle_automated_speech()
..()
if(prob(speak_chance))
if(prob(speak_chance) && !incapacitated())
for(var/mob/M in view())
M << squeak_sound
SEND_SOUND(M, squeak_sound)
/mob/living/simple_animal/mouse/Life(seconds, times_fired)
. = ..()
if(stat == UNCONSCIOUS)
if(ckey || prob(1))
stat = CONSCIOUS
icon_state = "mouse_[mouse_color]"
wander = 1
else if(prob(5))
emote("snuffles")
/mob/living/simple_animal/mouse/Life()
..()
if(!stat && prob(0.5) && !ckey)
stat = UNCONSCIOUS
icon_state = "mouse_[mouse_color]_sleep"
wander = 0
speak_chance = 0
if(.) // Alive
if(!ckey)
if(resting)
if(prob(1))
StopResting()
else if(prob(5))
custom_emote(2, "snuffles")
else if(prob(0.5))
StartResting()
/mob/living/simple_animal/mouse/New()
..()
@@ -222,7 +222,7 @@
if(isspacepod(the_target))
var/obj/spacepod/S = the_target
if(S.pilot)//Just so we don't attack empty mechs
if(S.pilot)//Just so we don't attack empty pods
if(CanAttack(S.pilot))
return TRUE
@@ -143,16 +143,15 @@
health = Clamp(health, 0, maxHealth)
med_hud_set_status()
/mob/living/simple_animal/lay_down()
/mob/living/simple_animal/StartResting(updating = 1)
..()
handle_resting_state_icons()
if(icon_resting && stat != DEAD)
icon_state = icon_resting
/mob/living/simple_animal/proc/handle_resting_state_icons()
if(icon_resting)
if(resting && stat != DEAD)
icon_state = icon_resting
else if(stat != DEAD)
icon_state = icon_living
/mob/living/simple_animal/StopResting(updating = 1)
..()
if(icon_resting && stat != DEAD)
icon_state = icon_living
/mob/living/simple_animal/update_stat(reason = "none given")
if(status_flags & GODMODE)