The ashdrake won't enrage anymore if all lava arena targets have gone clientless or deleted. (#55507)

This commit is contained in:
Ghom
2020-12-26 18:58:10 +08:00
committed by GitHub
parent 318ed5ed7a
commit 781e84d235
@@ -207,21 +207,27 @@
SLEEP_CHECK_DEATH(10) // give them a bit of time to realize what attack is actually happening
var/list/turfs = RANGE_TURFS(2, center)
var/list/mobs_with_clients = list()
while(amount > 0)
var/list/empty = indestructible_turfs.Copy() // can't place safe turfs on turfs that weren't changed to be open
var/any_attack = 0
var/any_attack = FALSE
for(var/turf/T in turfs)
for(var/mob/living/L in T.contents)
if(L.client)
empty += pick(((RANGE_TURFS(2, L) - RANGE_TURFS(1, L)) & turfs) - empty) // picks a turf within 2 of the creature not outside or in the shield
any_attack = 1
any_attack = TRUE
mobs_with_clients |= L
for(var/obj/vehicle/sealed/mecha/M in T.contents)
empty += pick(((RANGE_TURFS(2, M) - RANGE_TURFS(1, M)) & turfs) - empty)
any_attack = 1
if(!any_attack)
any_attack = TRUE
if(!any_attack) // nothing to attack in the arena, time for enraged attack if we still have a cliented target.
for(var/obj/effect/temp_visual/drakewall/D in drakewalls)
qdel(D)
return FALSE // nothing to attack in the arena time for enraged attack if we still have a target
for(var/a in mobs_with_clients)
var/mob/living/L = a
if(!QDELETED(L) && L.client)
return FALSE
return TRUE
for(var/turf/T in turfs)
if(!(T in empty))
new /obj/effect/temp_visual/lava_warning(T)