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C,iBAAiB,CAAC,CAAC;QAC3E,IAAI,iBAAiB,IAAI,iBAAiB,IAAI,GAAG,EAAE;YAC/C,gBAAU,CAAC,eAAe,CAAC,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC;YAC3D,gBAAU,CAAC,eAAe,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,GAAG,CAAC;YACzD,gBAAU,CAAC,UAAU,EAAE,CAAC;SAC3B;IACL,CAAC;IAED;;;;OAIG;IACH,cAAc,CAAC,MAAc,EAAE,IAAY;QACvC,IAAI,CAAC,GAAG,gBAAU,CAAC,eAAe,CAAC,MAAM,GAAG,MAAM,CAAW,CAAC;QAC9D,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACd,IAAI,CAAC,GAAG,gBAAU,CAAC,eAAe,CAAC,MAAM,GAAG,MAAM,CAAW,CAAC;QAC9D,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACd,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACd,IAAI,CAAC,IAAI,KAAK,EAAE;YACZ,qBAAS,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;YACvC,OAAO;SACV;QACD,IAAI,CAAC,GAAG,IAAI,IAAI,KAAK,EAAE;YACnB,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;SACjB;aAAM;YACH,CAAC,IAAI,IAAI,CAAC;SACb;QACD,gBAAU,CAAC,eAAe,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAChD,gBAAU,CAAC,UAAU,EAAE,CAAC;IAC5B,CAAC;CACJ;AAvED,oCAuEC","file":"","sourceRoot":"/","sourcesContent":["import { GameRecord } from \"../../avg/AVG\";\nimport { UIManager } from \"../../common/gameplay/managers/UIManager\";\n\nexport default class CDKeyEventManager {\n private CDKeyRemovePlotAD = \"CDKeyRemovePlotAD\";\n private CDKeyRemovePlotAD_New = \"prop_2_1001_num\";\n /**单例对象 */\n private static _instance: CDKeyEventManager | undefined;\n\n /**创建单例 */\n public static getInstance(): CDKeyEventManager {\n if (!CDKeyEventManager._instance) {\n CDKeyEventManager._instance = new CDKeyEventManager();\n }\n return CDKeyEventManager._instance;\n }\n\n /**\n * 兑换码去除剧情广告\n */\n cdKeyRemovePlotAD() {\n let cdKeyRemovePlotAd = GameRecord.globalVariables[this.CDKeyRemovePlotAD_New];\n cdKeyRemovePlotAd = cdKeyRemovePlotAd ? cdKeyRemovePlotAd : 0;\n let newCdKeyRemovePlotAd = cdKeyRemovePlotAd + 1\n GameRecord.globalVariables[this.CDKeyRemovePlotAD_New] = newCdKeyRemovePlotAd;\n GameRecord.saveRecord();\n UIManager.showToast(\"兑换成功,解锁剧情将不再需要观看广告\");\n }\n\n /**\n * 检查是否去除了剧情广告\n */\n checkCDKeyRemovePlotAD(): number {\n let cdKeyRemovePlotAd = 0;\n cdKeyRemovePlotAd = GameRecord.globalVariables[this.CDKeyRemovePlotAD_New];\n cdKeyRemovePlotAd = cdKeyRemovePlotAd ? cdKeyRemovePlotAd : 0;\n return cdKeyRemovePlotAd;\n }\n\n /**\n * 版本兼容,将旧版的免广告卡存档迁移到新版存档中\n */\n shiftCDKeyRemovePlotAD() {\n let cdKeyRemovePlotAd = GameRecord.globalVariables[this.CDKeyRemovePlotAD];\n if (cdKeyRemovePlotAd && cdKeyRemovePlotAd == \"1\") {\n GameRecord.globalVariables[this.CDKeyRemovePlotAD_New] = 1;\n GameRecord.globalVariables[this.CDKeyRemovePlotAD] = \"0\";\n GameRecord.saveRecord();\n }\n }\n\n /**\n * 根据人物Id改变该人物的好感度\n * @param roleId 人物Id\n * @param like 好感度\n */\n changeRoleLike(roleId: number, like: number) {\n let g = GameRecord.globalVariables[\"like\" + roleId] as number;\n g = g ? g : 0;\n let r = GameRecord.recordVariables[\"like\" + roleId] as number;\n r = r ? r : 0;\n let l = g + r;\n if (l >= 10000) {\n UIManager.showToast(\"该人物的好感度已满,无法再增加\");\n return;\n }\n if (l + like >= 10000) {\n g = 10000 - r;\n } else {\n g += like;\n }\n GameRecord.globalVariables[\"like\" + roleId] = g;\n GameRecord.saveRecord();\n }\n}\n"]}