From 3ad446048a19a4e17b9ea134f0922601c92f5386 Mon Sep 17 00:00:00 2001 From: walkpan Date: Fri, 16 Jan 2026 20:10:52 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E9=85=8D=E7=BD=AE):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=8D=AF=E6=B0=B4=E5=8D=A1=E7=89=87=E9=85=8D=E7=BD=AE=E5=8F=8A?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增药水卡片的基础配置 CanSelectPotions 和 PotionCards 在卡片信息获取和默认卡池逻辑中添加药水类型的处理 --- assets/script/game/common/config/AttrSet.ts | 9 +++++++++ assets/script/game/common/config/CardSet.ts | 22 ++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) 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; }