import User from "../../../FrameWork/User/User" import TaskManager, { MainTaskIdEnum } from "../../JuQingChat/TaskManager"; import BagManager from "../../Manager/BagManager"; import MeiNvZhaoMuManager from "../../MeiNvZhaoMu/MeiNvZhaoMuManager"; export enum CaiXiEnum { YaoShan = 0, ShiPingChang, YiYao, WenYu, DianZi, WangLuo, JingRong, WeiLai, } let ZhongCanTingConfig = [ { id: CaiXiEnum.YaoShan, caiMing: '叶氏药膳', spineName: '药膳', unLockTag: 'YaoShan', maxLevel: 8, shengJiXiaoHaoArr: [168, 210, 276, 378, 468, 600, -1], meiMiaoShouYiArr: [20, 28, 35, 46, 63, 78, 100, 130], caiPinMing: ['黄芪鲫鱼汤', '山药乌鸡汤', '花胶鸽子汤', '玉竹老鸭汤', '海参香菇汤', '松茸土鸡汤', '金箔燕窝羹', '海马人参汤'], subtitle: 22 }, { id: CaiXiEnum.ShiPingChang, caiMing: '叶氏食品厂', spineName: '食品', unLockTag: 'ShiPingChang', maxLevel: 8, shengJiXiaoHaoArr: [1740, 2280, 2760, 3200, -1, -1, -1], meiMiaoShouYiArr: [47, 58, 76, 92, 140, 185, 231, 271], caiPinMing: ['即食燕麦片', '罐装八宝粥', '海苔肉松卷', '核桃芝麻糊', '有机蔓越莓', '福运红枣糕', '黑枸杞果干', '松露巧克力'], subtitle: 51 }, { id: CaiXiEnum.YiYao, caiMing: '叶氏医药', unLockTag: 'YiYao', spineName: '医药', maxLevel: 8, shengJiXiaoHaoArr: [18840, 22560, 27060, -1, -1, -1, -1], meiMiaoShouYiArr: [262, 314, 376, 451, 541, 816, 1216, 1824], caiPinMing: ['退烧药', '消炎药', '感冒药', '降压药', '肝病药', '肠胃药', '心血管药', '新型肝药'], subtitle: 81 }, { id: CaiXiEnum.WenYu, caiMing: '叶氏文娱', spineName: '文娱', unLockTag: 'WenYu', maxLevel: 8, shengJiXiaoHaoArr: [54480, 65340, -1, -1, -1, -1, -1], meiMiaoShouYiArr: [757, 908, 1089, 1306, 1975, 2940, 4410, 6615], caiPinMing: ['网剧制作', '艺术培训', '音乐制作', '影视制作', '综艺制作', '直播业务', '艺人经纪', '主题公园'], subtitle: 94 }, { id: CaiXiEnum.DianZi, caiMing: '叶氏电子', spineName: '电子', unLockTag: 'DianZi', maxLevel: 8, shengJiXiaoHaoArr: [217440, 260880, -1, -1, -1, -1, -1], meiMiaoShouYiArr: [2937, 3624, 4348, 5217, 8125, 11700, 17600, 26400], caiPinMing: ['智能音箱', '智能手表', 'VR眼镜', '智能电视', '笔记本电脑', '平板电脑', '无人机', '智能手机'], subtitle: 117 }, { id: CaiXiEnum.WangLuo, caiMing: '叶氏网络', spineName: '网络', unLockTag: 'WangLuo', maxLevel: 8, shengJiXiaoHaoArr: [381000, -1, -1, -1, -1, -1, -1], meiMiaoShouYiArr: [5290, 6350, 7620, 11400, 17100, 25700, 38500, 57800], caiPinMing: ['线上音乐', '线上教育', '网约车', '本地生活', '搜索引擎', '短视频平台', '即时通讯', '电商平台'], subtitle: 126 }, { id: CaiXiEnum.JingRong, caiMing: '叶氏金融', spineName: '金融', unLockTag: 'JingRong', maxLevel: 8, shengJiXiaoHaoArr: [26898000, -1, -1, -1, -1, -1, -1], meiMiaoShouYiArr: [373600, 448300, 537900, 806900, 1210400, 1815600, 2723500, 4083400], caiPinMing: ['金融咨询', '小额贷款', '消费金融', '信托业务', '保险业务', '资产管理', '投资银行', '股票交易'], subtitle: 156 }, { id: CaiXiEnum.WeiLai, caiMing: '叶氏未来', spineName: '未来', unLockTag: 'WeiLai', maxLevel: 8, shengJiXiaoHaoArr: [-1, -1, -1, -1, -1, -1, -1], meiMiaoShouYiArr: [1161000, 1393000, 2091000, 3135000, 4703000, 7055000, 10583000, 15874000], caiPinMing: ['人工智能', '生物技术', '自动驾驶', '纳米技术', '深海探测', '量子技术', '脑机接口', '太空探索'], subtitle: 171 }, ] export default class ZhongCanTingManager { public static getZhongCanTingConfig() { return ZhongCanTingConfig } public static setBaDaCaiXiLevelInfo(id, level) { this.checkTask(); User.setBaDaCaiXiLevelInfo(id, level) } public static getBaDaCaiXiLevelInfo() { return User.getBaDaCaiXiLevelInfo() } // public static updateBaDaCaiXiTime() { // let tab = this.getBaDaCaiXiLevelInfo() // for (var i = 0; i < tab.length; i++) { // if (tab[i].isStartTimer) { // tab[i].timeNum -= 1 // if (tab[i].timeNum <= 0) { // tab[i].isStartTimer = false // tab[i].level += 1 // this.checkTask(); // } // } // } // User.setBaDaCaiXiInfo(tab) // } public static getCaiXiUnlockStatus(tag) { let baDaCaiXiUnlockStatus = User.getBaDaCaiXiUnlockStatus() return baDaCaiXiUnlockStatus[tag] } public static getPerSecondShouYi(addTili = 0, addNaoLi = 0) { let baDaCaiXiLevelInfo = this.getBaDaCaiXiLevelInfo() let allMoney = 0 for (let i = 0; i < ZhongCanTingConfig.length; i++) { let level = baDaCaiXiLevelInfo[i].level // if (ZhongCanTingManager.getCaiXiUnlockStatus(ZhongCanTingConfig[i].unLockTag)) { // allMoney += ZhongCanTingConfig[i].meiMiaoShouYiArr[level - 1] // } if (ZhongCanTingManager.getCaiXiUnlockStatus(ZhongCanTingConfig[i].unLockTag)) { for (let j = 0; j <= level - 1; j++) { allMoney += ZhongCanTingConfig[i].meiMiaoShouYiArr[j] } } } // let naoLi = User.getProper_NaoLi() + addNaoLi // let naoLiJiaCheng = (naoLi - 50) * 0.2 // let tiLi = User.getProper_TiLi() + addTili // let tiLiJiaCheng = (tiLi - 50) * 0.15 let rate = 1 let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo() let mainId = mainTaskInfo.Id let zhaoMuBeiShu = MeiNvZhaoMuManager.getZhaoMuBeiShu(0) if (zhaoMuBeiShu) { rate = zhaoMuBeiShu } if (mainId == MainTaskIdEnum.MainTask_2702) { rate = rate / 2 } return allMoney * rate // return allMoney * (1 + naoLiJiaCheng + tiLiJiaCheng) * rate } // 任务完成检测 public static checkTask() { let taskInfo: any = TaskManager.getCurUnLockMainTaskInfo(); if (taskInfo.Id != MainTaskIdEnum.MainTask_None && taskInfo.Id) { let configData = TaskManager.getTaskConfigById(taskInfo.Id); if (configData && configData.GMGameType == "ZhongCanTing") { if (configData.GMCapitalLevel && configData.GMCapitalLevel.length > 0) { let isFinish = true; let tab = this.getBaDaCaiXiLevelInfo(); for (const capitalLevel of configData.GMCapitalLevel) { if (tab[capitalLevel[0]].level < capitalLevel[1]) { isFinish = false; break; } } if (isFinish) { TaskManager.finishCurMainTask(taskInfo.Id); if (taskInfo.Id == MainTaskIdEnum.MainTask_1406) { // 开设肝病药物产线获得肝病药物 BagManager.addBagList({ goodId: 3083, goodNum: 1 }) } } } if (configData.needMiaoZhuan) { let allMoney = ZhongCanTingManager.getPerSecondShouYi() if (allMoney >= configData.needMiaoZhuan) { TaskManager.finishCurMainTask(taskInfo.Id); } } } } } public static checkIsCanTingNeedShengJi() { let ZhongCanTingConfig = ZhongCanTingManager.getZhongCanTingConfig() let baDaCaiXiLevelInfo = User.getBaDaCaiXiLevelInfo() for (let i = 0; i < ZhongCanTingConfig.length; i++) { let level = baDaCaiXiLevelInfo[i].level if (ZhongCanTingManager.getCaiXiUnlockStatus(ZhongCanTingConfig[i].unLockTag)) { if (level >= ZhongCanTingConfig[i].maxLevel) { } else { return i } } } return -1 } }