fix(config): 调整英雄卡抽取权重随等级递减逻辑
将原本固定的英雄抽取权重改为按等级几何递减,高等级英雄更难抽取,优化卡池抽取概率梯度
This commit is contained in:
@@ -102,17 +102,26 @@ function getHeroCost(cardLv: number): number {
|
|||||||
return 15;
|
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 => {
|
HeroList.forEach(uuid => {
|
||||||
const hero = HeroInfo[uuid];
|
const hero = HeroInfo[uuid];
|
||||||
if (!hero) return;
|
if (!hero) return;
|
||||||
|
|
||||||
const baseWeight = 25;
|
|
||||||
|
|
||||||
CardPoolList.push({
|
CardPoolList.push({
|
||||||
uuid: hero.uuid,
|
uuid: hero.uuid,
|
||||||
type: CardType.Hero,
|
type: CardType.Hero,
|
||||||
cost: getHeroCost(hero.card_lv ?? 1),
|
cost: getHeroCost(hero.card_lv ?? 1),
|
||||||
weight: baseWeight,
|
weight: getHeroWeight(hero.card_lv ?? 1),
|
||||||
card_lv: hero.card_lv ?? 1,
|
card_lv: hero.card_lv ?? 1,
|
||||||
kind: CKind.Hero,
|
kind: CKind.Hero,
|
||||||
hero_lv: 1,
|
hero_lv: 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user