diff --git a/assets/script/game/common/config/AttrSet.ts b/assets/script/game/common/config/AttrSet.ts index 01258249..b8f8e9cd 100644 --- a/assets/script/game/common/config/AttrSet.ts +++ b/assets/script/game/common/config/AttrSet.ts @@ -54,4 +54,13 @@ export const CanSelectAttrs: Record = { 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] +}; + +export const CanSelectPotions: Record = { + // 普通药水 + 1: [3005, 3006, 3007, 3008], + // 强力药水 + 10: [3001, 3002, 3003, 3004], + // 默认全开 + 99: [3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008] }; \ No newline at end of file diff --git a/assets/script/game/common/config/CardSet.ts b/assets/script/game/common/config/CardSet.ts index 2fd5041f..4b5827e2 100644 --- a/assets/script/game/common/config/CardSet.ts +++ b/assets/script/game/common/config/CardSet.ts @@ -1,4 +1,4 @@ -import { AttrCards, AttrInfo, CanSelectAttrs } from "./AttrSet"; +import { AttrCards, AttrInfo, CanSelectAttrs, PotionCards, CanSelectPotions } from "./AttrSet"; import { talConf, ItalConf, CanSelectTalents } from "./TalSet"; import { SkillSet, SkillConfig, CanSelectSkills } from "./SkillSet"; import { HeroInfo, heroInfo, CanSelectHeros } from "./heroSet"; @@ -114,6 +114,14 @@ function getCardBaseInfo(type: CardType, uuid: number): ICardInfo | null { icon = baseInfo.icon; kind = CardKind.Partner; break; + case CardType.Potion: + baseInfo = PotionCards[uuid]; + if (!baseInfo) return null; + name = baseInfo.note || "药水"; + desc = baseInfo.desc; + icon = baseInfo.icon; + kind = CardKind.Buff; // 药水归类为 Buff 类型的卡片显示 + break; } return { @@ -188,6 +196,18 @@ function getDefaultPool(type: CardType, level: number = 1): IPoolItem[] { }); } break; + case CardType.Potion: + // 优先使用 CanSelectPotions 中的配置 + if (CanSelectPotions[level]) { + CanSelectPotions[level].forEach(id => items.push({ id, weight: 100 })); + } else if (CanSelectPotions[99]) { + // 默认池 + CanSelectPotions[99].forEach(id => items.push({ id, weight: 100 })); + } else { + // 全量兜底 + Object.keys(PotionCards).forEach(key => items.push({ id: Number(key), weight: 100 })); + } + break; } return items; }