diff --git a/doc/api.md b/doc/api.md index cc8c8fa..5b28b78 100644 --- a/doc/api.md +++ b/doc/api.md @@ -93,7 +93,8 @@ "comboCount": 0, // 当前连续答对的数量 "maxCombo": 1, // 当局连续答对的最大数量 "score": 10, // 当局胜利后的得分 - "star": 1, // 当局胜利后获得的星星 + "star": 1, // 当局胜利后获得的星星 + "timeLeft": 1, // 当局剩余时间 "gameResult": 0 // 当局的游戏结果, 单人的话和上一层gameResult相同 } } diff --git a/src/models/match/PuzzleSession.ts b/src/models/match/PuzzleSession.ts index 08dc2c3..6c4411a 100644 --- a/src/models/match/PuzzleSession.ts +++ b/src/models/match/PuzzleSession.ts @@ -53,6 +53,9 @@ export class PuzzleStatusClass { @prop({default: 0}) star: number + @prop() + timeLeft: number + /** * 游戏结果 * @type {number} diff --git a/src/services/GameLogic.ts b/src/services/GameLogic.ts index f835cbb..b3659a6 100644 --- a/src/services/GameLogic.ts +++ b/src/services/GameLogic.ts @@ -216,6 +216,7 @@ export function calcSingleScore(history: any, accountId: string) { (stat.maxCombo >= cfgLevel.enemystar) && star++; (hp >= cfgLevel.hpstar) && star ++; stat.star = star + stat.timeLeft = time return { score, star } }