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
This commit is contained in:
baloh.matevz
2011-09-10 16:43:28 +00:00
parent c4ac6d6010
commit e74922a985
2 changed files with 24 additions and 13 deletions
+23 -13
View File
@@ -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))