diff --git a/FileConfig.json b/FileConfig.json index 7043f7d..53cf83e 100644 --- a/FileConfig.json +++ b/FileConfig.json @@ -82,15 +82,37 @@ } }, "装备跨界": { - "Private": true, + "price": 0, "Script": [ "Project/ItemTool/ItemCrossover/ItemCrossover.nut" ], "info": { - "ProjectAuthor": "官方 (期限:月)", + "ProjectAuthor": "0", "ProjectVersion": "1.0.0", - "ProjectDescribe": "装备跨界定制插件", - "ImageMini": "http://49.234.27.222:8651/dps/download2/Image:chengjiu.png" + "ProjectDescribe": "装备跨界插件", + "ProjectAlias": "装备跨界插件", + "ProjectDetails": [ + { + "type": "img", + "content": "0" + }, + { + "type": "img", + "content": "1" + }, + { + "type": "img", + "content": "2" + }, + { + "type": "str", + "content": "在 etc/rindro/itemtool/itemcrossover/itemcrossover.etc 文件中更改配置,详细说明如下." + }, + { + "type": "img", + "content": "3" + } + ] } }, "赛利亚的热忱": { @@ -119,13 +141,16 @@ { "type": "img", "content": "0" - },{ + }, + { "type": "str", "content": "在 etc/rindro/ancientrelic/ancientrelic.etc 文件中更改配置,三个数字为一组,(装备编号,普通状态下伤害倍率,开启魔能爆发状态下伤害倍率),可自行拓展装备和伤害,不限制装备类型." - },{ + }, + { "type": "img", "content": "1" - },{ + }, + { "type": "str", "content": "其余机制均与原版一模一样." } diff --git a/Project/CustomizeWeapon/AncientRelic/AncientRelic.nut b/Project/CustomizeWeapon/AncientRelic/AncientRelic.nut index 59d6a2e..d5e9ba6 100644 --- a/Project/CustomizeWeapon/AncientRelic/AncientRelic.nut +++ b/Project/CustomizeWeapon/AncientRelic/AncientRelic.nut @@ -10,6 +10,8 @@ class CustomizeWeapon_AncientRelic { //是否有荒古装备 IsAncientRelic = false; + //当前荒古装备信息 + CurrentAncientRelicInfo = null; //当前魔能积攒数值 MagicEnergyValue = 0; //当前魔能开启状态 @@ -23,6 +25,7 @@ class CustomizeWeapon_AncientRelic { //魔能状态伤害增加率 MagicDamageRate = 1.0; + EffectSetFlag = null; constructor() { Info = {}; @@ -38,10 +41,12 @@ class CustomizeWeapon_AncientRelic { } local NormalRate = Data.Get(); local ExRate = Data.Get(); + local DefaultMagicEnergyValue = Data.Get(); Info.rawset(Fbuf, { NormalRate = NormalRate.tofloat() / 100.0 + 1.0, - ExRate = ExRate.tofloat() / 100.0 + 1.0 + ExRate = ExRate.tofloat() / 100.0 + 1.0, + DefaultMagicEnergyValue = DefaultMagicEnergyValue.tointeger() }) } } @@ -52,7 +57,7 @@ class CustomizeWeapon_AncientRelic { return MagicEnergyState ? MagicDamageRate : DamageRate; }.bindenv(this)); - DrawAppendCallBackFunc.rawset("AncientRelic", DrawEffect.bindenv(this)); + // DrawAppendCallBackFunc.rawset("AncientRelic", DrawEffect.bindenv(this)); // onAttackParentCallBackFunc.rawset("AncientRelic", OnAttack.bindenv(this)); // local str = "funcaksdnjkansdknasjdad"; @@ -70,6 +75,13 @@ class CustomizeWeapon_AncientRelic { local appendage = CNSquirrelAppendage.sq_GetAppendage(obj, "../etc/rindro/ancientrelic/ancientrelic.nut"); if (!appendage) { CNSquirrelAppendage.sq_AppendAppendage(obj, obj, 169, true, "../etc/rindro/ancientrelic/ancientrelic.nut", true); + if (CurrentAncientRelicInfo) { + DamageRate = CurrentAncientRelicInfo.NormalRate; + MagicDamageRate = CurrentAncientRelicInfo.ExRate; + MagicEnergyValue = CurrentAncientRelicInfo.DefaultMagicEnergyValue; + } + //默认魔能值不为0的装备 + if (MagicEnergyValue != 0) SetEffect(); } } } @@ -77,7 +89,8 @@ class CustomizeWeapon_AncientRelic { //魔能爆炸 function MagicEnergyExplosion(obj) { local OutbreakBool = obj.getMyPassiveObject(48882, 0); - if (OutbreakBool && !MagicEnergyState) { + if (OutbreakBool && !MagicEnergyState && MagicEnergyValue >= 100) { + EffectSetFlag = 7; MagicEnergyState = true; MagicEnergyTimer = Clock(); sq_SendDestroyPacketPassiveObject(OutbreakBool); @@ -85,47 +98,83 @@ class CustomizeWeapon_AncientRelic { } - //绘制魔能特效 - function DrawEffect(args) { - if (IsAncientRelic) { - //魔能开启状态 - if (MagicEnergyValue > 0) { - if (MagicEnergyState) { - if (MagicEnergyStage == 0) { - Rindro_BaseToolClass.DrawAniEx(args[1], args[2], "etc/rindro/ancientrelic/ani/open/01_red/red_onedodge2.ani"); - } else if (MagicEnergyStage == 1) { - Rindro_BaseToolClass.DrawAniEx(args[1], args[2], "etc/rindro/ancientrelic/ani/open/02_yellow/yellow_onedodge2.ani"); - } else if (MagicEnergyStage == 2) { - Rindro_BaseToolClass.DrawAniEx(args[1], args[2], "etc/rindro/ancientrelic/ani/open/03_white/white_onedodge2.ani"); - } - } - //普通状态 - else { - local Step = ((MagicEnergyValue / 20).tointeger() + 1); - if (Step > 5) Step = 5; - Rindro_BaseToolClass.DrawAniEx(args[1], args[2], "etc/rindro/ancientrelic/ani/" + Step + "/particle1.ani"); - } + // //绘制魔能特效 + // function DrawEffect(args) { + // if (IsAncientRelic) { + // //魔能开启状态 + // if (MagicEnergyValue > 0) { + // if (MagicEnergyState) { + // if (MagicEnergyStage == 0) { + // Rindro_BaseToolClass.DrawAniEx(args[1], args[2], "etc/rindro/ancientrelic/ani/open/01_red/red_onedodge2.ani"); + // } else if (MagicEnergyStage == 1) { + // Rindro_BaseToolClass.DrawAniEx(args[1], args[2], "etc/rindro/ancientrelic/ani/open/02_yellow/yellow_onedodge2.ani"); + // } else if (MagicEnergyStage == 2) { + // Rindro_BaseToolClass.DrawAniEx(args[1], args[2], "etc/rindro/ancientrelic/ani/open/03_white/white_onedodge2.ani"); + // } + // } + // //普通状态 + // else { + // local Step = ((MagicEnergyValue / 20).tointeger() + 1); + // if (Step > 5) Step = 5; + // Rindro_BaseToolClass.DrawAniEx(args[1], args[2], "etc/rindro/ancientrelic/ani/" + Step + "/particle1.ani"); + // } - } - } - } + // } + // } + // } //攻击判定回调 function OnAttack() { - if (IsAncientRelic) { + if (IsAncientRelic && !MagicEnergyState) { MagicEnergyValue++; + + SetEffect(); + if (MagicEnergyValue > 100) MagicEnergyValue = 100; } } + //设置魔能值与动画关联关系 + function SetEffect() { + if (MagicEnergyValue == 1) EffectSetFlag = 1; + if (MagicEnergyValue == 20) EffectSetFlag = 2; + if (MagicEnergyValue == 40) EffectSetFlag = 3; + if (MagicEnergyValue == 60) EffectSetFlag = 4; + if (MagicEnergyValue == 80) EffectSetFlag = 5; + if (MagicEnergyValue == 100) EffectSetFlag = 6; + } + + function AppendProc(appendage) { + if (EffectSetFlag != null && EffectSetFlag <= 6 && !MagicEnergyState) { + appendage.sq_DeleteEffectFront(); + appendage.sq_AddEffectFront("etc/rindro/ancientrelic/ani/" + EffectSetFlag + "/particle1.ani"); + EffectSetFlag = null; + } else if (EffectSetFlag == 7) { + appendage.sq_DeleteEffectFront(); + appendage.sq_AddEffectFront("etc/rindro/ancientrelic/ani/open/01_red/red_onedodge2.ani"); + EffectSetFlag = null; + } else if (EffectSetFlag == 8) { + appendage.sq_DeleteEffectFront(); + appendage.sq_AddEffectFront("etc/rindro/ancientrelic/ani/open/02_yellow/yellow_onedodge2.ani"); + EffectSetFlag = null; + } else if (EffectSetFlag == 9) { + appendage.sq_DeleteEffectFront(); + appendage.sq_AddEffectFront("etc/rindro/ancientrelic/ani/open/03_white/white_onedodge2.ani"); + EffectSetFlag = null; + } else if (EffectSetFlag == 10) { + appendage.sq_DeleteEffectFront(); + EffectSetFlag = null; + } + } + + //检测是否穿戴荒古装备 function CheckWear() { for (local i = 1; i< 13; ++i) { //编号 local Index = L_sq_GetCharacterAttribute(0x1c, i); if (Info.rawin(Index)) { - DamageRate = Info[Index].NormalRate; - MagicDamageRate = Info[Index].ExRate; + CurrentAncientRelicInfo = Info[Index]; IsAncientRelic = true; return; } @@ -139,14 +188,16 @@ class CustomizeWeapon_AncientRelic { if (MagicEnergyValue > 0) { if (MagicEnergyState) { //检测魔能变更时间 - if (Clock() - MagicEnergyTimer >= 7000) { + if (Clock() - MagicEnergyTimer >= 1000) { MagicEnergyTimer = Clock(); MagicEnergyStage++; + EffectSetFlag = 7 + MagicEnergyStage; //爆发结束 if (MagicEnergyStage > 2) { MagicEnergyState = false; MagicEnergyStage = 0; MagicEnergyValue = 0; + EffectSetFlag = 10; sq_GetCNRDObjectToSQRCharacter(obj).sq_SendCreatePassiveObjectPacket(48883, 0, 0, 0, 0); } } @@ -177,6 +228,11 @@ class CustomizeWeapon_AncientRelic { DamageRate = 1.0; //魔能状态伤害增加率 MagicDamageRate = 1.0; + //移除掉身上的AP + local appendage = CNSquirrelAppendage.sq_GetAppendage(obj, "../etc/rindro/ancientrelic/ancientrelic.nut"); + if (appendage) { + CNSquirrelAppendage.sq_RemoveAppendage(obj, "../etc/rindro/ancientrelic/ancientrelic.nut"); + } } } } @@ -202,4 +258,12 @@ function onAttackParent_appendage_AncientRelic(appendage, realAttacker, damager, } } +function proc_appendage_ancient(appendage) { + if (!appendage) return; + local RootTab = getroottable(); + if (RootTab.rawin("CustomizeWeapon_AncientRelic_Obj")) { + RootTab["CustomizeWeapon_AncientRelic_Obj"].AppendProc(appendage); + } +} + getroottable()["LenheartFuncTab"].rawset("AncientRelicFuncN", Lenheart_AncientRelic_Fun); \ No newline at end of file diff --git a/Project/EventShop/EventShop.nut b/Project/EventShop/EventShop.nut index 5578afc..18394cb 100644 --- a/Project/EventShop/EventShop.nut +++ b/Project/EventShop/EventShop.nut @@ -67,8 +67,6 @@ class EventShopC extends LenheartNewUI_Windows { function RegisterNpc(id) { local EachManager = getroottable()["L_Each_Obj"]; - //先清空注册 - EachManager.RemoveEachForNpc(id); EachManager.AddEachForNpc(id, function(SThis) { //关闭按钮 diff --git a/Project/Exchange/Exchange.nut b/Project/Exchange/Exchange.nut index acba1e5..469336c 100644 --- a/Project/Exchange/Exchange.nut +++ b/Project/Exchange/Exchange.nut @@ -125,8 +125,6 @@ class ExchangeC extends LenheartNewUI_Windows { function RegisterNpc(id) { local EachManager = getroottable()["L_Each_Obj"]; - //先清空注册 - EachManager.RemoveEachForNpc(id); EachManager.AddEachForNpc(id, function(SThis) { //关闭按钮 local ApplyEngagementButton = LenheartNewUI_Each_BaseButton(0, 0, 100, 21, "interface2/popup_menu/popup_back.img", 3); diff --git a/Project/ItemTool/ItemCrossover/img/0.png b/Project/ItemTool/ItemCrossover/img/0.png new file mode 100644 index 0000000..62a7d3d Binary files /dev/null and b/Project/ItemTool/ItemCrossover/img/0.png differ diff --git a/Project/ItemTool/ItemCrossover/img/1.png b/Project/ItemTool/ItemCrossover/img/1.png new file mode 100644 index 0000000..374a3c5 Binary files /dev/null and b/Project/ItemTool/ItemCrossover/img/1.png differ diff --git a/Project/ItemTool/ItemCrossover/img/2.png b/Project/ItemTool/ItemCrossover/img/2.png new file mode 100644 index 0000000..62a7d3d Binary files /dev/null and b/Project/ItemTool/ItemCrossover/img/2.png differ diff --git a/Project/ItemTool/ItemCrossover/img/3.png b/Project/ItemTool/ItemCrossover/img/3.png new file mode 100644 index 0000000..ca84313 Binary files /dev/null and b/Project/ItemTool/ItemCrossover/img/3.png differ diff --git a/Project/ItemTool/ItemInherit/ItemInherit.nut b/Project/ItemTool/ItemInherit/ItemInherit.nut new file mode 100644 index 0000000..42bcabb --- /dev/null +++ b/Project/ItemTool/ItemInherit/ItemInherit.nut @@ -0,0 +1,84 @@ +/* +文件名:ItemInherit.nut +路径:Project/ItemTool/ItemInherit/ItemInherit.nut +创建日期:2025-12-15 15:03 +文件用途: +*/ +class ItemInheritC extends LenheartNewUI_Windows { + //调试模式 + // DeBugMode = true; + + //不是窗口 + // NoWindow = true; + + //是否可见 + // Visible = false; + + NPCList = null; + + Img = Rindro_Image("interface2/ui/newitemtool/newitemtool.img"); + + constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { + Childrens = []; + //注册控件 + RegisterWidget(); + + LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH); + } + + function RegisterWidget() { + // //关闭按钮 + // local CloseButton = LenheartNewUI_BaseButton(278, 0, 11, 12, "interface/lenheartwindowcommon.img", 276); + // CloseButton.OnClick = function() { + // this.Visible = false; + // }.bindenv(this); + // Childrens.append(CloseButton); + + + } + + //绘制主界面 + function DrawMain(obj) { + //背景框 + DrawNineBox(X, Y, 292, 292, "interface/lenheartwindowcommon.img", 213); + //标题 + DrawWindowTitle(293); + //绘制标题名 + L_sq_DrawCode("装备继承", X + 123, Y + 5, sq_RGBA(230, 200, 155, 255), 0, 1); + + + Img.DrawPng(3, X + 8, Y + 32); + + + Rindro_Image_GlobalMap["lenheartui"].DrawPng(469, X + 260, Y + 40); + + } + + function Show(obj) { + DrawMain(obj); + LenheartNewUI_Windows.Show(obj); + + } + + //逻辑入口 + function Proc(obj) { + LenheartNewUI_Windows.SyncPos(X, Y); + } + +} + +L_Windows_List <- []; +getroottable().rawdelete("LenheartPluginsInitFlag"); +getroottable().rawdelete("EventList_Obj") +getroottable().rawdelete("ItemInherit_Obj"); +getroottable().rawdelete("L_Each_Obj"); + +function Lenheart_ItemInherit_Fun(obj) { + local RootTab = getroottable(); + if (!RootTab.rawin("ItemInherit_Obj")) { + RootTab.rawset("ItemInherit_Obj", true); + LenheartNewUI_CreateWindow(ItemInheritC, "装备继承窗口", ((getroottable().Rindro_Scr_Width - 700) / 2).tointeger(), 160, 292, 290, 28); + } +} + +getroottable()["LenheartFuncTab"].rawset("ItemInheritFuncN", Lenheart_ItemInherit_Fun); \ No newline at end of file diff --git a/Project/NpcTransaction/NpcTransaction.nut b/Project/NpcTransaction/NpcTransaction.nut index ba90012..86b13e7 100644 --- a/Project/NpcTransaction/NpcTransaction.nut +++ b/Project/NpcTransaction/NpcTransaction.nut @@ -288,8 +288,6 @@ class NpcTransactionC extends LenheartNewUI_Windows { function RegNpc() { local EachManager = getroottable()["L_Each_Obj"]; foreach(id in NPCList) { - //先清空注册 - EachManager.RemoveEachForNpc(id); EachManager.AddEachForNpc(id, function(SThis) { //关闭按钮 local ApplyEngagementButton = LenheartNewUI_Each_BaseButton(0, 0, 100, 21, "interface2/popup_menu/popup_back.img", 3); diff --git a/Project/Recovery/Recovery.nut b/Project/Recovery/Recovery.nut index 5002bd6..98bdc03 100644 --- a/Project/Recovery/Recovery.nut +++ b/Project/Recovery/Recovery.nut @@ -169,8 +169,6 @@ class RecoveryC extends LenheartNewUI_Windows { function RegisterNpc(id) { local EachManager = getroottable()["L_Each_Obj"]; - //先清空注册 - EachManager.RemoveEachForNpc(id); EachManager.AddEachForNpc(id, function(SThis) { //关闭按钮 diff --git a/folder-alias.json b/folder-alias.json index dcfe7c4..c33dd58 100644 --- a/folder-alias.json +++ b/folder-alias.json @@ -213,6 +213,9 @@ "description": "设置" }, "Project/ItemTool/ItemCrossover": { - "description": "装备跨甲" + "description": "装备跨界" + }, + "Project/ItemTool/ItemInherit": { + "description": "装备继承" } } \ No newline at end of file