|
jywar.lua 中修改 WarShowHead 函数
- --显示人物的战斗信息,包括头像,生命,内力等
- function WarShowHead(id)
- if not id then
- id = WAR.CurID
- end
- if id < 0 then
- return
- end
- local pid = WAR.Person[id]["人物编号"]
- local p = JY.Person[pid]
- local h = CC.FontSMALL
- local width = CC.FontSMALL*11 - 6
- local height = (CC.FontSMALL+CC.RowPixel)*9 - 12
- local x1, y1 = nil, nil
- local i = 1
- local size = CC.FontSmall3
- if p["主运内功"] > 0 then
- height = height + CC.FontSMALL + 2
- end
- if p["主运轻功"] > 0 then
- height = height + CC.FontSMALL + 2
- end
- if WAR.Person[id]["我方"] == true then
- x1 = CC.ScreenW - width - 6
- y1 = CC.ScreenH - height - CC.ScreenH/6 -6
- DrawBox(x1, y1, x1 + width, y1 + height + CC.ScreenH/6, C_GOLD)
- else
- x1 = 10
- y1 = 10
- DrawBox(x1, y1, x1 + width, y1 + height + CC.ScreenH/6, C_GOLD)
- end
-
- --太极之形显示
- if Curr_NG(pid, 171) then
- local tjzx = WAR.TJZX[pid] or 0
- if WAR.Person[id]["我方"] == true then
- DrawString(x1 - size*6- CC.RowPixel, CC.ScreenH - size - CC.RowPixel, "太极之形:"..tjzx, C_WHITE, size)
- else
- DrawString(x1 + width + CC.RowPixel, CC.RowPixel, "太极之形:"..tjzx, C_WHITE, size)
- end
- end
- local headw, headh = lib.GetPNGXY(1, p["头像代号"])
- local headx = (width - headw) / 2
- local heady = (CC.ScreenH/5 - headh) / 2
- --头像信息
- local headid = WAR.tmp[5000+id];
- lib.LoadPNG(1, headid*2, x1 + 1 + headx, y1 - 14 + heady, 1)
- x1 = x1 + CC.RowPixel
- y1 = y1 + CC.RowPixel + CC.ScreenH/6 - 12
- local color = nil
- if p["受伤程度"] < p["中毒程度"] then
- if p["中毒程度"] == 0 then
- color = RGB(252, 148, 16)
- elseif p["中毒程度"] < 50 then
- color = RGB(120, 208, 88)
- else
- color = RGB(56, 136, 36)
- end
- elseif p["受伤程度"] < 33 then
- color = RGB(236, 200, 40)
- elseif p["受伤程度"] < 66 then
- color = RGB(244, 128, 32)
- else
- color = RGB(232, 32, 44)
- end
- MyDrawString(x1 -4 , x1 + width -4, y1 + CC.RowPixel + 2, p["姓名"], color, CC.DefaultFont)
- --有运功时的显示
- if p["主运内功"] > 0 then
- DrawString(x1 + 8, y1 + CC.RowPixel + CC.DefaultFont, "运功", MilkWhite, size)
- DrawString(x1 + size*3, y1 + CC.RowPixel+ CC.DefaultFont, JY.Wugong[p["主运内功"]]["名称"], TG_Red_Bright, size)
- y1 = y1 + CC.FontSMALL + 2
- end
- --有轻功时的显示
- if p["主运轻功"] > 0 then
- DrawString(x1 + 8, y1 + CC.RowPixel + CC.DefaultFont, "轻功", MilkWhite, size)
- DrawString(x1 + size*3, y1 + CC.RowPixel+ CC.DefaultFont, JY.Wugong[p["主运轻功"]]["名称"], M_DeepSkyBlue, size)
- y1 = y1 + CC.FontSMALL + 2
- end
- y1 = y1 + size + CC.RowPixel + 3
-
- --颜色条
- local pcx = x1 + 3 - CC.RowPixel + 2;
- local pcy = y1 + CC.RowPixel +1
-
- --生命条
- lib.LoadPNG(1, 275 * 2 , pcx , pcy, 1)
- local pcw, pch = lib.GetPNGXY(1, 274 * 2);
-
- lib.SetClip(pcx, pcy, pcx + (p["生命"]/p["生命最大值"])*pcw, pcy + pch)
- lib.LoadPNG(1, 274 * 2 , pcx , pcy, 1)
- pcy = pcy + CC.RowPixel + size -2
- lib.SetClip(0,0,0,0)
-
- --内力条
- lib.LoadPNG(1, 275 * 2 , pcx , pcy, 1)
- local pcw, pch = lib.GetPNGXY(1, 273 * 2);
- lib.SetClip(pcx, pcy, pcx + (p["内力"]/p["内力最大值"])*pcw, pcy + pch)
- lib.LoadPNG(1, 273 * 2 , pcx , pcy, 1)
- pcy = pcy + CC.RowPixel + size -2
- lib.SetClip(0,0,0,0)
-
- --体力条
- lib.LoadPNG(1, 275 * 2 , pcx , pcy, 1)
- local pcw, pch = lib.GetPNGXY(1, 276 * 2);
- lib.SetClip(pcx, pcy, pcx + (p["体力"]/100)*pcw, pcy + pch)
- lib.LoadPNG(1, 276 * 2 , pcx , pcy, 1)
- pcy = pcy + CC.RowPixel + size -2
- lib.SetClip(0,0,0,0)
-
- local lifexs = "命 "..p["生命"]
- local nlxs = "内 "..p["内力"]
- local tlxs = "体 "..p["体力"]
- local lqzxs = WAR.LQZ[pid] or 0; --怒气
- local zdxs = p["中毒程度"]
-
- local nsxs = p["受伤程度"]; --内伤
- local bfxs = p["冰封程度"]; --冰封
- local zsxs = p["灼烧程度"]; --灼烧
- local fxxs = WAR.FXDS[pid] or 0; --封穴
- local lxxs = WAR.LXZT[pid] or 0; --流血
-
- DrawString(x1 + 9, y1 + CC.RowPixel + 6, lifexs, M_White, CC.FontSMALL)
- DrawString(x1 + 9, y1 + CC.RowPixel + size + 11, nlxs, M_White, CC.FontSMALL)
- DrawString(x1 + 9, y1 + CC.RowPixel + 2*size + 16, tlxs, M_White, CC.FontSMALL)
- y1 = y1 + 3*(CC.RowPixel + size) + 4
-
- local myx1 = 3;
- local myy1 = 0;
- --怒气
- DrawString(x1 + myx1, y1 + myy1, "怒气", C_RED, size)
- if lqzxs == 100 then
- lqzxs = "极"
- end
- DrawString(x1 + myx1 + size*2 + 10, y1 + myy1, lqzxs, C_RED, size)
- --如林
- myx1 = myx1 + size * 4;
- DrawString(x1 + myx1, y1 + myy1, "如林", M_DeepSkyBlue, size)
- if pid == 0 then
- DrawString(x1 + size*5/2 + myx1, y1 + myy1, WAR.FLHS2, M_DeepSkyBlue, size)
- else
- DrawString(x1 + size*5/2 + myx1, y1 + myy1, "※", M_DeepSkyBlue, size)
- end
- --冰封
- myx1 = 3;
- myy1 = myy1 + size + 2;
- DrawString(x1 + myx1, y1 + myy1, "冰封", M_LightBlue, size)
- DrawString(x1 + myx1 + size*2 + 10, y1 + myy1, bfxs, M_LightBlue, size)
- --灼烧
- myx1 = myx1 + size * 4;
- DrawString(x1 + myx1, y1 + myy1, "灼烧", C_ORANGE, size)
- DrawString(x1 + size*5/2 + myx1, y1 + myy1, zsxs, C_ORANGE, size)
- --封穴
- myx1 = 3;
- myy1 = myy1 + size + 2;
- DrawString(x1 + myx1, y1 + myy1, "封穴", C_GOLD, size)
- if fxxs == 50 then
- fxxs = "极"
- end
- DrawString(x1 + myx1 + size*2 + 10, y1 + myy1, fxxs, C_GOLD, size)
- --流血
- myx1 = myx1 + size * 4;
- DrawString(x1 + myx1, y1 + myy1, "流血", M_DarkRed, size)
- if lxxs == 100 then
- lxxs = "极"
- end
- DrawString(x1 + size*5/2 + myx1, y1 + myy1, lxxs, M_DarkRed, size)
- --内伤
- myx1 = 3;
- myy1 = myy1 + size + 2;
- DrawString(x1 + myx1, y1 + myy1, "内伤", PinkRed, size)
- if nsxs == 100 then
- nsxs = "极"
- end
- DrawString(x1 + myx1 + size*2 + 10, y1 + myy1, nsxs, PinkRed, size)
- --中毒
- myx1 = myx1 + size * 4;
- DrawString(x1 + myx1, y1 + myy1, "中毒", LimeGreen, size)
- if zdxs == 100 then
- zdxs = "极"
- end
- DrawString(x1 + size*5/2 + myx1, y1 + myy1, zdxs, LimeGreen, size)
- --敌方攻防轻与武功
- if WAR.Person[id]["我方"] == false then
- y1 = y1 + 3*(CC.RowPixel + size) +12
- DrawBox(x1-7, y1, x1 + width-7 , y1 + size*6, C_GOLD)
- local hl = 1
- DrawString(x1+2, y1 + hl * (size+CC.RowPixel) - 18, "攻" .. p["攻击力"] .. "防" .. p["防御力"] .. "轻" .. p["轻功"], C_WHITE, size)
- hl = hl + 1
- for i = 1, CC.Kungfunum do
- local wugongid = p["武功" .. i]
- if wugongid > 0 then
- DrawString(x1+2, y1 + hl * (size+CC.RowPixel) - 18, JY.Wugong[wugongid]["名称"], C_WHITE, size)
- hl = hl + 1
- end
- end
- end
-
- --敌方物品
- if WAR.Person[id]["我方"] == false then
- y1 = y1 + size*6 + 2
- DrawBox(x1-7, y1, x1 + width-7 , y1 + size*6, C_GOLD)
- local hl = 1
- for i = 1, 4 do
- local wp = p["携带物品" .. i]
- local wps = p["携带物品数量" .. i]
- if wp >= 0 then
- local wpm = JY.Thing[wp]["名称"]
- DrawString(x1+2, y1 + hl * (size+CC.RowPixel) - 18, wpm .. wps, C_WHITE, size)
- hl = hl + 1
- end
- end
- end
- end
复制代码 |
评分
-
查看全部评分
|