feat(卡牌系统): 重构卡牌选择逻辑并增加等级分段配置

重构卡牌选择系统,将原有的简单数组配置改为按等级分段的字典结构
- 为技能、英雄、天赋和属性分别添加 CanSelectXXX 配置
- 优化卡牌池构建逻辑,支持按等级筛选可用卡牌
- 改进权重随机算法,增加兜底机制
- 分离卡牌基础信息和权重配置,提高可维护性
This commit is contained in:
panw
2026-01-14 20:22:18 +08:00
parent 4a506555ba
commit 6ddfe7e2c4
5 changed files with 264 additions and 141 deletions

View File

@@ -25,4 +25,15 @@ import { Attrs } from "./HeroAttrs";
2012:{uuid:2012, icon:"2001", attr: Attrs.SLOW_CHANCE, value: 10, showValue: 10, desc: "减速概率 +10%", isSpecial: true, note: "上限50%" },
2013:{uuid:2013, icon:"2001", attr: Attrs.LIFESTEAL, value: 10, showValue: 10, desc: "吸血比例 +10%", isSpecial: true, note: "上限50%" },
2014:{uuid:2014, icon:"2001", attr: Attrs.MANASTEAL, value: 10, showValue: 10, desc: "吸蓝比例 +10%", isSpecial: true, note: "上限50%" },
}
}
export const CanSelectAttrs: Record<number, number[]> = {
// 基础属性
2: [2001, 2002, 2003, 2004],
// 混合
4: [2001, 2002, 2003, 2004],
// 进阶属性
7: [2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2013],
// 默认全开
99: [2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014]
};