Simple animals and turrets will now attack pods

This commit is contained in:
Markolie
2015-01-31 21:25:46 +01:00
parent 409dd8cfce
commit d9cf2a8bbe
6 changed files with 83 additions and 6 deletions
@@ -71,6 +71,9 @@
for(var/obj/mecha/M in mechas_list)
if(get_dist(M, src) <= vision_range && can_see(src, M, vision_range))
L += M
for(var/obj/spacepod/S in spacepods_list)
if(get_dist(S, src) <= vision_range && can_see(src, S, vision_range))
L += S
return L
/mob/living/simple_animal/hostile/proc/FindTarget()//Step 2, filter down possible targets to things we actually care about
@@ -131,6 +134,10 @@
var/obj/mecha/M = the_target
if(M.occupant)//Just so we don't attack empty mechs
return 1
if(istype(the_target, /obj/spacepod))
var/obj/spacepod/S = the_target
if(S.occupant || S.occupant2)//Just so we don't attack empty mechs
return 1
return 0
/mob/living/simple_animal/hostile/proc/GiveTarget(var/new_target)//Step 4, give us our selected target
@@ -14,6 +14,11 @@
if(M.occupant)
stance = HOSTILE_STANCE_ATTACK
return A
else if(istype(A, /obj/spacepod))
var/obj/spacepod/M = A
if(M.occupant || M.occupant2)
stance = HOSTILE_STANCE_ATTACK
return A
/mob/living/simple_animal/hostile/retaliate/ListTargets()
if(!enemies.len)
@@ -43,6 +48,11 @@
if(M.occupant)
enemies |= M
enemies |= M.occupant
else if(istype(A, /obj/spacepod))
var/obj/spacepod/M = A
if(M.occupant || M.occupant2)
enemies |= M
enemies |= M.occupant
for(var/mob/living/simple_animal/hostile/retaliate/H in around)
var/retaliate_faction_check = 0
@@ -468,6 +468,10 @@
var/obj/mecha/M = target
if (M.occupant)
return 0
if (istype(target,/obj/spacepod))
var/obj/spacepod/S = target
if (S.occupant || S.occupant2)
return 0
return 1
/mob/living/simple_animal/update_fire()
@@ -526,4 +530,8 @@
var/obj/mecha/M = the_target
if (M.occupant)
return 0
if (istype(the_target, /obj/spacepod))
var/obj/spacepod/S = the_target
if (S.occupant || S.occupant2)
return 0
return 1