Add count of valid vs total targets to Consider.finish

main
AreiaAard 4 years ago
parent e4b520aaf4
commit 3d25dc00b4

@ -458,9 +458,24 @@ end
function Consider.finish() function Consider.finish()
EnableTriggerGroup("trigger_group_consider_mobs", false) EnableTriggerGroup("trigger_group_consider_mobs", false)
local num = #Consider.mobs local total = #Consider.mobs
if (num > 0) then if (total == 0) then
Utility.print(string.format("@Y%d @wmob%s found.", num, num == 1 and "" or "s")) -- Utility.print("No mobs found.")
-- No real need to print here, since game output can handle this case itself.
return
end
local validTargets = 0
for _, mob in ipairs(Consider.mobs) do
validTargets = not mob.ignore and validTargets + 1 or validTargets
end
if (validTargets ~= total) then
Utility.print(string.format("@Y%d@w/@Y%d @wmob%s found.",
validTargets, total, total == 1 and "" or "s"
))
else
Utility.print(string.format("@Y%d @wmob%s found.",
total, total == 1 and "" or "s"
))
end end
end end

Loading…
Cancel
Save