feat(配置): 添加药水卡片配置及获取逻辑
新增药水卡片的基础配置 CanSelectPotions 和 PotionCards 在卡片信息获取和默认卡池逻辑中添加药水类型的处理
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user