mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
- 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:
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user