This commit is contained in:
2025-05-26 20:56:15 +08:00
parent 468f40351d
commit 12b16320e6
10 changed files with 79 additions and 23 deletions

View File

@@ -84,7 +84,7 @@ export class DailyChallenge extends Laya.Script {
var stageID = `${year}-${month}-${dayNow}`
var doStage = StorageManager.getInstance().getStage(stageID)
console.log("play >>>>>>>>>>>>>>>>>>>>>>>", stageID, doStage)
if (!doStage) {
if (!doStage || doStage.get_mistake() >= config.MISTAKE_MAX) {
var stageName = `${config.MONTH_ABBRS[month-1]} ${dayNow}`
StorageManager.getInstance().newStage(stageID, config.STAGE_TYPE.DC, stageName)
}
@@ -190,6 +190,16 @@ export class DailyChallenge extends Laya.Script {
}
var stageID = `${info.year}-${info.month}-${day}`
var progress = user.get_done(stageID)
if (open && progress < 1) {//检查失败的关卡,如果失败了就重置
var doStage = StorageManager.getInstance().getStage(stageID)
if (doStage) {//有关卡数据
if (doStage.get_mistake() >= config.MISTAKE_MAX) {
progress = 0
user.update_stage_done(stageID, 0)
StorageManager.getInstance().cleanStage(stageID)
}
}
}
unit.setCalendarUnit(info.year, info.month, day, open, progress, this, this.onClickUnit)
if (info.year == nowYear && info.month == nowMonth && day == nowDay) {
this.selectedUnit = unit