From 3d25dc00b4bae452383eae7ccbd3ca77c7508103 Mon Sep 17 00:00:00 2001 From: AreiaAard Date: Thu, 15 Apr 2021 16:53:26 -0400 Subject: [PATCH] Add count of valid vs total targets to Consider.finish --- areia_consider.xml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/areia_consider.xml b/areia_consider.xml index 4d54efa..a199517 100644 --- a/areia_consider.xml +++ b/areia_consider.xml @@ -458,9 +458,24 @@ end function Consider.finish() EnableTriggerGroup("trigger_group_consider_mobs", false) - local num = #Consider.mobs - if (num > 0) then - Utility.print(string.format("@Y%d @wmob%s found.", num, num == 1 and "" or "s")) + local total = #Consider.mobs + if (total == 0) then + -- 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