fix: count normal main-level wins in Coin Madness mock

This commit is contained in:
keke
2026-09-15 18:48:12 +08:00
parent d4dc79f0b9
commit 2fa17cb972
4 changed files with 36 additions and 5 deletions
+3 -1
View File
@@ -10,7 +10,9 @@ export function recordCoinMadnessMockWin(level: number): void {
const key = coinMadnessMockKey();
const state = cc.fx.StorageMessage.getStorage(key);
if (!state || !state.paidAt || state.settled || Date.now() >= state.config.endsAt || level <= state.lastLevel) return;
if (level === state.lastLevel + 1) state.totalWins++;
// This hook represents one actual victory, not a level delta. Gaps can follow
// config catchup or older builds; count this win once without backfilling them.
state.totalWins++;
state.lastLevel = level;
cc.fx.StorageMessage.setStorage(key, state);
} catch (error) { cc.warn('Coin Madness mock progress unavailable', error); }
+3 -1
View File
@@ -397,7 +397,9 @@ var GameTool = {
cc.fx.GameConfig.GM_INFO.level += 1;
}
if (!endLevel && cc.fx.GameConfig.GM_INFO.GameplayType == 1) recordCoinMadnessMockWin(stageId);
// 普通主线为 0;空计时调用来自配置缺关补进度,不属于实际胜利。
if (!isMaxLevel && cc.fx.GameConfig.GM_INFO.GameplayType == 0
&& !cc.fx.GameConfig.GM_INFO.otherLevel && time1 != null && time2 != null) recordCoinMadnessMockWin(stageId);
cc.fx.GameTool.maxLevel()
MiniGameSdk.API.setNewCloudlevel();
const timestamp = Date.now();