feat: 新增指定目标卡池等级抽卡功能并调整UI布局
- 在drawCardsByRule函数中增加targetPoolLv参数,支持强制从指定等级卡池抽卡 - 修改MissionCardComp中刷新英雄卡牌逻辑,使用targetPoolLv替代heroLv参数 - 调整role_controller.prefab中多个UI元素的位置和尺寸 - 将开始按钮文本从"开始"改为"开始战斗"并加宽按钮
This commit is contained in:
@@ -224,6 +224,7 @@ export const drawCardsByRule = (
|
||||
type?: CardType | CardType[]
|
||||
heroType?: HType
|
||||
heroLv?: number
|
||||
targetPoolLv?: number
|
||||
} = {}
|
||||
): CardConfig[] => {
|
||||
const count = Math.max(0, Math.floor(options.count ?? 4))
|
||||
@@ -233,6 +234,14 @@ export const drawCardsByRule = (
|
||||
const typeSet = normalizeTypeFilter(options.type)
|
||||
pool = pool.filter(card => typeSet.has(card.type))
|
||||
}
|
||||
if (options.targetPoolLv !== undefined) {
|
||||
// 如果指定了目标卡池等级,则强制从所有配置中筛选该等级的卡牌,无视当前的卡池等级限制
|
||||
pool = CardPoolList.filter(card => card.pool_lv === options.targetPoolLv)
|
||||
if (options.type !== undefined) {
|
||||
const typeSet = normalizeTypeFilter(options.type)
|
||||
pool = pool.filter(card => typeSet.has(card.type))
|
||||
}
|
||||
}
|
||||
if (options.heroType !== undefined || options.heroLv !== undefined) {
|
||||
pool = pool.filter(card => {
|
||||
if (card.type !== CardType.Hero) return false
|
||||
|
||||
Reference in New Issue
Block a user