refactor(config): 拆分英雄卡池到独立配置文件
将原CardPoolList中的英雄卡池逻辑迁移至heroSet.ts,统一管理英雄抽卡配置,简化主配置文件内容,同时更新MissionCardComp以使用新的英雄卡池数据源
This commit is contained in:
@@ -91,44 +91,9 @@ export interface CardConfig {
|
||||
target_hero_eid?: number;
|
||||
}
|
||||
|
||||
/** 基础卡池(英雄、技能、功能) */
|
||||
/** 基础卡池(技能、功能卡;英雄卡池已迁移至 heroSet.ts HeroCardPoolList) */
|
||||
export const CardPoolList: CardConfig[] = [];
|
||||
|
||||
// 动态生成英雄卡池:所有英雄统一生成 lv1 卡牌
|
||||
function getHeroCost(cardLv: number): number {
|
||||
if (cardLv === 1) return 5;
|
||||
if (cardLv === 2) return 10;
|
||||
return 15;
|
||||
}
|
||||
|
||||
/**
|
||||
* 英雄卡按 card_lv 分配抽取权重(几何递减,高等级越稀有)。
|
||||
* 梯度:lv1=40, lv2=25, lv3=15, lv4=8, lv5=3
|
||||
*/
|
||||
const HERO_WEIGHT_BY_LV: Record<number, number> = {
|
||||
1: 40, 2: 25, 3: 15, 4: 8, 5: 3,
|
||||
};
|
||||
function getHeroWeight(cardLv: number): number {
|
||||
return HERO_WEIGHT_BY_LV[cardLv] ?? HERO_WEIGHT_BY_LV[1];
|
||||
}
|
||||
|
||||
HeroList.forEach(uuid => {
|
||||
const hero = HeroInfo[uuid];
|
||||
if (!hero) return;
|
||||
|
||||
CardPoolList.push({
|
||||
uuid: hero.uuid,
|
||||
type: CardType.Hero,
|
||||
cost: getHeroCost(hero.card_lv ?? 1),
|
||||
weight: getHeroWeight(hero.card_lv ?? 1),
|
||||
card_lv: hero.card_lv ?? 1,
|
||||
kind: CKind.Hero,
|
||||
hero_lv: 1,
|
||||
base_card_lv: hero.card_lv ?? 1,
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
export enum SpecialRefreshHeroType {
|
||||
Any = 0,
|
||||
Melee = 1,
|
||||
|
||||
Reference in New Issue
Block a user