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,WAAW,CAAC,GAAW;QACnC,OAAO,uBAAU,CAAC,eAAe,CAAC,UAAU,GAAG,GAAG,CAAC,KAAK,8BAAe,CAAC,IAAI,CAAC;IACjF,CAAC;IAFe,4BAAW,cAE1B,CAAA;IAED,SAAgB,cAAc,CAAC,GAAW,EAAE,KAAsB;QAC9D,uBAAU,CAAC,eAAe,CAAC,UAAU,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC;QACrD,uBAAU,CAAC,QAAQ,EAAE,CAAC;IAC1B,CAAC;IAHe,+BAAc,iBAG7B,CAAA;AACL,CAAC,EAvVgB,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAuVhC","file":"","sourceRoot":"/","sourcesContent":["import { Emitter, CompositeDisposable } from \"simba-eventkit\";\nimport { shallowEqual } from \"simba-utils\";\nimport { GameRecord } from \"../../avg/game-data/GameRecord\";\nimport { Language, ReadonlyPlot, ReadonlyPlots, SentenceType } from \"../../avg/model/PlotModel\";\nimport { PlotManager } from \"../../avg/PlotManager\";\nimport { GameConstData } from \"../../common/gameplay/gamedata/GameConstData\";\nimport { ConfigManager } from \"../../common/gameplay/managers/ConfigManager\";\nimport { ResUtils } from \"../../common/utils/ResUtils\";\nimport { bannerRewardsConfig } from \"../../config/BannerRewardsConfig\";\nimport { constConfig } from \"../../config/ConstConfig\";\nimport { itemConfig } from \"../../config/ItemConfig\";\nimport { IRole, role } from \"../../config/Role\";\nimport { PlotSceneType } from \"../Enums\";\nimport GameRoleDataModel from \"./GameRoleDataModel\";\nimport { MessageSceneModel } from \"./MessageSceneModel\";\nimport { EditorEvents } from \"../../avg/EditorEvents\";\nimport { achievementConfig } from \"../../config/AchievementConfig\";\nimport { dailyQuestConfig } from \"../../config/DailyQuestConfig\";\nimport { DatingEventSceneModel, DatingEventStatus } from \"./DatingEventSceneModel\";\nimport { dateSceneConfig } from \"../../config/DateSceneConfig\";\nimport { DateType } from \"../../avg/EditorEnums\";\nimport { FuncStateEnum, RedPotStateEnum } from \"../../common/gameplay/gamedata/GameEnumData\";\nimport { i18nConfig } from \"../../config/I18nConfig\";\n\nexport namespace GameModelManager {\n let emitter = new Emitter;\n\n export const MessageSceneChanged = emitter.createEvent<(scenes: MessageSceneModel[]) => void>();\n export const RedPotReduction = emitter.createEvent<(key: string) => void>(); //红点还原\n export const MainDatingEventChanged = emitter.createEvent<(scenes: DatingEventSceneModel[]) => void>();\n /**报幕数据准备就绪事件 */\n export const ForceClickDataReady = emitter.createEvent<() => void>();\n\n let messageScenes: MessageSceneModel[] | undefined;\n let mainDatingScenes: DatingEventSceneModel[] | undefined;\n let currPlots: ReadonlyPlot[] | undefined;\n let phoneCallIndex: number = -1;\n\n let unlockGift = false;\n\n export function isGiftUnlock() { return unlockGift; }\n\n export async function rollbackPhoneCallIfNeeded() {\n // if (phoneCallIndex < 0) {\n // console.error(\"Error: no phone call.\");\n // }\n if (phoneCallIndex >= 0 && phoneCallIndex < GameRecord.getCurrentRecordItems().length - 1) {\n let ret = await PlotManager.rollbackToIndex(phoneCallIndex);\n savePhoneCall();\n return ret;\n } else {\n return PlotManager.getCurrentPlots();\n }\n }\n\n //#region //数据模块 \n let roleDatasMap: Map<number, GameRoleDataModel> = new Map<number, GameRoleDataModel>();\n let languagesMap: Map<number, string> = new Map<number, string>(); //语言\n //#endregion\n\n export function getCurrentChapterId() {\n return currPlots![0].chapterId;\n }\n\n export function getMessageScenesModel() {\n return messageScenes!;\n }\n\n export function getMessageSceneModel(id: number) {\n return messageScenes!.find(v => v.id === id);\n }\n export function getMainDatingEventScenesModel() {\n return mainDatingScenes!;\n }\n\n export function getMainDatingEventSceneModel(id: number) {\n return mainDatingScenes!.find(v => v.id === id);\n }\n\n\n async function initConfigData() {\n await ConfigManager.initConfigData();\n initLanguageConfig();\n initRoleConfig();\n }\n\n function initRoleConfig() {\n let cfg = ConfigManager.getAllConfig(role);\n for (let id in cfg) {\n let element = cfg[id] as IRole;\n if (element) {\n let data = new GameRoleDataModel();\n data.setConfig(element);\n roleDatasMap.set(element.id, data);\n }\n }\n }\n\n function getLanguagePath() {\n return \"userdata/language/chinese\"\n }\n async function initLanguageConfig() {\n let cfgFile = await ResUtils.loadRes<any>(getLanguagePath(), cc.JsonAsset);\n if (cfgFile) {\n let lans: Language[] = cfgFile as Language[];\n for (let i = 0; i < lans.length; ++i) {\n let element = lans[i] as Language;\n if (element) {\n languagesMap.set(element.id, element.value);\n }\n }\n }\n }\n\n export function getLanguageTxt(id: number): string {\n if (languagesMap.has(id)) {\n return languagesMap.get(id) as string;\n } else {\n console.log(\"current language id is miss \" + id);\n return \"\";\n }\n }\n\n export function getConfigLanguageTxt(id: number): string {\n return ConfigManager.getConfig(i18nConfig, id).cn;\n }\n\n export function getConstConfig(id: number) {\n return ConfigManager.getConfig(constConfig, id);\n }\n\n export function getItemConfig(id: number) {\n return ConfigManager.getConfig(itemConfig, id);\n }\n\n export function getItemConfigs() {\n return ConfigManager.getAllConfig(itemConfig);\n }\n\n export function getBannerRewardsConfigs() {\n return ConfigManager.getAllConfig(bannerRewardsConfig)\n }\n\n export function getBannerRewardsConfig(id: number) {\n return ConfigManager.getConfig(bannerRewardsConfig, id);\n }\n\n export function getDailyQuestConfigs() {\n return ConfigManager.getAllConfig(dailyQuestConfig)\n }\n\n export function getDailyQuestConfig(id: number) {\n return ConfigManager.getConfig(dailyQuestConfig, id);\n }\n\n export function getAchievementConfigs() {\n return ConfigManager.getAllConfig(achievementConfig)\n }\n\n export function getAchievementConfig(id: number) {\n return ConfigManager.getConfig(achievementConfig, id);\n }\n\n export function getRoleData(id: number) {\n return roleDatasMap.get(id);\n }\n\n export function getPlayerData() {\n return GameModelManager.getRoleData(GameConstData.GAME_CONST_PLAYER_ROLE_VALUE)!;\n }\n\n let disposable: CompositeDisposable;\n\n export async function init() {\n disposable = new CompositeDisposable;\n await initConfigData();\n phoneCallIndex = GameRecord.recordVariables[\"gm.pci\"] as number;\n unlockGift = !!GameRecord.recordVariables[\"gm.unlockGift\"];\n if (phoneCallIndex === undefined) phoneCallIndex = -1;\n let initRet: Promise<any>[] = [];\n { // init message models\n let ids = GameRecord.recordVariables[\"gm.ms\"] as any;\n if (ids !== undefined) {\n messageScenes = ids.map((id: number) => new MessageSceneModel(id));\n initRet.push(...messageScenes!.map((s) => s.initFromRecords()));\n }\n }\n { // init main dating models\n let ids = GameRecord.recordVariables[\"gm.md\"] as any;\n if (ids !== undefined) {\n mainDatingScenes = ids.map((id: number) => new DatingEventSceneModel(id));\n initRet.push(...mainDatingScenes!.map((s) => s.initFromRecords()));\n }\n }\n\n if (initRet.length) {\n await Promise.all(initRet);\n }\n\n disposable.add(PlotManager.PlotWillStart.on(handlePlotWillStart));\n disposable.add(PlotManager.PlotsRollbackEvent.on(handlePlotsRollback));\n disposable.add(EditorEvents.UNLOCK_GIFT.on(() => {\n unlockGift = true;\n GameRecord.recordVariables[\"gm.unlockGift\"] = 1;\n }));\n initPlots();\n\n for (let scene of mainDatingScenes!) { // 检查主线剧情状态\n if (currPlots![0].plotSceneType !== PlotSceneType.DatingEvent ||\n (scene.id !== currPlots![0].plotSceneTypeId && scene.status !== DatingEventStatus.Completed)) {\n scene.status = DatingEventStatus.Completed;\n }\n }\n }\n\n function save() {\n let oldValue = GameRecord.recordVariables[\"gm.ms\"];\n let newValue = messageScenes!.map(v => v.id) as any;\n if (!shallowEqual(oldValue, newValue)) {\n GameRecord.recordVariables[\"gm.ms\"] = newValue;\n }\n oldValue = GameRecord.recordVariables[\"gm.md\"];\n newValue = mainDatingScenes!.map(v => v.id) as any;\n if (!shallowEqual(oldValue, newValue)) {\n GameRecord.recordVariables[\"gm.md\"] = newValue;\n }\n }\n\n function savePhoneCall() {\n GameRecord.recordVariables[\"gm.pci\"] = phoneCallIndex;\n GameRecord.saveRecord();\n }\n\n async function initPlots() {\n let plots = PlotManager.getCurrentPlots();\n if (!currPlots) {\n currPlots = [...plots];\n if (!messageScenes) { // 第一次进游戏,根据剧情初始化数据\n messageScenes = [];\n }\n if (!mainDatingScenes) {\n mainDatingScenes = [];\n }\n for (let i = 0; i < plots.length; i++) {\n let plot = plots[i];\n if (plot.plotSceneType === PlotSceneType.Message) {\n let index = messageScenes.findIndex(v => v.id === plot.plotSceneTypeId);\n if (index < 0) {\n index = 0;\n let model = new MessageSceneModel(plot.plotSceneTypeId);\n model.firstPlot = plot;\n messageScenes.unshift(model);\n }\n // if (plot.sentences[0].content && plot.sentences[0].content.type !== SentenceType.SELECT) {\n // messageScenes[index].lastPlot = plot;\n // }\n } else if (plot.plotSceneType === PlotSceneType.DatingEvent) {\n let cfg = ConfigManager.getConfig(dateSceneConfig, plot.plotSceneTypeId);\n if (cfg.DateType === DateType.Date_Normal) { // 主线约会剧情\n if (plots[0] !== plot) { console.error(\"主线约会剧情应在主线开启\"); continue; }\n if (mainDatingScenes.findIndex(v => v.id === plot.plotSceneTypeId) < 0) {\n let model = new DatingEventSceneModel(plot.plotSceneTypeId);\n model.firstPlot = plot;\n model.status = DatingEventStatus.New;\n mainDatingScenes.push(model);\n }\n }\n }\n }\n save();\n }\n }\n\n async function handlePlotWillStart(plot: ReadonlyPlot, branch: number) {\n handleNewPlot(currPlots![branch], plot, branch);\n currPlots![branch] = plot;\n // for (let i = 0; i < plots.length; i++) {\n // if (!currPlots![i] || (currPlots![i].id !== plots[i].id)) {\n // handleNewPlot(currPlots![i], plots[i], i);\n // currPlots![i] = plots[i];\n // }\n // }\n }\n\n async function handlePlotsRollback(plots: ReadonlyPlots) {\n messageScenes = undefined;\n currPlots = undefined;\n disposable.dispose();\n await init();\n GameRecord.startTransaction();\n GameRecord.endTransaction(true);\n }\n\n async function handleNewPlot(prevPlot: ReadonlyPlot | undefined, plot: ReadonlyPlot, branch: number) {\n if (plot.plotSceneType === PlotSceneType.Message) {\n let idx = messageScenes!.findIndex(v => v.id === plot.plotSceneTypeId);\n if (idx >= 0) { // 原会话中有新消息\n let model = messageScenes![idx];\n if (idx > 0) {\n for (let i = idx; i > 0; i--) {\n messageScenes![i] = messageScenes![i - 1];\n }\n messageScenes![0] = model;\n }\n if (plot.sentences[0].content && plot.sentences[0].content.type !== SentenceType.SELECT) {\n // model.lastPlot = plot;\n }\n } else { // 新会话\n let model = new MessageSceneModel(plot.plotSceneTypeId);\n model.firstPlot = plot;\n if (plot.sentences[0].content && plot.sentences[0].content.type !== SentenceType.SELECT) {\n // model.lastPlot = plot;\n }\n messageScenes!.unshift(model);\n }\n MessageSceneChanged.emit(messageScenes!);\n save();\n } else if (plot.plotSceneType === PlotSceneType.PhoneCall) {\n if (!prevPlot || prevPlot.plotSceneType !== PlotSceneType.PhoneCall) {\n phoneCallIndex = GameRecord.getCurrentRecordItems().length; // 当前存档还没生成,不需要减1\n savePhoneCall();\n }\n } else if (plot.plotSceneType === PlotSceneType.DatingEvent) {\n let cfg = ConfigManager.getConfig(dateSceneConfig, plot.plotSceneTypeId);\n if (cfg.DateType === DateType.Date_Normal) { // 主线约会剧情\n if (branch !== 0) { console.error(\"主线约会剧情应在主线开启\"); return; }\n let idx = mainDatingScenes!.findIndex(v => v.id === plot.plotSceneTypeId);\n if (idx < 0) { // 新开启\n let model = new DatingEventSceneModel(plot.plotSceneTypeId);\n model.firstPlot = plot;\n model.status = DatingEventStatus.New;\n mainDatingScenes!.push(model);\n MainDatingEventChanged.emit(mainDatingScenes!);\n }\n save();\n }\n }\n\n if (prevPlot && prevPlot.plotSceneType === PlotSceneType.PhoneCall && plot.plotSceneType !== PlotSceneType.PhoneCall) {\n phoneCallIndex = -1;\n savePhoneCall();\n }\n\n if (prevPlot && (prevPlot.plotSceneType !== plot.plotSceneType || prevPlot.plotSceneTypeId !== plot.plotSceneTypeId)) { // 切换场景\n if (prevPlot.plotSceneType === PlotSceneType.Message) { // 最后一个是选项的情况下,此时已做选择,记录最后一条剧情\n // let model = messageScenes!.find(v => v.id === prevPlot.plotSceneTypeId);\n // model!.lastPlot = prevPlot;\n }\n if (prevPlot.plotSceneType === PlotSceneType.DatingEvent) {\n let model = mainDatingScenes!.find(v => v.id === prevPlot.plotSceneTypeId);\n if (model) model.status = DatingEventStatus.Completed;\n }\n }\n }\n\n export function checkFuncUnloced(key: string) {\n return GameRecord.recordVariables[key] === FuncStateEnum.locked ? false : true;\n }\n\n export function checkRedPot(key: string) {\n return GameRecord.globalVariables[\"red_pot_\" + key] === RedPotStateEnum.Show;\n }\n\n export function setRedPotState(key: string, state: RedPotStateEnum) {\n GameRecord.globalVariables[\"red_pot_\" + key] = state;\n GameRecord.autoSave();\n }\n}"]}