Files
pixelheros/assets/script/game/common/config/AttrSet.ts
panw 6ddfe7e2c4 feat(卡牌系统): 重构卡牌选择逻辑并增加等级分段配置
重构卡牌选择系统,将原有的简单数组配置改为按等级分段的字典结构
- 为技能、英雄、天赋和属性分别添加 CanSelectXXX 配置
- 优化卡牌池构建逻辑,支持按等级筛选可用卡牌
- 改进权重随机算法,增加兜底机制
- 分离卡牌基础信息和权重配置,提高可维护性
2026-01-14 20:22:18 +08:00

39 lines
2.8 KiB
TypeScript

import { Attrs } from "./HeroAttrs";
export interface AttrInfo {
uuid: number;
icon:string; // 属性图标
attr: Attrs; // 属性类型
value: number;// 属性值
showValue: number;// 显示值
desc: string;// 属性描述
isSpecial: boolean;// 是否为特殊属性
note?: string;// 属性备注
}
export const AttrCards: Record<number, AttrInfo> = {
2001:{uuid:2001, icon:"2001", attr: Attrs.AP, value: 16.5, showValue: 16.5, desc: "攻击力 +16.5", isSpecial: false, note: "常规强化" },
2002:{uuid:2002, icon:"2001", attr: Attrs.HP_MAX, value: 110, showValue: 110, desc: "生命上限 +110", isSpecial: false, note: "常规强化" },
2003:{uuid:2003, icon:"2001", attr: Attrs.DEF, value: 5.5, showValue: 5.5, desc: "防御力 +5.5", isSpecial: false, note: "常规强化" },
2004:{uuid:2004, icon:"2001", attr: Attrs.AS, value: 5.25, showValue: 5.25, desc: "攻击速度 +5.25%", isSpecial: false, note: "常规强化" },
2005:{uuid:2005, icon:"2001", attr: Attrs.PUNCTURE, value: 1, showValue: 1, desc: "穿透数量 +1", isSpecial: true, note: "上限5层" },
2006:{uuid:2006, icon:"2001", attr: Attrs.CRITICAL, value: 14, showValue: 14, desc: "暴击率 +14%", isSpecial: true, note: "上限70%" },
2007:{uuid:2007, icon:"2001", attr: Attrs.CRITICAL_DMG, value: 40, showValue: 40, desc: "暴击伤害 +40%", isSpecial: true, note: "上限200%" },
2008:{uuid:2008, icon:"2001", attr: Attrs.STUN_CHANCE, value: 10, showValue: 10, desc: "眩晕概率 +10%", isSpecial: true, note: "上限50%" },
2009:{uuid:2009, icon:"2001", attr: Attrs.FREEZE_CHANCE, value: 10, showValue: 10, desc: "冰冻概率 +10%", isSpecial: true, note: "上限50%" },
2010:{uuid:2010, icon:"2001", attr: Attrs.BURN_CHANCE, value: 10, showValue: 10, desc: "燃烧概率 +10%", isSpecial: true, note: "上限50%" },
2011:{uuid:2011, icon:"2001", attr: Attrs.BACK_CHANCE, value: 10, showValue: 10, desc: "击退概率 +10%", isSpecial: true, note: "上限50%" },
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]
};