mirror of
https://github.com/GreenComfyTea/MHR-Overlay.git
synced 2026-01-23 20:08:05 -08:00
feat: Add capture health hint
This commit is contained in:
@@ -76,7 +76,8 @@ local monster_UI = {
|
||||
colors = {
|
||||
health_bar = {
|
||||
remaining_health = 0xB952A674,
|
||||
missing_health = 0xB9000000
|
||||
missing_health = 0xB9000000,
|
||||
capturable_health = 0xFF7373ff
|
||||
},
|
||||
|
||||
monster_name = {
|
||||
@@ -321,7 +322,6 @@ re.on_frame(function()
|
||||
damage_meter();
|
||||
end
|
||||
|
||||
draw.text("x:\n" .. tostring(x), 500, 800, 0xFFFFFFFF);
|
||||
end);
|
||||
|
||||
function get_window_size()
|
||||
@@ -404,6 +404,7 @@ function record_health(enemy)
|
||||
local health = vital_param:call("get_Current");
|
||||
local max_health = vital_param:call("get_Max");
|
||||
local missing_health = max_health - health;
|
||||
local capture_health = physical_param:call("get_CaptureHpVital");
|
||||
|
||||
local health_percentage = 1;
|
||||
if max_health ~= 0 then
|
||||
@@ -437,6 +438,8 @@ function record_health(enemy)
|
||||
monster.max_health = max_health;
|
||||
monster.health_percentage = health_percentage;
|
||||
monster.missing_health = missing_health;
|
||||
monster.capture_health = capture_health;
|
||||
|
||||
end
|
||||
|
||||
function monster_health()
|
||||
@@ -517,7 +520,13 @@ function monster_health()
|
||||
local health_bar_missing_health_width = monster_UI.health_bar.width - health_bar_remaining_health_width;
|
||||
|
||||
--remaining health
|
||||
draw.filled_rect(screen_position.x + monster_UI.offsets.health_bar.x, screen_position.y + monster_UI.offsets.health_bar.y, health_bar_remaining_health_width, monster_UI.health_bar.height, monster_UI.colors.health_bar.remaining_health);
|
||||
if monster.health <= monster.capture_health then
|
||||
remaining_health_color = monster_UI.colors.health_bar.capturable_health
|
||||
else
|
||||
remaining_health_color = monster_UI.colors.health_bar.remaining_health
|
||||
end
|
||||
|
||||
draw.filled_rect(screen_position.x + monster_UI.offsets.health_bar.x, screen_position.y + monster_UI.offsets.health_bar.y, health_bar_remaining_health_width, monster_UI.health_bar.height, remaining_health_color);
|
||||
--missing health
|
||||
draw.filled_rect(screen_position.x + monster_UI.offsets.health_bar.x + health_bar_remaining_health_width, screen_position.y + monster_UI.offsets.health_bar.y, health_bar_missing_health_width, monster_UI.health_bar.height, monster_UI.colors.health_bar.missing_health);
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user