fix: 修复英雄升2级时费用未指数增长的问题

升级到2级时,费用应乘以 MERGE_NEED 的 (2-1) 次方,以符合指数增长的设计。
This commit is contained in:
walkpan
2026-04-04 18:33:40 +08:00
parent 8d9c9a6348
commit 80f0992fce

View File

@@ -1,5 +1,6 @@
import * as exp from "constants"
import { HeroInfo, HType } from "./heroSet"
import { FightSet } from "./GameSet"
/** 卡牌大类定义 */
export enum CardType {
@@ -174,7 +175,8 @@ const applyHeroLv2Probability = (cards: CardConfig[], currentPoolLv: number): Ca
if (card.type === CardType.Hero && card.hero_lv === 1) {
const prob = HERO_LV2_INIT_PROB + HERO_LV2_PROB_INC_PER_LV * (currentPoolLv - card.pool_lv)
if (Math.random() < prob) {
return { ...card, hero_lv: 2 }
// 升级到2级时花费呈指数增长 (1级cost * MERGE_NEED^(2-1))
return { ...card, hero_lv: 2, cost: card.cost * Math.pow(FightSet.MERGE_NEED, 1) }
}
}
return card