Slow your roll, turrets

This commit is contained in:
Aronai Sieyes
2020-03-30 12:03:39 -04:00
parent 776b3e4945
commit edd91313a8
2 changed files with 13 additions and 35 deletions

View File

@@ -1,38 +1,3 @@
/atom/movable/proc/get_mob()
return
/obj/mecha/get_mob()
return occupant
/obj/vehicle/train/get_mob()
return buckled_mobs
/mob/get_mob()
return src
/mob/living/bot/mulebot/get_mob()
if(load && istype(load, /mob/living))
return list(src, load)
return src
/proc/mobs_in_view(var/range, var/source)
var/list/mobs = list()
for(var/atom/movable/AM in view(range, source))
var/M = AM.get_mob()
if(M)
mobs += M
return mobs
/proc/mobs_in_xray_view(var/range, var/source)
var/list/mobs = list()
for(var/atom/movable/AM in orange(range, source))
var/M = AM.get_mob()
if(M)
mobs += M
return mobs
proc/random_hair_style(gender, species = SPECIES_HUMAN)
var/h_style = "Bald"

View File

@@ -701,8 +701,21 @@
var/list/targets = list() //list of primary targets
var/list/secondarytargets = list() //targets that are least important
var/list/seenturfs = list()
for(var/turf/T in oview(world.view, src))
seenturfs += T
for(var/mob in player_list)
var/mob/M = mob
if(M.z != z) //Skip
continue
if(get_turf(M) in seenturfs)
assess_and_assign(mob, targets, secondarytargets)
/* This was dumb. Why do this and then check line of sight later?
for(var/mob/M in mobs_in_xray_view(world.view, src))
assess_and_assign(M, targets, secondarytargets)
*/
if(!tryToShootAt(targets))
if(!tryToShootAt(secondarytargets)) // if no valid targets, go for secondary targets