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:
@@ -122,8 +122,12 @@ local DEFAULT_CLASS_SETTINGS = {
|
||||
toggle_other = true,
|
||||
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
|
||||
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
|
||||
DEFAULT_CLASS_SETTINGS.breed_priorities[breed_name] = 0
|
||||
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
|
||||
end
|
||||
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 omni_rejects then
|
||||
local sub
|
||||
if hit_unit_tag and hit_unit_tag._template and hit_unit_tag._template.name == TAG_NAMES.VETERAN_TAG then
|
||||
sub = "vet_conflict"
|
||||
elseif mod_settings.servo_skull_mark_ignore_unaggroed and hit_unit_attacking_unit_id == -1 then
|
||||
sub = "unaggroed"
|
||||
elseif not mod:has_enough_capacitance(hit_unit) then
|
||||
sub = "capacitance"
|
||||
else
|
||||
sub = "range"
|
||||
end
|
||||
omni_reject("skull:" .. sub)
|
||||
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
|
||||
local sub
|
||||
if hit_unit_tag and hit_unit_tag._template and hit_unit_tag._template.name == TAG_NAMES.VETERAN_TAG then
|
||||
sub = "vet_conflict"
|
||||
elseif hit_unit_breed_name == "cultist_ritualist" or hit_unit_breed_name == "chaos_mutator_ritualist" then
|
||||
sub = "ritual"
|
||||
elseif mod_settings.servo_skull_mark_ignore_unaggroed and hit_unit_attacking_unit_id == -1 then
|
||||
sub = "unaggroed"
|
||||
elseif not mod:has_enough_capacitance(hit_unit) then
|
||||
sub = "capacitance"
|
||||
else
|
||||
omni_reject("skull_invalid")
|
||||
sub = "range"
|
||||
end
|
||||
goto continue
|
||||
end
|
||||
end
|
||||
omni_reject("skull:" .. sub)
|
||||
else
|
||||
omni_reject("skull_invalid")
|
||||
end
|
||||
goto continue
|
||||
end
|
||||
end
|
||||
|
||||
local visible
|
||||
if omni_mark and mod_settings.omni_mark_ignore_los then
|
||||
|
||||
@@ -62,8 +62,7 @@ function mod:dump_breeds()
|
||||
table.sort(tags)
|
||||
local pounce_setting = breed_data.companion_pounce_setting
|
||||
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
|
||||
breed_data.smart_tag_target_type == "breed" and breed_data.faction_name ~= "imperium"
|
||||
local passes_filter = mod:passes_breed_target_filter(breed_data)
|
||||
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,
|
||||
tostring(breed_data.unit_template_name),
|
||||
|
||||
Reference in New Issue
Block a user