- Removed the 'alive' variable from simple animals. It was redundant, since stat already tells that.

- Standardized critter proc declarations
- Added an AdjustBruteLocc() proc to simple animals
- Fixed the bug where simple animals would move when bumped, even when buckled
- Added space bears. They have some decently complex AI which revolves around stances, which include idle, alert, attack, attacking and tired. They are quite a fun little thing. Sprites were in code forever.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4153 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
baloh.matevz
2012-07-23 05:25:13 +00:00
parent 64ddd6d2d9
commit 6adacc576d
12 changed files with 392 additions and 39 deletions

View File

@@ -80,16 +80,8 @@
var/attack_speed = 25 // delay of attack
proc
patrol_step()
seek_target()
Die()
ChaseAttack()
RunAttack()
TakeDamage(var/damage = 0)
Target_Attacker(var/target)
Harvest(var/obj/item/weapon/W, var/mob/living/user)//Controls havesting things from dead critters
AfterAttack(var/mob/living/target)
proc/AfterAttack(var/mob/living/target)
return

View File

@@ -86,7 +86,7 @@
return
patrol_step()
proc/patrol_step()
var/moveto = locate(src.x + rand(-1,1),src.y + rand(-1, 1),src.z)
if (istype(moveto, /turf/simulated/floor) || istype(moveto, /turf/simulated/shuttle/floor) || istype(moveto, /turf/unsimulated/floor)) step_towards(src, moveto)
if(src.aggressive) seek_target()
@@ -114,7 +114,7 @@
M:loc = T
seek_target()
proc/seek_target()
src.anchored = 0
var/T = null
for(var/mob/living/C in view(src.seekrange,src))//TODO: mess with this
@@ -179,13 +179,13 @@
return
ChaseAttack()
proc/ChaseAttack()
for(var/mob/O in viewers(src, null))
O.show_message("\red <B>[src]</B> [src.angertext] at [src.target]!", 1)
return
RunAttack()
proc/RunAttack()
src.attacking = 1
if(ismob(src.target))

View File

@@ -42,7 +42,7 @@ Contains the procs that control attacking critters
O.show_message("\blue [user] touches [src]!", 1)
Target_Attacker(var/target)
proc/Target_Attacker(var/target)
if(!target) return
src.target = target
src.oldtarget_name = target:name
@@ -54,7 +54,7 @@ Contains the procs that control attacking critters
return
TakeDamage(var/damage = 0)
proc/TakeDamage(var/damage = 0)
var/tempdamage = (damage-armor)
if(tempdamage > 0)
src.health -= tempdamage
@@ -64,7 +64,7 @@ Contains the procs that control attacking critters
src.Die()
Die()
proc/Die()
if (!src.alive) return
src.icon_state += "-dead"
src.alive = 0
@@ -74,7 +74,7 @@ Contains the procs that control attacking critters
src.visible_message("<b>[src]</b> [deathtext]")
Harvest(var/obj/item/weapon/W, var/mob/living/user)
proc/Harvest(var/obj/item/weapon/W, var/mob/living/user)
if((!W) || (!user)) return 0
if(src.alive) return 0
return 1