review polish: skull reject classifier checks ritualists before capacitance (was mislabeling ritual-gated rejections), fixed mangled indentation in SERVO_SKULL reject block, enumeration filter predicate now shared (mod:passes_breed_target_filter) between breed-priority init and breed_dump so the post-update diff can't drift; NOT installed yet (user in-session)

This commit is contained in:
2026-10-04 11:47:08 -04:00
parent a18194519b
commit 52cb8e9cbf
3 changed files with 25 additions and 20 deletions
+5 -1
View File
@@ -122,8 +122,12 @@ local DEFAULT_CLASS_SETTINGS = {
toggle_other = true, toggle_other = true,
breed_priorities = {}, breed_priorities = {},
} }
function mod:passes_breed_target_filter(breed_data)
return Breed.is_minion(breed_data) and breed_data.unit_template_name == "minion" and breed_data.smart_tag_target_type == "breed" and breed_data.faction_name ~= "imperium"
end
for breed_name, breed_data in pairs(breeds) do for breed_name, breed_data in pairs(breeds) do
if Breed.is_minion(breed_data) and breed_data.unit_template_name == "minion" and breed_data.smart_tag_target_type == "breed" and breed_data.faction_name ~= "imperium" then if mod:passes_breed_target_filter(breed_data) then
if breed_data.tags.elite then if breed_data.tags.elite then
DEFAULT_CLASS_SETTINGS.breed_priorities[breed_name] = 0 DEFAULT_CLASS_SETTINGS.breed_priorities[breed_name] = 0
elseif breed_data.tags.special then elseif breed_data.tags.special then
@@ -857,25 +857,27 @@ function mod:find_auto_mark_target_unit(min_range, max_range, tag_name, tag_cont
goto continue goto continue
end end
elseif tag_name == TAG_NAMES.SERVO_SKULL_TAG then elseif tag_name == TAG_NAMES.SERVO_SKULL_TAG then
if not is_servo_skull_tag_target_valid(hit_unit, hit_unit_tag, hit_unit_breed_name, hit_unit_breed_data, hit_unit_attacking_unit_id, game_session, removed_units, companion_position, hit_unit_center_pos, max_ability_charges, remaining_capacitance) then if not is_servo_skull_tag_target_valid(hit_unit, hit_unit_tag, hit_unit_breed_name, hit_unit_breed_data, hit_unit_attacking_unit_id, game_session, removed_units, companion_position, hit_unit_center_pos, max_ability_charges, remaining_capacitance) then
if omni_rejects then if omni_rejects then
local sub local sub
if hit_unit_tag and hit_unit_tag._template and hit_unit_tag._template.name == TAG_NAMES.VETERAN_TAG then if hit_unit_tag and hit_unit_tag._template and hit_unit_tag._template.name == TAG_NAMES.VETERAN_TAG then
sub = "vet_conflict" sub = "vet_conflict"
elseif mod_settings.servo_skull_mark_ignore_unaggroed and hit_unit_attacking_unit_id == -1 then elseif hit_unit_breed_name == "cultist_ritualist" or hit_unit_breed_name == "chaos_mutator_ritualist" then
sub = "unaggroed" sub = "ritual"
elseif not mod:has_enough_capacitance(hit_unit) then elseif mod_settings.servo_skull_mark_ignore_unaggroed and hit_unit_attacking_unit_id == -1 then
sub = "capacitance" sub = "unaggroed"
else elseif not mod:has_enough_capacitance(hit_unit) then
sub = "range" sub = "capacitance"
end
omni_reject("skull:" .. sub)
else else
omni_reject("skull_invalid") sub = "range"
end end
goto continue omni_reject("skull:" .. sub)
end else
end omni_reject("skull_invalid")
end
goto continue
end
end
local visible local visible
if omni_mark and mod_settings.omni_mark_ignore_los then if omni_mark and mod_settings.omni_mark_ignore_los then
@@ -62,8 +62,7 @@ function mod:dump_breeds()
table.sort(tags) table.sort(tags)
local pounce_setting = breed_data.companion_pounce_setting local pounce_setting = breed_data.companion_pounce_setting
local pounce_action = pounce_setting and pounce_setting.companion_pounce_action or "" local pounce_action = pounce_setting and pounce_setting.companion_pounce_action or ""
local passes_filter = Breed.is_minion(breed_data) and breed_data.unit_template_name == "minion" and local passes_filter = mod:passes_breed_target_filter(breed_data)
breed_data.smart_tag_target_type == "breed" and breed_data.faction_name ~= "imperium"
lines[#lines + 1] = string.format("%s|tpl=%s|tag_type=%s|faction=%s|boss=%s|filter=%s|her=%s|hef=%s|pounce=%s|tags=%s", lines[#lines + 1] = string.format("%s|tpl=%s|tag_type=%s|faction=%s|boss=%s|filter=%s|her=%s|hef=%s|pounce=%s|tags=%s",
breed_name, breed_name,
tostring(breed_data.unit_template_name), tostring(breed_data.unit_template_name),