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cesContent":["import { ConfigManager } from \"simba-config-manager\";\nimport { TimeManager } from \"simba-sdk\";\nimport { DeepReadonlyObject } from \"simba-utils\";\nimport { GameRecord, PlotManager } from \"../../avg/AVG\";\nimport { IStoryTbl, storyTbl } from \"../../config/StoryTbl\";\nimport { UnlockItemModelManager } from \"./UnlockItemModelManager\";\n\nclass UnlockSpecialPlotModelManager1 {\n /**存档Key */\n private UnlockedSpecialPlots = 'UnlockedSpecialPlots_';\n /**存档Key */\n private ClickedSpecialPlotsByItem = 'ClickedSpecialPlots_';\n /**存档Key */\n private FirstDayTime = \"FirstDayTime\"\n /**配置解锁番外剧情的剧情id和番外剧情id的映射表 */\n private _unlockPlotIds: Array<{ specialPlotId: number, plotId: number, itemId: number }> = [];\n\n /**\n * 检查一个番外剧情是否解锁\n * @param specialPlotId 番外剧情Id\n * @returns \n */\n public checkSpecialPlotIdIsUnlocked(specialPlotId: number): boolean {\n let unlockedAllSpecialPlotId = this.unlockedAllSpecialPlotId();\n for (let i = 0; i < unlockedAllSpecialPlotId.length; i++) {\n if (specialPlotId == unlockedAllSpecialPlotId[i]) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * 根据ItemId获取该Id解锁了的番外Id\n * @param itemId \n * @returns \n */\n public unlockedSpecialPlotIdByItemId(itemId: number): Array<number> {\n let unlockedSpecialPlots: Array<number> = [];\n let unlockedSpecialPlotsStrs = GameRecord.globalVariables[this.UnlockedSpecialPlots + itemId];\n if (unlockedSpecialPlotsStrs) {\n let itemsIdStr: Array<string> = unlockedSpecialPlotsStrs.split(',');\n itemsIdStr.forEach(id => {\n try {\n unlockedSpecialPlots.push(Number(id));\n } catch (error) {\n console.error(error);\n }\n });\n }\n unlockedSpecialPlots.sort((a, b) => {\n if (a < b) {\n return -1;\n } else if (a > b) {\n return 1;\n }\n return 0;\n });\n return unlockedSpecialPlots;\n }\n\n /**\n * 根据ItemId保存解锁了的番外Id到存档\n * @param specialPlotId 番外Id\n */\n saveUnlockedSpecialPlotIdByItemIdToGameRecord(specialPlotId: number): boolean {\n let cfg: DeepReadonlyObject<IStoryTbl> | undefined = undefined;\n cfg = ConfigManager.getConfig(storyTbl, specialPlotId);\n let itemId: number = -1;\n if (cfg) {\n itemId = cfg.itemId;\n }\n let unlockedSpecialPlotsStrs = GameRecord.globalVariables[this.UnlockedSpecialPlots + itemId];\n let plots: Array<number> = [];\n if (unlockedSpecialPlotsStrs) {\n let unlockedSpecialPlotsStr: Array<string> = unlockedSpecialPlotsStrs.split(',');\n unlockedSpecialPlotsStr.forEach(id => {\n try {\n plots.push(Number(id));\n plots.sort((a, b) => {\n if (a < b) {\n return -1;\n } else if (a > b) {\n return 1;\n }\n return 0;\n });\n } catch (error) {\n console.error(error);\n }\n });\n }\n if (plots.indexOf(specialPlotId) == -1) {\n plots.push(specialPlotId);\n plots.sort((a, b) => {\n if (a < b) {\n return -1;\n } else if (a > b) {\n return 1;\n }\n return 0;\n });\n GameRecord.globalVariables[this.UnlockedSpecialPlots + itemId] = plots.toString();\n GameRecord.saveRecord();\n return true;\n }\n return false;\n }\n\n /**\n * 根据ItemId获取该Id观看了的番外Id\n * @param itemId \n * @returns \n */\n public clickedSpecialPlotIdByItemId(itemId: number): Array<number> {\n let clickedSpecialPlots: Array<number> = [];\n let clickedSpecialPlotsStrs = GameRecord.globalVariables[this.ClickedSpecialPlotsByItem + itemId];\n if (clickedSpecialPlotsStrs) {\n let itemsIdStr: Array<string> = clickedSpecialPlotsStrs.split(',');\n itemsIdStr.forEach(id => {\n try {\n clickedSpecialPlots.push(Number(id));\n } catch (error) {\n console.error(error);\n }\n });\n }\n return clickedSpecialPlots;\n }\n\n /**\n * 根据ItemId保存观看了的番外Id到存档\n * @param specialPlotId 番外Id\n */\n saveClickedSpecialPlotIdByItemIdToGameRecord(specialPlotId: number): boolean {\n let cfg: DeepReadonlyObject<IStoryTbl> | undefined = undefined;\n cfg = ConfigManager.getConfig(storyTbl, specialPlotId);\n let itemId: number = -1;\n if (cfg) {\n itemId = cfg.itemId;\n }\n let clickedSpecialPlotsStrs = GameRecord.globalVariables[this.ClickedSpecialPlotsByItem + itemId];\n let plots: Array<number> = [];\n if (clickedSpecialPlotsStrs) {\n let unlockedSpecialPlotsStr: Array<string> = clickedSpecialPlotsStrs.split(',');\n unlockedSpecialPlotsStr.forEach(id => {\n try {\n plots.push(Number(id));\n } catch (error) {\n console.error(error);\n }\n });\n }\n if (plots.indexOf(specialPlotId) == -1) {\n plots.push(specialPlotId);\n GameRecord.globalVariables[this.ClickedSpecialPlotsByItem + itemId] = plots.toString();\n GameRecord.saveRecord();\n return true;\n }\n return false;\n }\n\n /**\n * 根据ItemId获取该Id的所有番外Id(不论是否解锁)\n * @param itemId \n * @returns \n */\n public allSpecialPlotIdByItemId(itemId: number): Array<number> {\n let allSpecialPlots: Array<number> = [];\n let cfg = ConfigManager.getAllConfig(storyTbl);\n if (cfg) {\n let ret: { specialPlotId: number, itemId: number }[] = [];\n for (let id in cfg) {\n ret.push({ specialPlotId: Number(id), itemId: cfg[id].itemId });\n }\n for (let i = 0; i < ret.length; i++) {\n if (itemId == ret[i].itemId) {\n allSpecialPlots.push(ret[i].specialPlotId);\n }\n }\n }\n return allSpecialPlots;\n }\n\n /**\n * 获取所有解锁了的番外Id\n * @returns \n */\n public unlockedAllSpecialPlotId(): Array<number> {\n let unlockedAllSpecialPlotId: Array<number> = [];\n let unlockedItemId: Array<number> = UnlockItemModelManager.unlockItems;\n for (let i = 0; i < unlockedItemId.length; i++) {\n let unlockedSpecialPlotId = GameRecord.globalVariables[this.UnlockedSpecialPlots + unlockedItemId[i]];\n if (unlockedSpecialPlotId) {\n let clickedSpecialPlotIdStr: Array<string> = unlockedSpecialPlotId.split(',');\n clickedSpecialPlotIdStr.forEach(id => {\n try {\n unlockedAllSpecialPlotId.push(Number(id));\n } catch (error) {\n console.error(error);\n }\n });\n }\n }\n return unlockedAllSpecialPlotId;\n }\n\n getFirstDayTime(): number {\n let firstDayTime = GameRecord.globalVariables[this.FirstDayTime];\n return firstDayTime;\n }\n\n saveFirstDayTime(): boolean {\n let firstDayTime = GameRecord.globalVariables[this.FirstDayTime];\n if (firstDayTime) {\n return false;\n } else {\n GameRecord.globalVariables[this.FirstDayTime] = TimeManager.getTime();\n GameRecord.saveRecord();\n return true;\n }\n }\n\n /**\n * 登录初始化已经解锁的番外\n */\n loginInitUnlockSpecialPlots() {\n //当前剧情应该解锁的所有物品\n let specialPlotcfg: { specialPlotId: number, plotId: number, itemId: number }[] = this.unlockPlotIds;\n //获取当前的剧情id\n let record = GameRecord.getPlotsInfo();\n for (let i = 0; i < specialPlotcfg.length; i++) {\n let ele = specialPlotcfg[i];\n if (ele) {\n if (record[`${ele.plotId}`] && record[`${ele.plotId}`].cnt >= 1) {\n let unlockedSpecialPlotsStrs = GameRecord.globalVariables[this.UnlockedSpecialPlots + ele.itemId];\n let plots: Array<number> = [];\n if (unlockedSpecialPlotsStrs) {\n let unlockedSpecialPlotsStr: Array<string> = unlockedSpecialPlotsStrs.split(',');\n unlockedSpecialPlotsStr.forEach(id => {\n try {\n plots.push(Number(id));\n } catch (error) {\n console.error(error);\n }\n });\n }\n if (plots.indexOf(ele.specialPlotId) == -1) {\n plots.push(ele.specialPlotId);\n }\n GameRecord.globalVariables[this.UnlockedSpecialPlots + ele.itemId] = plots.toString();\n // GameRecord.autoSave();\n }\n }\n }\n }\n\n public get unlockPlotIds(): Array<{ specialPlotId: number, plotId: number, itemId: number }> {\n if (this._unlockPlotIds.length == 0) this.analysisSpecialPlotCfg();\n return this._unlockPlotIds\n }\n\n /**\n * 解析story表结果\n */\n analysisSpecialPlotCfg() {\n let ret: { specialPlotId: number, plotId: number, itemId: number }[] = [];\n let cfg = ConfigManager.getAllConfig(storyTbl);\n for (let id in cfg) {\n ret.push({ specialPlotId: Number(id), plotId: cfg[id].plotId, itemId: cfg[id].itemId });\n }\n this._unlockPlotIds = ret;\n }\n}\n\nexport let UnlockSpecialPlotModelManager = new UnlockSpecialPlotModelManager1();"]}