- Fixed retaliating simple animals acting weird and added some minor improvements. They should act better to mechs.

- Decreased the amount of possible chickens you can get from the crate.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5577 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
giacomand@gmail.com
2013-01-18 19:54:00 +00:00
parent 569378878d
commit 95392cae87
4 changed files with 53 additions and 28 deletions
@@ -17,7 +17,7 @@
response_help = "pets the"
response_disarm = "gently pushes aside the"
response_harm = "kicks the"
faction = "neutral"
faction = "goat"
attacktext = "kicks"
health = 40
melee_damage_lower = 1
@@ -31,23 +31,26 @@
/mob/living/simple_animal/hostile/retaliate/goat/Life()
. = ..()
if(.)//chance to go crazy and start wacking stuff
if(prob(1))
src.visible_message("\red [src] gets an evil-looking gleam in their eye.")
faction = "hostile"
if(faction == "hostile" && prob(10))
faction = "neutral"
if(.)
//chance to go crazy and start wacking stuff
if(!enemies.len && prob(1))
Retaliate()
if(enemies.len && prob(10))
enemies = list()
stance = HOSTILE_STANCE_IDLE
target_mob = null
LoseTarget()
src.visible_message("\blue [src] calms down.")
if(stat == CONSCIOUS)
if(udder && prob(5))
udder.add_reagent("milk", rand(5, 10))
if(locate(/obj/effect/spacevine) in loc)
var/obj/effect/spacevine/SV = locate(/obj/effect/spacevine) in loc
del(SV)
if(prob(10))
say("Nom")
if(!pulledby)
for(var/direction in shuffle(list(1,2,4,8,5,6,9,10)))
var/step = get_step(src, direction)
@@ -55,6 +58,10 @@
if(locate(/obj/effect/spacevine) in step)
Move(step)
/mob/living/simple_animal/hostile/retaliate/goat/Retaliate()
..()
src.visible_message("\red [src] gets an evil-looking gleam in their eye.")
/mob/living/simple_animal/hostile/retaliate/goat/Move()
..()
if(!stat)
@@ -18,8 +18,9 @@
stop_automated_movement = 0
for(var/atom/A in ListTargets())
T = Found(A)
if(T)
var/atom/F = Found(A)
if(F)
T = F
break
if(isliving(A))
@@ -4,29 +4,46 @@
/mob/living/simple_animal/hostile/retaliate/Found(var/atom/A)
if(isliving(A))
var/mob/living/L = A
if(L in enemies)
if(!L.stat)
stance = HOSTILE_STANCE_ATTACK
return L
else
enemies -= L
if(!L.stat)
stance = HOSTILE_STANCE_ATTACK
return L
else
enemies -= L
else if(istype(A, /obj/mecha))
var/obj/mecha/M = A
if(M.occupant)
stance = HOSTILE_STANCE_ATTACK
return A
/mob/living/simple_animal/hostile/retaliate/ListTargets()
if(!enemies.len)
return list()
var/list/see = ..()
see &= enemies // Remove all entries that aren't in enemies
return see
/mob/living/simple_animal/hostile/retaliate/proc/retaliate()
/mob/living/simple_animal/hostile/retaliate/proc/Retaliate()
..()
var/list/mobs_around = viewers(src, 7)
var/list/around = view(src, 7)
for(var/mob/living/M in mobs_around)
if(M == src)
for(var/atom/movable/A in around)
if(A == src)
continue
if(!attack_same && M.faction != faction)
enemies += M
if(isliving(A))
var/mob/living/M = A
if(!attack_same && M.faction != faction)
enemies |= M
else if(istype(A, /obj/mecha))
var/obj/mecha/M = A
if(M.occupant)
enemies |= M
enemies |= M.occupant
for(var/mob/living/simple_animal/hostile/retaliate/H in mobs_around)
for(var/mob/living/simple_animal/hostile/retaliate/H in around)
if(!attack_same && !H.attack_same && H.faction == faction)
H.enemies += enemies
H.enemies |= enemies
return 0
/mob/living/simple_animal/hostile/retaliate/adjustBruteLoss(var/damage)
..(damage)
retaliate()
Retaliate()