Part Break/Sever implemented. Fallback to default renderer if d2d is not available.

This commit is contained in:
GreenComfyTea
2022-06-17 14:24:46 +03:00
parent 7d0adc5139
commit 1a95634ec2
17 changed files with 9365 additions and 3941 deletions

View File

@@ -219,9 +219,11 @@ local damage_param_field = enemy_character_base_type_def:get_field("<DamageParam
local damage_param_type = damage_param_field:get_type();
local get_condition_param_method = damage_param_type:get_method("get_ConditionParam");
local stun_param_field = damage_param_type:get_field("_StunParam");
local poison_param_field = damage_param_type:get_field("_PoisonParam");
local blast_param_field = damage_param_type:get_field("_BlastParam");
local poison_param_type = poison_param_field:get_type();
local blast_param_type = blast_param_field:get_type();
@@ -250,6 +252,18 @@ function ailments.update_ailments(enemy, monster)
return;
end
ailments.update_stun_poison_blast_ailments(monster, damage_param);
if not config.current_config.large_monster_UI.dynamic.ailments.visibility
and not config.current_config.large_monster_UI.static.ailments.visibility
and not config.current_config.large_monster_UI.highlighted.ailments.visibility
and not config.current_config.small_monster_UI.ailments.visibility
and not config.current_config.large_monster_UI.dynamic.ailment_buildups.visibility
and not config.current_config.large_monster_UI.static.ailment_buildups.visibility
and not config.current_config.small_monster_UI.ailment_buildups.visibility then
return;
end
local condition_param = get_condition_param_method:call(damage_param);
if condition_param == nil then
@@ -264,7 +278,34 @@ function ailments.update_ailments(enemy, monster)
for index, ailment_param in ipairs(condition_param_table) do
local id = index - 1;
if id == ailments.stun_id or id == ailments.poison_id or id == ailments.blast_id then
goto continue;
end
ailments.update_ailment(monster, ailment_param, id);
::continue::
end
end
function ailments.update_stun_poison_blast_ailments(monster, damage_param)
local stun_param = stun_param_field:get_data(damage_param);
if stun_param ~= nil then
ailments.update_ailment(monster, stun_param, ailments.stun_id);
end
local poison_param = poison_param_field:get_data(damage_param);
if poison_param ~= nil then
ailments.update_ailment(monster, poison_param, ailments.poison_id);
end
local blast_param = blast_param_field:get_data(damage_param);
if blast_param ~= nil then
ailments.update_ailment(monster, blast_param, ailments.blast_id);
end
end
function ailments.update_ailment(monster, ailment_param, id)
local is_enable = get_is_enable_method:call(ailment_param);
local activate_count = get_activate_count_method:call(ailment_param):get_element(0):get_field("mValue");
local buildup = get_stock_method:call(ailment_param):get_element(0):get_field("mValue");
@@ -356,7 +397,6 @@ function ailments.update_ailments(enemy, monster)
monster.ailments[id].minutes_left = minutes_left;
monster.ailments[id].seconds_left = seconds_left;
end
end
end
function ailments.update_last_change_time(monster, id)

View File

@@ -14,25 +14,33 @@ local time;
body_part.list = {};
function body_part.new(REpart, name, id)
function body_part.new(id, name)
local part = {};
part.REpart = REpart;
part.id = id;
part.health = 99999;
part.health = 9999;
part.max_health = 99999;
part.health_percentage = 0;
part.break_health = 9999;
part.break_max_health = 99999;
part.break_health_percentage = 0;
part.lost_health = 9999;
part.loss_max_health = 99999;
part.loss_health_percentage = 0;
part.name = name;
part.flinch_count = 0;
part.break_count = 0;
part.break_max_count = 0;
part.last_change_time = time.total_elapsed_seconds;
body_part.init_dynamic_UI(part);
body_part.init_static_UI(part);
body_part.init_highlighted_UI(part);
return part;
end
@@ -40,62 +48,146 @@ end
function body_part.init_dynamic_UI(part)
part.body_part_dynamic_UI = body_part_UI_entity.new(
config.current_config.large_monster_UI.dynamic.parts.visibility,
config.current_config.large_monster_UI.dynamic.parts.bar,
config.current_config.large_monster_UI.dynamic.parts.part_name_label,
config.current_config.large_monster_UI.dynamic.parts.text_label,
config.current_config.large_monster_UI.dynamic.parts.value_label,
config.current_config.large_monster_UI.dynamic.parts.percentage_label
config.current_config.large_monster_UI.dynamic.parts.part_health.visibility,
config.current_config.large_monster_UI.dynamic.parts.part_health.bar,
config.current_config.large_monster_UI.dynamic.parts.part_health.text_label,
config.current_config.large_monster_UI.dynamic.parts.part_health.value_label,
config.current_config.large_monster_UI.dynamic.parts.part_health.percentage_label,
config.current_config.large_monster_UI.dynamic.parts.part_break.visibility,
config.current_config.large_monster_UI.dynamic.parts.part_break.bar,
config.current_config.large_monster_UI.dynamic.parts.part_break.text_label,
config.current_config.large_monster_UI.dynamic.parts.part_break.value_label,
config.current_config.large_monster_UI.dynamic.parts.part_break.percentage_label,
config.current_config.large_monster_UI.dynamic.parts.part_loss.visibility,
config.current_config.large_monster_UI.dynamic.parts.part_loss.bar,
config.current_config.large_monster_UI.dynamic.parts.part_loss.text_label,
config.current_config.large_monster_UI.dynamic.parts.part_loss.value_label,
config.current_config.large_monster_UI.dynamic.parts.part_loss.percentage_label
);
end
function body_part.init_static_UI(part)
part.body_part_static_UI = body_part_UI_entity.new(
config.current_config.large_monster_UI.static.parts.visibility,
config.current_config.large_monster_UI.static.parts.bar,
config.current_config.large_monster_UI.static.parts.part_name_label,
config.current_config.large_monster_UI.static.parts.text_label,
config.current_config.large_monster_UI.static.parts.value_label,
config.current_config.large_monster_UI.static.parts.percentage_label
config.current_config.large_monster_UI.static.parts.part_health.visibility,
config.current_config.large_monster_UI.static.parts.part_health.bar,
config.current_config.large_monster_UI.static.parts.part_health.text_label,
config.current_config.large_monster_UI.static.parts.part_health.value_label,
config.current_config.large_monster_UI.static.parts.part_health.percentage_label,
config.current_config.large_monster_UI.static.parts.part_break.visibility,
config.current_config.large_monster_UI.static.parts.part_break.bar,
config.current_config.large_monster_UI.static.parts.part_break.text_label,
config.current_config.large_monster_UI.static.parts.part_break.value_label,
config.current_config.large_monster_UI.static.parts.part_break.percentage_label,
config.current_config.large_monster_UI.static.parts.part_loss.visibility,
config.current_config.large_monster_UI.static.parts.part_loss.bar,
config.current_config.large_monster_UI.static.parts.part_loss.text_label,
config.current_config.large_monster_UI.static.parts.part_loss.value_label,
config.current_config.large_monster_UI.static.parts.part_loss.percentage_label
);
end
function body_part.init_highlighted_UI(part)
part.body_part_highlighted_UI = body_part_UI_entity.new(
config.current_config.large_monster_UI.highlighted.parts.visibility,
config.current_config.large_monster_UI.highlighted.parts.bar,
config.current_config.large_monster_UI.highlighted.parts.part_name_label,
config.current_config.large_monster_UI.highlighted.parts.text_label,
config.current_config.large_monster_UI.highlighted.parts.value_label,
config.current_config.large_monster_UI.highlighted.parts.percentage_label
config.current_config.large_monster_UI.highlighted.parts.part_health.visibility,
config.current_config.large_monster_UI.highlighted.parts.part_health.bar,
config.current_config.large_monster_UI.highlighted.parts.part_health.text_label,
config.current_config.large_monster_UI.highlighted.parts.part_health.value_label,
config.current_config.large_monster_UI.highlighted.parts.part_health.percentage_label,
config.current_config.large_monster_UI.highlighted.parts.part_break.visibility,
config.current_config.large_monster_UI.highlighted.parts.part_break.bar,
config.current_config.large_monster_UI.highlighted.parts.part_break.text_label,
config.current_config.large_monster_UI.highlighted.parts.part_break.value_label,
config.current_config.large_monster_UI.highlighted.parts.part_break.percentage_label,
config.current_config.large_monster_UI.highlighted.parts.part_loss.visibility,
config.current_config.large_monster_UI.highlighted.parts.part_loss.bar,
config.current_config.large_monster_UI.highlighted.parts.part_loss.text_label,
config.current_config.large_monster_UI.highlighted.parts.part_loss.value_label,
config.current_config.large_monster_UI.highlighted.parts.part_loss.percentage_label
);
end
function body_part.update(part, new_health, new_max_health)
function body_part.update(part, part_current, part_max, part_break_current, part_break_max, part_loss_current, part_loss_max, part_break_count, part_break_max_count, is_severed)
if part == nil then
return;
end
if new_health > part.health then
if part_current > part.health then
part.flinch_count = part.flinch_count + 1;
end
if part.health ~= new_health then
if part_break_current > part.break_health then
part.break_count = part.break_count + 1;
end
if part.health ~= part_current then
part.last_change_time = time.total_elapsed_seconds;
end
if part.break_health ~= part_break_current then
part.last_change_time = time.total_elapsed_seconds;
end
if part.loss_health ~= part_loss_current then
part.last_change_time = time.total_elapsed_seconds;
end
if part.break_count ~= part_break_count then
part.last_change_time = time.total_elapsed_seconds;
end
if part.break_max_count ~= part_break_max_count then
part.last_change_time = time.total_elapsed_seconds;
end
if part.is_severed ~= is_severed then
part.last_change_time = time.total_elapsed_seconds;
end
part.health = new_health;
part.max_health = new_max_health;
part.health = part_current;
part.max_health = part_max;
part.break_health = part_break_current;
part.break_max_health = part_break_max;
part.loss_health = part_loss_current;
part.loss_max_health = part_loss_max;
part.break_count = part_break_count;
part.break_max_count = part_break_max_count;
part.is_severed = is_severed;
if part.max_health ~= 0 then
part.health_percentage = part.health / part.max_health;
end
if part.break_max_health ~= 0 then
part.break_health_percentage = part.break_health / part.break_max_health;
end
if part.loss_max_health ~= 0 then
part.loss_health_percentage = part.loss_health / part.loss_max_health;
end
end
function body_part.draw_dynamic(monster, parts_position_on_screen, opacity_scale)
--sort parts here
local displayed_parts = {};
for REpart, part in pairs(monster.parts) do
if config.current_config.large_monster_UI.dynamic.parts.settings.hide_undamaged_parts and part.health == part.max_health and part.flinch_count == 0 then
if config.current_config.large_monster_UI.dynamic.parts.settings.hide_undamaged_parts
and part.health == part.max_health and part.flinch_count == 0
and ((part.break_health == part.break_max_health and part.break_count == 0) or part.break_max_health < 0)
and ((part.loss_health == part.loss_max_health and not part.is_severed) or part.loss_max_health < 0) then
goto continue;
end
if (not part.body_part_dynamic_UI.flinch_visibility)
and (not part.body_part_dynamic_UI.break_visibility or part.break_max_health < 0 or part.break_count >= part.break_max_count)
and (not part.body_part_dynamic_UI.loss_visibility or part.loss_max_health < 0 or part.is_severed) then
goto continue;
end
@@ -137,6 +229,66 @@ function body_part.draw_dynamic(monster, parts_position_on_screen, opacity_scale
return left.health_percentage < right.health_percentage;
end);
end
elseif config.current_config.large_monster_UI.dynamic.parts.sorting.type == "Flinch Count" then
if config.current_config.large_monster_UI.dynamic.parts.sorting.reversed_order then
table.sort(displayed_parts, function(left, right)
return left.flinch_count > right.flinch_count;
end);
else
table.sort(displayed_parts, function(left, right)
return left.flinch_count < right.flinch_count;
end);
end
elseif config.current_config.large_monster_UI.dynamic.parts.sorting.type == "Break Health" then
if config.current_config.large_monster_UI.dynamic.parts.sorting.reversed_order then
table.sort(displayed_parts, function(left, right)
return left.break_health > right.break_health;
end);
else
table.sort(displayed_parts, function(left, right)
return left.break_health < right.break_health;
end);
end
elseif config.current_config.large_monster_UI.dynamic.parts.sorting.type == "Break Health Percentage" then
if config.current_config.large_monster_UI.dynamic.parts.sorting.reversed_order then
table.sort(displayed_parts, function(left, right)
return left.break_health_percentage > right.break_health_percentage;
end);
else
table.sort(displayed_parts, function(left, right)
return left.break_health_percentage < right.break_health_percentage;
end);
end
elseif config.current_config.large_monster_UI.dynamic.parts.sorting.type == "Break Count" then
if config.current_config.large_monster_UI.dynamic.parts.sorting.reversed_order then
table.sort(displayed_parts, function(left, right)
return left.break_count > right.break_count;
end);
else
table.sort(displayed_parts, function(left, right)
return left.break_count < right.break_count;
end);
end
elseif config.current_config.large_monster_UI.dynamic.parts.sorting.type == "Sever Health" then
if config.current_config.large_monster_UI.dynamic.parts.sorting.reversed_order then
table.sort(displayed_parts, function(left, right)
return left.loss_health > right.loss_health;
end);
else
table.sort(displayed_parts, function(left, right)
return left.loss_health < right.loss_health;
end);
end
elseif config.current_config.large_monster_UI.dynamic.parts.sorting.type == "Sever Health Percentage" then
if config.current_config.large_monster_UI.dynamic.parts.sorting.reversed_order then
table.sort(displayed_parts, function(left, right)
return left.loss_health_percentage > right.loss_health_percentage;
end);
else
table.sort(displayed_parts, function(left, right)
return left.loss_health_percentage < right.loss_health_percentage;
end);
end
end
local last_part_position_on_screen;
@@ -155,11 +307,19 @@ function body_part.draw_dynamic(monster, parts_position_on_screen, opacity_scale
end
function body_part.draw_static(monster, parts_position_on_screen, opacity_scale)
--sort parts here
local displayed_parts = {};
for REpart, part in pairs(monster.parts) do
if config.current_config.large_monster_UI.static.parts.settings.hide_undamaged_parts and part.health == part.max_health and part.flinch_count == 0 then
if config.current_config.large_monster_UI.static.parts.settings.hide_undamaged_parts
and part.health == part.max_health and part.flinch_count == 0
and ((part.break_health == part.break_max_health and part.break_count == 0) or part.break_max_health < 0)
and ((part.loss_health == part.loss_max_health and not part.is_severed) or part.loss_max_health < 0) then
goto continue;
end
if (not part.body_part_static_UI.flinch_visibility)
and (not part.body_part_static_UI.break_visibility or part.break_max_health < 0 or part.break_count >= part.break_max_count)
and (not part.body_part_static_UI.loss_visibility or part.loss_max_health < 0 or part.is_severed) then
goto continue;
end
@@ -201,6 +361,66 @@ function body_part.draw_static(monster, parts_position_on_screen, opacity_scale)
return left.health_percentage < right.health_percentage;
end);
end
elseif config.current_config.large_monster_UI.static.parts.sorting.type == "Flinch Count" then
if config.current_config.large_monster_UI.static.parts.sorting.reversed_order then
table.sort(displayed_parts, function(left, right)
return left.flinch_count > right.flinch_count;
end);
else
table.sort(displayed_parts, function(left, right)
return left.flinch_count < right.flinch_count;
end);
end
elseif config.current_config.large_monster_UI.static.parts.sorting.type == "Break Health" then
if config.current_config.large_monster_UI.static.parts.sorting.reversed_order then
table.sort(displayed_parts, function(left, right)
return left.break_health > right.break_health;
end);
else
table.sort(displayed_parts, function(left, right)
return left.break_health < right.break_health;
end);
end
elseif config.current_config.large_monster_UI.static.parts.sorting.type == "Break Health Percentage" then
if config.current_config.large_monster_UI.static.parts.sorting.reversed_order then
table.sort(displayed_parts, function(left, right)
return left.break_health_percentage > right.break_health_percentage;
end);
else
table.sort(displayed_parts, function(left, right)
return left.break_health_percentage < right.break_health_percentage;
end);
end
elseif config.current_config.large_monster_UI.static.parts.sorting.type == "Break Count" then
if config.current_config.large_monster_UI.static.parts.sorting.reversed_order then
table.sort(displayed_parts, function(left, right)
return left.break_count > right.break_count;
end);
else
table.sort(displayed_parts, function(left, right)
return left.break_count < right.break_count;
end);
end
elseif config.current_config.large_monster_UI.static.parts.sorting.type == "Sever Health" then
if config.current_config.large_monster_UI.static.parts.sorting.reversed_order then
table.sort(displayed_parts, function(left, right)
return left.loss_health > right.loss_health;
end);
else
table.sort(displayed_parts, function(left, right)
return left.loss_health < right.loss_health;
end);
end
elseif config.current_config.large_monster_UI.static.parts.sorting.type == "Sever Health Percentage" then
if config.current_config.large_monster_UI.static.parts.sorting.reversed_order then
table.sort(displayed_parts, function(left, right)
return left.loss_health_percentage > right.loss_health_percentage;
end);
else
table.sort(displayed_parts, function(left, right)
return left.loss_health_percentage < right.loss_health_percentage;
end);
end
end
local last_part_position_on_screen;
@@ -219,10 +439,18 @@ function body_part.draw_static(monster, parts_position_on_screen, opacity_scale)
end
function body_part.draw_highlighted(monster, parts_position_on_screen, opacity_scale)
--sort parts here
local displayed_parts = {};
for REpart, part in pairs(monster.parts) do
if config.current_config.large_monster_UI.highlighted.parts.settings.hide_undamaged_parts and part.health == part.max_health and part.flinch_count == 0 then
if config.current_config.large_monster_UI.highlighted.parts.settings.hide_undamaged_parts
and part.health == part.max_health and part.flinch_count == 0
and ((part.break_health == part.break_max_health and part.break_count == 0) or part.break_max_health < 0)
and ((part.loss_health == part.loss_max_health and not part.is_severed) or part.loss_max_health < 0) then
goto continue;
end
if (not part.body_part_highlighted_UI.flinch_visibility)
and (not part.body_part_highlighted_UI.break_visibility or part.break_max_health < 0 or part.break_count >= part.break_max_count)
and (not part.body_part_highlighted_UI.loss_visibility or part.loss_max_health < 0 or part.is_severed) then
goto continue;
end
@@ -264,6 +492,66 @@ function body_part.draw_highlighted(monster, parts_position_on_screen, opacity_s
return left.health_percentage < right.health_percentage;
end);
end
elseif config.current_config.large_monster_UI.highlighted.parts.sorting.type == "Flinch Count" then
if config.current_config.large_monster_UI.highlighted.parts.sorting.reversed_order then
table.sort(displayed_parts, function(left, right)
return left.flinch_count > right.flinch_count;
end);
else
table.sort(displayed_parts, function(left, right)
return left.flinch_count < right.flinch_count;
end);
end
elseif config.current_config.large_monster_UI.highlighted.parts.sorting.type == "Break Health" then
if config.current_config.large_monster_UI.highlighted.parts.sorting.reversed_order then
table.sort(displayed_parts, function(left, right)
return left.break_health > right.break_health;
end);
else
table.sort(displayed_parts, function(left, right)
return left.break_health < right.break_health;
end);
end
elseif config.current_config.large_monster_UI.highlighted.parts.sorting.type == "Break Health Percentage" then
if config.current_config.large_monster_UI.highlighted.parts.sorting.reversed_order then
table.sort(displayed_parts, function(left, right)
return left.break_health_percentage > right.break_health_percentage;
end);
else
table.sort(displayed_parts, function(left, right)
return left.break_health_percentage < right.break_health_percentage;
end);
end
elseif config.current_config.large_monster_UI.highlighted.parts.sorting.type == "Break Count" then
if config.current_config.large_monster_UI.highlighted.parts.sorting.reversed_order then
table.sort(displayed_parts, function(left, right)
return left.break_count > right.break_count;
end);
else
table.sort(displayed_parts, function(left, right)
return left.break_count < right.break_count;
end);
end
elseif config.current_config.large_monster_UI.highlighted.parts.sorting.type == "Sever Health" then
if config.current_config.large_monster_UI.highlighted.parts.sorting.reversed_order then
table.sort(displayed_parts, function(left, right)
return left.loss_health > right.loss_health;
end);
else
table.sort(displayed_parts, function(left, right)
return left.loss_health < right.loss_health;
end);
end
elseif config.current_config.large_monster_UI.highlighted.parts.sorting.type == "Sever Health Percentage" then
if config.current_config.large_monster_UI.highlighted.parts.sorting.reversed_order then
table.sort(displayed_parts, function(left, right)
return left.loss_health_percentage > right.loss_health_percentage;
end);
else
table.sort(displayed_parts, function(left, right)
return left.loss_health_percentage < right.loss_health_percentage;
end);
end
end
local last_part_position_on_screen;

View File

@@ -22,6 +22,7 @@ large_monster.list = {};
function large_monster.new(enemy)
local monster = {};
monster.enemy = enemy;
monster.is_large = true;
monster.id = 0;
@@ -330,6 +331,8 @@ end
local physical_param_field = enemy_character_base_type_def:get_field("<PhysicalParam>k__BackingField");
local stamina_param_field = enemy_character_base_type_def:get_field("<StaminaParam>k__BackingField");
local anger_param_field = enemy_character_base_type_def:get_field("<AngerParam>k__BackingField");
local damage_param_field = enemy_character_base_type_def:get_field("<DamageParam>k__BackingField");
local check_die_method = enemy_character_base_type_def:get_method("checkDie");
local is_disp_icon_mini_map_method = enemy_character_base_type_def:get_method("isDispIconMiniMap");
@@ -457,6 +460,12 @@ function large_monster.update(enemy)
return;
end
local damage_param = damage_param_field:get_data(enemy);
if damage_param == nil then
customization_menu.status = "No damage param";
return;
end
local health = get_current_method:call(vital_param);
local max_health = get_max_method:call(vital_param);
local capture_health = get_capture_hp_vital_method:call(physical_param);
@@ -490,7 +499,7 @@ function large_monster.update(enemy)
customization_menu.status = "No vital list";
return;
end
local vital_list_count = vital_list:call("get_Count");
if vital_list_count == nil or vital_list_count < 2 then
customization_menu.status = "No vital list count";
@@ -509,53 +518,79 @@ function large_monster.update(enemy)
return;
end
local last_REpart = part_list:call("get_Item", part_list_count - 1);
local last_REpart_health = 9999999;
if last_REpart ~= nil then
local _last_REpart_health = last_REpart:call("get_Current");
if last_REpart_health ~= nil then
last_REpart_health = _last_REpart_health;
end
local enemy_parts_damage_info = damage_param:get_field("_EnemyPartsDamageInfo");
local enemy_parts_info_array;
if enemy_parts_damage_info ~= nil then
enemy_parts_info_array = enemy_parts_damage_info:call("get_PartsInfo");
end
local part_id = 1;
for i = 0, part_list_count - 1 do
local REpart = part_list:call("get_Item", i);
if REpart == nil then
goto continue;
local enemy_parts_info;
if enemy_parts_info_array ~= nil then
enemy_parts_info = enemy_parts_info_array[i];
end
local part_health = REpart:call("get_Current");
if part_health == nil then
goto continue;
end
local part_max_health = REpart:call("get_Max");
if part_max_health == nil or part_max_health <= 0 then
goto continue;
end
local part = monster.parts[REpart];
local part = monster.parts[part_id];
if part == nil then
local part_name = part_names.get_part_name(monster.id, part_id);
if part_name ~= "" then
part = body_part.new(REpart, part_name, part_id);
monster.parts[REpart] = part;
if part_name == "" then
goto continue;
else
part = body_part.new(part_id, part_name);
monster.parts[part_id] = part;
end
end
local part_vital = physical_param:call("getVital", 1, i);
local part_current = -1;
local part_max = -1;
body_part.update(part, part_health, part_max_health);
if part_vital ~= nil then
part_current = part_vital:call("get_Current") or -1;
part_max = part_vital:call("get_Max") or -1;
end
local part_break_vital = physical_param:call("getVital", 2, i);
local part_break_current = -1;
local part_break_max = -1;
if part_break_vital ~= nil then
part_break_current = part_break_vital:call("get_Current") or -1;
part_break_max = part_break_vital:call("get_Max") or -1;
end
local part_loss_vital = physical_param:call("getVital", 3, i);
local part_loss_current = -1;
local part_loss_max = -1;
if part_loss_vital ~= nil then
part_loss_current = part_loss_vital:call("get_Current") or -1;
part_loss_max = part_loss_vital:call("get_Max") or -1;
end
local part_break_count = -1;
local part_break_max_count = -1;
local is_severed = false;
if enemy_parts_info ~= nil then
part_break_count = enemy_parts_info:call("get_PartsBreakDamageLevel") or -1;
part_break_max_count = enemy_parts_info:call("get_PartsBreakDamageMaxLevel") or -1;
is_severed = enemy_parts_info:call("get_PartsLossState") or false;
end
body_part.update(part, part_current, part_max, part_break_current, part_break_max, part_loss_current, part_loss_max, part_break_count, part_break_max_count, is_severed);
part_id = part_id + 1;
::continue::
end
if health ~= nil then
monster.health = health;
end
if max_health ~= nil then
monster.max_health = max_health;
end
@@ -747,7 +782,6 @@ function large_monster.draw_static(monster, position_on_screen, opacity_scale)
monster.health_static_UI.bar.colors = config.current_config.large_monster_UI.static.health.bar.normal_colors;
end
drawing.draw_label(monster.static_name_label, position_on_screen, opacity_scale, monster_name_text);
local health_position_on_screen = {
@@ -894,6 +928,7 @@ function large_monster.init_module()
stamina_UI_entity = require("MHR_Overlay.UI.UI_Entities.stamina_UI_entity");
rage_UI_entity = require("MHR_Overlay.UI.UI_Entities.rage_UI_entity");
ailment_UI_entity = require("MHR_Overlay.UI.UI_Entities.ailment_UI_entity");
screen = require("MHR_Overlay.Game_Handler.screen");
drawing = require("MHR_Overlay.UI.drawing");
part_names = require("MHR_Overlay.Misc.part_names");