import User from "../../FrameWork/User/User"; import Common5 from "../../Platform/th/Common5"; import MaoYiFenHong from "../GameMethodRes/MaoYiFenHong/MaoYiFenHong"; import MaoYiFenHongManager from "../GameMethodRes/MaoYiFenHong/MaoYiFenHongManager"; import ZhongCanTing from "../GameMethodRes/ZhongCanTing/ZhongCanTing"; import { CaiXiEnum } from "../GameMethodRes/ZhongCanTing/ZhongCanTingManager"; import RoomCommon from "../GameRoomRes/RoomCommon/RoomCommon"; import JuQingManager from "../JuQingChat/JuQingManager" import TaskManager, { MainTaskIdEnum } from "../JuQingChat/TaskManager" import InterfaceManager from "../Manager/InterfaceManager"; import UserManager from "../Manager/UserManager"; import PrefabManage, { GameType } from "../PrefabManager/PrefabManage" export default class GameEnterClick { /*************************县城*************************/ // public static clickWangShiChanYe() { // let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.YiMaJiangXuanGuan) // if (isHaveKaiye) { // let dhetong = User.getUserHeTong() // if (dhetong.buyWangShiChanYe || GMManager.getToggleStatus_AllGameOpen()) { // PrefabManage.loadPrefabByType(GameType.YiMaJiangXuanGuan) // } else { // PrefabManage.showTextTips(`丑女林繁星不得进入`) // } // } else { // let num = UserManager.getDisTaskNumByGameType(GameType.YiMaJiangXuanGuan) // PrefabManage.showTextTips(`还差${num}个任务解锁`) // } // } // public static clickNongZhuang() { // let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.XiuXianNongZhuang) // if (isHaveKaiye) { // let dhetong = User.getUserHeTong() // if (dhetong.buyXiuXianNongZhuang) { // PrefabManage.loadPrefabByType(GameType.XiuXianNongZhuang) // } else { // let money = UserManager.getCurMoney() // if (money >= 100000) { // UserManager.subMoney(100000) // dhetong.buyXiuXianNongZhuang = true // User.setUserHeTong(dhetong) // let bagConfig: GoodsLocalProperty = { // goodId: 1739, // goodNum: 1, // } // BagManager.addBagList(bagConfig) // PrefabManage.loadPrefabByType(GameType.XiuXianNongZhuang) // } else { // PrefabManage.showTextTips('进入农庄需要准备10万办理通行证!!!') // } // } // } else { // let num = UserManager.getDisTaskNumByGameType(GameType.XiuXianNongZhuang) // PrefabManage.showTextTips(`还差${num}个任务解锁`) // } // } // public static clickChongWuGuanEvent() { // Common5.playEffect("sound/按键点击") // let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.ChongWuGuan) // if (isHaveKaiye) { // let UserHeTong = User.getUserHeTong() // if (UserHeTong.buyMengChongGuan) { // PrefabManage.loadPrefabByType(GameType.ChongWuGuan) // } else { // PrefabManage.loadPrefabByType(GameType.HeTongPrefab, null, (prefab) => { // prefab.getComponent(DHeTong).setBuyMengChongShengHuoGuan() // }) // } // } else { // let num = UserManager.getDisTaskNumByGameType(GameType.ChongWuGuan) // PrefabManage.showTextTips(`还差${num}个任务解锁`) // } // } // public static clickChuShou() { // let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.KaiGongSi) // if (isHaveKaiye) { // let UserHeTong = User.getUserHeTong() // if (UserHeTong.buyChuShouDaLou) { // PrefabManage.loadPrefabByType(GameType.KaiGongSi) // } else { // PrefabManage.loadPrefabByType(GameType.HeTongPrefab, null, (prefab) => { // prefab.getComponent(DHeTong).setBuyChuShouDaLou() // }) // } // } else { // let num = UserManager.getDisTaskNumByGameType(GameType.KaiGongSi) // PrefabManage.showTextTips(`还差${num}个任务解锁`) // } // } // public static clickDiTan() { // if (User.getGameGuideStepIndex() == 21) { // User.setGameGuideStepIndex(22) // } // let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.DiTanMaiHuo) // if (isHaveKaiye) { // PrefabManage.loadPrefabByType(GameType.DiTanMaiHuo) // } else { // let num = UserManager.getDisTaskNumByGameType(GameType.DiTanMaiHuo) // PrefabManage.showTextTips(`还差${num}个任务解锁`) // } // } // public static clickMangHeEvent() { // Common5.playEffect("sound/按键点击") // let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.ZhuaMangHe) // if (isHaveKaiye) { // PrefabManage.loadPrefabByType(GameType.ZhuaMangHe) // } else { // let num = UserManager.getDisTaskNumByGameType(GameType.ZhuaMangHe) // PrefabManage.showTextTips(`还差${num}个任务解锁`) // } // } // public static clickFengHuangZuYu() { // let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.DianYingTouZi) // if (isHaveKaiye) { // let UserHeTong = User.getUserHeTong() // if (UserHeTong.buyFengHuangZuYu) { // PrefabManage.loadPrefabByType(GameType.DianYingTouZi) // } else { // PrefabManage.loadPrefabByType(GameType.HeTongPrefab, null, (prefab) => { // prefab.getComponent(DHeTong).setBuyFengHuangZuYu() // }) // } // } else { // let num = UserManager.getDisTaskNumByGameType(GameType.DianYingTouZi) // PrefabManage.showTextTips(`还差${num}个任务解锁`) // } // } // public static clickPeiXunLou() { // let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.FKSC_Level1) // if (isHaveKaiye) { // let UserHeTong = User.getUserHeTong() // if (UserHeTong.buyPeiXunLou) { // PrefabManage.loadPrefabByType(GameType.FKSC_Level1) // } else { // PrefabManage.loadPrefabByType(GameType.HeTongPrefab, null, (prefab) => { // prefab.getComponent(DHeTong).setBuyPeiXunLou() // }) // } // } else { // let num = UserManager.getDisTaskNumByGameType(GameType.FKSC_Level1) // PrefabManage.showTextTips(`还差${num}个任务解锁`) // } // } // public static clickDongLaiChaoShi() { // if (User.getGameGuideStepIndex() == 41) { // User.setGameGuideStepIndex(42) // } // let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.DongLaiChaoShi) // if (isHaveKaiye) { // let daoYeList = InterfaceManager.getDaoyeList() // if (daoYeList.length > 0) { // PrefabManage.loadPrefabByType(GameType.DongLaiChaoShi) // } else { // PrefabManage.loadPrefabByType(GameType.JRMK_DongLaiChaoShi) // } // } else { // let num = UserManager.getDisTaskNumByGameType(GameType.DongLaiChaoShi) // PrefabManage.showTextTips(`还差${num}个任务解锁`) // } // } // public static clickShouHuojiEvent() { // PrefabManage.loadPrefabByType(GameType.ShouHuoji); // return; // if (User.getGameGuideStepIndex() == 12) { // User.setGameGuideStepIndex(13) // } // Common5.playEffect("sound/按键点击") // let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.ShouHuoji) // if (isHaveKaiye) { // PrefabManage.loadPrefabByType(GameType.ShouHuoji) // } else { // let num = UserManager.getDisTaskNumByGameType(GameType.ShouHuoji) // PrefabManage.showTextTips(`还差${num}个任务解锁`) // } // } // public static clickKeLaiCanGuan() { // if (User.getGameGuideStepIndex() == 31) { // User.setGameGuideStepIndex(32) // } // let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.Game_xpz) // if (isHaveKaiye) { // PrefabManage.loadPrefabByType(GameType.Game_xpz) // } else { // let num = UserManager.getDisTaskNumByGameType(GameType.Game_xpz) // PrefabManage.showTextTips(`还差${num}个任务解锁`) // } // } // /*************************市区*************************/ // public static clickYouTingJiDi() { // let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.YouTingJiDi) // if (isHaveKaiye) { // let isHaveYQH = BagManager.getBagGoodNums(1736) > 0 // if (isHaveYQH) { // PrefabManage.loadPrefabByType(GameType.YouTingJiDi) // } else { // PrefabManage.loadPrefabByType(GameType.YanZiJiemian, null, (prefab) => { // prefab.getComponent('YanZiJieMian').setGameLimt(0) // }) // } // } else { // let num = UserManager.getDisTaskNumByGameType(GameType.YouTingJiDi) // PrefabManage.showTextTips(`还差${num}个任务解锁`) // } // } // public static clickPaiMaiChang() { // Common5.playEffect("sound/按键点击") // let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.Paimaihang) // if (isHaveKaiye) { // let dhetong = User.getUserHeTong() // if (dhetong.buyPaiMaiHang) { // PrefabManage.loadPrefabByType(GameType.Paimaihang) // } else { // PrefabManage.loadPrefabByType(GameType.YanZiJiemian, null, (prefab) => { // prefab.getComponent('YanZiJieMian').setGameLimt(2) // }) // } // } else { // let num = UserManager.getDisTaskNumByGameType(GameType.Paimaihang) // PrefabManage.showTextTips(`还差${num}个任务解锁`) // } // } // public static clickMeiRongYuan() { // let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.MeiRongYuan) // if (isHaveKaiye) { // PrefabManage.loadPrefabByType(GameType.MeiRongYuan) // } else { // let num = UserManager.getDisTaskNumByGameType(GameType.MeiRongYuan) // PrefabManage.showTextTips(`还差${num}个任务解锁`) // } // } // public static clickJuLeBu() { // Common5.playEffect("sound/按键点击") // let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.Julebu) // if (isHaveKaiye) { // let dhetong = User.getUserHeTong() // if (dhetong.buyClub) { // PrefabManage.loadPrefabByType(GameType.Julebu) // } else { // PrefabManage.loadPrefabByType(GameType.YanZiJiemian, null, (prefab) => { // prefab.getComponent('YanZiJieMian').setGameLimt(1) // }) // } // } else { // let num = UserManager.getDisTaskNumByGameType(GameType.Julebu) // PrefabManage.showTextTips(`还差${num}个任务解锁`) // } // } // public static clickQunYingJiuDian() { // let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.QunYingJiuDian) // if (isHaveKaiye) { // PrefabManage.loadPrefabByType(GameType.QunYingJiuDian) // } else { // let num = UserManager.getDisTaskNumByGameType(GameType.QunYingJiuDian) // PrefabManage.showTextTips(`还差${num}个任务解锁`) // } // } // public static clickGuanLiSuCheng() { // let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.WZ_firstLevelSelectView) // if (isHaveKaiye) { // PrefabManage.loadPrefabByType(GameType.WZ_firstLevelSelectView) // } else { // let num = UserManager.getDisTaskNumByGameType(GameType.WZ_firstLevelSelectView) // PrefabManage.showTextTips(`还差${num}个任务解锁`) // } // } // public static clickFengTouDaSha() { // Common5.playEffect("sound/按键点击") // let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.SignHeTong) // if (isHaveKaiye) { // PrefabManage.loadPrefabByType(GameType.SignHeTong) // } else { // let num = UserManager.getDisTaskNumByGameType(GameType.SignHeTong) // PrefabManage.showTextTips(`还差${num}个任务解锁`) // } // } // public static clickMeiZhuangGongSi() { // Common5.playEffect("sound/按键点击") // let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.Meizhuang) // if (isHaveKaiye) { // let dhetong = User.getUserHeTong() // if (dhetong.buyMeiZhuang) { // PrefabManage.loadPrefabByType(GameType.Meizhuang) // } else { // PrefabManage.loadPrefabByType(GameType.YanZiJiemian, null, (prefab) => { // prefab.getComponent('YanZiJieMian').setGameLimt(4) // }) // } // } else { // let num = UserManager.getDisTaskNumByGameType(GameType.Meizhuang) // PrefabManage.showTextTips(`还差${num}个任务解锁`) // } // } // public static clickBaiMaHuiSuo() { // let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.JiaLiGong) // if (isHaveKaiye) { // let dhetong = User.getUserHeTong() // if (dhetong.buyBaiMaHuiSuo) { // PrefabManage.loadPrefabByType(GameType.JiaLiGong) // } else { // PrefabManage.loadPrefabByType(GameType.YanZiJiemian, null, (prefab) => { // prefab.getComponent('YanZiJieMian').setGameLimt(3) // }) // } // } else { // let num = UserManager.getDisTaskNumByGameType(GameType.JiaLiGong) // PrefabManage.showTextTips(`还差${num}个任务解锁`) // } // } // public static clickWaiXingZhongCai() { // let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.WaiXingZhongCai) // if (isHaveKaiye) { // let dhetong = User.getUserHeTong() // if (dhetong.buyWaiXing) { // PrefabManage.loadPrefabByType(GameType.WaiXingZhongCai) // } else { // PrefabManage.loadPrefabByType(GameType.HeTongPrefab, null, (prefab) => { // prefab.getComponent(DHeTong).setBuildWaixing() // }) // } // } else { // let num = UserManager.getDisTaskNumByGameType(GameType.WaiXingZhongCai) // PrefabManage.showTextTips(`还差${num}个任务解锁`) // } // } static clickQuHaiWai() { let config = TaskManager.getTaskConfigById(MainTaskIdEnum.MainTask_2506); let num = config.subtitle - User.getCurTaskIndex(); if (num > 0) { PrefabManage.showTextTips(`还差${num}个任务解锁`); } else { PrefabManage.showTextTips(`新章节还在赶来的路上,敬请期待~`); } } public static clickBingShanQiE() { let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo() let mainId = mainTaskInfo.Id let config = TaskManager.getTaskConfigById(MainTaskIdEnum.MainTask_1202); let num = config.subtitle - User.getCurTaskIndex(); if (num > 0) { PrefabManage.showTextTips(`还差${num}个任务解锁`); } else { let curLevel = User.getQieLevel() let isCanPlay = false if (mainId >= MainTaskIdEnum.MainTask_1202 && curLevel <= 2) { isCanPlay = true } else if (mainId >= MainTaskIdEnum.MainTask_1306 && curLevel <= 4) { isCanPlay = true } else if (mainId >= MainTaskIdEnum.MainTask_1603 && curLevel <= 6) { isCanPlay = true } else if (mainId >= MainTaskIdEnum.MainTask_1705 && curLevel <= 8) { isCanPlay = true } else if (mainId >= MainTaskIdEnum.MainTask_1806 && curLevel <= 10) { isCanPlay = true } else if (mainId >= MainTaskIdEnum.MainTask_2002 && curLevel <= 12) { isCanPlay = true } else if (mainId >= MainTaskIdEnum.MainTask_2004 && curLevel <= 14) { isCanPlay = true } else if (mainId >= MainTaskIdEnum.MainTask_2102 && curLevel <= 16) { isCanPlay = true } else if (mainId >= MainTaskIdEnum.MainTask_2302 && curLevel <= 18) { isCanPlay = true } else if (mainId >= MainTaskIdEnum.MainTask_2402 && curLevel <= 20) { isCanPlay = true } else if (mainId >= MainTaskIdEnum.MainTask_2505 && curLevel <= 30) { isCanPlay = true } if (isCanPlay) { if (User.getQieLevel() == 0) { PrefabManage.loadPrefabByType(GameType.CNXX_firstLevel); } else { PrefabManage.loadPrefabByType(GameType.CNXX_secondLevel); } } else { PrefabManage.showTextTips(`当前脑力够用了,请先完成剧情`); } } } public static clickHaiWaiMaoYi() { let config = TaskManager.getTaskConfigById(MainTaskIdEnum.MainTask_404); let num = config.subtitle - User.getCurTaskIndex(); if (num > 0) { PrefabManage.showTextTips(`还差${num}个任务解锁`); } else { let daoyeGoodList = InterfaceManager.getDaoyeList() if (daoyeGoodList.length > 0) { PrefabManage.loadPrefabByType(GameType.GDaoYeShouGou); } else { if (MaoYiFenHongManager.checkIsShowMaoYiFenHong()) { PrefabManage.loadPrefabByType(GameType.MaoYiFenHong, null, (prefabNode) => { prefabNode.getComponent(MaoYiFenHong).initView(1) }) } else { PrefabManage.showTextTips(`暂时没有海外订单`); } } } } public static clickShaMoZhongShu() { let config = TaskManager.getTaskConfigById(MainTaskIdEnum.MainTask_1504); let num = config.subtitle - User.getCurTaskIndex(); if (num > 0) { PrefabManage.showTextTips(`还差${num}个任务解锁`); } else { PrefabManage.loadPrefabByType(GameType.ZhiShuZaoLin); } } public static clickShenHaiTanBao() { let config = TaskManager.getTaskConfigById(MainTaskIdEnum.MainTask_803); let num = config.subtitle - User.getCurTaskIndex(); if (num > 0) { PrefabManage.showTextTips(`还差${num}个任务解锁`); } else { PrefabManage.loadPrefabByType(GameType.HuangJinYuFu); } } public static clickGuShi() { let config = TaskManager.getTaskConfigById(MainTaskIdEnum.MainTask_1106); let num = config.subtitle - User.getCurTaskIndex(); if (num > 0) { PrefabManage.showTextTips(`还差${num}个任务解锁`); } else { PrefabManage.loadPrefabByType(GameType.GuPiao); } } public static clickPaiMaiHang() { let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo() let mainId = mainTaskInfo.Id let config = TaskManager.getTaskConfigById(MainTaskIdEnum.MainTask_706); let num = config.subtitle - User.getCurTaskIndex(); if (num > 0) { PrefabManage.showTextTips(`还差${num}个任务解锁`); } else { if (mainId == MainTaskIdEnum.MainTask_706) { PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => { let parentNode = prefab.getComponent(RoomCommon).getMainNode() PrefabManage.loadPrefabByType(GameType.DH_10, parentNode) }) } else if (mainId == MainTaskIdEnum.MainTask_708) { PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => { let parentNode = prefab.getComponent(RoomCommon).getMainNode() PrefabManage.loadPrefabByType(GameType.DH_11, parentNode) }) } else if (mainId == MainTaskIdEnum.MainTask_1603) { PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => { let parentNode = prefab.getComponent(RoomCommon).getMainNode() PrefabManage.loadPrefabByType(GameType.DH_23, parentNode) }) } else if (mainId == MainTaskIdEnum.MainTask_2803) { PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => { let parentNode = prefab.getComponent(RoomCommon).getMainNode() PrefabManage.loadPrefabByType(GameType.DH_33, parentNode) }) } else { PrefabManage.loadPrefabByType(GameType.Paimaihang); } } } public static clickChenShiMaiKenJi() { let config = TaskManager.getTaskConfigById(MainTaskIdEnum.MainTask_2103); let num = config.subtitle - User.getCurTaskIndex(); if (num > 0) { PrefabManage.showTextTips(`还差${num}个任务解锁`); } else { } } public static clickChenShiXingBaKe() { let config = TaskManager.getTaskConfigById(MainTaskIdEnum.MainTask_2303); let num = config.subtitle - User.getCurTaskIndex(); if (num > 0) { PrefabManage.showTextTips(`还差${num}个任务解锁`); } else { } } public static clickChenShiMiQiLin() { let config = TaskManager.getTaskConfigById(MainTaskIdEnum.MainTask_2406); let num = config.subtitle - User.getCurTaskIndex(); if (num > 0) { PrefabManage.showTextTips(`还差${num}个任务解锁`); } else { PrefabManage.loadPrefabByType(GameType.ZhongCanTing, null, (prefabNode) => { prefabNode.getComponent(ZhongCanTing).initView(CaiXiEnum.XiangCai) }) } } public static clickXiCanMeiShiCheng() { PrefabManage.showTextTips('玩法待开放') } public static clickKuaiDiZhan() { let config = TaskManager.getTaskConfigById(MainTaskIdEnum.MainTask_303); let num = config.subtitle - User.getCurTaskIndex(); if (num > 0) { PrefabManage.showTextTips(`还差${num}个任务解锁`); } else { PrefabManage.loadPrefabByType(GameType.KuaiDiZhan); } } public static clickJiuPingHuiShouChang() { let config = TaskManager.getTaskConfigById(MainTaskIdEnum.MainTask_302); let num = config.subtitle - User.getCurTaskIndex(); if (num > 0) { PrefabManage.showTextTips(`还差${num}个任务解锁`); } else { PrefabManage.loadPrefabByType(GameType.JiuPingHuiShou); } } public static clickShiPinHuiShou() { let config = TaskManager.getTaskConfigById(MainTaskIdEnum.MainTask_204); let num = config.subtitle - User.getCurTaskIndex(); if (num > 0) { PrefabManage.showTextTips(`还差${num}个任务解锁`); } else { PrefabManage.loadPrefabByType(GameType.ShiCaiHuiShou); } } public static clickMaiHuoLang() { let config = TaskManager.getTaskConfigById(MainTaskIdEnum.MainTask_202); let num = config.subtitle - User.getCurTaskIndex(); if (num > 0) { PrefabManage.showTextTips(`还差${num}个任务解锁`); } else { PrefabManage.loadPrefabByType(GameType.ShouHuoji); } } public static clickLinShiYueCai() { PrefabManage.loadPrefabByType(GameType.ZhongCanTing) } public static clickLinShiLuCai() { PrefabManage.loadPrefabByType(GameType.ZhongCanTing) } public static clickLinShiHuiCai() { PrefabManage.loadPrefabByType(GameType.ZhongCanTing) } public static clickLinShiChuanCai() { PrefabManage.loadPrefabByType(GameType.ZhongCanTing) } public static clickLinShiXiangCai() { PrefabManage.loadPrefabByType(GameType.ZhongCanTing) } public static clickLinShiMinCai() { PrefabManage.loadPrefabByType(GameType.ZhongCanTing) } public static clickLinShiSuCai() { PrefabManage.loadPrefabByType(GameType.ZhongCanTing) } public static clickLinShiZheCai() { PrefabManage.loadPrefabByType(GameType.ZhongCanTing) } public static clickFeiXu() { } }