Consistency/data/entities/animals/boss_wizard/orb_death_effect.lua

30 lines
715 B
Lua

dofile_once("data/scripts/lib/utilities.lua")
local entity_id = GetUpdatedEntityID()
local x,y = EntityGetTransform( entity_id )
local r = 128
local targets = EntityGetInRadiusWithTag( x, y, r, "boss_wizard" )
for i,v in ipairs( targets ) do
if ( v ~= entity_id ) then
local c = EntityGetAllChildren( v )
local valid = true
if ( c ~= nil ) then
for a,b in ipairs( c ) do
local comps = EntityGetComponent( b, "GameEffectComponent", "protection_all_short" )
if ( comps ~= nil ) then
valid = false
break
end
end
end
if valid then
local eid = EntityLoad( "data/entities/misc/effect_protection_all_short_evil.xml", x, y )
EntityAddChild( v, eid )
end
end
end