mirror of
https://github.com/GreenComfyTea/MHR-Overlay.git
synced 2026-01-24 04:18:11 -08:00
Merge pull request #6 from chenjr0719/feat/capture_health
feat: Add capture health hint
This commit is contained in:
@@ -76,7 +76,8 @@ local monster_UI = {
|
|||||||
colors = {
|
colors = {
|
||||||
health_bar = {
|
health_bar = {
|
||||||
remaining_health = 0xB952A674,
|
remaining_health = 0xB952A674,
|
||||||
missing_health = 0xB9000000
|
missing_health = 0xB9000000,
|
||||||
|
capturable_health = 0xFF7373ff
|
||||||
},
|
},
|
||||||
|
|
||||||
monster_name = {
|
monster_name = {
|
||||||
@@ -306,7 +307,8 @@ re.on_frame(function()
|
|||||||
damage_meter();
|
damage_meter();
|
||||||
end
|
end
|
||||||
|
|
||||||
--draw.text("x:\n" .. tostring(x), 500, 800, 0xFFFFFFFF);
|
--draw.text("x:\n" .. tostring(x), 500, 800, 0xFFFFFFFF);
|
||||||
|
|
||||||
end);
|
end);
|
||||||
|
|
||||||
function get_window_size()
|
function get_window_size()
|
||||||
@@ -389,6 +391,7 @@ function record_health(enemy)
|
|||||||
local health = vital_param:call("get_Current");
|
local health = vital_param:call("get_Current");
|
||||||
local max_health = vital_param:call("get_Max");
|
local max_health = vital_param:call("get_Max");
|
||||||
local missing_health = max_health - health;
|
local missing_health = max_health - health;
|
||||||
|
local capture_health = physical_param:call("get_CaptureHpVital");
|
||||||
|
|
||||||
local health_percentage = 1;
|
local health_percentage = 1;
|
||||||
if max_health ~= 0 then
|
if max_health ~= 0 then
|
||||||
@@ -422,6 +425,8 @@ function record_health(enemy)
|
|||||||
monster.max_health = max_health;
|
monster.max_health = max_health;
|
||||||
monster.health_percentage = health_percentage;
|
monster.health_percentage = health_percentage;
|
||||||
monster.missing_health = missing_health;
|
monster.missing_health = missing_health;
|
||||||
|
monster.capture_health = capture_health;
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function monster_health()
|
function monster_health()
|
||||||
@@ -502,7 +507,13 @@ function monster_health()
|
|||||||
local health_bar_missing_health_width = monster_UI.health_bar.width - health_bar_remaining_health_width;
|
local health_bar_missing_health_width = monster_UI.health_bar.width - health_bar_remaining_health_width;
|
||||||
|
|
||||||
--remaining health
|
--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
|
--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);
|
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
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user