fix: keep cleared streaks from triggering delayed B guide
This commit is contained in:
parent
6b921eb978
commit
5d0f498f9e
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user