feat(配置): 添加药水卡片配置及获取逻辑
新增药水卡片的基础配置 CanSelectPotions 和 PotionCards 在卡片信息获取和默认卡池逻辑中添加药水类型的处理
This commit is contained in:
@@ -54,4 +54,13 @@ export const CanSelectAttrs: Record<number, number[]> = {
|
|||||||
7: [2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2013],
|
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]
|
99: [2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014]
|
||||||
|
};
|
||||||
|
|
||||||
|
export const CanSelectPotions: Record<number, number[]> = {
|
||||||
|
// 普通药水
|
||||||
|
1: [3005, 3006, 3007, 3008],
|
||||||
|
// 强力药水
|
||||||
|
10: [3001, 3002, 3003, 3004],
|
||||||
|
// 默认全开
|
||||||
|
99: [3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008]
|
||||||
};
|
};
|
||||||
@@ -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 { talConf, ItalConf, CanSelectTalents } from "./TalSet";
|
||||||
import { SkillSet, SkillConfig, CanSelectSkills } from "./SkillSet";
|
import { SkillSet, SkillConfig, CanSelectSkills } from "./SkillSet";
|
||||||
import { HeroInfo, heroInfo, CanSelectHeros } from "./heroSet";
|
import { HeroInfo, heroInfo, CanSelectHeros } from "./heroSet";
|
||||||
@@ -114,6 +114,14 @@ function getCardBaseInfo(type: CardType, uuid: number): ICardInfo | null {
|
|||||||
icon = baseInfo.icon;
|
icon = baseInfo.icon;
|
||||||
kind = CardKind.Partner;
|
kind = CardKind.Partner;
|
||||||
break;
|
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 {
|
return {
|
||||||
@@ -188,6 +196,18 @@ function getDefaultPool(type: CardType, level: number = 1): IPoolItem[] {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
break;
|
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;
|
return items;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user