refactor(card): 升级动态升级卡的英雄绑定逻辑

将动态升级卡从绑定英雄UUID改为绑定实体EID,适配ECS实体管理模式:
1. 更新CardConfig定义,替换target_hero_uuid为target_hero_eid
2. 新增EID反查UUID的工具方法,适配渲染和交互逻辑
3. 修改抽卡、卡牌点击和使用的全流程逻辑
4. 优化升级卡生成和匹配的稳定性
This commit is contained in:
panFD
2026-07-21 00:03:44 +08:00
parent 48e0ab06c5
commit 8818ec9c3f
4 changed files with 73 additions and 66 deletions

View File

@@ -110,11 +110,11 @@ export interface CardConfig {
trigger_limit?: number;
/**
* 动态升级卡专属:目标英雄 UUID
* 动态升级卡专属:目标英雄实体 eid运行时唯一
* 仅当 type === CardType.SpecialUpgrade 且该卡由 buildDrawCards 动态生成时使用。
* 使用该卡时精确升级场上对应 UUID 的英雄。
* 使用该卡时精确升级场上对应 eid 的英雄实体
*/
target_hero_uuid?: number;
target_hero_eid?: number;
}
/** 升级卡折扣表(已废弃,保留以兼容历史引用) */
@@ -274,7 +274,7 @@ export enum SpecialRefreshHeroType {
export interface SpecialUpgradeCardConfig extends CardConfig {
name: string
info: string
/** 模板字段currentLv=0 表示动态卡(实际值由 target_hero_uuid 对应的英雄决定) */
/** 模板字段currentLv=0 表示动态卡(实际值由 target_hero_eid 对应的英雄决定) */
currentLv: number
/** 模板字段targetLv=0 表示"+1 级"(实际目标等级 = 当前等级 + 1 */
targetLv: number
@@ -292,7 +292,7 @@ export interface SpecialRefreshCardConfig extends CardConfig {
* 升级卡模板。
* 仅有 7001 一条记录作为动态升级卡的基础配置cost/weight/name/info
* 实际使用时由 MissionCardComp.buildDrawCards 根据场上英雄动态生成 CardConfig
* 通过 target_hero_uuid 字段绑定具体英雄。
* 通过 target_hero_eid 字段绑定具体英雄实体
*/
export const SpecialUpgradeCardList: Record<number, SpecialUpgradeCardConfig> = {
7001: {