feat(评分系统): 实现多维度游戏评分统计与结算

- 扩展 GameScoreStats 数据结构,新增战绩、输出、防御、构建和效率五个维度的统计字段
- 在战斗、治疗、购卡、刷新等关键节点实时采集评分数据
- 实现评分数据重置机制,确保每局数据独立
- 重构总分计算逻辑,采用五维加权评分模型
- 新增初始金币收入统计,完善资源利用效率评估
This commit is contained in:
walkpan
2026-04-25 21:52:59 +08:00
parent 83d5792b48
commit b588fd06a0
9 changed files with 220 additions and 28 deletions

View File

@@ -92,16 +92,35 @@ export class SingletonModuleComp extends ecs.Comp {
// 生存统计
heal_total: 0, // 治疗总量
lifesteal_total: 0, // 吸血总量
shield_block_count: 0,
dead_trigger_count: 0,
// 资源统计
exp_total: 0, // 经验总数
gold_total: 0, // 金币总数
gold_earned: 0,
gold_spent: 0,
refresh_count: 0,
refresh_hit_count: 0,
// 击杀统计
melee_kill_count: 0, // 近战怪击杀数量
remote_kill_count: 0, // 远程怪击杀数量
elite_kill_count: 0, // 精英怪击杀数量
boss_kill_count: 0, // Boss击杀数
// 战绩统计
wave_win_count: 0,
wave_remain_monsters: 0,
wave_all_alive_count: 0,
passed_wave_20: false,
highest_dmg: 0,
score_combat: 0,
score_output: 0,
score_defense: 0,
score_build: 0,
score_efficiency: 0,
} as GameScoreStats,
gold: 0, // 金币数据MVVM绑定字段
@@ -120,6 +139,51 @@ export class SingletonModuleComp extends ecs.Comp {
}
}
/**
* 重置单局评分数据
* 在每次新战斗开始时调用,确保上一局的得分不会带入新一局
*/
resetScores() {
this.vmdata.scores = {
score: 0,
crt_count: 0,
wf_count: 0,
dod_count: 0,
back_count: 0,
stun_count: 0,
freeze_count: 0,
total_dmg: 0,
atk_count: 0,
avg_dmg: 0,
thorns_dmg: 0,
crit_dmg_total: 0,
heal_total: 0,
lifesteal_total: 0,
shield_block_count: 0,
dead_trigger_count: 0,
exp_total: 0,
gold_total: 0,
gold_earned: 0,
gold_spent: 0,
refresh_count: 0,
refresh_hit_count: 0,
melee_kill_count: 0,
remote_kill_count: 0,
elite_kill_count: 0,
boss_kill_count: 0,
wave_win_count: 0,
wave_remain_monsters: 0,
wave_all_alive_count: 0,
passed_wave_20: false,
highest_dmg: 0,
score_combat: 0,
score_output: 0,
score_defense: 0,
score_build: 0,
score_efficiency: 0,
} as GameScoreStats;
}
// ==================== 数据管理方法 ====================
/**