feat(评分系统): 实现多维度游戏评分统计与结算
- 扩展 GameScoreStats 数据结构,新增战绩、输出、防御、构建和效率五个维度的统计字段 - 在战斗、治疗、购卡、刷新等关键节点实时采集评分数据 - 实现评分数据重置机制,确保每局数据独立 - 重构总分计算逻辑,采用五维加权评分模型 - 新增初始金币收入统计,完善资源利用效率评估
This commit is contained in:
@@ -298,6 +298,9 @@ export class MissionCardComp extends CCComp {
|
||||
const v = typeof payload === 'number' ? payload : (payload?.delta ?? payload?.value ?? 0);
|
||||
if (v === 0) return;
|
||||
this.setMissionCoin(this.getMissionCoin() + v);
|
||||
// 【评分系统 - 效率分】精确统计整局游戏的总收入与额外支出(如卖卡、技能扣费等)
|
||||
if (v > 0) smc.vmdata.scores.gold_earned += v;
|
||||
else smc.vmdata.scores.gold_spent -= v;
|
||||
this.updateCoinAndCostUI();
|
||||
this.playCoinChangeAnim(v > 0);
|
||||
}
|
||||
@@ -554,6 +557,9 @@ export class MissionCardComp extends CCComp {
|
||||
return;
|
||||
}
|
||||
this.setMissionCoin(currentCoin - cost);
|
||||
// 【评分系统 - 效率分】记录因刷新卡池消耗的金币,以及刷新次数
|
||||
smc.vmdata.scores.gold_spent += cost;
|
||||
smc.vmdata.scores.refresh_count++;
|
||||
this.playCoinChangeAnim(false);
|
||||
this.updateCoinAndCostUI();
|
||||
mLogger.log(this.debugMode, "MissionCardComp", "click draw", {
|
||||
|
||||
Reference in New Issue
Block a user