This commit is contained in:
2024-03-18 21:37:40 +08:00
commit c4aef8f3a3
313 changed files with 74071 additions and 0 deletions

343
UI/HOOK_UI/CreatChr.nut Normal file
View File

@@ -0,0 +1,343 @@
class UnderBaseDraw
{
//绘制函数
function T_DrawDynamicAni(AniFileName, Xpos, Ypos, AniName)
{
if(CreatChrTable.rawin(AniName) == false) CreatChrTable.rawset(AniName, sq_CreateAnimation("", AniFileName));
else
{
sq_AnimationProc(CreatChrTable[AniName]);
sq_drawCurrentFrame(CreatChrTable[AniName], Xpos, Ypos, true);
}
}
function T_DrawStayAni(AniFileName, Xpos, Ypos, Index, AniName)
{
if(CreatChrTable.rawin(AniName) == false) CreatChrTable.rawset(AniName, sq_CreateAnimation("", AniFileName));
else
{
sq_DrawSpecificFrame(CreatChrTable[AniName], Xpos, Ypos, false, Index, false, 1.0);
}
}
function T_DrawStayAniAlpha(AniFileName, Xpos, Ypos, Index, AniName, Alpha)
{
if(CreatChrTable.rawin(AniName) == false) CreatChrTable.rawset(AniName, sq_CreateAnimation("", AniFileName));
else
{
CreatChrTable[AniName].setRGBA(255, 255, 255, Alpha);
sq_DrawSpecificFrame(CreatChrTable[AniName], Xpos, Ypos, false, Index, false, 1.0);
}
}
}
class UnderButton extends UnderBaseDraw
{
State = 0; //按钮状态
ClickEnble = false; //点击效果
ButtonDynamic = false; //动态按钮效果
CustomClickEnble = false; //自定义点击效果
CustomClickAnifile = null; //自定义点击效果Ani路径
CustomButtonName = null; //自定义点击效果名称
CustomClickFrame = null; //自定义点击效果Ani编号
CustomClickx = null; //自定义点击效果X坐标
CustomClicky = null; //自定义点击效果Y坐标
RectEnble = false; //悬停效果
RectButtonName = null; //悬停名称
RectBaseAnifile = null; //悬停Ani路径
RectFrame = null; //非动态按钮的悬停调用Ani编号
Rectx = null; //悬停X坐标
Recty = null; //悬停Y坐标
ButtonName = null; //按钮名称
x = null; //X坐标
y = null; //Y坐标
BaseAnifile = null; //调用Ani路径
width = null; //可点击宽度
length = null; //可点击高度
//构造函数
constructor(gButtonName, gX, gY, gAnifile, gWidth, gLength)
{
ButtonName = gButtonName;
x = gX;
y = gY;
BaseAnifile = gAnifile;
width = gWidth;
length = gLength;
}
//绘制按钮
function Show()
{
if(ClickEnble) //是否开启点击效果
{
if(isLBDown() && State == 0) //按下左键并且按钮处于弹起状态
{
State = 1; //按键进入按下状态
//++y;
}
if(!isLBDown() && State == 1) //按下左键并且按钮处于弹起状态
{
State = 0; //按键进入弹起状态
//--y;
}
}
if(CustomClickEnble) //是否开启自定义点击效果
{
if(isLBDown()) //按下左键并且按钮处于弹起状态
{
if(!ButtonDynamic) T_DrawStayAni(CustomClickAnifile, CustomClickx, CustomClicky, CustomClickFrame, CustomButtonName);
else T_DrawDynamicAni(CustomClickAnifile, CustomClickx, CustomClicky, CustomButtonName);
}
}
if(RectEnble) //开启悬停效果时
{
if((isInRect() && !isLBDown()) || (isInRect() && !CustomClickEnble)) //如果鼠标悬停的时候 并且没有点击的时候
{
//IMouse.SetMouseTask(44);
if(!ButtonDynamic) T_DrawStayAni(RectBaseAnifile, Rectx, Recty, RectFrame, RectButtonName);
else T_DrawDynamicAni(RectBaseAnifile, Rectx, Recty, RectButtonName);
}
}
if(!isInRect()) //如果鼠标没有悬停的时候
{
//IMouse.SetMouseTask(0);
if(!ButtonDynamic) T_DrawStayAni(BaseAnifile, x, y, 0, ButtonName);
else T_DrawDynamicAni(BaseAnifile, x, y, ButtonName);
}
}
//设置自定义点击效果
function SetCustomClickEnble(bool, gButtonName, gX, gY, gAnifile, gFrame)
{
CustomClickEnble = bool; //自定义点击效果
CustomClickAnifile = gAnifile; //自定义点击效果Ani路径
CustomButtonName = gButtonName; //自定义点击效果名称
CustomClickFrame = gFrame; //自定义点击效果Ani编号
CustomClickx = gX; //自定义点击效果X坐标
CustomClicky = gY; //自定义点击效果Y坐标
}
//设置悬停效果
function SetRectEnble(bool, gButtonName, gX, gY, gAnifile, gFrame)
{
RectEnble = bool; //悬停效果
RectButtonName = gButtonName; //悬停名称
RectBaseAnifile = gAnifile; //悬停Ani路径
RectFrame = gFrame; //非动态按钮的悬停调用Ani编号
Rectx = gX; //悬停X坐标
Recty = gY; //悬停Y坐标
}
//设置动态按钮
function SetClickEnble(bool)
{
ButtonDynamic = bool;
}
//设置点击效果
function SetClickEnble(bool)
{
ClickEnble = bool;
}
//悬停状态
function isInRect()
{
if(sq_IsIntersectRect(IMouse.GetXPos(), IMouse.GetYPos(), 5, 5, x, y, width, length)) return true;
else return false;
}
//左键按下状态
function isLBDown()
{
if(isInRect() && IMouse.GetLButton() == 1) return true;
else return false;
}
//左键弹起状态
function isLBUp()
{
if(isInRect() && IMouse.GetLButton() == 0) return true;
else return false;
}
//左键双击状态
function IsLBDoubleClick()
{
if(isInRect() && IMouse.GetLButton() == 64) return true;
else return false;
}
//左键单击状态
function isLBActive()
{
if(isInRect() && IMouse.isButtonUpEvent()) return true;
else return false;
}
}
class CreatChrC extends UnderBaseDraw
{
Job = 0; //当前职业
ChrJobDrawState = 0; //职业绘制状态
DrawChrAniEffTimer = null; //职业绘制Timer
ChrJobDrawAlpha = []; //职业绘制Alpha数组
SelectSwitch = false; //选择职业开关
NowChrSelectPos = 0; //当前角色职业选择位置
constructor()
{
ChrJobDrawAlpha.resize(16); //初始化职业绘制Alpha数组
for(local i = 0; i < 16; ++i)
{
ChrJobDrawAlpha[i] = 0;
}
DrawChrAniEffTimer = TimeSTL("DrawChrAniEffTimer", 3000); //初始化职业绘制Timer
}
//同步角色职业选择位置
function SyncChrSelectPos()
{
NowChrSelectPos = L_sq_RA(0x1A5E258, "0xA8+0xC0+");
}
//绘制角色信息
function DrawChrJobInfo()
{
T_DrawStayAni("common/creatchr/chrbackground/background.ani", 0, 0, NowChrSelectPos, "BMain0");
T_DrawDynamicAni("common/creatchr/chrjobani/" + NowChrSelectPos + ".ani", -160, 0, "DrawChrJobInfo" + NowChrSelectPos);
T_DrawDynamicAni("common/creatchr/base/0.ani", 0, 0, "BackGround0");
T_DrawDynamicAni("common/creatchr/base/" + (NowChrSelectPos % 2 + 1) + ".ani", 0, 0, "BackGround1" + (NowChrSelectPos % 2 + 1));
//T_DrawDynamicAni( "common/creatchr/base/1.ani", 0, 0,"BackGround1");
//T_DrawDynamicAni( "common/creatchr/base/2.ani", -267, 0,"BackGround2");
T_DrawDynamicAni("common/creatchr/base/3.ani", -267, 0, "BackGround3");
}
function DrawSelectButton()
{
for(local i = 0; i < 16; ++i)
{
if(i == NowChrSelectPos) continue;
local SelectButton = UnderButton("SelectChrJob" + i, 40 + (i % 4 * 70), 40 + (i / 4 * 70), "common/creatchr/jobbutton/0.ani", 66, 66);
SelectButton.SetRectEnble(true, "SelectChrJob" + i, 40 + (i % 4 * 70), 40 + (i / 4 * 70), "common/creatchr/jobbutton/0.ani", 1);
SelectButton.SetCustomClickEnble(true, "SelectChrJob" + i, 40 + (i % 4 * 70), 40 + (i / 4 * 70), "common/creatchr/jobbutton/0.ani", 1);
SelectButton.Show();
if(SelectButton.isLBActive())
{
L_sq_WA(0x1A5E258, "0xA8+0xC0+", i);
}
}
//角色职业按钮动画完毕以后才显示当前选中
if(ChrJobDrawAlpha[15] == 250) T_DrawStayAni("common/creatchr/jobbutton/0.ani", 40 + (NowChrSelectPos % 4 * 70), 40 + (NowChrSelectPos / 4 * 70), 2, "DrawChrJobInfoSelectPos");
}
function DrawJobButton()
{
DrawChrJobInfo();
for(local i = 0; i < 16; ++i)
{
T_DrawStayAniAlpha("common/creatchr/jobbutton/0.ani", 40 + (i % 4 * 70), 40 + (i / 4 * 70), 3 + (i * 2), "JobAni" + i, ChrJobDrawAlpha[i]);
}
local MainButton = UnderButton("MainButton", 50, 530, "common/training/main/maintab.ani", 38, 35);
MainButton.SetRectEnble(true, "MainButton", 50, 530, "common/training/main/maintab.ani", 0);
MainButton.SetCustomClickEnble(true, "MainButton", 50, 530 + 1, "common/training/main/maintab.ani", 0);
MainButton.Show();
if(MainButton.isLBActive())
{
DrawChrAniEffTimer.Reset();
DrawChrAniEffTimer.Start();
if(ChrJobDrawState == 0) ++ChrJobDrawState;
else ChrJobDrawState = ChrJobDrawState * -1;
}
//绘制阶段
if(ChrJobDrawState == 1)
{
//最后一个角色头像的Alpha值等于250之前
if(ChrJobDrawAlpha[15] < 250)
{
if(DrawChrAniEffTimer.Get() >= 15)
{
DrawChrAniEffTimer.Reset();
DrawChrAniEffTimer.Start();
for(local i = 0; i < 16; ++i)
{
local AddAlpha = (20 - i) * 1;
if(ChrJobDrawAlpha[i] + AddAlpha < 250) ChrJobDrawAlpha[i] += AddAlpha;
else ChrJobDrawAlpha[i] = 250;
}
}
}
else
{
SelectSwitch = true;
}
}
if(ChrJobDrawState == -1)
{
//第一个角色的Alpha值等于0之前
if(ChrJobDrawAlpha[0] > 0)
{
if(DrawChrAniEffTimer.Get() >= 15)
{
DrawChrAniEffTimer.Reset();
DrawChrAniEffTimer.Start();
for(local i = 0; i < 16; ++i)
{
local AddAlpha = (4 + i) * 1;
if(ChrJobDrawAlpha[i] - AddAlpha > 0) ChrJobDrawAlpha[i] -= AddAlpha;
else ChrJobDrawAlpha[i] = 0;
}
}
}
else
{
SelectSwitch = false;
}
}
//绘制选择角色职业按钮
if((SelectSwitch == true && ChrJobDrawAlpha[0] >= 35) || ChrJobDrawState == 1) DrawSelectButton();
}
function Run()
{
SyncChrSelectPos();
DrawJobButton();
}
}
CreatChrTable <- {}
function CreatChr()
{
/*
if(sq_IsKeyDown(7, ENUM_SUBKEY_TYPE_ALL))
{
if(CreatChrTable.rawin("CreatChrCObject") == true) CreatChrTable.rawdelete("CreatChrCObject");
}
*/
if(CreatChrTable.rawin("CreatChrCObject") == false) CreatChrTable.rawset("CreatChrCObject", CreatChrC());
else CreatChrTable["CreatChrCObject"].Run();
//CreatChrC.T_DrawDynamicAni("BackGround0", "common/creatchr/base/0.ani", -267, 0);
/*
if(CreatChrTable.rawin("BackGround0") == false) CreatChrTable.rawset("BackGround0", sq_CreateAnimation("", "common/creatchr/base/0.ani"));
if(CreatChrTable.rawin("BackGround1") == false) CreatChrTable.rawset("BackGround1", sq_CreateAnimation("", "common/creatchr/base/0.ani"));
if(CreatChrTable.rawin("BackGround2") == false) CreatChrTable.rawset("BackGround2", sq_CreateAnimation("", "common/creatchr/base/0.ani"));
if(CreatChrTable.rawin("BackGround3") == false) CreatChrTable.rawset("BackGround3", sq_CreateAnimation("", "common/creatchr/base/0.ani"));
sq_AnimationProc(CreatChrTable["Test"]);
sq_drawCurrentFrame(CreatChrTable["Test"], -267, 0, true);
//T_DrawDynamicAni(obj, "common/dps/maintop.ani", 0, 0, "maintop"); //绘制Dps上边栏
//print(666);
//local mouseX = IMouse.GetXPos();
//local mouseY = IMouse.GetYPos();
//print(mouseX);
//print(mouseY);
*/
}

View File

@@ -0,0 +1,9 @@
/*
文件名:Init_CodeDraw.nut
路径:UI/Init_CodeDraw/Init_CodeDraw.nut
创建日期:2022-11-14 07:25
文件用途:修改文字颜色
*/
L_RegisterCodeDraw_STL("权御九界 - 最终伤害+20%",sq_RGBA(255,177,0,250),"最终伤害+20%");
L_RegisterCodeDraw_STL("权御九界 - 冷却-6%",sq_RGBA(255,177,0,250),"冷却-6%");
L_RegisterCodeDraw_STL("权御九界 - 强化增幅几率+30%",sq_RGBA(255,177,0,250),"强化增幅几率+30%");

View File

@@ -0,0 +1,314 @@
/*
文件名:Init_ItemColor.nut
路径:UI/Init_ItemColor/Init_ItemColor.nut
创建日期:2022-11-01 02:06
文件用途:修改Item颜色
*/
//权御九界称号
L_RegisterItemColor_STL(2019185, 0xFF0055FF);
L_RegisterItemColor_STL(2022110703, 0xFF0055FF);
L_RegisterItemColor_STL(2022110704, 0xFF0055FF);
//特殊物品
L_RegisterItemColor_STL(2022111302, 0xFFACFF08);
L_RegisterItemColor_STL(2022111301, 0xFFACFF08);
L_RegisterItemColor_STL(2022111311, 0xFF00008B);
L_RegisterItemColor_STL(2022111312, 0xFF00008B);
L_RegisterItemColor_STL(2022111313, 0xFF00008B);
L_RegisterItemColor_STL(2022111314, 0xFF00008B);
L_RegisterItemColor_STL(2022111315, 0xFF00008B);
L_RegisterItemColor_STL(2022111316, 0xFF00008B);
L_RegisterItemColor_STL(2022111317, 0xFF00008B);
//传说
L_RegisterItemColor_STL(100300079, 0xFF0055FF);
L_RegisterItemColor_STL(100300080, 0xFF0055FF);
L_RegisterItemColor_STL(100300081, 0xFF0055FF);
L_RegisterItemColor_STL(100300082, 0xFF0055FF);
L_RegisterItemColor_STL(100300083, 0xFF0055FF);
L_RegisterItemColor_STL(100300329, 0xFF0055FF);
L_RegisterItemColor_STL(100300330, 0xFF0055FF);
L_RegisterItemColor_STL(100300331, 0xFF0055FF);
L_RegisterItemColor_STL(100300333, 0xFF0055FF);
L_RegisterItemColor_STL(100300334, 0xFF0055FF);
L_RegisterItemColor_STL(100300497, 0xFF0055FF);
L_RegisterItemColor_STL(100300505, 0xFF0055FF);
L_RegisterItemColor_STL(100300506, 0xFF0055FF);
L_RegisterItemColor_STL(100300507, 0xFF0055FF);
L_RegisterItemColor_STL(100310804, 0xFF0055FF);
L_RegisterItemColor_STL(100310805, 0xFF0055FF);
L_RegisterItemColor_STL(100310806, 0xFF0055FF);
L_RegisterItemColor_STL(100310807, 0xFF0055FF);
L_RegisterItemColor_STL(100310813, 0xFF0055FF);
L_RegisterItemColor_STL(100310814, 0xFF0055FF);
L_RegisterItemColor_STL(100200490, 0xFF0055FF);
L_RegisterItemColor_STL(100230410, 0xFF0055FF);
L_RegisterItemColor_STL(100220442, 0xFF0055FF);
L_RegisterItemColor_STL(100210442, 0xFF0055FF);
L_RegisterItemColor_STL(100050074, 0xFF0055FF);
L_RegisterItemColor_STL(100080019, 0xFF0055FF);
L_RegisterItemColor_STL(100080435, 0xFF0055FF);
L_RegisterItemColor_STL(100080437, 0xFF0055FF);
L_RegisterItemColor_STL(100070023, 0xFF0055FF);
L_RegisterItemColor_STL(100060029, 0xFF0055FF);
L_RegisterItemColor_STL(100060476, 0xFF0055FF);
L_RegisterItemColor_STL(100090020, 0xFF0055FF);
L_RegisterItemColor_STL(100350107, 0xFF0055FF);
L_RegisterItemColor_STL(100350108, 0xFF0055FF);
L_RegisterItemColor_STL(100350109, 0xFF0055FF);
L_RegisterItemColor_STL(100350110, 0xFF0055FF);
L_RegisterItemColor_STL(100350111, 0xFF0055FF);
L_RegisterItemColor_STL(100350112, 0xFF0055FF);
L_RegisterItemColor_STL(100350696, 0xFF0055FF);
L_RegisterItemColor_STL(100350697, 0xFF0055FF);
L_RegisterItemColor_STL(100350698, 0xFF0055FF);
L_RegisterItemColor_STL(100350699, 0xFF0055FF);
L_RegisterItemColor_STL(100352608, 0xFF0055FF);
L_RegisterItemColor_STL(100352611, 0xFF0055FF);
L_RegisterItemColor_STL(100352612, 0xFF0055FF);
L_RegisterItemColor_STL(100352613, 0xFF0055FF);
L_RegisterItemColor_STL(100352614, 0xFF0055FF);
L_RegisterItemColor_STL(100352615, 0xFF0055FF);
L_RegisterItemColor_STL(100352616, 0xFF0055FF);
L_RegisterItemColor_STL(100352617, 0xFF0055FF);
L_RegisterItemColor_STL(100352618, 0xFF0055FF);
L_RegisterItemColor_STL(100352619, 0xFF0055FF);
L_RegisterItemColor_STL(100100138, 0xFF0055FF);
L_RegisterItemColor_STL(100100533, 0xFF0055FF);
L_RegisterItemColor_STL(100130135, 0xFF0055FF);
L_RegisterItemColor_STL(100130427, 0xFF0055FF);
L_RegisterItemColor_STL(100120153, 0xFF0055FF);
L_RegisterItemColor_STL(100110122, 0xFF0055FF);
L_RegisterItemColor_STL(100110465, 0xFF0055FF);
L_RegisterItemColor_STL(100140071, 0xFF0055FF);
L_RegisterItemColor_STL(100320084, 0xFF0055FF);
L_RegisterItemColor_STL(100320085, 0xFF0055FF);
L_RegisterItemColor_STL(100320086, 0xFF0055FF);
L_RegisterItemColor_STL(100320087, 0xFF0055FF);
L_RegisterItemColor_STL(100320088, 0xFF0055FF);
L_RegisterItemColor_STL(100320089, 0xFF0055FF);
L_RegisterItemColor_STL(100320090, 0xFF0055FF);
L_RegisterItemColor_STL(100320091, 0xFF0055FF);
L_RegisterItemColor_STL(100320618, 0xFF0055FF);
L_RegisterItemColor_STL(100320619, 0xFF0055FF);
L_RegisterItemColor_STL(100320620, 0xFF0055FF);
L_RegisterItemColor_STL(100320625, 0xFF0055FF);
L_RegisterItemColor_STL(100320626, 0xFF0055FF);
L_RegisterItemColor_STL(100322054, 0xFF0055FF);
L_RegisterItemColor_STL(100322055, 0xFF0055FF);
L_RegisterItemColor_STL(100322056, 0xFF0055FF);
L_RegisterItemColor_STL(100322057, 0xFF0055FF);
L_RegisterItemColor_STL(100322058, 0xFF0055FF);
L_RegisterItemColor_STL(100322059, 0xFF0055FF);
L_RegisterItemColor_STL(100322060, 0xFF0055FF);
L_RegisterItemColor_STL(100322061, 0xFF0055FF);
L_RegisterItemColor_STL(100322062, 0xFF0055FF);
L_RegisterItemColor_STL(100322063, 0xFF0055FF);
L_RegisterItemColor_STL(100322064, 0xFF0055FF);
L_RegisterItemColor_STL(100322065, 0xFF0055FF);
L_RegisterItemColor_STL(100322066, 0xFF0055FF);
L_RegisterItemColor_STL(100322067, 0xFF0055FF);
L_RegisterItemColor_STL(100322068, 0xFF0055FF);
L_RegisterItemColor_STL(100322069, 0xFF0055FF);
L_RegisterItemColor_STL(100322070, 0xFF0055FF);
L_RegisterItemColor_STL(100322071, 0xFF0055FF);
L_RegisterItemColor_STL(100250113, 0xFF0055FF);
L_RegisterItemColor_STL(100280112, 0xFF0055FF);
L_RegisterItemColor_STL(100270136, 0xFF0055FF);
L_RegisterItemColor_STL(100260113, 0xFF0055FF);
L_RegisterItemColor_STL(100260449, 0xFF0055FF);
L_RegisterItemColor_STL(100290067, 0xFF0055FF);
L_RegisterItemColor_STL(100290300, 0xFF0055FF);
L_RegisterItemColor_STL(100150515, 0xFF0055FF);
L_RegisterItemColor_STL(100180411, 0xFF0055FF);
L_RegisterItemColor_STL(100170449, 0xFF0055FF);
L_RegisterItemColor_STL(100190287, 0xFF0055FF);
L_RegisterItemColor_STL(100340349, 0xFF0055FF);
L_RegisterItemColor_STL(100340350, 0xFF0055FF);
L_RegisterItemColor_STL(100340351, 0xFF0055FF);
L_RegisterItemColor_STL(100340352, 0xFF0055FF);
L_RegisterItemColor_STL(100340353, 0xFF0055FF);
L_RegisterItemColor_STL(100340354, 0xFF0055FF);
L_RegisterItemColor_STL(100340355, 0xFF0055FF);
L_RegisterItemColor_STL(100340356, 0xFF0055FF);
L_RegisterItemColor_STL(100341603, 0xFF0055FF);
L_RegisterItemColor_STL(100341604, 0xFF0055FF);
L_RegisterItemColor_STL(100341605, 0xFF0055FF);
L_RegisterItemColor_STL(100341606, 0xFF0055FF);
L_RegisterItemColor_STL(100341607, 0xFF0055FF);
L_RegisterItemColor_STL(100341608, 0xFF0055FF);
L_RegisterItemColor_STL(100341613, 0xFF0055FF);
L_RegisterItemColor_STL(100341614, 0xFF0055FF);
L_RegisterItemColor_STL(100341619, 0xFF0055FF);
L_RegisterItemColor_STL(100344252, 0xFF0055FF);
L_RegisterItemColor_STL(100344253, 0xFF0055FF);
L_RegisterItemColor_STL(100344254, 0xFF0055FF);
L_RegisterItemColor_STL(100344255, 0xFF0055FF);
L_RegisterItemColor_STL(100344256, 0xFF0055FF);
L_RegisterItemColor_STL(100344257, 0xFF0055FF);
L_RegisterItemColor_STL(100344258, 0xFF0055FF);
L_RegisterItemColor_STL(100344259, 0xFF0055FF);
L_RegisterItemColor_STL(100344260, 0xFF0055FF);
L_RegisterItemColor_STL(100344262, 0xFF0055FF);
L_RegisterItemColor_STL(100310072, 0xFF0055FF);
L_RegisterItemColor_STL(100310073, 0xFF0055FF);
L_RegisterItemColor_STL(100310074, 0xFF0055FF);
L_RegisterItemColor_STL(100310546, 0xFF0055FF);
L_RegisterItemColor_STL(100310547, 0xFF0055FF);
L_RegisterItemColor_STL(100310548, 0xFF0055FF);
L_RegisterItemColor_STL(100310553, 0xFF0055FF);
L_RegisterItemColor_STL(100310554, 0xFF0055FF);
L_RegisterItemColor_STL(100312195, 0xFF0055FF);
L_RegisterItemColor_STL(100312196, 0xFF0055FF);
L_RegisterItemColor_STL(100312198, 0xFF0055FF);
L_RegisterItemColor_STL(100312199, 0xFF0055FF);
L_RegisterItemColor_STL(100312200, 0xFF0055FF);
L_RegisterItemColor_STL(100312201, 0xFF0055FF);
L_RegisterItemColor_STL(100312202, 0xFF0055FF);
L_RegisterItemColor_STL(100312204, 0xFF0055FF);
L_RegisterItemColor_STL(100312205, 0xFF0055FF);
L_RegisterItemColor_STL(102030398, 0xFF0055FF);
L_RegisterItemColor_STL(102030399, 0xFF0055FF);
L_RegisterItemColor_STL(102040048, 0xFF0055FF);
L_RegisterItemColor_STL(102020052, 0xFF0055FF);
L_RegisterItemColor_STL(102020368, 0xFF0055FF);
L_RegisterItemColor_STL(102020371, 0xFF0055FF);
L_RegisterItemColor_STL(102010229, 0xFF0055FF);
L_RegisterItemColor_STL(102010463, 0xFF0055FF);
L_RegisterItemColor_STL(102010464, 0xFF0055FF);
L_RegisterItemColor_STL(102000176, 0xFF0055FF);
L_RegisterItemColor_STL(102000399, 0xFF0055FF);
L_RegisterItemColor_STL(102000400, 0xFF0055FF);
L_RegisterItemColor_STL(102030048, 0xFF0055FF);
L_RegisterItemColor_STL(102040435, 0xFF0055FF);
L_RegisterItemColor_STL(102040436, 0xFF0055FF);
L_RegisterItemColor_STL(104010043, 0xFF0055FF);
L_RegisterItemColor_STL(104010449, 0xFF0055FF);
L_RegisterItemColor_STL(104010452, 0xFF0055FF);
L_RegisterItemColor_STL(104040164, 0xFF0055FF);
L_RegisterItemColor_STL(104040468, 0xFF0055FF);
L_RegisterItemColor_STL(104040469, 0xFF0055FF);
L_RegisterItemColor_STL(104030155, 0xFF0055FF);
L_RegisterItemColor_STL(104030454, 0xFF0055FF);
L_RegisterItemColor_STL(104030455, 0xFF0055FF);
L_RegisterItemColor_STL(104040047, 0xFF0055FF);
L_RegisterItemColor_STL(104020232, 0xFF0055FF);
L_RegisterItemColor_STL(104020450, 0xFF0055FF);
L_RegisterItemColor_STL(104020453, 0xFF0055FF);
L_RegisterItemColor_STL(104000049, 0xFF0055FF);
L_RegisterItemColor_STL(104000468, 0xFF0055FF);
L_RegisterItemColor_STL(104000469, 0xFF0055FF);
L_RegisterItemColor_STL(106040050, 0xFF0055FF);
L_RegisterItemColor_STL(106040363, 0xFF0055FF);
L_RegisterItemColor_STL(106040366, 0xFF0055FF);
L_RegisterItemColor_STL(106010136, 0xFF0055FF);
L_RegisterItemColor_STL(106010384, 0xFF0055FF);
L_RegisterItemColor_STL(106010387, 0xFF0055FF);
L_RegisterItemColor_STL(106010046, 0xFF0055FF);
L_RegisterItemColor_STL(106020446, 0xFF0055FF);
L_RegisterItemColor_STL(106020449, 0xFF0055FF);
L_RegisterItemColor_STL(106000047, 0xFF0055FF);
L_RegisterItemColor_STL(106000357, 0xFF0055FF);
L_RegisterItemColor_STL(106000358, 0xFF0055FF);
L_RegisterItemColor_STL(106030137, 0xFF0055FF);
L_RegisterItemColor_STL(106030479, 0xFF0055FF);
L_RegisterItemColor_STL(106030482, 0xFF0055FF);
L_RegisterItemColor_STL(108030043, 0xFF0055FF);
L_RegisterItemColor_STL(108040343, 0xFF0055FF);
L_RegisterItemColor_STL(108040344, 0xFF0055FF);
L_RegisterItemColor_STL(108000112, 0xFF0055FF);
L_RegisterItemColor_STL(108000382, 0xFF0055FF);
L_RegisterItemColor_STL(108000383, 0xFF0055FF);
L_RegisterItemColor_STL(108010100, 0xFF0055FF);
L_RegisterItemColor_STL(108010352, 0xFF0055FF);
L_RegisterItemColor_STL(108010353, 0xFF0055FF);
L_RegisterItemColor_STL(108030386, 0xFF0055FF);
L_RegisterItemColor_STL(108030387, 0xFF0055FF);
L_RegisterItemColor_STL(108040044, 0xFF0055FF);
L_RegisterItemColor_STL(108020044, 0xFF0055FF);
L_RegisterItemColor_STL(108020095, 0xFF0055FF);
L_RegisterItemColor_STL(108020333, 0xFF0055FF);
L_RegisterItemColor_STL(108020336, 0xFF0055FF);
L_RegisterItemColor_STL(101040156, 0xFF0055FF);
L_RegisterItemColor_STL(101040405, 0xFF0055FF);
L_RegisterItemColor_STL(101040406, 0xFF0055FF);
L_RegisterItemColor_STL(101020543, 0xFF0055FF);
L_RegisterItemColor_STL(101020544, 0xFF0055FF);
L_RegisterItemColor_STL(101030044, 0xFF0055FF);
L_RegisterItemColor_STL(101010047, 0xFF0055FF);
L_RegisterItemColor_STL(101030598, 0xFF0055FF);
L_RegisterItemColor_STL(101030599, 0xFF0055FF);
L_RegisterItemColor_STL(101010731, 0xFF0055FF);
L_RegisterItemColor_STL(101010732, 0xFF0055FF);
L_RegisterItemColor_STL(101020049, 0xFF0055FF);
L_RegisterItemColor_STL(101000030, 0xFF0055FF);
L_RegisterItemColor_STL(101000574, 0xFF0055FF);
L_RegisterItemColor_STL(101000575, 0xFF0055FF);
L_RegisterItemColor_STL(109000045, 0xFF0055FF);
L_RegisterItemColor_STL(109000333, 0xFF0055FF);
L_RegisterItemColor_STL(109000334, 0xFF0055FF);
L_RegisterItemColor_STL(109010044, 0xFF0055FF);
L_RegisterItemColor_STL(109010318, 0xFF0055FF);
L_RegisterItemColor_STL(109010321, 0xFF0055FF);
L_RegisterItemColor_STL(109020042, 0xFF0055FF);
L_RegisterItemColor_STL(109030217, 0xFF0055FF);
L_RegisterItemColor_STL(109030220, 0xFF0055FF);
//以下为镇魂 释魂
L_RegisterItemColor_STL(102040045, 0xFF0055FF);
L_RegisterItemColor_STL(102020049, 0xFF0055FF);
L_RegisterItemColor_STL(102010113, 0xFF0055FF);
L_RegisterItemColor_STL(102000056, 0xFF0055FF);
L_RegisterItemColor_STL(102030045, 0xFF0055FF);
L_RegisterItemColor_STL(104010040, 0xFF0055FF);
L_RegisterItemColor_STL(104020042, 0xFF0055FF);
L_RegisterItemColor_STL(104040044, 0xFF0055FF);
L_RegisterItemColor_STL(104030049, 0xFF0055FF);
L_RegisterItemColor_STL(104000046, 0xFF0055FF);
L_RegisterItemColor_STL(106040047, 0xFF0055FF);
L_RegisterItemColor_STL(106020041, 0xFF0055FF);
L_RegisterItemColor_STL(106010043, 0xFF0055FF);
L_RegisterItemColor_STL(106000044, 0xFF0055FF);
L_RegisterItemColor_STL(106030043, 0xFF0055FF);
L_RegisterItemColor_STL(108030040, 0xFF0055FF);
L_RegisterItemColor_STL(108000044, 0xFF0055FF);
L_RegisterItemColor_STL(108010042, 0xFF0055FF);
L_RegisterItemColor_STL(108040041, 0xFF0055FF);
L_RegisterItemColor_STL(108020041, 0xFF0055FF);
L_RegisterItemColor_STL(101040045, 0xFF0055FF);
L_RegisterItemColor_STL(101030041, 0xFF0055FF);
L_RegisterItemColor_STL(101010044, 0xFF0055FF);
L_RegisterItemColor_STL(101020046, 0xFF0055FF);
L_RegisterItemColor_STL(101000027, 0xFF0055FF);
L_RegisterItemColor_STL(109000042, 0xFF0055FF);
L_RegisterItemColor_STL(109010041, 0xFF0055FF);
L_RegisterItemColor_STL(109020039, 0xFF0055FF);
L_RegisterItemColor_STL(102040046, 0xFF0055FF);
L_RegisterItemColor_STL(102020050, 0xFF0055FF);
L_RegisterItemColor_STL(102010114, 0xFF0055FF);
L_RegisterItemColor_STL(102000057, 0xFF0055FF);
L_RegisterItemColor_STL(102030046, 0xFF0055FF);
L_RegisterItemColor_STL(104010041, 0xFF0055FF);
L_RegisterItemColor_STL(104020043, 0xFF0055FF);
L_RegisterItemColor_STL(104040045, 0xFF0055FF);
L_RegisterItemColor_STL(104030050, 0xFF0055FF);
L_RegisterItemColor_STL(104000047, 0xFF0055FF);
L_RegisterItemColor_STL(106040048, 0xFF0055FF);
L_RegisterItemColor_STL(106020042, 0xFF0055FF);
L_RegisterItemColor_STL(106010044, 0xFF0055FF);
L_RegisterItemColor_STL(106000045, 0xFF0055FF);
L_RegisterItemColor_STL(106030044, 0xFF0055FF);
L_RegisterItemColor_STL(108030041, 0xFF0055FF);
L_RegisterItemColor_STL(108000045, 0xFF0055FF);
L_RegisterItemColor_STL(108010043, 0xFF0055FF);
L_RegisterItemColor_STL(108040042, 0xFF0055FF);
L_RegisterItemColor_STL(108020042, 0xFF0055FF);
L_RegisterItemColor_STL(101040046, 0xFF0055FF);
L_RegisterItemColor_STL(101030042, 0xFF0055FF);
L_RegisterItemColor_STL(101010045, 0xFF0055FF);
L_RegisterItemColor_STL(101020047, 0xFF0055FF);
L_RegisterItemColor_STL(101000028, 0xFF0055FF);
L_RegisterItemColor_STL(109000043, 0xFF0055FF);
L_RegisterItemColor_STL(109010042, 0xFF0055FF);
L_RegisterItemColor_STL(109020040, 0xFF0055FF);
//传说

View File

@@ -0,0 +1,237 @@
/*
文件名:MonsterBloodUi.nut
路径:UI/MonsterBloodUi/MonsterBloodUi.nut
创建日期:2022-10-14 18:19
文件用途:
*/
NowHitMonsterId <- null
BOSSOpenDraw <- false
class NewMonsterBlood extends BasicsDrawTool {
Id = null;
OldHp = null;
NowHp = null;
HpArr = null;
MonsterBloodUiEffTimer = null;
constructor(id) {
HpArr = [];
Id = id;
//构造血条Timer
MonsterBloodUiEffTimer = TimeSTL("MonsterBloodUiEffTimerid" + id, 2000);
}
function Delete() {
MonsterBloodUiEffTimer.Delete();
}
function SetDate(MonObject, Hp) {
if (!MonObject || MonObject.isDead()) return;
//if(MonsterBloodUiEffTimer.Get() >= 300 || MonsterBloodUiEffTimer.Get() == 0)
//{
if (MonObject.getHp() > Hp)
HpArr.append(Hp);
//}
}
function Run(object) {
if (!object || object.isDead()) return;
if (!OldHp) {
OldHp = object.getHp();
HpArr.append(OldHp);
HpArr.append(OldHp);
//重置时间容器
MonsterBloodUiEffTimer.Reset();
//开始计时
MonsterBloodUiEffTimer.Start();
}
}
//绘制简易静态Ani // obj -- ani路径 -- X -- Y -- 第几帧 -- ani名字
function DrawStayAni(obj, aniFileName, x, y, index, aniname, R, G, B, A) {
if (!obj) return;
local SelectAni = obj.getVar().GetAnimationMap(aniname, aniFileName);
if (SelectAni) {
SelectAni.setRGBA(R, G, B, A);
//sq_AnimationProc(SelectAni);
sq_DrawSpecificFrame(SelectAni, x, y, false, index, false, 1.0);
}
}
//绘制跟随血条
function DrawF_MonsterHp(obj, OldRate, BloodRate, Time, ArrCount, Xpos, Ypos, MonObject) {
local color = 0xFFffffff;
if (MonObject.isObjectType(OBJECTTYPE_CHARACTER) && MonObject.getTeam() == 0) color = 0xFF4990aa; //角色对象
else if (MonObject.isObjectType(OBJECTTYPE_CHARACTER) && MonObject.getTeam() != 0) color = 0xFF0000CC; //敌对角色对象
else if (!MonObject.isObjectType(OBJECTTYPE_CHARACTER) && MonObject.getTeam() == 0) color = 0xFF00ff00; //友方对象
L_sq_DrawCode("Lv." + MonObject.GetLevel().tostring(), Xpos - 49, Ypos + 16, color, 0, 1);
L_sq_DrawCode(MonObject.GetName(), Xpos - 17, Ypos + 16, color, 0, 1);
local R = 0xff;
local G = 0x00;
local B = 0x00;
if (MonObject.getTeam() == 0) {
R = 0x00;
G = 0xff;
} else if (MonObject.getTeam() == 200) {
R = 0xFF;
G = 0x66;
}
local MR = 0x00;
local MG = 0x99;
local MB = 0xFF;
T_DrawStayAni(obj, "common/monsterbloodui/new/normain.ani", Xpos - 47, Ypos + 30, 0, "怪物血槽nor底");
//绘制血槽特效
local v = sq_GetUniformVelocity((OldRate * 96.0).tointeger(), (BloodRate * 96.0).tointeger(), Time * (ArrCount - 1), 300);
local av = sq_GetUniformVelocity(250, 100, Time * (ArrCount - 1), 300);
if (v < 0) v = 0;
setClip(Xpos - 47 + 2, Ypos + 30 + 1, Xpos - 47 + 3 + v, Ypos + 30 + 1 + 6);
DrawStayAni(obj, "common/monsterbloodui/new/noreff.ani", Xpos - 47 + 3, Ypos + 30 + 2, 0, "怪物血槽nor", 255, 255, 255, av);
releaseClip(); //裁切结束
//绘制血槽
setClip(Xpos - 47 + 2, Ypos + 30 + 1, Xpos - 47 + 3 + (BloodRate * 96.0).tointeger(), Ypos + 30 + 1 + 6);
DrawStayAni(obj, "common/monsterbloodui/new/noreff.ani", Xpos - 47 + 3, Ypos + 30 + 2, 0, "怪物血槽norEFf", R, G, B, 250);
releaseClip();
//如果需要绘制蓝槽
if (MonObject.isObjectType(OBJECTTYPE_CHARACTER) /*|| sq_IsMyControlObject(MonObject)*/ ) {
T_DrawStayAni(obj, "common/monsterbloodui/new/normain.ani", Xpos - 47, Ypos + 38, 0, "怪物蓝槽nor底");
local m = ((MonObject.getMp().tofloat() / MonObject.getMpMax().tofloat()) * 96.0).tointeger();
setClip(Xpos - 47 + 2, Ypos + 38 + 1, Xpos - 47 + 3 + m, Ypos + 30 + 1 + 6);
DrawStayAni(obj, "common/monsterbloodui/new/noreff.ani", Xpos - 47 + 3, Ypos + 38 + 2, 0, "怪物蓝槽nor", MR, MG, MB, 250);
releaseClip(); //裁切结束
}
}
//绘制固定血条 基础坐标 血槽框补全坐标 血条偏移坐标 血条高度
function DrawFX_MonsterHp(obj, OldRate, BloodRate, Time, ArrCount, Type, X, Y, XF, YF, XS, YS, YM) {
local v = sq_GetUniformVelocity((OldRate * 538.0).tointeger(), (BloodRate * 538.0).tointeger(), Time * (ArrCount - 1), 1000);
local av = sq_GetUniformVelocity(250, 100, Time * (ArrCount - 1), 1000);
if (v < 0) v = 0;
//绘制血槽底
T_DrawStayAni(obj, "common/monsterbloodui/zh/normain.ani", X, Y, 0, 0 + "BOSSNewMonsterBloodUi_Main");
//绘制生命值
setClip(X, Y, X + v, Y + YM);
local BloodEffAni = obj.getVar().GetAnimationMap(2 + "_NewMonsterBloodUi_BloodEff", "common/monsterbloodui/zh/normain.ani");
BloodEffAni.setRGBA(255, 255, 255, av);
sq_DrawSpecificFrame(BloodEffAni, X, Y, false, 2, false, 1.0);
releaseClip();
setClip(X, Y, X + (BloodRate * 538).tointeger(), Y + YM);
T_DrawStayAni(obj, "common/monsterbloodui/zh/normain.ani", X, Y, 1, 1 + "_NewMonsterBloodUi_Blood");
releaseClip();
}
function Draw(obj, MonObject) {
if (!MonObject || !obj || MonObject.isDead() || obj.isDead()) return;
local Xpos = sq_GetScreenXPos(MonObject);
local Ypos = sq_GetScreenYPos(MonObject);
//local Zpos = sq_GetHeightObject(MonObject);
//Ypos -= (Zpos * 1.50).tointeger();
local ArrCount = HpArr.len();
if (ArrCount > 1) {
///print(11111);
local Time = MonsterBloodUiEffTimer.Get();
if (Time == false) return;
if ((Time * (ArrCount - 1)) >= 300 && ArrCount > 2) {
HpArr.remove(0);
//重置时间容器
MonsterBloodUiEffTimer.Reset();
//开始计时
MonsterBloodUiEffTimer.Start();
}
OldHp = HpArr[0];
NowHp = HpArr[1];
local OldRate = OldHp.tofloat() / MonObject.getHpMax().tofloat();
local BloodRate = NowHp.tofloat() / MonObject.getHpMax().tofloat();
//普通怪物血条
//DrawFX_MonsterHp(obj, OldRate, BloodRate, Time, ArrCount, 0, 0, 110, 626, 15, 29, 17, 27);
if (getroottable().rawin("S_MonsterBloodSB") && getroottable()["S_MonsterBloodSB"] == true) {
//Boss血条
if (sq_IsBoss(MonObject)) {
//DrawFX_MonsterHp(obj, OldRate, BloodRate, Time, ArrCount, 8, 0, 110, 628, 0, 34, 4, 50);
}
//普通怪物血条
else if (!sq_IsBoss(MonObject)) DrawF_MonsterHp(obj, OldRate, BloodRate, Time, ArrCount, Xpos, Ypos, MonObject);
} else {
}
//Boss血条
if (sq_GetObjectId(MonObject) == NowHitMonsterId && sq_IsBoss(MonObject) && BOSSOpenDraw == true) {
DrawFX_MonsterHp(obj, OldRate, BloodRate, Time, ArrCount, 8, 34, 130, 628, 0, 34, 4, 50);
BOSSOpenDraw = false;
}
}
}
}
function NewMonsterBloodUi(obj) {
local RootTab = getroottable();
if (sq_GetCurrentModuleType() == 3 || sq_GetCurrentModuleType() == 10 || sq_GetCurrentModuleType() == 12 || sq_GetCurrentModuleType() == 13) {
if (RootTab.rawin("MonBloodUI") == false) {
local Map = {};
RootTab.rawset("MonBloodUI", Map);
}
}
}
//Hook获取是否要使用新版血条
function Sq_GetDrawMonBloodSw() {
if (getroottable().rawin("S_MonsterBloodSB")) return getroottable()["S_MonsterBloodSB"];
else return false;
}
//新版怪物血条回调
function Sq_DrawMonsterBlood(Object, X, Y) {
BOSSOpenDraw = true;
//Sout("X: %L" , X);
//Sout("Y: %L" , Y);
}
//附加Ap
function MonsterBlood_ApAdd(obj) {
local objectManager = obj.getObjectManager();
if (!objectManager) return;
local CollisionObjectNumber = objectManager.getCollisionObjectNumber();
for (local i = 0; i < CollisionObjectNumber; i += 1) {
local object = objectManager.getCollisionObject(i);
if (object && object.isObjectType(OBJECTTYPE_ACTIVE)) {
local activeObj = sq_GetCNRDObjectToActiveObject(object); //活動類
//沒死亡
if (!activeObj.isDead()) {
if (!CNSquirrelAppendage.sq_IsAppendAppendage(activeObj, "appendage/currency_monster.nut")) {
local append = CNSquirrelAppendage.sq_AppendAppendage(activeObj, obj, -1, true, "appendage/currency_monster.nut", false);
CNSquirrelAppendage.sq_AppendAppendageID(append, activeObj, obj, 255, false);
}
}
}
}
}

235
UI/TeamDps/TeamDps.nut Normal file
View File

@@ -0,0 +1,235 @@
/*
文件名:TeamDps.nut
路径:UI/TeamDps/TeamDps.nut
创建日期:2023-01-26 05:15
文件用途:团队DPS
*/
function onSetHp_appendage_dps(appendage, hp, attacker) {
if (!appendage) {
return hp;
}
local parentObj = appendage.getParent();
local sourceObj = appendage.getSource();
local RootTab = getroottable();
if (RootTab.rawin("TEAMDPSCONTROLOBJECT")) RootTab["TEAMDPSCONTROLOBJECT"].onSetHp(appendage, hp, attacker);
return hp;
}
class TeamDps extends BasicsDrawTool {
MyDamage = 0;
TeamDpsTimer = null;
GetTeamDpsTimer = null;
PackSize = 0;
DPSSTL = {};
function TeamDpsPack(chunk) {
local RootTab = getroottable();
if (RootTab.rawin("TEAMDPSCONTROLOBJECT") == false)return;
local TObj = RootTab["TEAMDPSCONTROLOBJECT"];
local TeamDpsPack = Json_STL("TeamDpsPack");
TeamDpsPack.Parse(chunk, 0, false);
TObj.PackSize = TeamDpsPack.Get("PACKSIZE");
for (local i = 0; i < TObj.PackSize; ++i) {
local tab = ["Player", "0", "0%", "0.0"];
tab[0] = TeamDpsPack.Get("PACK->" + i + "->NAME");
tab[1] = TeamDpsPack.Get("PACK->" + i + "->DAMAGE");
tab[2] = TeamDpsPack.Get("PACK->" + i + "->RATE");
tab[3] = TeamDpsPack.Get("PACK->" + i + "->RATENUM");
if (tab[0] != false && tab[1] != false && tab[2] != false && tab[3] != false)
TObj.DPSSTL.rawset(i, tab);
}
TeamDpsPack.Delete();
}
constructor() {
//构造同步Timer
TeamDpsTimer = TimeSTL("TeamDpsTimer", 5000);
TeamDpsTimer.Start();
GetTeamDpsTimer = TimeSTL("GetTeamDpsTimer", 5000);
GetTeamDpsTimer.Start();
Pack_Control.rawset(614, TeamDpsPack);
}
//AP成员函数
function onSetHp(Append, Hp, Attacker) {
if (!Append) return Hp;
local MonsterObj = sq_GetCNRDObjectToActiveObject(Append.getParent()); //获取怪物
local Chr = sq_GetCNRDObjectToSQRCharacter(sq_getMyCharacter()); //获取我自己
if (!MonsterObj || !Chr) //如果怪物或者我自己不存在设置AP销毁
{
Append.setValid(false);
return Hp;
}
//if(!MonsterObj.isMyControlObject()) return Hp; //如果怪物对象是我的角色直接返回
local MonsterHp = MonsterObj.getHp(); //获取怪物当前生命值
if (Attacker == null && MonsterHp > Hp) //如果攻击者为空 并且 当前生命值大于要设置的生命值
{
if (!Chr.isEnemy(MonsterObj)) return Hp; //如果怪物和我不是敌对直接返回
local DamageHp = MonsterHp - Hp; //得到这次掉的血
if (DamageHp < 2147483647) {
//MyDamage += DamageHp;
return Hp;
}
}
if (Attacker != null && sq_IsMyControlObject(Attacker) && MonsterHp > Hp) //如果攻击者是我自己 并且 当前生命值大于要设置的生命值
{
if (!Chr.isEnemy(MonsterObj)) return Hp; //如果怪物和我不是敌对直接返回
local DamageHp = MonsterHp - Hp; //得到这次掉的血
if (DamageHp < 2147483647) {
MyDamage += DamageHp;
return Hp;
}
}
return Hp;
}
//绘制函数
function DrawDpsFunc(obj) {
//print(TEAMDPSCONTROL.DPSSTL[0][0]);
//print(TEAMDPSCONTROL.DPSSTL[0][1]);
local Psize = 4;
local Base_X = 20;
local Base_Y = 120;
T_DrawDynamicAni(obj, "common/dps/maintop.ani", Base_X, Base_Y, "maintop"); //绘制Dps上边栏
for (local i = 0; i < PackSize; i++) {
T_DrawDynamicAni(obj, "common/dps/main.ani", Base_X, Base_Y + 41 + (i * 22), "main"); //绘制Dps中间栏
if (DPSSTL.rawin(i)) {
T_DrawDynamicAni(obj, "common/dps/dps.ani", Base_X + 8, Base_Y + 22 + (i * 28), "mainslot" + i); //绘制Dps中间槽底
local Rate = DPSSTL[i][3].tofloat();
setClip(Base_X + 8, Base_Y + 22 + (i * 28), Base_X + 8 + (160.0 * Rate).tointeger(), Base_Y + 22 + (i * 28) + 18); //开始裁切
T_DrawDynamicAni(obj, "common/dps/dps" + (i + 1) + ".ani", Base_X + 8, Base_Y + 22 + (i * 28), "mainslotc" + i); //绘制Dps中间槽
releaseClip(); //裁切结束
L_Code_STL(DPSSTL[i][0], Base_X + 10, Base_Y + 24 + (i * 28), 0xFFFFFFFF, 0);
L_Code_STL(DPSSTL[i][1].tostring(), Base_X + 94, Base_Y + 24 + (i * 28), 0xFFFFFFFF, 0);
local RateStr = DPSSTL[i][2].tostring();
local RateStrLen = RateStr.len();
L_Code_STL(RateStr, Base_X + 164 - (RateStrLen * 5), Base_Y + 24 + (i * 28), 0xFFFFFFFF, 0);
}
}
T_DrawDynamicAni(obj, "common/dps/mainbotton.ani", Base_X, Base_Y + 41 + (PackSize * 22), "mainbotton"); //绘制Dps下边栏
//T_DrawDynamicAni(obj, "common/dps/maintop.ani", Base_X, Base_Y, "maintop");
/*
for(local i = 0; i < 4; ++i)
{
if(DPSSTL.rawin(i))
{
L_Code_STL(DPSSTL[i][0], 28, 110 + (i * 24), 0xFFFFFFFF, 1);
L_Code_STL(DPSSTL[i][1].tostring() + " " + DPSSTL[i][2].tostring(), 148, 110 + (i * 24), 0xFFFFFFFF, 1);
}
}
*/
}
//常规成员函数
function exit() {
TeamDpsTimer.Reset();
TeamDpsTimer.Delete();
GetTeamDpsTimer.Reset();
GetTeamDpsTimer.Delete();
DPSSTL.rawdelete(0);
DPSSTL.rawdelete(1);
DPSSTL.rawdelete(2);
DPSSTL.rawdelete(3);
}
function Run(obj) {
if (TeamDpsTimer.Get() >= 1700) {
local TeamDpsBuffer = Json_STL("TeamDpsBuffer");
TeamDpsBuffer.Put("op", 611);
TeamDpsBuffer.Put("DAMAGE", MyDamage);
local str = TeamDpsBuffer.GetString();
L_sq_SendPackType(130);
L_sq_SendPackWChar(str);
L_sq_SendPack();
TeamDpsBuffer.Delete();
MyDamage = 0;
TeamDpsTimer.Reset();
TeamDpsTimer.Start();
}
if (GetTeamDpsTimer.Get() >= 3000) {
local TeamDpsBuffer = Json_STL("GetTeamDpsBuffer");
TeamDpsBuffer.Put("op", 613);
local str = TeamDpsBuffer.GetString();
L_sq_SendPackType(130);
L_sq_SendPackWChar(str);
L_sq_SendPack();
TeamDpsBuffer.Delete();
GetTeamDpsTimer.Reset();
GetTeamDpsTimer.Start();
}
DrawDpsFunc(obj);
}
}
function TeamDPS(obj) {
if (!obj) return false; //如果人物不存在则返回
local RootTab = getroottable();
//建立时间容器
if (RootTab.rawin("TeamDpsMonTimer") == false) {
local Buf = TimeSTL("TeamDpsMonTimer", 500);
Buf.Start();
RootTab.rawset("TeamDpsMonTimer", Buf);
}
if (sq_GetCurrentModuleType() != 3 && sq_GetCurrentModuleType() != 10 && sq_GetCurrentModuleType() != 12 && sq_GetCurrentModuleType() != 13) {
if (RootTab.rawin("TEAMDPSCONTROLOBJECT")) {
RootTab["TEAMDPSCONTROLOBJECT"].exit();
RootTab.rawdelete("TEAMDPSCONTROLOBJECT");
}
return false; //如果不是处于副本中则返回
}
if (RootTab["TeamDpsMonTimer"].Get() >= 500) {
RootTab["TeamDpsMonTimer"].Reset();
RootTab["TeamDpsMonTimer"].Start();
local objectManager = obj.getObjectManager();
if (objectManager) {
local CollisionObjectNumber = objectManager.getCollisionObjectNumber();
for (local i = 0; i < CollisionObjectNumber; ++i) {
local Monobject = objectManager.getCollisionObject(i);
Monobject = sq_GetCNRDObjectToActiveObject(Monobject);
if (Monobject && Monobject.isObjectType(OBJECTTYPE_ACTIVE) && obj.isEnemy(Monobject)) {
if (!CNSquirrelAppendage.sq_IsAppendAppendage(Monobject, "appendage/teamdps/dps.nut")) {
CNSquirrelAppendage.sq_AppendAppendage(Monobject, obj, -1, false, "appendage/teamdps/dps.nut", true);
}
}
}
}
}
if (!RootTab.rawin("TEAMDPSCONTROLOBJECT")) {
local Buffer = TeamDps();
RootTab.rawset("TEAMDPSCONTROLOBJECT", Buffer);
}
RootTab["TEAMDPSCONTROLOBJECT"].Run(obj);
}