相亲相爱-资源分享 【千恋大王】
الذهاب إلى القناة على Telegram
This Channel follows Telegram Terms.No adult content, no violence, no spam.
إظهار المزيدالصين50 164الفئة غير محددة
1 854
المشتركون
-324 ساعات
-37 أيام
-1530 أيام
أرشيف المشاركات
1 854
if (血量 && Player->Health > 0) {
int CurHP = (int) std::max(0, std::min((int)Player->Health, (int)Player->HealthMax));
int MaxHP = (int) Player->HealthMax;
float h = abs(HeadPosSC.y - RootPosSC.y);
float w = h * 0.65f;
float l = HeadPosSC.x - w * 0.5f;
float t = HeadPosSC.y;
float b = RootPosSC.y;
float boxHeight = b - t;
float barX = l - 6.f;
float targetHealthHeight = (CurHP / (float)MaxHP) * boxHeight;
static std::map curH, tarH, delH;
uintptr_t key = reinterpret_cast(Player);
if (curH.find(key) == curH.end()) { curH[key] = targetHealthHeight; tarH[key] = targetHealthHeight; delH[key] = targetHealthHeight; }
tarH[key] = targetHealthHeight;
float diff = tarH[key] - curH[key];
curH[key] += diff * (diff < 0 ? 0.7f : 0.12f);
if (fabs(curH[key] - tarH[key]) < 0.3f) curH[key] = tarH[key];
ImColor hp_color = (CurHP < 40) ? ImColor(1.0f, 0.0f, 0.0f, 1.0f) : ImColor(0.0f, 1.0f, 0.0f, 1.0f);
draw->AddRectFilled(ImVec2(barX, t), ImVec2(barX + 3.f, b), ImColor(0, 0, 0, 180));
draw->AddRectFilled(ImVec2(barX, b - curH[key]), ImVec2(barX + 3.f, b), hp_color);
delH[key] += (tarH[key] - delH[key]) * 0.04f;
if (delH[key] > curH[key] + 2.0f) draw->AddRectFilled(ImVec2(barX, b - delH[key]), ImVec2(barX + 3.f, b - curH[key]), ImColor(100, 100, 100, 120));
}
