diff --git a/assets/bundles/first/config/Hero.json b/assets/bundles/first/config/Hero.json index 2a13dd8..cd6cf82 100644 --- a/assets/bundles/first/config/Hero.json +++ b/assets/bundles/first/config/Hero.json @@ -16,7 +16,8 @@ "critical_dam": 20000, "atk_id": [ 10101 - ] + ], + "skill_id": 220301 }, { "id": 102, @@ -35,7 +36,8 @@ "critical_dam": 20000, "atk_id": [ 10101 - ] + ], + "skill_id": 220301 }, { "id": 103, @@ -54,7 +56,8 @@ "critical_dam": 20000, "atk_id": [ 10101 - ] + ], + "skill_id": 220301 }, { "id": 104, @@ -73,7 +76,8 @@ "critical_dam": 20000, "atk_id": [ 10102 - ] + ], + "skill_id": 230301 }, { "id": 105, @@ -92,7 +96,8 @@ "critical_dam": 20000, "atk_id": [ 10102 - ] + ], + "skill_id": 230301 }, { "id": 106, @@ -111,7 +116,8 @@ "critical_dam": 20000, "atk_id": [ 10102 - ] + ], + "skill_id": 230301 }, { "id": 107, @@ -130,7 +136,8 @@ "critical_dam": 20000, "atk_id": [ 10103 - ] + ], + "skill_id": 240301 }, { "id": 108, @@ -149,7 +156,8 @@ "critical_dam": 20000, "atk_id": [ 10103 - ] + ], + "skill_id": 240301 }, { "id": 109, @@ -168,7 +176,8 @@ "critical_dam": 20000, "atk_id": [ 10103 - ] + ], + "skill_id": 240301 }, { "id": 110, @@ -187,7 +196,8 @@ "critical_dam": 20000, "atk_id": [ 10104 - ] + ], + "skill_id": 250301 }, { "id": 111, @@ -206,7 +216,8 @@ "critical_dam": 20000, "atk_id": [ 10104 - ] + ], + "skill_id": 250301 }, { "id": 112, @@ -225,7 +236,48 @@ "critical_dam": 20000, "atk_id": [ 10105 - ] + ], + "skill_id": 250301 + }, + { + "id": 111, + "name": "金4096", + "type": 1, + "herotype": 1, + "quality": 0, + "icon": "", + "res": "金4096", + "number": 4096, + "level": 13, + "atk": 4096, + "atk_range": 140, + "size": 1, + "critical_chance": 1000, + "critical_dam": 20000, + "atk_id": [ + 10105 + ], + "skill_id": 250301 + }, + { + "id": 112, + "name": "金8192", + "type": 1, + "herotype": 1, + "quality": 0, + "icon": "", + "res": "金8192", + "number": 8192, + "level": 14, + "atk": 9182, + "atk_range": 140, + "size": 1, + "critical_chance": 1000, + "critical_dam": 20000, + "atk_id": [ + 10105 + ], + "skill_id": 250301 }, { "id": 201, @@ -244,7 +296,8 @@ "critical_dam": 20000, "atk_id": [ 20101 - ] + ], + "skill_id": 310101 }, { "id": 202, @@ -263,7 +316,8 @@ "critical_dam": 20000, "atk_id": [ 20101 - ] + ], + "skill_id": 310101 }, { "id": 203, @@ -282,7 +336,8 @@ "critical_dam": 20000, "atk_id": [ 20101 - ] + ], + "skill_id": 310101 }, { "id": 204, @@ -301,7 +356,8 @@ "critical_dam": 20000, "atk_id": [ 20102 - ] + ], + "skill_id": 320101 }, { "id": 205, @@ -320,7 +376,8 @@ "critical_dam": 20000, "atk_id": [ 20102 - ] + ], + "skill_id": 320101 }, { "id": 206, @@ -339,7 +396,8 @@ "critical_dam": 20000, "atk_id": [ 20102 - ] + ], + "skill_id": 320101 }, { "id": 207, @@ -358,7 +416,8 @@ "critical_dam": 20000, "atk_id": [ 20103 - ] + ], + "skill_id": 330101 }, { "id": 208, @@ -377,7 +436,8 @@ "critical_dam": 20000, "atk_id": [ 20103 - ] + ], + "skill_id": 330101 }, { "id": 209, @@ -396,7 +456,8 @@ "critical_dam": 20000, "atk_id": [ 20103 - ] + ], + "skill_id": 330101 }, { "id": 210, @@ -415,7 +476,8 @@ "critical_dam": 20000, "atk_id": [ 20104 - ] + ], + "skill_id": 340101 }, { "id": 211, @@ -434,7 +496,8 @@ "critical_dam": 20000, "atk_id": [ 20104 - ] + ], + "skill_id": 340101 }, { "id": 212, @@ -453,7 +516,48 @@ "critical_dam": 20000, "atk_id": [ 20105 - ] + ], + "skill_id": 340101 + }, + { + "id": 213, + "name": "木4096", + "type": 1, + "herotype": 2, + "quality": 0, + "icon": "", + "res": "木4096", + "number": 4096, + "level": 13, + "atk": 4096, + "atk_range": 220, + "size": 1, + "critical_chance": 1000, + "critical_dam": 20000, + "atk_id": [ + 20105 + ], + "skill_id": 340101 + }, + { + "id": 214, + "name": "木9182", + "type": 1, + "herotype": 2, + "quality": 0, + "icon": "", + "res": "木8192", + "number": 8192, + "level": 14, + "atk": 9182, + "atk_range": 220, + "size": 1, + "critical_chance": 1000, + "critical_dam": 20000, + "atk_id": [ + 20105 + ], + "skill_id": 340101 }, { "id": 301, @@ -472,7 +576,8 @@ "critical_dam": 20000, "atk_id": [ 30101 - ] + ], + "skill_id": 420201 }, { "id": 302, @@ -491,7 +596,8 @@ "critical_dam": 20000, "atk_id": [ 30101 - ] + ], + "skill_id": 420201 }, { "id": 303, @@ -510,7 +616,8 @@ "critical_dam": 20000, "atk_id": [ 30101 - ] + ], + "skill_id": 420201 }, { "id": 304, @@ -529,7 +636,8 @@ "critical_dam": 20000, "atk_id": [ 30102 - ] + ], + "skill_id": 430201 }, { "id": 305, @@ -548,7 +656,8 @@ "critical_dam": 20000, "atk_id": [ 30102 - ] + ], + "skill_id": 430201 }, { "id": 306, @@ -567,7 +676,8 @@ "critical_dam": 20000, "atk_id": [ 30102 - ] + ], + "skill_id": 430201 }, { "id": 307, @@ -586,7 +696,8 @@ "critical_dam": 20000, "atk_id": [ 30103 - ] + ], + "skill_id": 440201 }, { "id": 308, @@ -605,7 +716,8 @@ "critical_dam": 20000, "atk_id": [ 30103 - ] + ], + "skill_id": 440201 }, { "id": 309, @@ -624,7 +736,8 @@ "critical_dam": 20000, "atk_id": [ 30103 - ] + ], + "skill_id": 440201 }, { "id": 310, @@ -643,7 +756,8 @@ "critical_dam": 20000, "atk_id": [ 30104 - ] + ], + "skill_id": 450201 }, { "id": 311, @@ -662,7 +776,8 @@ "critical_dam": 20000, "atk_id": [ 30104 - ] + ], + "skill_id": 450201 }, { "id": 312, @@ -681,7 +796,48 @@ "critical_dam": 20000, "atk_id": [ 30105 - ] + ], + "skill_id": 450201 + }, + { + "id": 313, + "name": "水4096", + "type": 2, + "herotype": 3, + "quality": 0, + "icon": "", + "res": "水4096", + "number": 4096, + "level": 13, + "atk": 4096, + "atk_range": 260, + "size": 1, + "critical_chance": 1000, + "critical_dam": 20000, + "atk_id": [ + 30105 + ], + "skill_id": 450201 + }, + { + "id": 314, + "name": "水9182", + "type": 2, + "herotype": 3, + "quality": 0, + "icon": "", + "res": "水8192", + "number": 8192, + "level": 14, + "atk": 9182, + "atk_range": 260, + "size": 1, + "critical_chance": 1000, + "critical_dam": 20000, + "atk_id": [ + 30105 + ], + "skill_id": 450201 }, { "id": 401, @@ -700,7 +856,8 @@ "critical_dam": 20000, "atk_id": [ 40101 - ] + ], + "skill_id": 520301 }, { "id": 402, @@ -719,7 +876,8 @@ "critical_dam": 20000, "atk_id": [ 40101 - ] + ], + "skill_id": 520301 }, { "id": 403, @@ -738,7 +896,8 @@ "critical_dam": 20000, "atk_id": [ 40101 - ] + ], + "skill_id": 520301 }, { "id": 404, @@ -757,7 +916,8 @@ "critical_dam": 20000, "atk_id": [ 40102 - ] + ], + "skill_id": 530301 }, { "id": 405, @@ -776,7 +936,8 @@ "critical_dam": 20000, "atk_id": [ 40102 - ] + ], + "skill_id": 530301 }, { "id": 406, @@ -795,7 +956,8 @@ "critical_dam": 20000, "atk_id": [ 40102 - ] + ], + "skill_id": 530301 }, { "id": 407, @@ -814,7 +976,8 @@ "critical_dam": 20000, "atk_id": [ 40103 - ] + ], + "skill_id": 540301 }, { "id": 408, @@ -833,7 +996,8 @@ "critical_dam": 20000, "atk_id": [ 40103 - ] + ], + "skill_id": 540301 }, { "id": 409, @@ -852,7 +1016,8 @@ "critical_dam": 20000, "atk_id": [ 40103 - ] + ], + "skill_id": 540301 }, { "id": 410, @@ -871,7 +1036,8 @@ "critical_dam": 20000, "atk_id": [ 40104 - ] + ], + "skill_id": 550301 }, { "id": 411, @@ -890,7 +1056,8 @@ "critical_dam": 20000, "atk_id": [ 40104 - ] + ], + "skill_id": 550301 }, { "id": 412, @@ -909,7 +1076,48 @@ "critical_dam": 20000, "atk_id": [ 40105 - ] + ], + "skill_id": 550301 + }, + { + "id": 413, + "name": "火4096", + "type": 2, + "herotype": 1, + "quality": 0, + "icon": "", + "res": "火4096", + "number": 4096, + "level": 13, + "atk": 4096, + "atk_range": 300, + "size": 1, + "critical_chance": 1000, + "critical_dam": 20000, + "atk_id": [ + 40105 + ], + "skill_id": 550301 + }, + { + "id": 414, + "name": "火9182", + "type": 2, + "herotype": 1, + "quality": 0, + "icon": "", + "res": "火8192", + "number": 8192, + "level": 14, + "atk": 9182, + "atk_range": 300, + "size": 1, + "critical_chance": 1000, + "critical_dam": 20000, + "atk_id": [ + 40105 + ], + "skill_id": 550301 }, { "id": 501, @@ -928,7 +1136,8 @@ "critical_dam": 20000, "atk_id": [ 50101 - ] + ], + "skill_id": 620201 }, { "id": 502, @@ -947,7 +1156,8 @@ "critical_dam": 20000, "atk_id": [ 50101 - ] + ], + "skill_id": 620201 }, { "id": 503, @@ -966,7 +1176,8 @@ "critical_dam": 20000, "atk_id": [ 50101 - ] + ], + "skill_id": 620201 }, { "id": 504, @@ -985,7 +1196,8 @@ "critical_dam": 20000, "atk_id": [ 50102 - ] + ], + "skill_id": 630201 }, { "id": 505, @@ -1004,7 +1216,8 @@ "critical_dam": 20000, "atk_id": [ 50102 - ] + ], + "skill_id": 630201 }, { "id": 506, @@ -1023,7 +1236,8 @@ "critical_dam": 20000, "atk_id": [ 50102 - ] + ], + "skill_id": 630201 }, { "id": 507, @@ -1042,7 +1256,8 @@ "critical_dam": 20000, "atk_id": [ 50103 - ] + ], + "skill_id": 640201 }, { "id": 508, @@ -1061,7 +1276,8 @@ "critical_dam": 20000, "atk_id": [ 50103 - ] + ], + "skill_id": 640201 }, { "id": 509, @@ -1080,7 +1296,8 @@ "critical_dam": 20000, "atk_id": [ 50103 - ] + ], + "skill_id": 640201 }, { "id": 510, @@ -1099,7 +1316,8 @@ "critical_dam": 20000, "atk_id": [ 50104 - ] + ], + "skill_id": 650201 }, { "id": 511, @@ -1118,7 +1336,8 @@ "critical_dam": 20000, "atk_id": [ 50104 - ] + ], + "skill_id": 650201 }, { "id": 512, @@ -1137,6 +1356,47 @@ "critical_dam": 20000, "atk_id": [ 50105 - ] + ], + "skill_id": 650201 + }, + { + "id": 513, + "name": "土4096", + "type": 1, + "herotype": 5, + "quality": 0, + "icon": "", + "res": "土4096", + "number": 4096, + "level": 13, + "atk": 4096, + "atk_range": 180, + "size": 1, + "critical_chance": 1000, + "critical_dam": 20000, + "atk_id": [ + 50105 + ], + "skill_id": 650201 + }, + { + "id": 514, + "name": "土9182", + "type": 1, + "herotype": 5, + "quality": 0, + "icon": "", + "res": "土8192", + "number": 8192, + "level": 14, + "atk": 9182, + "atk_range": 180, + "size": 1, + "critical_chance": 1000, + "critical_dam": 20000, + "atk_id": [ + 50105 + ], + "skill_id": 650201 } ] \ No newline at end of file diff --git a/assets/bundles/first/config/Level.json b/assets/bundles/first/config/Level.json index 9a75206..b97f98b 100644 --- a/assets/bundles/first/config/Level.json +++ b/assets/bundles/first/config/Level.json @@ -11,7 +11,7 @@ "loserreward": "1|5", "monster": "1,1001,10,1.6|2,1001,10,1.6|3,1001,10,1.6|4,1001,10,1.6|5,1002,15,1.6|6,1002,15,1.6|7,1002,15,1.6|8,1002,15,1.6|9,1002,15,1.6|10,1003,20,1.6|11,1003,20,1.6|12,1003,20,1.6|13,1003,20,1.6|14,1003,20,1.6|15,1003,25,1.6|16,1003,25,1.6|17,1003,25,1.6|18,1003,25,1.6|19,1003,25,1.6|20,1003,30,1.6|21,1003,30,1.6|22,1003,30,1.6|23,1003,30,1.6|24,1003,30,1.6|25,1003,40,1.6", "boss": "5|1101,10|1101,15|1101,20|1101,25|1101", - "bosspro": 1200, + "bosspro": 10000, "unlockland1": "0,2,5", "unlockland2": "0,5,5", "unlockland3": "1,5,1|2,5,1|3,5,1|4,5,1|5,5,1", @@ -49,7 +49,7 @@ "loserreward": "1|5", "monster": "1,2001,10,1.6|2,2001,10,1.6|3,2001,10,1.6|4,2001,10,1.6|5,2002,15,1.6|6,2002,15,1.6|7,2002,15,1.6|8,2002,15,1.6|9,2002,15,1.6|10,2003,20,1.6|11,2003,20,1.6|12,2003,20,1.6|13,2003,20,1.6|14,2003,20,1.6|15,2003,25,1.6|16,2003,25,1.6|17,2003,25,1.6|18,2003,25,1.6|19,2003,25,1.6|20,2003,30,1.6|21,2003,30,1.6|22,2003,30,1.6|23,2003,30,1.6|24,2003,30,1.6|25,2003,40,1.6", "boss": "5|2101,10|2101,15|2101,20|2101,25|2101", - "bosspro": 1200, + "bosspro": 10000, "unlockland1": "0,2,5", "unlockland2": "0,5,5", "unlockland3": "1,5,1|2,5,1|3,5,1|4,5,1|5,5,1", @@ -87,7 +87,7 @@ "loserreward": "1|5", "monster": "1,3001,10,1.6|2,3001,10,1.6|3,3001,10,1.6|4,3001,10,1.6|5,3002,15,1.6|6,3002,15,1.6|7,3002,15,1.6|8,3002,15,1.6|9,3002,15,1.6|10,3003,20,1.6|11,3003,20,1.6|12,3003,20,1.6|13,3003,20,1.6|14,3003,20,1.6|15,3003,25,1.6|16,3003,25,1.6|17,3003,25,1.6|18,3003,25,1.6|19,3003,25,1.6|20,3003,30,1.6|21,3003,30,1.6|22,3003,30,1.6|23,3003,30,1.6|24,3003,30,1.6|25,3003,40,1.6", "boss": "5|3101,10|3101,15|3101,20|3101,25|3101", - "bosspro": 1200, + "bosspro": 10000, "unlockland1": "0,2,5", "unlockland2": "0,5,5", "unlockland3": "1,5,1|2,5,1|3,5,1|4,5,1|5,5,1", @@ -125,7 +125,7 @@ "loserreward": "1|5", "monster": "1,4001,10,1.6|2,4001,10,1.6|3,4001,10,1.6|4,4001,10,1.6|5,4002,15,1.6|6,4002,15,1.6|7,4002,15,1.6|8,4002,15,1.6|9,4002,15,1.6|10,4003,20,1.6|11,4003,20,1.6|12,4003,20,1.6|13,4003,20,1.6|14,4003,20,1.6|15,4003,25,1.6|16,4003,25,1.6|17,4003,25,1.6|18,4003,25,1.6|19,4003,25,1.6|20,4003,30,1.6|21,4003,30,1.6|22,4003,30,1.6|23,4003,30,1.6|24,4003,30,1.6|25,4003,40,1.6", "boss": "5|4101,10|4101,15|4101,20|4101,25|4101", - "bosspro": 1200, + "bosspro": 10000, "unlockland1": "0,2,5", "unlockland2": "0,5,5", "unlockland3": "1,5,1|2,5,1|3,5,1|4,5,1|5,5,1", @@ -163,7 +163,7 @@ "loserreward": "1|5", "monster": "1,5001,10,1.6|2,5001,10,1.6|3,5001,10,1.6|4,5001,10,1.6|5,5002,15,1.6|6,5002,15,1.6|7,5002,15,1.6|8,5002,15,1.6|9,5002,15,1.6|10,5003,20,1.6|11,5003,20,1.6|12,5003,20,1.6|13,5003,20,1.6|14,5003,20,1.6|15,5003,25,1.6|16,5003,25,1.6|17,5003,25,1.6|18,5003,25,1.6|19,5003,25,1.6|20,5003,30,1.6|21,5003,30,1.6|22,5003,30,1.6|23,5003,30,1.6|24,5003,30,1.6|25,5003,40,1.6", "boss": "5|5101,10|5101,15|5101,20|5101,25|5101", - "bosspro": 1200, + "bosspro": 10000, "unlockland1": "0,2,5", "unlockland2": "0,5,5", "unlockland3": "1,5,1|2,5,1|3,5,1|4,5,1|5,5,1", diff --git a/assets/script/battle/combat/PassiveSkillRuntime.ts b/assets/script/battle/combat/PassiveSkillRuntime.ts index 926f620..e679269 100644 --- a/assets/script/battle/combat/PassiveSkillRuntime.ts +++ b/assets/script/battle/combat/PassiveSkillRuntime.ts @@ -36,8 +36,10 @@ export interface IPassiveAtkOverrideHost { applyNormalAtkOverride(session: BattleSession, entityId: EntityId, atkType: string, atkPara: string, sourceSkillId: number): void; } -/** bindFromLoadout 只需武器被动槽 */ +/** bindFromLoadout:英雄被动 + 武器被动 */ interface PassiveLoadoutBind { + /** 英雄被动 Skill.id(`Hero.skill_id` 且 type=2;0=无) */ + heroPassiveSkillId: number; /** 武器技能 Skill.id */ weaponSkillId: number; /** 武器技能是否为主动 */ @@ -587,6 +589,11 @@ export class PassiveSkillHost { } this.unbind(entityId); const list: PassiveSkillBind[] = []; + const heroPassiveId = Math.floor(Number(loadout.heroPassiveSkillId) || 0); + if (heroPassiveId > 0) { + const bind = this._parseSkill(heroPassiveId, false); + if (bind) list.push(bind); + } if (loadout.weaponSkillId > 0 && !loadout.weaponSkillActive) { const bind = this._parseSkill(loadout.weaponSkillId, false); if (bind) list.push(bind); diff --git a/assets/script/battle/combat/TowerLoadoutService.ts b/assets/script/battle/combat/TowerLoadoutService.ts index b243332..081be79 100644 --- a/assets/script/battle/combat/TowerLoadoutService.ts +++ b/assets/script/battle/combat/TowerLoadoutService.ts @@ -101,6 +101,7 @@ export class TowerLoadoutService { } // 五行每行自带技能数组;非五行仍按合成等级取下标 const skillLv = isElementHero(hero) ? 1 : level; + const heroSkill = this._resolveHeroSkillSlots(heroUltSkillId(hero, skillLv)); const loadout: TowerLoadout = { weapon1Id: heroId, level, @@ -108,7 +109,8 @@ export class TowerLoadoutService { normalBaseAtkId: heroNormalSkillId(hero, skillLv), overAtkType: '', overAtkPara: '', - activeSkillBaseAtkId: heroUltSkillId(hero, skillLv), + activeSkillBaseAtkId: heroSkill.activeId, + heroPassiveSkillId: heroSkill.passiveId, weaponSkillId, weaponSkillActive, }; @@ -486,6 +488,25 @@ export class TowerLoadoutService { } } + /** + * `Hero.skill_id` 按 Skill.type 拆主动/被动槽。 + * @param skillId Hero.skill_id + */ + private _resolveHeroSkillSlots(skillId: number): { activeId: number; passiveId: number } { + const id = Math.floor(Number(skillId) || 0); + if (!(id > 0)) return { activeId: 0, passiveId: 0 }; + const sk = gg.data.table.getTableData(TableNames.Skill, id); + if (!sk) { + console.log(`[TowerLoadout] 英雄技能缺失 Skill.id=${id}`); + return { activeId: 0, passiveId: 0 }; + } + const typ = Math.floor(Number(sk.type) || 0); + if (typ === 1) return { activeId: id, passiveId: 0 }; + if (typ === 2) return { activeId: 0, passiveId: id }; + console.log(`[TowerLoadout] 英雄技能 type 非主动/被动,仍按主动挂`, id, typ); + return { activeId: id, passiveId: 0 }; + } + /** * 武器被动 Skill.skill 类型8:写入 AtkHookComp,普攻命中按距离加伤。 * @param session 战斗会话 diff --git a/assets/script/battle/combat/TowerQueryTypes.ts b/assets/script/battle/combat/TowerQueryTypes.ts index 53750c9..8d3dd87 100644 --- a/assets/script/battle/combat/TowerQueryTypes.ts +++ b/assets/script/battle/combat/TowerQueryTypes.ts @@ -16,8 +16,10 @@ export interface TowerLoadout { overAtkType: string; /** 被动 result 10 覆盖的普攻 atk_para */ overAtkPara: string; - /** 英雄主动 Skill.id(0=无) */ + /** 英雄主动 Skill.id(`Hero.skill_id` 且 type=1;0=无) */ activeSkillBaseAtkId: number; + /** 英雄被动 Skill.id(`Hero.skill_id` 且 type=2;0=无) */ + heroPassiveSkillId: number; /** 武器技能 Skill.id(0=无;type=2 时仅被动) */ weaponSkillId: number; /** 武器技能是否为主动(type=1) */ diff --git a/assets/script/battle/config/BattleHeroTable.ts b/assets/script/battle/config/BattleHeroTable.ts index 2cc67a2..424c4af 100644 --- a/assets/script/battle/config/BattleHeroTable.ts +++ b/assets/script/battle/config/BattleHeroTable.ts @@ -38,9 +38,15 @@ export function heroNormalSkillId(hero: ITableHero, composeLevel: number): numbe return _skillIdAtLevel(hero.atk_id, composeLevel); } -/** 英雄主动技能 id(Hero.act_skill 已删,恒无) */ -export function heroUltSkillId(_hero: ITableHero | null | undefined, _composeLevel = 1): number { - return 0; +/** + * 英雄技能 id(`Hero.skill_id`;0=无)。 + * 主动/被动由 Skill.type 决定,挂载见 TowerLoadoutService。 + * @param hero Hero 行 + * @param _composeLevel 保留签名(skill_id 不按等级取下标) + */ +export function heroUltSkillId(hero: ITableHero | null | undefined, _composeLevel = 1): number { + if (!hero) return 0; + return Math.floor(Number(hero.skill_id) || 0); } /** 是否基础单字英雄 */ diff --git a/assets/script/battle/config/ChapterLevelBuilder.ts b/assets/script/battle/config/ChapterLevelBuilder.ts index 6639b7b..8a9cbbb 100644 --- a/assets/script/battle/config/ChapterLevelBuilder.ts +++ b/assets/script/battle/config/ChapterLevelBuilder.ts @@ -312,6 +312,8 @@ export class ChapterLevelBuilder { const atkId = Number(rawAtkId); if (Number.isFinite(atkId) && atkId > 0) membershipAdd(baseAtkIds, atkId); } + const heroSkillId = Math.floor(Number(w1.skill_id) || 0); + if (heroSkillId > 0) membershipAdd(baseAtkIds, heroSkillId); } const atkIds = membershipToArray(baseAtkIds); diff --git a/assets/script/game/ConfigProjectData.ts b/assets/script/game/ConfigProjectData.ts index e99b20c..c093f86 100644 --- a/assets/script/game/ConfigProjectData.ts +++ b/assets/script/game/ConfigProjectData.ts @@ -395,7 +395,7 @@ export class ConfigProjectData extends Singleton { return result; } - /** 英雄 atk_id + 当前装备武器 act_skill */ + /** 英雄 atk_id + skill_id + 当前装备武器 act_skill */ public getSkillIdsForWeapon1(weapon1Id: number, _level: number): number[] { const config = gg.data.table.getTableData(TableNames.Hero, weapon1Id); if (!config) return []; @@ -403,6 +403,8 @@ export class ConfigProjectData extends Singleton { for (const id of config.atk_id ?? []) { if (id > 0) skillIdArr.push(id); } + const heroSkillId = Math.floor(Number(config.skill_id) || 0); + if (heroSkillId > 0) skillIdArr.push(heroSkillId); try { const weaponId = gg.equip?.getHeroDisplayWeaponId?.(weapon1Id) ?? 0; if (weaponId > 0) { diff --git a/assets/script/game/TableAnomaly.ts b/assets/script/game/TableAnomaly.ts index d385d74..832c22b 100644 --- a/assets/script/game/TableAnomaly.ts +++ b/assets/script/game/TableAnomaly.ts @@ -99,6 +99,10 @@ export class TableAnomaly { this.warn('Hero', id, 'herotype', '不是金木水火土 1~5', row.herotype); } this._checkSkillIds(src, 'Hero', id, 'atk_id', row.atk_id); + const skillId = Math.floor(Number(row.skill_id) || 0); + if (skillId > 0 && !src.getTableData('Skill', skillId)) { + this.warn('Hero', id, 'skill_id', 'Skill 行不存在', skillId); + } } } diff --git a/assets/script/interface/AutoTable.ts b/assets/script/interface/AutoTable.ts index 1cb6641..8ba343e 100644 --- a/assets/script/interface/AutoTable.ts +++ b/assets/script/interface/AutoTable.ts @@ -180,6 +180,8 @@ declare global { readonly critical_dam: number; /** 普攻id */ readonly atk_id: number[]; + /** 技能id */ + readonly skill_id: number; } /** * Headicon 配置数据 diff --git a/assets/script/ui/BattleWeaponDescHero/UIBattleWeaponDescHero.ts b/assets/script/ui/BattleWeaponDescHero/UIBattleWeaponDescHero.ts index 6fcab64..b3bc39d 100644 --- a/assets/script/ui/BattleWeaponDescHero/UIBattleWeaponDescHero.ts +++ b/assets/script/ui/BattleWeaponDescHero/UIBattleWeaponDescHero.ts @@ -29,7 +29,7 @@ import { Auto_BattleWeaponDescHero } from './Auto_BattleWeaponDescHero'; import type { TileEntitySnapshot, TowerRuntimeSnapshot } from '../../battle/combat/TowerQueryTypes'; import { TowerQueryService } from '../../battle/combat/TowerQueryService'; import { deriveTowerSetupStats, TowerStatDisplay } from '../../battle/combat/TowerStatResolver'; -import { heroNormalSkillId, isElementHero } from '../../battle/config/BattleHeroTable'; +import { heroUltSkillId, isElementHero } from '../../battle/config/BattleHeroTable'; import { WeaponComposeConfigProvider } from '../../battle/bag/WeaponComposeConfigProvider'; import { BATTLE_HERO_NUM_PATH } from '../../battle/res/BattleHeroResCollector'; import { glyphSpineHasSkin } from '../../battle/view/GlyphSpineSkin'; @@ -404,27 +404,26 @@ export class UIBattleWeaponDescHero extends Auto_BattleWeaponDescHero { } /** - * lb_skillName / lb_skillDesc:读 Hero.atk_id 对应 Skill。 - * Skill.name 配表常为空时,名称回退为 desc,避免「技能:」右侧空白。 + * lb_skillName / lb_skillDesc:读 Hero.skill_id 对应 Skill.name / Skill.desc。 + * 名称不回退 desc,避免与描述重复。 * @param w1 Hero - * @param level 合成等级 + * @param _level 合成等级(skill_id 不按等级取下标) */ - private _refreshSkillLabels(w1: ITableHero, level: number): void { - const skillId = heroNormalSkillId(w1, level); + private _refreshSkillLabels(w1: ITableHero, _level: number): void { + const skillId = heroUltSkillId(w1); const skill = skillId > 0 ? gg.data.table.getTableData(TableNames.Skill, skillId) : null; if (skillId > 0 && !skill) { - console.warn(LOG, 'Skill 缺失', skillId, w1.id, level); + console.warn(LOG, 'Skill 缺失', skillId, w1.id); } const nameKey = skill ? String(skill.name ?? '').trim() : ''; const descKey = skill ? String(skill.desc ?? '').trim() : ''; if (skill && !nameKey) { - console.warn(LOG, 'Skill.name 为空,名称回退 desc', skillId, w1.id); + console.warn(LOG, 'Skill.name 为空', skillId, w1.id); } if (this.lb_skillName) { - const nameText = nameKey ? gg.lang.get(nameKey) : (descKey ? gg.lang.get(descKey) : ''); - this.lb_skillName.string = nameText; + this.lb_skillName.string = nameKey ? gg.lang.get(nameKey) : ''; } if (this.lb_skillDesc) { this.lb_skillDesc.string = descKey ? gg.lang.get(descKey) : ''; diff --git a/docs/方案-战斗技能逻辑层.md b/docs/方案-战斗技能逻辑层.md index 5c16fae..95b3d01 100644 --- a/docs/方案-战斗技能逻辑层.md +++ b/docs/方案-战斗技能逻辑层.md @@ -10,7 +10,7 @@ |----------|-------------|------| | **技能** | `Skill` / `ITableSkill` | 战斗技能配置(普攻形态、主动、被动、额外效果) | | **普攻** | `Hero.atk_id[level-1]` → `Skill.id` | 每塔 1 个,随合成等级取数组索引 | -| **英雄技能** | `Hero.act_skill[level-1]` → `Skill.id` | 可无;按合成等级取索引 | +| **英雄技能** | `Hero.skill_id` → `Skill.id` | 可无;`type=1` 主动 / `type=2` 被动(数字英雄每行自带) | | **武器技能** | `Weapon.act_skill` → `Skill.id` | 局外装备确定;`type=1` 主动 / `type=2` 被动 | | **词条** | — | 旧三选1表已删;代码遗留路径须空操作,禁止把新 Skill 当词条 | @@ -21,12 +21,14 @@ ``` Hero(合成等级 level) ├─ atk_id[level-1] → 普攻 Skill - ├─ act_skill[level-1] → 英雄主动 Skill(可空) - └─ 装备武器 weaponId + ├─ skill_id → 英雄技能(0=无;type=1 进 Ability 主动槽 / type=2 进 PassiveSkillHost) + └─ 装备武器 / 技能宝石 weaponId └─ Weapon.act_skill → 武器技能(0=无;type 分流主动/被动) ``` -装备解析:`gg.equip.getHeroDisplayWeaponId(heroId)`(穿戴 >0 用穿戴,否则 `Hero.startweapon`)。 +挂载:`TowerLoadoutService.initEntity` 读 `Hero.skill_id`,按 `Skill.type` 写入 `activeSkillBaseAtkId` 或 `heroPassiveSkillId`;`applyAbilities` 挂主动 Ability,`PassiveSkillHost.bindFromLoadout` 挂被动。 + +装备解析:五行读镶嵌技能宝石;非五行 `gg.equip.getHeroDisplayWeaponId(heroId)`。 ## 3. Ability id @@ -202,3 +204,4 @@ Hero(合成等级 level) | 2026-10-09 | 冰锥发射物改「冰锥」;冰冻覆盖「冰冻」播怪物冻结/解冻怪物冻结2 | | 2026-10-09 | atk_type=14:武器动画循环至多段伤害结束(棍神通大风车与时长同步) | | 2026-10-09 | atk_type=14:每段按施法者射程圆重新索敌,非开战锁定名单 | +| 2026-10-15 | Hero.skill_id:数字英雄挂载技能;type=1→主动 Ability,type=2→PassiveSkillHost |