fix: count normal main-level wins in Coin Madness mock
This commit is contained in:
@@ -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); }
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user