edit | blame | history | raw
local CONST     = require 'config.const'
local Suspicion = require 'systems.suspicion'
local Base      = require 'profession.base'

Base.register('eagle_eye', function(unit, ability)
    local scan_area = clicli.area.create_circle_area(unit:get_point(), 15)
    local all_units = scan_area:get_all_unit_in_area()
    scan_area:remove()

    for _, u in ipairs(all_units) do
        if u:has_tag('player_controlled') and u ~= unit and u:is_alive() then
            u:add_buff({
                key    = CONST.BUFF_EAGLE_MARK,
                source = unit,
                time   = 3.0,
            })
        end
    end

    Suspicion.add(unit, 10)
end)

return Base