From 5d0f498f9eeb62b7031456a95a4c71a0cc089d20 Mon Sep 17 00:00:00 2001 From: "COMPUTER\\EDY" <249929363@qq.com> Date: Thu, 10 Sep 2026 19:47:04 +0800 Subject: [PATCH] fix: keep cleared streaks from triggering delayed B guide --- assets/Script/ItemGuide.ts | 4 ++-- assets/Script/Map.ts | 2 +- assets/Script/module/Config/GameConfig.ts | 5 +++++ tools/new-player-ab-test-support.cjs | 2 +- tools/test-new-player-ab.cjs | 4 ++++ 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/assets/Script/ItemGuide.ts b/assets/Script/ItemGuide.ts index af068c7..547a27b 100644 --- a/assets/Script/ItemGuide.ts +++ b/assets/Script/ItemGuide.ts @@ -38,7 +38,7 @@ export default class ItemGuide extends cc.Component { this.itemList[2].getComponent(cc.Sprite).spriteFrame = this.itemSpriteList[8]; this.itemList[3].getComponent(cc.Sprite).spriteFrame = this.itemSpriteList[12]; } - else if (cc.fx.GameConfig.GM_INFO.winStreakFirst == true && cc.fx.GameConfig.isWinStreakUnlocked()) { + else if (cc.fx.GameConfig.shouldShowWinStreakGuide()) { this.itemList[0].getComponent(cc.Sprite).spriteFrame = this.itemSpriteList[9]; this.itemList[1].getComponent(cc.Sprite).spriteFrame = this.itemSpriteList[10]; this.itemList[2].getComponent(cc.Sprite).spriteFrame = this.itemSpriteList[11]; @@ -75,7 +75,7 @@ export default class ItemGuide extends cc.Component { cc.fx.GameConfig.GM_INFO.magicAFirst = false; index = 2; } - else if (cc.fx.GameConfig.GM_INFO.winStreakFirst == true && cc.fx.GameConfig.isWinStreakUnlocked()) { + else if (cc.fx.GameConfig.shouldShowWinStreakGuide()) { cc.fx.GameConfig.GM_INFO.winStreakFirst = false; index = 0; } diff --git a/assets/Script/Map.ts b/assets/Script/Map.ts index 55e8e0e..8616d42 100644 --- a/assets/Script/Map.ts +++ b/assets/Script/Map.ts @@ -1343,7 +1343,7 @@ export default class MapConroler extends cc.Component { this.guideItem.active = true; this.setPropNum(); } - if (cc.fx.GameConfig.GM_INFO.winStreakFirst == true && cc.fx.GameConfig.isWinStreakUnlocked()) { + if (cc.fx.GameConfig.shouldShowWinStreakGuide()) { this.guideItem.active = true; } diff --git a/assets/Script/module/Config/GameConfig.ts b/assets/Script/module/Config/GameConfig.ts index b7248aa..c663081 100644 --- a/assets/Script/module/Config/GameConfig.ts +++ b/assets/Script/module/Config/GameConfig.ts @@ -430,6 +430,11 @@ export class GameConfig { return !this.isNewPlayerB() || this.GM_INFO.level >= 50; } + static shouldShowWinStreakGuide(): boolean { + return !!this.GM_INFO.winStreakFirst && this.isWinStreakUnlocked() + && (!this.isNewPlayerB() || this.GM_INFO.winStreak >= 10); + } + static canSettleCareer(): boolean { return !this.isNewPlayerB() || this.GM_INFO.level > 15; } diff --git a/tools/new-player-ab-test-support.cjs b/tools/new-player-ab-test-support.cjs index 0edb68c..981b5cc 100644 --- a/tools/new-player-ab-test-support.cjs +++ b/tools/new-player-ab-test-support.cjs @@ -20,7 +20,7 @@ function loadMembers(file, names, globals = {}) { const Config = loadMembers('assets/Script/module/Config/GameConfig.ts', [ 'isNewPlayerB', 'getLevelConfigPath', 'getPropUnlockLevel', 'getFeatureUnlockLevel', - 'isWinStreakUnlocked', 'canSettleCareer', 'defaultNewLevel', 'newPlayerNewLevel', + 'isWinStreakUnlocked', 'shouldShowWinStreakGuide', 'canSettleCareer', 'defaultNewLevel', 'newPlayerNewLevel', 'defaultNewGuide', 'NEW_LEVEL', 'NEW_GUIDE', ]); function withNewPlayerConfig(config) { diff --git a/tools/test-new-player-ab.cjs b/tools/test-new-player-ab.cjs index 42d5f20..3a470d9 100644 --- a/tools/test-new-player-ab.cjs +++ b/tools/test-new-player-ab.cjs @@ -223,9 +223,13 @@ test('10-win progress and failure reset retain their original behavior before un assert.equal(c.GM_INFO.winStreak, 10); assert.equal(c.GM_INFO.winStreakFirst, true); assert.equal(c.isWinStreakUnlocked(), false); + assert.equal(c.shouldShowWinStreakGuide(), false); c.GM_INFO.level = 50; assert.equal(c.isWinStreakUnlocked(), true); + assert.equal(c.shouldShowWinStreakGuide(), true); c.GM_INFO.level = 30; tool.setWinStreak('fail'); assert.equal(c.GM_INFO.winStreak, 0); + c.GM_INFO.level = 50; + assert.equal(c.shouldShowWinStreakGuide(), false, 'a stale first-guide flag cannot revive a cleared streak'); });