fix: keep cleared streaks from triggering delayed B guide

This commit is contained in:
COMPUTER\EDY 2026-09-10 19:47:04 +08:00
parent 6b921eb978
commit 5d0f498f9e
5 changed files with 13 additions and 4 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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) {

View File

@ -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');
});