feat(map,economy): 重做游戏经济与卡牌平衡系统
本次提交重构了英雄出售、抽卡、波次金币的数值体系: 1. 调整英雄出售价格按等级计算,1/2/3级分别为3/10/25金币 2. 修改抽卡刷新费用为2,初始金币调整为10 3. 重做波次金币公式,基础收益改为10,每波增长4 4. 调整卡池卡牌消耗与特殊卡牌的定价 5. 优化卡牌抽取消耗的计算逻辑,使用指数增长替代线性计算
This commit is contained in:
@@ -304,17 +304,19 @@ export class HInfoComp extends CCComp {
|
||||
*/
|
||||
private onSellHero(event?: Event) {
|
||||
if (!this.eid) return;
|
||||
const heroLv = Math.max(1, Math.floor(this.model?.lv ?? 1));
|
||||
const removed = Hero.removeByEid(this.eid);
|
||||
mLogger.log(this.debugMode, "HInfoComp", "onSellHero", {
|
||||
eid: this.eid,
|
||||
heroLv,
|
||||
isAlive: this.isModelAlive(),
|
||||
removed
|
||||
});
|
||||
if (!removed) return;
|
||||
|
||||
// 使用统一经济管理入口出售英雄
|
||||
MissionEconomy.executeSellHero();
|
||||
|
||||
|
||||
// 使用统一经济管理入口出售英雄(按等级计算卖价)
|
||||
MissionEconomy.executeSellHero(heroLv);
|
||||
|
||||
oops.gui.remove(UIID.IBox);
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ export class MissionCardComp extends CCComp {
|
||||
/** 按钮弹起缩放(峰值) */
|
||||
private readonly buttonClickScale: number = 1.06;
|
||||
/** 抽卡(刷新)费用 */
|
||||
refreshCost: number = 1;
|
||||
refreshCost: number = 2;
|
||||
/** 卡牌面板展开/收起动画时长(秒) */
|
||||
cardsPanelMoveDuration: number = 0.2;
|
||||
|
||||
|
||||
@@ -87,10 +87,10 @@ export class MissionComp extends CCComp {
|
||||
private maxMonsterCount: number = 50;
|
||||
/** 怪物数量恢复阈值(降至此值以下恢复刷怪) */
|
||||
private resumeMonsterCount: number = 30;
|
||||
/** 新一波金币奖励基础值(现已固定,不再随波次增长) */
|
||||
private prepareBaseCoinReward: number = 25;
|
||||
/** 每一波金币增长值(固定收益设为0) */
|
||||
private prepareCoinWaveGrow: number = 0;
|
||||
/** 新一波金币奖励基础值 */
|
||||
private prepareBaseCoinReward: number = 10;
|
||||
/** 每一波金币增长值(公式: base + (wave-1) * growth) */
|
||||
private prepareCoinWaveGrow: number = 4;
|
||||
/** 金币奖励上限(固定收益,此值不再生效) */
|
||||
private prepareCoinRewardCap: number = 100;
|
||||
/** 卡池升级波次配置:达到对应波次时,推送卡池升级事件 */
|
||||
@@ -788,12 +788,13 @@ export class MissionComp extends CCComp {
|
||||
private grantPrepareCoinByWave(wave: number) {
|
||||
if (wave <= 1) return;
|
||||
if (wave <= this.lastPrepareCoinWave) return;
|
||||
|
||||
// 使用统一经济管理入口发放每波金币
|
||||
const reward = MissionEconomy.executeWaveGold(this.prepareBaseCoinReward);
|
||||
|
||||
|
||||
// 波次金币公式: baseReward + (wave-1) * waveGrow
|
||||
const waveReward = this.prepareBaseCoinReward + (wave - 1) * this.prepareCoinWaveGrow;
|
||||
const reward = MissionEconomy.executeWaveGold(waveReward);
|
||||
|
||||
this.lastPrepareCoinWave = wave;
|
||||
mLogger.log(this.debugMode, "MissionComp", "grantPrepareCoinByWave", { wave, reward, coin: smc.vmdata.mission_data.coin });
|
||||
mLogger.log(this.debugMode, "MissionComp", "grantPrepareCoinByWave", { wave, waveReward, reward, coin: smc.vmdata.mission_data.coin });
|
||||
}
|
||||
|
||||
// ======================== 怪物数量管理 ========================
|
||||
|
||||
@@ -66,11 +66,12 @@ export class MissionEconomy {
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算英雄出售金币
|
||||
/**
|
||||
* 计算英雄出售金币(按英雄等级缩放)
|
||||
*/
|
||||
static getSellGold(): number {
|
||||
const baseSellGold = 1; // 基础卖出金币
|
||||
static getSellGold(heroLevel: number = 1): number {
|
||||
const sellByLevel: Record<number, number> = { 1: 3, 2: 10, 3: 25 };
|
||||
const baseSellGold = sellByLevel[heroLevel] || 3;
|
||||
const goldBoost = FieldSkillHelper.getFieldSkillTotalValue(FieldSkillType.SellGold);
|
||||
let totalSellGold = baseSellGold + goldBoost;
|
||||
// 应用天赋 SellBonus (增加数值)
|
||||
@@ -81,11 +82,11 @@ export class MissionEconomy {
|
||||
return Math.floor(totalSellGold);
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行出售英雄并增加金币
|
||||
/**
|
||||
* 执行出售英雄并增加金币
|
||||
*/
|
||||
static executeSellHero(): number {
|
||||
const gold = this.getSellGold();
|
||||
static executeSellHero(heroLevel: number = 1): number {
|
||||
const gold = this.getSellGold(heroLevel);
|
||||
this.addCoin(gold);
|
||||
return gold;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user