fix(config): 调整英雄卡抽取权重随等级递减逻辑

将原本固定的英雄抽取权重改为按等级几何递减,高等级英雄更难抽取,优化卡池抽取概率梯度
This commit is contained in:
pan
2026-08-11 14:56:38 +08:00
parent 805a3928a7
commit d692251467

View File

@@ -102,17 +102,26 @@ function getHeroCost(cardLv: number): number {
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;
const baseWeight = 25;
CardPoolList.push({
uuid: hero.uuid,
type: CardType.Hero,
cost: getHeroCost(hero.card_lv ?? 1),
weight: baseWeight,
weight: getHeroWeight(hero.card_lv ?? 1),
card_lv: hero.card_lv ?? 1,
kind: CKind.Hero,
hero_lv: 1,