From e74922a985bc0749aa79502f9d86d80f422353ed Mon Sep 17 00:00:00 2001 From: "baloh.matevz" Date: Sat, 10 Sep 2011 16:43:28 +0000 Subject: [PATCH] Simple animals update (At the moment only effects the corgi ingame): - Hud removed from simple animals, so if you move from human to a simple animals, your HUD will properly update - Stat for dead and alive now properly updated - Fixed animals randomly leaving closed containers such as closets or the dna pod - Animals can now be buckled. They will not randomly move if bucked or if they have the resting variable set - Bumping follows the same rules as above, it should also now work properly - Harm intent message shown in red instead of blue git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2169 316c924e-a436-60f5-8080-3fe189b3f50e --- code/defines/mob/simple_animal/life.dm | 36 ++++++++++++++++---------- icons/changelog.html | 1 + 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/code/defines/mob/simple_animal/life.dm b/code/defines/mob/simple_animal/life.dm index 8abed85fe21..b3dbe6238af 100644 --- a/code/defines/mob/simple_animal/life.dm +++ b/code/defines/mob/simple_animal/life.dm @@ -1,4 +1,5 @@ /mob/living/simple_animal + name = "animal" var/icon_living = "" var/icon_dead = "" var/max_health = 20 @@ -54,14 +55,14 @@ turns_per_move = 5 meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat/corgi meat_amount = 3 - response_help = "pats the" + response_help = "pets the" response_disarm = "getnly pushes aside the" response_harm = "kicks the" /mob/living/simple_animal/corgi/Ian name = "Ian" desc = "It's Ian, what else do you need to know?" - response_help = "pats" + response_help = "pets" response_disarm = "getnly pushes aside" response_harm = "kicks" @@ -69,6 +70,10 @@ ..() verbs -= /mob/verb/observe +/mob/living/simple_animal/Login() + if(src && src.client) + src.client.screen = null + /mob/living/simple_animal/Life() //Health @@ -76,11 +81,13 @@ if(health > 0) icon_state = icon_living alive = 1 + stat = 0 //Alive - conscious return if(health < 1) alive = 0 icon_state = icon_dead + stat = 2 //Dead return if(health > max_health) @@ -88,10 +95,11 @@ //Movement if(!ckey) - turns_since_move++ - if(turns_since_move >= turns_per_move) - Move(get_step(src,pick(cardinal))) - turns_since_move = 0 + if(isturf(src.loc) && !resting && !buckled) //This is so it only moves if it's not inside a closet, gentics machine, etc. + turns_since_move++ + if(turns_since_move >= turns_per_move) + Move(get_step(src,pick(cardinal))) + turns_since_move = 0 //Speaking if(speak_chance) @@ -182,12 +190,14 @@ health -= unsuitable_atoms_damage /mob/living/simple_animal/Bumped(AM as mob|obj) - if(ismob(AM)) - //var/newamloc = src.loc - src.loc = AM:loc - //AM:loc = newamloc - else - ..() + if(!AM) return + if(isturf(src.loc) && !resting && !buckled) + if(ismob(AM)) + var/newamloc = src.loc + src.loc = AM:loc + AM:loc = newamloc + else + ..() /mob/living/simple_animal/gib() if(meat_amount && meat_type) @@ -242,7 +252,7 @@ health -= harm_intent_damage for(var/mob/O in viewers(src, null)) if ((O.client && !( O.blinded ))) - O.show_message("\blue [M] [response_harm] [src]") + O.show_message("\red [M] [response_harm] [src]") if ("disarm") for(var/mob/O in viewers(src, null)) diff --git a/icons/changelog.html b/icons/changelog.html index 92c501e5113..3f04a5116c0 100644 --- a/icons/changelog.html +++ b/icons/changelog.html @@ -58,6 +58,7 @@ should be listed in the changelog upon commit tho. Thanks. -->
  • Errorage updated:
  • Lasty updated: