Updates Swarmers: Fixes Swarmer Megafauna (#12516)

This commit is contained in:
Fox McCloud
2019-10-08 20:57:39 -04:00
committed by variableundefined
parent 167773d6ee
commit e884e76445
4 changed files with 269 additions and 142 deletions
@@ -83,6 +83,17 @@
if(!bee_syndicate && !beehome)
. += "<span class='warning'>This bee is homeless!</span>"
/mob/living/simple_animal/hostile/poison/bees/ListTargets() // Bee processing is expessive, so we override them finding targets here.
if(!search_objects) //In case we want to have purely hostile bees
return ..()
else
. = list() // The following code is only very slightly slower than just returning oview(vision_range, targets_from), but it saves us much more work down the line
var/list/searched_for = oview(vision_range, targets_from)
for(var/obj/A in searched_for)
. += A
for(var/mob/A in searched_for)
. += A
/mob/living/simple_animal/hostile/poison/bees/proc/generate_bee_visuals()
overlays.Cut()
@@ -137,11 +137,7 @@
if(can_see(targets_from, HM, vision_range))
. += HM
else
. = list() // The following code is only very slightly slower than just returning oview(vision_range, targets_from), but it saves us much more work down the line, particularly when bees are involved
for(var/obj/A in oview(vision_range, targets_from))
. += A
for(var/mob/A in oview(vision_range, targets_from))
. += A
. = oview(vision_range, targets_from)
/mob/living/simple_animal/hostile/proc/FindTarget(var/list/possible_targets, var/HasTargetsList = 0)//Step 2, filter down possible targets to things we actually care about
. = list()