diff --git a/assets/script/game/common/SingletonModuleComp.ts b/assets/script/game/common/SingletonModuleComp.ts index 58b30ff6..d16c17ad 100644 --- a/assets/script/game/common/SingletonModuleComp.ts +++ b/assets/script/game/common/SingletonModuleComp.ts @@ -7,7 +7,7 @@ import { WxCloudApi } from "../wx_clound_client_api/WxCloudApi"; import { GameEvent } from "./config/GameEvent"; import * as exp from "constants"; import { HeroAttrsComp } from "../hero/HeroAttrsComp"; -import { Attrs } from "./config/HeroAttrs"; +import { Attrs, GameScoreStats } from "./config/HeroAttrs"; import { time } from "console"; import { getLevelExp } from "../map/RogueConfig"; /** @@ -65,8 +65,33 @@ export class SingletonModuleComp extends ecs.Comp { max_mission:4,//最大关卡 coin:0, time:15*60,//游戏时间 - score:0, }, + 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, // 吸血总量 + + // 资源统计 + exp_total: 0, // 经验总数 + gold_total: 0, // 金币总数 + } as GameScoreStats, hero:{ name:'', path:'', diff --git a/assets/script/game/common/config/HeroAttrs.ts b/assets/script/game/common/config/HeroAttrs.ts index ddd48304..cbd6f0cd 100644 --- a/assets/script/game/common/config/HeroAttrs.ts +++ b/assets/script/game/common/config/HeroAttrs.ts @@ -211,4 +211,34 @@ export const isRatioAttr = (attrType: Attrs): boolean => { return AttrsType[attrType] === BType.RATIO; }; +/** + * 游戏单局统计数据接口 + */ +export interface GameScoreStats { + score: number; // 基础得分 + + // 战斗统计 + crt_count: number; // 暴击次数 + wf_count: number; // 风怒次数 + dod_count: number; // 闪避次数 + back_count: number; // 击退次数 + stun_count: number; // 击晕次数 + freeze_count: number; // 冰冻次数 + + // 伤害统计 + total_dmg: number; // 总伤害 + atk_count: number; // 攻击次数 (用于计算平均伤害) + avg_dmg: number; // 平均伤害 + thorns_dmg: number; // 反伤伤害 + crit_dmg_total: number; // 暴击伤害总额 + + // 生存统计 + heal_total: number; // 治疗总量 + lifesteal_total: number;// 吸血总量 + + // 资源统计 + exp_total: number; // 经验总数 + gold_total: number; // 金币总数 +} +