From 9b3189c9e1014505740cf674da94e00187d30fa9 Mon Sep 17 00:00:00 2001 From: Jacob Chen Date: Tue, 25 Jan 2022 01:22:56 +0800 Subject: [PATCH] feat: Add capture health hint --- MHR_Overlay.lua | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/MHR_Overlay.lua b/MHR_Overlay.lua index 168b309..55b4a4b 100644 --- a/MHR_Overlay.lua +++ b/MHR_Overlay.lua @@ -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