觉醒时刻
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2002 lines
106 KiB

1 week ago
// Learn TypeScript:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
import { ryw_Event } from "../../FrameWork/Event/EventEnum";
import EventMgr from "../../FrameWork/Event/EventMgr";
import GameMgr from "../../FrameWork/Mgr/GameMgr";
import User, { RoomBtnIndexEnum } from "../../FrameWork/User/User";
import AppPlatform from "../../FrameWork/Util/AppPlatform";
// import { DateUtils } from "../../FrameWork/Util/DateUtils";
import Common5 from "../../Platform/th/Common5";
import MaoYiFenHongManager from "../GameMethodRes/MaoYiFenHong/MaoYiFenHongManager";
import ZhongCanTing from "../GameMethodRes/ZhongCanTing/ZhongCanTing";
import ZhongCanTingManager, { CaiXiEnum } from "../GameMethodRes/ZhongCanTing/ZhongCanTingManager";
import RoomCommon from "../GameRoomRes/RoomCommon/RoomCommon";
import ChatManager from "../JuQingChat/ChatManager";
import JuQingManager from "../JuQingChat/JuQingManager";
import TaskInfoView from "../JuQingChat/TaskInfoView";
import TaskManager, { MainTaskIdEnum } from "../JuQingChat/TaskManager";
import BagManager from "../Manager/BagManager";
import InterfaceManager from "../Manager/InterfaceManager";
import UserManager from "../Manager/UserManager";
import NewGuideScript from "../NewGuide/NewGuideScript";
import PrefabManage, { GameType } from "../PrefabManager/PrefabManage";
import GameBase from "../SCommon/GameBase";
import GetAward from "../SCommon/GetAward";
import CccGame from "../WenZiRes/WenZiCommon/CccGame";
import GameEnterClick from "./GameEnterClick";
import JianLouBox from "./JianLouBox";
export let AutoShouYiConfig = [
{ money: 800, moneyNode: '收益_中餐厅', gameTittle: '中餐厅' },
{ money: 160, moneyNode: '收益_松花江', gameTittle: '顾氏水产' },
]
const { ccclass, property } = cc._decorator;
@ccclass
export default class CityPrefab extends GameBase {
isStartBuild: boolean = false;
@property(cc.Node)
private lingqufuli_node: cc.Node = null;
@property(cc.Node)
private cheSpine: cc.Node = null;
@property(cc.Sprite)
private chuZuCheSpFrame: cc.Sprite = null;
@property([cc.SpriteFrame])
private spFrameTab: cc.SpriteFrame[] = [];
_dt: number = 0
shouYiTimeTab = []
isOpenShouYiTab = []
// LIFE-CYCLE CALLBACKS:
maskGuideNode: cc.Node = null
shouyiMoneyNode: cc.Node = null
_dt4: number = 0
isCaiDanBaoShi1 = false
isCaiDanBaoShi2 = false
public static _instance = null
public static getInstance() {
return CityPrefab._instance
}
onLoad() {
// Common5.playRemoteAudioMusic('CommonSound/主场景')
CityPrefab._instance = this
if (AppPlatform.is_WECHAT_GAME_custom() && this.lingqufuli_node) {
this.lingqufuli_node.active = false;
}
super.onLoad()
this.shouyiMoneyNode = this.node.getChildByName('自动收益Node')
// // this.shouyiMoneyNode.active = false
for (let i = 0; i < this.shouyiMoneyNode.childrenCount; i++) {
this.shouYiTimeTab[i] = 4
this.isOpenShouYiTab[i] = false
let node = this.shouyiMoneyNode.children[i]
node['recoveryPosi'] = node.getPosition()
node.active = false
}
// let times = User.getChongFanHaoMenTimes()
// if (times > 0) {
// this.node.getChildByName('记事本').getChildByName('timeStr').getComponent(cc.Label).string = DateUtils.formatTime_custom(times)
// }
}
onDestroy() {
if (cc.isValid(this.maskGuideNode)) {
this.maskGuideNode.removeFromParent()
this.maskGuideNode.destroy()
}
super.onDestroy()
}
protected update(dt: number): void {
// this.refreshChongFanHaoMenTime(dt)
this._dt += dt
if (this._dt >= 1) {
this._dt = 0
// this.refreshJianZaoProgress()
for (let i = 0; i < AutoShouYiConfig.length; i++) {
if (this.isOpenShouYiTab[i]) {
this.shouYiTimeTab[i] += 1
if (this.shouYiTimeTab[i] >= 5) {
this.shouYiTimeTab[i] = 0
this.showShouYiMoneyNode(i, true)
}
}
}
}
}
// refreshChongFanHaoMenTime(dt) {
// this._dt4 += dt
// if (this._dt4 >= 1) {
// this._dt4 = 0
// let times = User.getChongFanHaoMenTimes()
// if (times > 0) {
// this.node.getChildByName('记事本').getChildByName('timeStr').getComponent(cc.Label).string = DateUtils.formatTime_custom(times)
// }
// }
// }
showShouYiMoneyNode(index, bShow) {
let money = User.getShouYiMoneyCount(AutoShouYiConfig[index].gameTittle)
this.shouyiMoneyNode.getChildByName(AutoShouYiConfig[index].moneyNode).active = bShow
this.shouyiMoneyNode.getChildByName(AutoShouYiConfig[index].moneyNode).getChildByName('shouyiLab').getComponent(cc.Label).string = `${Common5.getNumberChangeHanzi(money, '1', 1)}`
this.shouyiMoneyNode.getChildByName(AutoShouYiConfig[index].moneyNode).getChildByName('减半').active = false
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
// if (mainId == MainTaskIdEnum.MainTask_2001 || mainId == MainTaskIdEnum.MainTask_2002) {
// this.shouyiMoneyNode.getChildByName(AutoShouYiConfig[index].moneyNode).getChildByName('减半').active = true
// } else if (mainId >= MainTaskIdEnum.MainTask_1801 && mainId <= MainTaskIdEnum.MainTask_1806) {
// this.shouyiMoneyNode.getChildByName(AutoShouYiConfig[index].moneyNode).getChildByName('减半').active = true
// }
let shouYi = ZhongCanTingManager.getPerSecondShouYi()
this.node.getChildByName('yuanBao').getChildByName('shouYiStr').getComponent(cc.Label).string = `${Common5.getNumberChangeHanzi(shouYi, '1', 1)}/秒`
}
clickShouYiMoney(event, custom) {
this.shouYiTimeTab[custom] = 0
let money = User.getShouYiMoneyCount(AutoShouYiConfig[custom].gameTittle)
UserManager.addMoney(money)
User.setShouYiMoneyCount(AutoShouYiConfig[custom].gameTittle, 0)
let node = this.shouyiMoneyNode.getChildByName(AutoShouYiConfig[custom].moneyNode)
PrefabManage.showMoneyFlyEffect(node)
node.active = false
}
start() {
Common5.playMusicCustom('CommonRes', 'sound/背景音');
// TaskManager.checkIsMainTask520Finish()
Common5.getSpriteFrameFromBundle("CommonRes", "texture/" + User.getHeadImg(), this.node.getChildByName("head").getChildByName("头像").getComponent(cc.Sprite));
EventMgr.onEvent_custom(ryw_Event.setHeadImg, (img) => {
Common5.getSpriteFrameFromBundle("CommonRes", "texture/" + img, this.node.getChildByName("head").getChildByName("头像").getComponent(cc.Sprite));
}, this)
this.showChatBtnStatus()
this.guideStep()
this.refreshShangRen()
EventMgr.onEvent_custom(ryw_Event.RefreshJuQingDuiHua, () => {
this.showJieSuoQiPao()
this.showChatBtnStatus()
this.guideStep()
this.refreshShangRen()
}, this)
this.showJianZaoInfo()
EventMgr.onEvent_custom(ryw_Event.refreshJianZaoXinXi, () => {
// //签完合同后第一次额外给奖励
// this.scheduleOnce(()=>{
// if(awardIndex >= 0 && awardIndex <= 2){
// this.showShouYiMoneyNode(awardIndex,true)
// }
// },1)
this.showJianZaoInfo()
}, this)
// this.refreshJianZaoProgress()
// EventMgr.onEvent_custom(ryw_Event.chiTangJianZao,()=>{
// this.refreshJianZaoProgress()
// },this)
this.showJieSuoQiPao()
EventMgr.onEvent_custom(ryw_Event.RefreshUnLockGame, () => {
this.showJieSuoQiPao()
this.showChatBtnStatus()
}, this)
EventMgr.onEvent_custom(ryw_Event.refreshButton, () => {
this.showChatBtnStatus()
}, this)
EventMgr.onEvent_custom(ryw_Event.updateDaoYe, () => {
this.showJieSuoQiPao()
this.refreshShangRen()
}, this)
EventMgr.onEvent_custom(ryw_Event.ExitCurLayerEvent, () => {
this.guideStep()
}, this)
// this.checkCaiDanStatus()
// EventMgr.onEvent_custom(ryw_Event.RefreshChaoShiCaiDan, () => {
// this.checkCaiDanStatus()
// }, this)
EventMgr.onEvent_custom(ryw_Event.NormalTouchMoveCheck, (data_) => {
this.normalTouchCallback(data_.targetNode);
}, this);
EventMgr.onEvent_custom(ryw_Event.NormalTouchEndCheck, (data_) => {
this.normalTouchCallback(data_.targetNode);
}, this);
EventMgr.onEvent_custom(ryw_Event.HandTip, () => {
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
if (mainId == MainTaskIdEnum.MainTask_404) {
if (BagManager.getBagGoodNums(3012) > 0 && BagManager.getBagGoodNums(3013) > 0 &&
BagManager.getBagGoodNums(3014) > 0 && BagManager.getBagGoodNums(3015) > 0) {
let node = this.node.getChildByName('rk').getChildByName("rk_huanQiuMaoYi");
this.guideView([node]);
}
}
}, this);
EventMgr.onEvent_custom(ryw_Event.updateMainTask, (data) => {
this.showJieSuoQiPao()
this.showJianZaoInfo()
this.showChatBtnStatus()
console.log("更新任务+", data)
let customTaskInfo = data.taskInfo
if (customTaskInfo && Object.keys(customTaskInfo).length > 0 && customTaskInfo.Id != 0 && data.isAutoTanChu) {
this.node.getChildByName("taskInfoNode").getComponent(TaskInfoView).init()
} else {
//PrefabManage.showTextTips('当前无任务')
}
}, this)
}
guideStep() {
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
// let isHave1706 = (BagManager.getBagGoodNums(1706)>0)//是否有乌鸡
// let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.GDaoYeShouGou)
// let daoYeList = InterfaceManager.getDaoyeList()
// let indexStr = JuQingManager.getCurJuQingUnLockIndex()
//引导点击卖货郎
if (mainId == MainTaskIdEnum.MainTask_202) {
let node = this.node.getChildByName('rk').getChildByName('rk_maiHuoLang');
this.guideView([node]);
} else if (mainId == MainTaskIdEnum.MainTask_203) {
let node = this.node.getChildByName('手机')
this.guideView([node]);
} else if (mainId == MainTaskIdEnum.MainTask_204 || mainId == MainTaskIdEnum.MainTask_305) {
let node = this.node.getChildByName('rk').getChildByName('rk_chuZuChe');
this.guideView([node]);
} else if (mainId == MainTaskIdEnum.MainTask_213) {
let node = this.node.getChildByName('rk').getChildByName('rk_chuZuChe');
this.guideView([node]);
} else if (mainId == MainTaskIdEnum.MainTask_302) {
let node = this.node.getChildByName('rk').getChildByName('rk_chuZuChe');
this.guideView([node]);
} else if (mainId == MainTaskIdEnum.MainTask_310 && !User.getBaDaCaiXiUnlockStatus().YaoShan) {
let node = this.node.getChildByName('chongjian').getChildByName('startBtn_YaoShan');
this.guideView([node]);
} else if (mainId == MainTaskIdEnum.MainTask_311) {
let node = this.node.getChildByName('rk').getChildByName('rk_yeShiYaoShan');
this.guideView([node]);
}
}
guideView(nodeArray) {
if (!cc.isValid(this.maskGuideNode)) {
PrefabManage.loadPrefabByType(GameType.GuideMskNode, this.node, (prefab) => {
let guideNodeArray = nodeArray
this.maskGuideNode = prefab
let firstNode = guideNodeArray.shift()
prefab.getComponent(NewGuideScript).setBindNode(firstNode, guideNodeArray)
})
} else {
this.maskGuideNode.active = true
let guideNodeArray = nodeArray
let firstNode = guideNodeArray.shift()
this.maskGuideNode.getComponent(NewGuideScript).setBindNode(firstNode, guideNodeArray)
}
}
checkTaskCaiGouDan() {
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let config = TaskManager.getTaskConfigById(mainTaskInfo.Id)
let isHave = false
if (config && config.taskCaiGouDan && config.taskCaiGouDan.length > 0) {
isHave = true
for (let i = 0; i < config.taskCaiGouDan.length; i++) {
if (BagManager.getBagGoodNums(config.taskCaiGouDan[i]) <= 0) {
isHave = false
break
}
}
}
return isHave
}
showJieSuoQiPao() {
for (let i = 0; i < this.node.getChildByName('rk').childrenCount; i++) {
let child = this.node.getChildByName('rk').children[i]
if (child.getChildByName('jieSuoQiPao')) {
child.getChildByName('jieSuoQiPao').active = false
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let config = TaskManager.getTaskConfigById(mainTaskInfo.Id)
let daoYeList = User.getDaoyeGoodList()
if (config && config.wanFaRuKouTip && config.wanFaRuKouTip.indexOf(child.name) >= 0) {
if (config.wanFaRuKouTip.indexOf('rk_huanQiuMaoYi') >= 0 && daoYeList.length == 0 &&
(child.name == 'rk_yuTang' || child.name == 'rk_kuaiDiZhan' || child.name == 'rk_ciShanChouJiang')) {
} else if (config.wanFaRuKouTip.indexOf('rk_huanQiuMaoYi') >= 0 && (child.name == 'rk_ciShanChouJiang') && mainTaskInfo.Id && mainTaskInfo.Id == MainTaskIdEnum.MainTask_404) {
child.getChildByName('jieSuoQiPao').active = !this.checkTaskCaiGouDan()
} else if (config.wanFaRuKouTip.indexOf('rk_huanQiuMaoYi') >= 0 && (child.name == 'rk_huanQiuMaoYi') && mainTaskInfo.Id && mainTaskInfo.Id == MainTaskIdEnum.MainTask_404) {
child.getChildByName('jieSuoQiPao').active = this.checkTaskCaiGouDan()
} else {
child.getChildByName('jieSuoQiPao').active = true
}
} else if (daoYeList.length > 0) {
let config2 = BagManager.getJuQingGoodConfig(daoYeList[0].goodId).wanFaRuKouTip
if (config2 && config2.indexOf(child.name) >= 0) {
child.getChildByName('jieSuoQiPao').active = true
}
}
}
}
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
if (mainTaskInfo && mainTaskInfo.Id == MainTaskIdEnum.MainTask_310) {
this.node.getChildByName('rk').getChildByName("rk_feiXu").getChildByName('jieSuoQiPao').active = false
} else if (mainTaskInfo && mainTaskInfo.Id == MainTaskIdEnum.MainTask_505) {
this.node.getChildByName('rk').getChildByName("rk_yeShiShiPingChang").getChildByName('jieSuoQiPao').active = false
} else if (mainTaskInfo && mainTaskInfo.Id == MainTaskIdEnum.MainTask_805) {
this.node.getChildByName('rk').getChildByName("rk_yeShiYiYao").getChildByName('jieSuoQiPao').active = false
} else if (mainTaskInfo && mainTaskInfo.Id == MainTaskIdEnum.MainTask_1005) {
this.node.getChildByName('rk').getChildByName("rk_yeShiWenYu").getChildByName('jieSuoQiPao').active = false
} else if (mainTaskInfo && mainTaskInfo.Id == MainTaskIdEnum.MainTask_1310) {
this.node.getChildByName('rk').getChildByName("rk_yeShiDianZi").getChildByName('jieSuoQiPao').active = false
} else if (mainTaskInfo && mainTaskInfo.Id == MainTaskIdEnum.MainTask_1903) {
this.node.getChildByName('rk').getChildByName("rk_yeShiWangLuo").getChildByName('jieSuoQiPao').active = false
} else if (mainTaskInfo && mainTaskInfo.Id == MainTaskIdEnum.MainTask_2106 && !User.getBaDaCaiXiUnlockStatus().JingRong) {
this.node.getChildByName('rk').getChildByName("rk_yeShiJingRong").getChildByName('jieSuoQiPao').active = false
} else if (mainTaskInfo && mainTaskInfo.Id == MainTaskIdEnum.MainTask_2406 && !User.getBaDaCaiXiUnlockStatus().WeiLai) {
this.node.getChildByName('rk').getChildByName("rk_yeShiWeiLai").getChildByName('jieSuoQiPao').active = false
}
//贸易分红
if (MaoYiFenHongManager.checkIsShowMaoYiFenHong()) {
this.node.getChildByName('rk').getChildByName('rk_huanQiuMaoYi').getChildByName('jieSuoQiPao').active = true
}
}
showJianZaoInfo() {
// ShiPingChang: false, YaoShan: false, YiYao: false, WenYu: false,
// JingRong: false, WeiLai: false, DianZi: false, WangLuo: false,
// this.node.getChildByName('背景').getChildByName("地图背景_新").active = false
// User.setBaDaCaiXiUnlockStatus({
// ShiPingChang: false, YaoShan: false, YiYao: false, WenYu: false,
// JingRong: false, WeiLai: false, DianZi: false, WangLuo: false,
// })
let baDaCaiXiUnlockStatus = User.getBaDaCaiXiUnlockStatus()
if (baDaCaiXiUnlockStatus.ShiPingChang) {
console.log('食品厂已解锁')
this.node.getChildByName('背景').getChildByName('叶氏食品厂').active = true
this.node.getChildByName('背景').getChildByName('叶氏食品厂').opacity = 255
this.node.getChildByName('背景').getChildByName('叶氏食品厂').getChildByName("title").active = true
this.node.getChildByName('rk').getChildByName('rk_yeShiShiPingChang').active = true
} else {
console.log('食品厂未解锁')
this.node.getChildByName('背景').getChildByName('叶氏食品厂').active = false
this.node.getChildByName('背景').getChildByName('叶氏食品厂').getChildByName("title").active = false
this.node.getChildByName('rk').getChildByName('rk_yeShiShiPingChang').active = false
if (baDaCaiXiUnlockStatus.YaoShan) {
this.node.getChildByName('背景').getChildByName('叶氏食品厂').active = true
this.node.getChildByName('背景').getChildByName('叶氏食品厂').opacity = 150
this.node.getChildByName('rk').getChildByName('rk_yeShiShiPingChang').active = true
}
}
if (baDaCaiXiUnlockStatus.YaoShan) {
console.log('药膳已解锁')
this.node.getChildByName('背景').getChildByName('叶氏药膳').active = true
this.node.getChildByName('背景').getChildByName('废楼').active = false
this.node.getChildByName('rk').getChildByName('rk_feiXu').active = false
this.node.getChildByName('rk').getChildByName('rk_yeShiYaoShan').active = true
this.node.getChildByName('背景').getChildByName("地图背景_新").active = true
this.node.getChildByName('背景').getChildByName("凑数建筑2").active = true
this.node.getChildByName('背景').getChildByName("凑数建筑3").active = true
this.node.getChildByName('背景').getChildByName("凑数建筑4").active = true
} else {
console.log('药膳未解锁')
this.node.getChildByName('背景').getChildByName('叶氏药膳').active = false
this.node.getChildByName('背景').getChildByName('废楼').active = true
this.node.getChildByName('rk').getChildByName('rk_feiXu').active = true
this.node.getChildByName('rk').getChildByName('rk_yeShiYaoShan').active = false
}
if (baDaCaiXiUnlockStatus.YiYao) {
console.log('医药已解锁')
this.node.getChildByName('背景').getChildByName('叶氏医药').active = true
this.node.getChildByName('背景').getChildByName('叶氏医药').opacity = 255
this.node.getChildByName('背景').getChildByName('叶氏医药').getChildByName("title").active = true
this.node.getChildByName('rk').getChildByName('rk_yeShiYiYao').active = true
} else {
console.log('医药未解锁')
this.node.getChildByName('背景').getChildByName('叶氏医药').active = false
this.node.getChildByName('背景').getChildByName('叶氏医药').getChildByName("title").active = false
this.node.getChildByName('rk').getChildByName('rk_yeShiYiYao').active = false
if (baDaCaiXiUnlockStatus.YaoShan) {
this.node.getChildByName('背景').getChildByName('叶氏医药').active = true
this.node.getChildByName('背景').getChildByName('叶氏医药').opacity = 150
this.node.getChildByName('rk').getChildByName('rk_yeShiYiYao').active = true
}
}
if (baDaCaiXiUnlockStatus.WenYu) {
console.log('文娱已解锁')
this.node.getChildByName('背景').getChildByName('叶氏文娱').active = true
this.node.getChildByName('背景').getChildByName('叶氏文娱').opacity = 255
this.node.getChildByName('背景').getChildByName('叶氏文娱').getChildByName("title").active = true
this.node.getChildByName('rk').getChildByName('rk_yeShiWenYu').active = true
} else {
console.log('文娱未解锁')
this.node.getChildByName('背景').getChildByName('叶氏文娱').active = false
this.node.getChildByName('背景').getChildByName('叶氏文娱').getChildByName("title").active = false
this.node.getChildByName('rk').getChildByName('rk_yeShiWenYu').active = false
if (baDaCaiXiUnlockStatus.YaoShan) {
this.node.getChildByName('背景').getChildByName('叶氏文娱').active = true
this.node.getChildByName('背景').getChildByName('叶氏文娱').opacity = 150
this.node.getChildByName('rk').getChildByName('rk_yeShiWenYu').active = true
}
}
let title = this.node.getChildByName('背景').getChildByName('叶氏金融').getChildByName('title')
if (baDaCaiXiUnlockStatus.JingRong) {
console.log('金融已解锁')
// this.node.getChildByName('背景').getChildByName('叶氏金融').getChildByName('title').active = true
Common5.getSpriteFrameFromBundle("XianCheng", "texture/建筑名字/13", title.getComponent(cc.Sprite));
} else {
console.log('金融未解锁')
// this.node.getChildByName('背景').getChildByName('叶氏金融').getChildByName('title').active = false
Common5.getSpriteFrameFromBundle("XianCheng", "texture/建筑名字/anshi", title.getComponent(cc.Sprite));
}
title = this.node.getChildByName('背景').getChildByName('叶氏未来').getChildByName('title')
if (baDaCaiXiUnlockStatus.WeiLai) {
console.log('未来已解锁')
// this.node.getChildByName('背景').getChildByName('叶氏未来').getChildByName('title').active = true
Common5.getSpriteFrameFromBundle("XianCheng", "texture/建筑名字/17", title.getComponent(cc.Sprite));
} else {
console.log('未来未解锁')
// this.node.getChildByName('背景').getChildByName('叶氏未来').getChildByName('title').active = false
Common5.getSpriteFrameFromBundle("XianCheng", "texture/建筑名字/longshi", title.getComponent(cc.Sprite));
}
title = this.node.getChildByName('背景').getChildByName('叶氏电子').getChildByName('title')
if (baDaCaiXiUnlockStatus.DianZi) {
console.log('电子已解锁')
// this.node.getChildByName('背景').getChildByName('叶氏电子').getChildByName('title').active = true
Common5.getSpriteFrameFromBundle("XianCheng", "texture/建筑名字/9", title.getComponent(cc.Sprite));
} else {
console.log('电子未解锁')
// this.node.getChildByName('背景').getChildByName('叶氏电子').getChildByName('title').active = false
Common5.getSpriteFrameFromBundle("XianCheng", "texture/建筑名字/qianshi", title.getComponent(cc.Sprite));
}
title = this.node.getChildByName('背景').getChildByName('叶氏网络').getChildByName('title')
if (baDaCaiXiUnlockStatus.WangLuo) {
console.log('网络已解锁')
// this.node.getChildByName('背景').getChildByName('叶氏网络').getChildByName('title').active = true
Common5.getSpriteFrameFromBundle("XianCheng", "texture/建筑名字/12", title.getComponent(cc.Sprite));
} else {
console.log('网络未解锁')
// this.node.getChildByName('背景').getChildByName('叶氏网络').getChildByName('title').active = false
Common5.getSpriteFrameFromBundle("XianCheng", "texture/建筑名字/fushi", title.getComponent(cc.Sprite));
}
// let isNeedShengJi = ZhongCanTingManager.checkIsCanTingNeedShengJi()
// if (isNeedShengJi > -1) {
// this.node.getChildByName('研发菜品').active = true
// } else {
// this.node.getChildByName('研发菜品').active = false
// }
// let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
// let mainId = mainTaskInfo.Id
// if (mainId == MainTaskIdEnum.MainTask_302 || mainId == MainTaskIdEnum.MainTask_303 || mainId == MainTaskIdEnum.MainTask_304) {
// this.node.getChildByName('背景').getChildByName('废墟').getChildByName('湘菜待开发').active = true
// } else if (mainId == MainTaskIdEnum.MainTask_705 || mainId == MainTaskIdEnum.MainTask_706 || mainId == MainTaskIdEnum.MainTask_707) {
// this.node.getChildByName('背景').getChildByName('中餐美食城').getChildByName('川菜待开发').active = true
// this.node.getChildByName('rk').getChildByName('rk_linShiChuanCai').active = true
// } else if (mainId == MainTaskIdEnum.MainTask_1101 || mainId == MainTaskIdEnum.MainTask_1102 || mainId == MainTaskIdEnum.MainTask_1103) {
// this.node.getChildByName('背景').getChildByName('中餐美食城').getChildByName('苏菜待开发').active = true
// this.node.getChildByName('rk').getChildByName('rk_linShiSuCai').active = true
// } else if (mainId == MainTaskIdEnum.MainTask_1301 || mainId == MainTaskIdEnum.MainTask_1302 || mainId == MainTaskIdEnum.MainTask_1303) {
// this.node.getChildByName('背景').getChildByName('中餐美食城').getChildByName('徽菜待开发').active = true
// this.node.getChildByName('rk').getChildByName('rk_linShiHuiCai').active = true
// } else if (mainId == MainTaskIdEnum.MainTask_1601 || mainId == MainTaskIdEnum.MainTask_1602 || mainId == MainTaskIdEnum.MainTask_1603) {
// this.node.getChildByName('背景').getChildByName('中餐美食城').getChildByName('浙菜待开发').active = true
// this.node.getChildByName('rk').getChildByName('rk_linShiZheCai').active = true
// } else if (mainId == MainTaskIdEnum.MainTask_1703 || mainId == MainTaskIdEnum.MainTask_1704 || mainId == MainTaskIdEnum.MainTask_1705) {
// this.node.getChildByName('背景').getChildByName('中餐美食城').getChildByName('闽菜待开发').active = true
// this.node.getChildByName('rk').getChildByName('rk_linShiMinCai').active = true
// }
//根据条件判定是否开启玩法的自动收益
if (baDaCaiXiUnlockStatus.YaoShan) {
this.isOpenShouYiTab[0] = true
} else {
this.isOpenShouYiTab[0] = false
}
// if (mainId >= MainTaskIdEnum.MainTask_1801 && mainId <= MainTaskIdEnum.MainTask_1806) {
// this.node.getChildByName('背景').getChildByName('中餐美食城').getChildByName('烧毁').active = true
// } else {
// this.node.getChildByName('背景').getChildByName('中餐美食城').getChildByName('烧毁').active = false
// }
// let qiEShouYiBtnUnlockArr = [
// MainTaskIdEnum.MainTask_1303, MainTaskIdEnum.MainTask_1306, MainTaskIdEnum.MainTask_1603, MainTaskIdEnum.MainTask_1705, MainTaskIdEnum.MainTask_1806, MainTaskIdEnum.MainTask_2002, MainTaskIdEnum.MainTask_2004, MainTaskIdEnum.MainTask_2102, MainTaskIdEnum.MainTask_2103, MainTaskIdEnum.MainTask_2302, MainTaskIdEnum.MainTask_2303, MainTaskIdEnum.MainTask_2402, MainTaskIdEnum.MainTask_2406, MainTaskIdEnum.MainTask_2505
// ]
// if (qiEShouYiBtnUnlockArr.indexOf(mainId) >= 0) {
// this.node.getChildByName('企鹅').active = true
// } else {
// this.node.getChildByName('企鹅').active = false
// }
}
// onBtnWanChengJianZao(){
// let tab = {
// onClose: (finish)=>{
// if (finish) {
// this.reportKey(()=>{
// GameReport.ADReport('一家酒馆建造立即完成',1)
// })
// Common5.ReportDY("inLevel", "一家酒馆建造-AD-立即完成");
// User.finishJianZao()
// this.refreshJianZaoProgress()
// }else{
// this.reportKey(()=>{
// GameReport.ADReport('一家酒馆建造立即完成',0)
// })
// Common5.showTips_custom("广告未观看完");
// }
// },onFailed:()=>{
// }
// }
// AppPlatform.playVideo_custom(tab)
// }
// onBtnJianZaoClick(){
// Common5.playEffect("sound/按键点击")
// let UserHeTong = User.getUserHeTong()
// if(UserHeTong.buildChiTang){
// return
// }
// PrefabManage.loadPrefabByType(GameType.HeTongPrefab, null, (prefab)=>{
// prefab.getComponent(DHeTong).setBuildChiTang()
// })
// }
refreshShangRen() {
// let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.DongLaiChaoShi)
// let daoYeList = InterfaceManager.getDaoyeList()
// let daoyeIndex = User.getDaoyeIndex()
// if(isHaveKaiye && daoYeList.length > 0){
// this.node.getChildByName('东来超市').getChildByName('任务标').active = true
// // this.node.getChildByName('daoye').getChildByName('jieSuoQiPao').active = true
// // if(daoyeIndex == 0){
// // this.node.getChildByName('daoye').getChildByName('城镇商人').active = true
// // this.node.getChildByName('daoye').getChildByName('商人妹妹').active = false
// // }else if(daoyeIndex == 1){
// // this.node.getChildByName('daoye').getChildByName('城镇商人').active = false
// // this.node.getChildByName('daoye').getChildByName('商人妹妹').active = true
// // }
// // this.guideStep()
// }else{
// this.node.getChildByName('东来超市').getChildByName('任务标').active = false
// // this.node.getChildByName('daoye').getChildByName('jieSuoQiPao').active = false
// }
// let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.GDaoYeShouGou)
// let daoYeList = InterfaceManager.getDaoyeList()
// let daoyeIndex = User.getDaoyeIndex()
// if(isHaveKaiye && daoYeList.length > 0 && BagManager.getJuQingGoodConfig(daoYeList[0].goodId).shangRenType == 1){
// this.node.getChildByName('daoye').active = true
// this.node.getChildByName('daoye').getChildByName('jieSuoQiPao').active = true
// if(daoyeIndex == 0){
// this.node.getChildByName('daoye').getChildByName('城镇商人').active = true
// this.node.getChildByName('daoye').getChildByName('商人妹妹').active = false
// }else if(daoyeIndex == 1){
// this.node.getChildByName('daoye').getChildByName('城镇商人').active = false
// this.node.getChildByName('daoye').getChildByName('商人妹妹').active = true
// }
// this.guideStep()
// }else{
// this.node.getChildByName('daoye').active = false
// this.node.getChildByName('daoye').getChildByName('jieSuoQiPao').active = false
// }
}
showChatBtnStatus() {
let indexStr = JuQingManager.getCurJuQingUnLockIndex()
if (ChatManager.isChatTypeIncludeEventIndex('WX', indexStr)) {
let spineNode = this.node.getChildByName('手机').getChildByName('手机')
spineNode.getComponent(sp.Skeleton).setAnimation(0, '闪', true)
Common5.playEffect('sound/手机信息')
} else {
let spineNode = this.node.getChildByName('手机').getChildByName('手机')
spineNode.getComponent(sp.Skeleton).setAnimation(0, '静止', false)
}
let isHaveTask = false
// let isTaskNeedGood = false
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
if (mainId != MainTaskIdEnum.MainTask_None && mainId) {
isHaveTask = true
// let taskConfig = TaskManager.getTaskConfigById(mainId)
// if (taskConfig.needGoodId) {
// isTaskNeedGood = true
// }
}
if (isHaveTask) {
// let spineNode = this.node.getChildByName('任务助手').getChildByName('任务')
// spineNode.getComponent(sp.Skeleton).setAnimation(0, '闪', true)
let rednode = this.node.getChildByName('任务助手').getChildByName('红点')
rednode.active = true
cc.tween(rednode)
.sequence(
cc.tween().to(0.5, { opacity: 0 }),
cc.tween().to(0.5, { opacity: 255 }),
)
.repeatForever()
.start()
} else {
// let spineNode = this.node.getChildByName('任务助手').getChildByName('任务')
// spineNode.getComponent(sp.Skeleton).setAnimation(0, '静止', false)
let rednode = this.node.getChildByName('任务助手').getChildByName('红点')
rednode.active = false
}
if (mainId == MainTaskIdEnum.MainTask_2405) {
// let spineNode = this.node.getChildByName('我的背包').getChildByName('背包')
// spineNode.getComponent(sp.Skeleton).setAnimation(0, '闪', true)
} else {
let spineNode = this.node.getChildByName('我的背包').getChildByName('背包')
spineNode.getComponent(sp.Skeleton).setAnimation(0, '静止', false)
}
let roomBtnIndex = User.getRoomBtnIndex()
if (roomBtnIndex == RoomBtnIndexEnum.room) {//回家
this.chuZuCheSpFrame.spriteFrame = this.spFrameTab[0]
} else if (roomBtnIndex == RoomBtnIndexEnum.xuexiao) {//去学校
this.chuZuCheSpFrame.spriteFrame = this.spFrameTab[1]
} else if (roomBtnIndex == RoomBtnIndexEnum.touzirenjia) {//去投资人家
this.chuZuCheSpFrame.spriteFrame = this.spFrameTab[2]
} else if (roomBtnIndex == RoomBtnIndexEnum.qianzong) {//去钱总家
this.chuZuCheSpFrame.spriteFrame = this.spFrameTab[3]
} else if (roomBtnIndex == RoomBtnIndexEnum.yiyuan) {//去医院
this.chuZuCheSpFrame.spriteFrame = this.spFrameTab[4]
} else if (roomBtnIndex == RoomBtnIndexEnum.fushijiazu) {//去傅氏家族
this.chuZuCheSpFrame.spriteFrame = this.spFrameTab[5]
} else if (roomBtnIndex == RoomBtnIndexEnum.huigongsi) {//回公司
this.chuZuCheSpFrame.spriteFrame = this.spFrameTab[6]
} else if (roomBtnIndex == RoomBtnIndexEnum.haibian) {//去海边
this.chuZuCheSpFrame.spriteFrame = this.spFrameTab[7]
} else if (roomBtnIndex == RoomBtnIndexEnum.anjia) {//去安家
this.chuZuCheSpFrame.spriteFrame = this.spFrameTab[8]
} else if (roomBtnIndex == RoomBtnIndexEnum.longjia) {//去龙家
this.chuZuCheSpFrame.spriteFrame = this.spFrameTab[9]
} else if (roomBtnIndex == RoomBtnIndexEnum.yaoshanguan) {//药膳馆
this.chuZuCheSpFrame.spriteFrame = this.spFrameTab[10]
} else if (roomBtnIndex == RoomBtnIndexEnum.paimaihang) {//拍卖行
this.chuZuCheSpFrame.spriteFrame = this.spFrameTab[11]
} else if (roomBtnIndex == RoomBtnIndexEnum.gushuyajia) {//顾书雅家
this.chuZuCheSpFrame.spriteFrame = this.spFrameTab[12]
}
// if (mainId < MainTaskIdEnum.MainTask_104) {
// this.node.getChildByName('背景').getChildByName('回家').active = false
// this.node.getChildByName('rk').getChildByName('rk_chuZuChe').active = false
// } else
if (mainId < MainTaskIdEnum.MainTask_1205) {
this.node.getChildByName('背景').getChildByName('回家').active = true
this.node.getChildByName('rk').getChildByName('rk_chuZuChe').active = true
this.cheSpine.getComponent(sp.Skeleton).setAnimation(0, '单车待机', true)
} else {
this.node.getChildByName('背景').getChildByName('回家').active = true
this.node.getChildByName('rk').getChildByName('rk_chuZuChe').active = true
this.cheSpine.getComponent(sp.Skeleton).setAnimation(0, '车待机', true)
}
let taskConfig = TaskManager.getTaskConfigById(mainId)
if (taskConfig && taskConfig.wanFaRuKouTip && taskConfig.wanFaRuKouTip.indexOf('rk_chuZuChe') >= 0) {
if (mainId < MainTaskIdEnum.MainTask_1205) {
Common5.playEffectCustom('XianCheng', 'sound/骑行车铃声')
} else {
Common5.playEffectCustom('XianCheng', 'sound/车滴滴声')
}
}
if (mainId == MainTaskIdEnum.MainTask_310) {
this.node.getChildByName('chongjian').getChildByName('startBtn_YaoShan').active = true
} else {
this.node.getChildByName('chongjian').getChildByName('startBtn_YaoShan').active = false
}
if (mainId == MainTaskIdEnum.MainTask_505) {
this.node.getChildByName('chongjian').getChildByName('startBtn_ShiPing').active = true
} else {
this.node.getChildByName('chongjian').getChildByName('startBtn_ShiPing').active = false
}
if (mainId == MainTaskIdEnum.MainTask_805) {
this.node.getChildByName('chongjian').getChildByName('startBtn_YiYao').active = true
} else {
this.node.getChildByName('chongjian').getChildByName('startBtn_YiYao').active = false
}
if (mainId == MainTaskIdEnum.MainTask_1005) {
this.node.getChildByName('chongjian').getChildByName('startBtn_WenYu').active = true
} else {
this.node.getChildByName('chongjian').getChildByName('startBtn_WenYu').active = false
}
if (mainId == MainTaskIdEnum.MainTask_1310) {
this.node.getChildByName('chongjian').getChildByName('startBtn_DianZi').active = true
} else {
this.node.getChildByName('chongjian').getChildByName('startBtn_DianZi').active = false
}
if (mainId == MainTaskIdEnum.MainTask_1903) {
this.node.getChildByName('chongjian').getChildByName('startBtn_WangLuo').active = true
} else {
this.node.getChildByName('chongjian').getChildByName('startBtn_WangLuo').active = false
}
if (mainId == MainTaskIdEnum.MainTask_2106) {
let baDaCaiXiUnlockStatus = User.getBaDaCaiXiUnlockStatus()
this.node.getChildByName('chongjian').getChildByName('startBtn_JinRong').active = !baDaCaiXiUnlockStatus.JingRong
} else {
this.node.getChildByName('chongjian').getChildByName('startBtn_JinRong').active = false
}
if (mainId == MainTaskIdEnum.MainTask_2406) {
let baDaCaiXiUnlockStatus = User.getBaDaCaiXiUnlockStatus()
this.node.getChildByName('chongjian').getChildByName('startBtn_WeiLai').active = !baDaCaiXiUnlockStatus.WeiLai
} else {
this.node.getChildByName('chongjian').getChildByName('startBtn_WeiLai').active = false
}
let daoyeGoodList = InterfaceManager.getDaoyeList()
if (mainId == MainTaskIdEnum.MainTask_2702 && User.getMoney() >= 200000000000 && daoyeGoodList.length == 0) {
this.node.getChildByName('chongjian').getChildByName('startBtn_恢复').active = true
} else {
this.node.getChildByName('chongjian').getChildByName('startBtn_恢复').active = false
}
// if (mainId < MainTaskIdEnum.MainTask_211) {
// this.node.getChildByName('我的背包').active = false
// } else {
this.node.getChildByName('我的背包').active = true
// }
}
normalTouchCallback(targetNode) {
switch (targetNode.name) {
case "彩蛋宝石1":
this.isCaiDanBaoShi1 = true
break;
case "彩蛋宝石2":
this.isCaiDanBaoShi2 = true
break;
case "奖杯":
let goodArray = [{ goodId: 1741, goodNum: 1 }]
PrefabManage.loadPrefabByType(GameType.GetAward, null, (prefabNode) => {
prefabNode.getComponent(GetAward).initView(goodArray, () => {
User.setCaiDanStatus(1, 3)
});
})
break;
default:
break;
}
if (this.isCaiDanBaoShi1 && this.isCaiDanBaoShi2) {
this.isCaiDanBaoShi1 = false
this.isCaiDanBaoShi2 = false
//终极彩蛋不在超市里
// let index = User.getDaoyeIndex()
// if (index == -1) {
// this.node.getChildByName('农庄').getChildByName('彩蛋动效').getComponent(sp.Skeleton).setAnimation(0, '光2', false)
// this.scheduleOnce(() => {
// this.node.getChildByName('农庄').getChildByName('彩蛋动效').getComponent(sp.Skeleton).setAnimation(0, '静止2', false)
// this.node.getChildByName('彩蛋奖杯').active = true
// }, 2)
// } else {
// User.setCaiDanStatus(1, 2)
// this.node.getChildByName('农庄').getChildByName('彩蛋动效').getComponent(sp.Skeleton).setAnimation(0, '光1', false)
// this.scheduleOnce(() => {
// this.node.getChildByName('农庄').getChildByName('彩蛋动效').getComponent(sp.Skeleton).setAnimation(0, '静止2', false)
// }, 2)
// }
}
}
clickJuQingDuiHua() {
JuQingManager.openJuQingOrChat('DH')
}
// clickJoinWXChat_ys(){
// //加入聊天
// Common5.playEffect("sound/按键点击")
// PrefabManage.showTextTips('医生已加入聊天')
// ChatManager.setSingleChatStatus('WX','WX_YiSheng', 'WX_1', false)
// }
clickWXChat() {
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
if (mainId == MainTaskIdEnum.MainTask_203) {
Common5.ReportDY("inLevel", "任务001-开场三4点击手机");
}
JuQingManager.openJuQingOrChat('WX')
}
clickBiJiBen() {
//Common5.playEffect("sound/按键点击")
JuQingManager.openJuQingOrChat('RJB')
}
clickCebianlanEvent() {
PrefabManage.loadPrefabByType(GameType.CeBianLan)
}
clickSettingEvent() {
PrefabManage.loadPrefabByType(GameType.Setting)
}
clickBeibaoEvent() {
PrefabManage.loadPrefabByType(GameType.BeiBao)
}
clickDaoyeEvent(event) {
let daoYeList = InterfaceManager.getDaoyeList()
let isHaveKaiye = InterfaceManager.getHaveKaiye(GameType.GDaoYeShouGou)
if (isHaveKaiye && daoYeList.length > 0) {
PrefabManage.loadPrefabByType(GameType.GDaoYeShouGou)
} else {
PrefabManage.showTextTips('暂无收购任务')
}
}
checkIsHaveDaoJu() {
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
let isHave = true
if (mainId == MainTaskIdEnum.MainTask_205) {
isHave = (BagManager.getBagGoodNums(3002) > 0) && (BagManager.getBagGoodNums(3003) > 0)
} else if (mainId == MainTaskIdEnum.MainTask_807) {
let isHave3767 = (BagManager.getBagGoodNums(3767) > 0)
let isHave3768 = (BagManager.getBagGoodNums(3768) > 0)
let isHave3769 = (BagManager.getBagGoodNums(3769) > 0)
isHave = isHave3767 && isHave3768 && isHave3769
} else if (mainId == MainTaskIdEnum.MainTask_1706) {
let isHave3700 = (BagManager.getBagGoodNums(3700) > 0)
let isHave3701 = (BagManager.getBagGoodNums(3701) > 0)
let isHave3702 = (BagManager.getBagGoodNums(3702) > 0)
let isHave3703 = (BagManager.getBagGoodNums(3703) > 0)
isHave = isHave3700 && isHave3701 && isHave3702 && isHave3703
}
if (!isHave) {
PrefabManage.showTextTips("缺少任务道具")
}
return isHave
}
// checkIsCanUseCar() {
// let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
// let mainId = mainTaskInfo.Id
// let config = TaskManager.getTaskConfigById(mainId)
// if (config.wanFaRuKouTip.indexOf('rk_chuZuChe') != -1 || config.wanFaRuKouTip.indexOf("rk_chuZuChe") != -1) {
// }
// }
clickMyRoomEvent() {
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
let isHave = this.checkIsHaveDaoJu()
if (isHave) {
let callFunc = () => {
this.node.removeFromParent()
this.node.destroy()
if (User.getCurTaskId()[0] == 0 || mainId == MainTaskIdEnum.MainTask_201 || mainId == MainTaskIdEnum.MainTask_202 || mainId == MainTaskIdEnum.MainTask_203) {
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.Room2, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_204 || mainId == MainTaskIdEnum.MainTask_206) {
if (mainId == MainTaskIdEnum.MainTask_204) {
Common5.ReportDY("inLevel", "任务001-开场三5点击学校");
}
// PrefabManage.loadPrefabByType(GameType.DH_2)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_2, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_302) {
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.Room3, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_305) {
// PrefabManage.loadPrefabByType(GameType.DH_3)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_3, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_308) {
// PrefabManage.loadPrefabByType(GameType.DH_4)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_4, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_314) {
// EventMgr.emitEvent_custom(ryw_Event.EnterCurGame);
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.Room3, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_402) {
// EventMgr.emitEvent_custom(ryw_Event.EnterCurGame);
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.Room4, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_405) {
// EventMgr.emitEvent_custom(ryw_Event.EnterCurGame);
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.Room4, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_502 || mainId == MainTaskIdEnum.MainTask_503) {
// PrefabManage.loadPrefabByType(GameType.DH_5)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_5, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_504 || mainId == MainTaskIdEnum.MainTask_505) {
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_5, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_508 || mainId == MainTaskIdEnum.MainTask_510) {
// PrefabManage.loadPrefabByType(GameType.DH_6)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_6, parentNode)
})
}
else if (mainId == MainTaskIdEnum.MainTask_604 || mainId == MainTaskIdEnum.MainTask_606 || mainId == MainTaskIdEnum.MainTask_607) {
// PrefabManage.loadPrefabByType(GameType.DH_7)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_7, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_701) {
// 701任务第一幕在医院,第二幕在家里..
console.log("User.getRoomBtnIndex()=", User.getRoomBtnIndex())
if (User.getRoomBtnIndex() == 4) {
// PrefabManage.loadPrefabByType(GameType.DH_8)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_8, parentNode)
})
} else if (User.getRoomBtnIndex() == 0) {
// PrefabManage.loadPrefabByType(GameType.DH_9)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_9, parentNode)
})
}
} else if (mainId == MainTaskIdEnum.MainTask_702 || mainId == MainTaskIdEnum.MainTask_703 || mainId == MainTaskIdEnum.MainTask_704) {
// PrefabManage.loadPrefabByType(GameType.DH_9)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_9, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_706) {
// PrefabManage.loadPrefabByType(GameType.DH_10)
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_802 || mainId == MainTaskIdEnum.MainTask_804 || mainId == MainTaskIdEnum.MainTask_805) {
if (mainId == MainTaskIdEnum.MainTask_805) {
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_12, parentNode)
})
} else {
// PrefabManage.loadPrefabByType(GameType.DH_12)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_12, parentNode)
})
}
} else if (mainId == MainTaskIdEnum.MainTask_808) {
// PrefabManage.loadPrefabByType(GameType.DH_13)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_13, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_902 || mainId == MainTaskIdEnum.MainTask_904) {
// PrefabManage.loadPrefabByType(GameType.DH_14)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_14, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_910 || mainId == MainTaskIdEnum.MainTask_912) {
// PrefabManage.loadPrefabByType(GameType.DH_15)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_15, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_1002 || mainId == MainTaskIdEnum.MainTask_1004 || mainId == MainTaskIdEnum.MainTask_1005) {
if (mainId == MainTaskIdEnum.MainTask_1005) {
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_16, parentNode)
})
} else {
// PrefabManage.loadPrefabByType(GameType.DH_16)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_16, parentNode)
})
}
} else if (mainId == MainTaskIdEnum.MainTask_1007) {
// PrefabManage.loadPrefabByType(GameType.DH_17)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_17, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_1102) {
// PrefabManage.loadPrefabByType(GameType.DH_18)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_18, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_1203) {
// PrefabManage.loadPrefabByType(GameType.DH_19)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_19, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_1302 || mainId == MainTaskIdEnum.MainTask_1304) {
// PrefabManage.loadPrefabByType(GameType.DH_20)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_20, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_1307 || mainId == MainTaskIdEnum.MainTask_1308 || mainId == MainTaskIdEnum.MainTask_1309 || mainId == MainTaskIdEnum.MainTask_1310) {
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.Room3, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_1402 || mainId == MainTaskIdEnum.MainTask_1407) {
// PrefabManage.loadPrefabByType(GameType.DH_21)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_21, parentNode)
})
} else if (mainId >= MainTaskIdEnum.MainTask_1502 && mainId <= MainTaskIdEnum.MainTask_1505) {
// PrefabManage.loadPrefabByType(GameType.DH_22)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_22, parentNode)
})
} if (mainId == MainTaskIdEnum.MainTask_1603) {
// PrefabManage.loadPrefabByType(GameType.DH_23)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_23, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_1801) {
// PrefabManage.loadPrefabByType(GameType.DH_24)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_24, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_1702) {
// PrefabManage.loadPrefabByType(GameType.DH_25)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_25, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_1705 || mainId == MainTaskIdEnum.MainTask_1706) {
// PrefabManage.loadPrefabByType(GameType.DH_26)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_26, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_2005) {
// PrefabManage.loadPrefabByType(GameType.DH_27)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_27, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_2302 || mainId == MainTaskIdEnum.MainTask_2305) {
// PrefabManage.loadPrefabByType(GameType.DH_28)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_28, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_2403) {
// PrefabManage.loadPrefabByType(GameType.DH_29)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_29, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_2503) {
// PrefabManage.loadPrefabByType(GameType.DH_30)
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_30, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_2603) {
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_31, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_2708) {
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_32, 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 if (mainId == MainTaskIdEnum.MainTask_3003) {
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_34, parentNode)
})
} else {
if (mainId > MainTaskIdEnum.MainTask_302 && mainId < MainTaskIdEnum.MainTask_502 && User.getRoomBtnIndex() == RoomBtnIndexEnum.touzirenjia) {
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.Room3, parentNode)
})
} else if (mainId > MainTaskIdEnum.MainTask_502 && mainId < MainTaskIdEnum.MainTask_802 && User.getRoomBtnIndex() == RoomBtnIndexEnum.touzirenjia) {
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_5, parentNode)
})
} else if (mainId > MainTaskIdEnum.MainTask_802 && mainId < MainTaskIdEnum.MainTask_1002 && User.getRoomBtnIndex() == RoomBtnIndexEnum.touzirenjia) {
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_12, parentNode)
})
} else if (mainId > MainTaskIdEnum.MainTask_1002 && mainId < MainTaskIdEnum.MainTask_1307 && User.getRoomBtnIndex() == RoomBtnIndexEnum.touzirenjia) {
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_16, parentNode)
})
} else if (mainId > MainTaskIdEnum.MainTask_1307 && User.getRoomBtnIndex() == RoomBtnIndexEnum.touzirenjia) {
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.Room3, parentNode)
})
}
// //第一章特殊处理
// if (Common5.selectGameInfo.index == 0) {
// PrefabManage.loadPrefabByType(Common5.selectGameInfo.roomIndex)
// } else {
// PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
// let parentNode = prefab.getComponent(RoomCommon).getMainNode()
// PrefabManage.loadPrefabByType(Common5.selectGameInfo.roomIndex, parentNode)
// })
// }
}
}
this.cheSpine.stopAllActions()
// if (mainId < MainTaskIdEnum.MainTask_606) {
// Common5.playEffectCustom('XianCheng', 'sound/汽车启动')
// this.cheSpine.getComponent(sp.Skeleton).setAnimation(0, '单车离开', false)
// cc.tween(this.cheSpine)
// .delay(0.5)
// .call(() => {
// callFunc()
// })
// .start()
// } else
if (mainId < MainTaskIdEnum.MainTask_1205) {
Common5.playEffectCustom('XianCheng', 'sound/自行车骑走')
this.cheSpine.getComponent(sp.Skeleton).setAnimation(0, '单车离开', false)
cc.tween(this.cheSpine)
.delay(0.5)
.call(() => {
callFunc()
})
.start()
} else {
Common5.playEffectCustom('XianCheng', 'sound/汽车启动')
this.cheSpine.getComponent(sp.Skeleton).setAnimation(0, '车离开', false)
cc.tween(this.cheSpine)
.delay(0.5)
.call(() => {
callFunc()
})
.start()
}
}
}
clickTaskInfoEvent() {
let customTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
if (customTaskInfo && Object.keys(customTaskInfo).length > 0 && customTaskInfo.Id != MainTaskIdEnum.MainTask_None) {
// PrefabManage.loadPrefabByType(GameType.TaskInfoNode)
this.node.getChildByName("taskInfoNode").getComponent(TaskInfoView).init()
} else {
if (TaskManager.getIsLastTaskFinish()) {
PrefabManage.showTextTips('后续剧情策划挠头制作中,敬请期待!')
} else {
PrefabManage.showTextTips('当前无任务')
}
}
}
openJishiBen(event) {
GameMgr.getInstance_custom().onLoadToSelectScene_custom();
//PrefabManage.loadPrefabByType(GameType.JiShiBen)
}
onBtnClickFeedback() {
// Common5.playEffect("sound/按键点击");
PrefabManage.loadPrefabByType(GameType.Feedback);
}
/********************新********************/
clickQuHaiWai() {
GameEnterClick.clickQuHaiWai()
}
clickBingShanQiE() {
GameEnterClick.clickBingShanQiE()
}
clickHaiWaiMaoYi() {
GameEnterClick.clickHaiWaiMaoYi()
}
clickShaMoZhongShu() {
GameEnterClick.clickShaMoZhongShu()
}
clickShenHaiTanBao() {
GameEnterClick.clickShenHaiTanBao()
}
// clickMengChongShengHuoGuan(){
clickGuShi() {
GameEnterClick.clickGuShi()
}
// }
clickPaiMaiHang() {
GameEnterClick.clickPaiMaiHang()
}
// update (dt) {}
clickChenShiMaiKenJi() {
GameEnterClick.clickChenShiMaiKenJi()
}
// clickMangHeJi(){
clickChenShiXingBaKe() {
GameEnterClick.clickChenShiXingBaKe()
}
// }
clickChenShiMiQiLin() {
GameEnterClick.clickChenShiMiQiLin()
}
clickXiCanMeiShiCheng() {
GameEnterClick.clickXiCanMeiShiCheng()
}
clickKuaiDiZhan() {
GameEnterClick.clickKuaiDiZhan()
}
clickJiuPingHuiShouChang() {
GameEnterClick.clickJiuPingHuiShouChang()
}
clickShiPinHuiShou() {
GameEnterClick.clickShiPinHuiShou()
}
clickMaiHuoLang() {
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
if (mainId == MainTaskIdEnum.MainTask_202) {
Common5.ReportDY("inLevel", "任务001-开场三1卖货郎");
}
GameEnterClick.clickMaiHuoLang()
}
clickLinShiYueCai() {
PrefabManage.loadPrefabByType(GameType.ZhongCanTing, null, (prefabNode) => {
prefabNode.getComponent(ZhongCanTing).initView(CaiXiEnum.YueCai)
})
}
clickLinShiLuCai() {
PrefabManage.loadPrefabByType(GameType.ZhongCanTing, null, (prefabNode) => {
prefabNode.getComponent(ZhongCanTing).initView(CaiXiEnum.LuCai)
})
}
clickLinShiHuiCai() {
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
if (mainId == MainTaskIdEnum.MainTask_1301 || mainId == MainTaskIdEnum.MainTask_1302) {
PrefabManage.loadPrefabByType(GameType.JianLouBox, null, (prefab) => {
prefab.getComponent(JianLouBox).initView(3, false, () => {
})
})
} else if (mainId == MainTaskIdEnum.MainTask_1303) {
PrefabManage.loadPrefabByType(GameType.JianLouBox, null, (prefab) => {
prefab.getComponent(JianLouBox).initView(3, true, () => {
let baDaCaiXiUnlockStatus = User.getBaDaCaiXiUnlockStatus()
baDaCaiXiUnlockStatus.HuiCai = true
User.setBaDaCaiXiUnlockStatus(baDaCaiXiUnlockStatus)
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_1303)
JuQingManager.unLockNewJuQing('WX_1301')
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_1304)
})
})
} else {
PrefabManage.loadPrefabByType(GameType.ZhongCanTing, null, (prefabNode) => {
prefabNode.getComponent(ZhongCanTing).initView(CaiXiEnum.HuiCai)
})
}
}
clickLinShiChuanCai() {
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
if (mainId == MainTaskIdEnum.MainTask_705 || mainId == MainTaskIdEnum.MainTask_706) {
PrefabManage.loadPrefabByType(GameType.JianLouBox, null, (prefab) => {
prefab.getComponent(JianLouBox).initView(1, false, () => {
})
})
} else if (mainId == MainTaskIdEnum.MainTask_707) {
PrefabManage.loadPrefabByType(GameType.JianLouBox, null, (prefab) => {
prefab.getComponent(JianLouBox).initView(1, true, () => {
let baDaCaiXiUnlockStatus = User.getBaDaCaiXiUnlockStatus()
baDaCaiXiUnlockStatus.ChuanCai = true
User.setBaDaCaiXiUnlockStatus(baDaCaiXiUnlockStatus)
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_707)
JuQingManager.unLockNewJuQing('WX_701')
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_708)
})
})
} else {
PrefabManage.loadPrefabByType(GameType.ZhongCanTing, null, (prefabNode) => {
prefabNode.getComponent(ZhongCanTing).initView(CaiXiEnum.ChuanCai)
})
}
}
clickLinShiXiangCai() {
console.log('点击湘菜')
PrefabManage.loadPrefabByType(GameType.ZhongCanTing, null, (prefabNode) => {
prefabNode.getComponent(ZhongCanTing).initView(CaiXiEnum.XiangCai)
})
}
clickLinShiMinCai() {
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
if (mainId == MainTaskIdEnum.MainTask_1703 || mainId == MainTaskIdEnum.MainTask_1704) {
PrefabManage.loadPrefabByType(GameType.JianLouBox, null, (prefab) => {
prefab.getComponent(JianLouBox).initView(5, false, () => {
})
})
} else if (mainId == MainTaskIdEnum.MainTask_1705) {
PrefabManage.loadPrefabByType(GameType.JianLouBox, null, (prefab) => {
prefab.getComponent(JianLouBox).initView(5, true, () => {
let baDaCaiXiUnlockStatus = User.getBaDaCaiXiUnlockStatus()
baDaCaiXiUnlockStatus.MinCai = true
User.setBaDaCaiXiUnlockStatus(baDaCaiXiUnlockStatus)
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_1705)
JuQingManager.unLockNewJuQing('WX_1701')
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_1706)
})
})
} else {
PrefabManage.loadPrefabByType(GameType.ZhongCanTing, null, (prefabNode) => {
prefabNode.getComponent(ZhongCanTing).initView(CaiXiEnum.MinCai)
})
}
}
clickLinShiSuCai() {
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
if (mainId == MainTaskIdEnum.MainTask_1101 || mainId == MainTaskIdEnum.MainTask_1102) {
PrefabManage.loadPrefabByType(GameType.JianLouBox, null, (prefab) => {
prefab.getComponent(JianLouBox).initView(2, false, () => {
})
})
} else if (mainId == MainTaskIdEnum.MainTask_1103) {
PrefabManage.loadPrefabByType(GameType.JianLouBox, null, (prefab) => {
prefab.getComponent(JianLouBox).initView(2, true, () => {
let baDaCaiXiUnlockStatus = User.getBaDaCaiXiUnlockStatus()
baDaCaiXiUnlockStatus.SuCai = true
User.setBaDaCaiXiUnlockStatus(baDaCaiXiUnlockStatus)
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_1103)
JuQingManager.unLockNewJuQing('WX_1101')
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_1104)
})
})
} else {
PrefabManage.loadPrefabByType(GameType.ZhongCanTing, null, (prefabNode) => {
prefabNode.getComponent(ZhongCanTing).initView(CaiXiEnum.SuCai)
})
}
}
clickLinShiZheCai() {
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
if (mainId == MainTaskIdEnum.MainTask_1601 || mainId == MainTaskIdEnum.MainTask_1602) {
PrefabManage.loadPrefabByType(GameType.JianLouBox, null, (prefab) => {
prefab.getComponent(JianLouBox).initView(4, false, () => {
})
})
} else if (mainId == MainTaskIdEnum.MainTask_1603) {
PrefabManage.loadPrefabByType(GameType.JianLouBox, null, (prefab) => {
prefab.getComponent(JianLouBox).initView(4, true, () => {
let baDaCaiXiUnlockStatus = User.getBaDaCaiXiUnlockStatus()
baDaCaiXiUnlockStatus.ZheCai = true
User.setBaDaCaiXiUnlockStatus(baDaCaiXiUnlockStatus)
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_1603)
JuQingManager.unLockNewJuQing('WX_1601')
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_1604)
})
})
} else {
PrefabManage.loadPrefabByType(GameType.ZhongCanTing, null, (prefabNode) => {
prefabNode.getComponent(ZhongCanTing).initView(CaiXiEnum.ZheCai)
})
}
}
clickYanFaCaiPin() {
let isNeedShengJi = ZhongCanTingManager.checkIsCanTingNeedShengJi()
if (isNeedShengJi > -1) {
PrefabManage.loadPrefabByType(GameType.ZhongCanTing, null, (prefabNode) => {
prefabNode.getComponent(ZhongCanTing).initView(isNeedShengJi)
})
}
}
clickFeiXu() {
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
// if (mainId == MainTaskIdEnum.MainTask_302 || mainId == MainTaskIdEnum.MainTask_303) {
// PrefabManage.loadPrefabByType(GameType.JianLouBox, null, (prefab) => {
// prefab.getComponent(JianLouBox).initView(0, false, () => {
// })
// })
// } else
if (mainId == MainTaskIdEnum.MainTask_310) {
PrefabManage.loadPrefabByType(GameType.JianLouBox, null, (prefab) => {
prefab.getComponent(JianLouBox).initView(0, true, () => {
let baDaCaiXiUnlockStatus = User.getBaDaCaiXiUnlockStatus()
baDaCaiXiUnlockStatus.YaoShan = true
User.setBaDaCaiXiUnlockStatus(baDaCaiXiUnlockStatus)
EventMgr.emitEvent_custom(ryw_Event.refreshJianZaoXinXi);
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_310)
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_311, false)
CccGame.playAnimation2(this.node.getChildByName("开业大吉").getChildByName("剪彩"), "剪彩", false, null, (spineNode) => {
spineNode.active = false;
Common5.playEffectCustom('XianCheng', 'sound/烟花');
CccGame.playAnimation2(this.node.getChildByName("开业大吉").getChildByName("烟花"), "烟花", false, null, (spineNode) => {
spineNode.active = false;
cc.tween(this.node.getChildByName("开业大吉").getChildByName("开业大吉"))
.set({ active: true, scale: 0 })
.to(0.5, { scale: 1 })
.delay(1)
.to(0.5, { opacity: 0 })
.set({ opacity: 255, active: false })
.call(() => {
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_311)
})
.start();
});
});
})
})
} else {
}
}
clickKuangShan() {
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
let config = TaskManager.getTaskConfigById(MainTaskIdEnum.MainTask_1303);
let num = config.subtitle - User.getCurTaskIndex();
if (num > 0) {
PrefabManage.showTextTips(`还差${num}个任务解锁`);
} else {
PrefabManage.loadPrefabByType(GameType.KaiKuangFirstView)
}
}
clickGuWan() {
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 {
PrefabManage.loadPrefabByType(GameType.HuXinGongYuan)
}
}
clickYuTang() {
PrefabManage.loadPrefabByType(GameType.ChoushuiFirst)
}
clickCiShanChouJiang() {
PrefabManage.loadPrefabByType(GameType.CiShanChouJiang)
}
clickDianZi() {
// PrefabManage.loadPrefabByType(GameType.ChoushuiFirst)
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
let config = TaskManager.getTaskConfigById(MainTaskIdEnum.MainTask_1310);
let num = config.subtitle - User.getCurTaskIndex();
if (num > 0) {
PrefabManage.showTextTips(`还差${num}个任务解锁`);
} else {
if (mainId == MainTaskIdEnum.MainTask_1310) {
PrefabManage.loadPrefabByType(GameType.JianLouBox, null, (prefab) => {
prefab.getComponent(JianLouBox).initView(4, true, () => {
let baDaCaiXiUnlockStatus = User.getBaDaCaiXiUnlockStatus()
baDaCaiXiUnlockStatus.DianZi = true
User.setBaDaCaiXiUnlockStatus(baDaCaiXiUnlockStatus)
EventMgr.emitEvent_custom(ryw_Event.refreshJianZaoXinXi);
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_1310)
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_1311, false)
CccGame.playAnimation2(this.node.getChildByName("开业大吉").getChildByName("剪彩"), "剪彩", false, null, (spineNode) => {
spineNode.active = false;
Common5.playEffectCustom('XianCheng', 'sound/烟花');
CccGame.playAnimation2(this.node.getChildByName("开业大吉").getChildByName("烟花"), "烟花", false, null, (spineNode) => {
spineNode.active = false;
cc.tween(this.node.getChildByName("开业大吉").getChildByName("开业大吉"))
.set({ active: true, scale: 0 })
.to(0.5, { scale: 1 })
.delay(1)
.to(0.5, { opacity: 0 })
.set({ opacity: 255, active: false })
.call(() => {
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_1311)
})
.start();
});
});
})
})
} else {
PrefabManage.loadPrefabByType(GameType.ZhongCanTing, null, (prefabNode) => {
prefabNode.getComponent(ZhongCanTing).initView(CaiXiEnum.DianZi)
})
}
}
}
clickWeiLai() {
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
let config = TaskManager.getTaskConfigById(MainTaskIdEnum.MainTask_2406);
let num = config.subtitle - User.getCurTaskIndex();
if (num > 0) {
PrefabManage.showTextTips(`还差${num}个任务解锁`);
} else {
if (mainId == MainTaskIdEnum.MainTask_2406) {
let baDaCaiXiUnlockStatus = User.getBaDaCaiXiUnlockStatus()
if (baDaCaiXiUnlockStatus.WeiLai) {
PrefabManage.loadPrefabByType(GameType.ZhongCanTing, null, (prefabNode) => {
prefabNode.getComponent(ZhongCanTing).initView(CaiXiEnum.WeiLai)
})
} else {
PrefabManage.loadPrefabByType(GameType.JianLouBox, null, (prefab) => {
prefab.getComponent(JianLouBox).initView(7, true, () => {
let baDaCaiXiUnlockStatus = User.getBaDaCaiXiUnlockStatus()
baDaCaiXiUnlockStatus.WeiLai = true
User.setBaDaCaiXiUnlockStatus(baDaCaiXiUnlockStatus)
EventMgr.emitEvent_custom(ryw_Event.refreshJianZaoXinXi);
this.showJieSuoQiPao()
this.showChatBtnStatus()
// TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_505)
// TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_506)
CccGame.playAnimation2(this.node.getChildByName("开业大吉").getChildByName("剪彩"), "剪彩", false, null, (spineNode) => {
spineNode.active = false;
Common5.playEffectCustom('XianCheng', 'sound/烟花');
CccGame.playAnimation2(this.node.getChildByName("开业大吉").getChildByName("烟花"), "烟花", false, null, (spineNode) => {
spineNode.active = false;
cc.tween(this.node.getChildByName("开业大吉").getChildByName("开业大吉"))
.set({ active: true, scale: 0 })
.to(0.5, { scale: 1 })
.delay(1)
.to(0.5, { opacity: 0 })
.set({ opacity: 255, active: false })
.start();
});
});
})
})
}
} else {
PrefabManage.loadPrefabByType(GameType.ZhongCanTing, null, (prefabNode) => {
prefabNode.getComponent(ZhongCanTing).initView(CaiXiEnum.WeiLai)
})
}
}
}
clickJingRong() {
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
let config = TaskManager.getTaskConfigById(MainTaskIdEnum.MainTask_2106);
let num = config.subtitle - User.getCurTaskIndex();
if (num > 0) {
PrefabManage.showTextTips(`还差${num}个任务解锁`);
} else {
if (mainId == MainTaskIdEnum.MainTask_2106) {
let baDaCaiXiUnlockStatus = User.getBaDaCaiXiUnlockStatus()
if (baDaCaiXiUnlockStatus.JingRong) {
PrefabManage.loadPrefabByType(GameType.ZhongCanTing, null, (prefabNode) => {
prefabNode.getComponent(ZhongCanTing).initView(CaiXiEnum.JingRong)
})
} else {
PrefabManage.loadPrefabByType(GameType.JianLouBox, null, (prefab) => {
prefab.getComponent(JianLouBox).initView(6, true, () => {
let baDaCaiXiUnlockStatus = User.getBaDaCaiXiUnlockStatus()
baDaCaiXiUnlockStatus.JingRong = true
User.setBaDaCaiXiUnlockStatus(baDaCaiXiUnlockStatus)
EventMgr.emitEvent_custom(ryw_Event.refreshJianZaoXinXi);
this.showJieSuoQiPao()
this.showChatBtnStatus()
// TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_505)
// TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_506)
CccGame.playAnimation2(this.node.getChildByName("开业大吉").getChildByName("剪彩"), "剪彩", false, null, (spineNode) => {
spineNode.active = false;
Common5.playEffectCustom('XianCheng', 'sound/烟花');
CccGame.playAnimation2(this.node.getChildByName("开业大吉").getChildByName("烟花"), "烟花", false, null, (spineNode) => {
spineNode.active = false;
cc.tween(this.node.getChildByName("开业大吉").getChildByName("开业大吉"))
.set({ active: true, scale: 0 })
.to(0.5, { scale: 1 })
.delay(1)
.to(0.5, { opacity: 0 })
.set({ opacity: 255, active: false })
.start();
});
});
})
})
}
} else {
PrefabManage.loadPrefabByType(GameType.ZhongCanTing, null, (prefabNode) => {
prefabNode.getComponent(ZhongCanTing).initView(CaiXiEnum.JingRong)
})
}
}
}
clickWangLuo() {
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
let config = TaskManager.getTaskConfigById(MainTaskIdEnum.MainTask_1903);
let num = config.subtitle - User.getCurTaskIndex();
if (num > 0) {
PrefabManage.showTextTips(`还差${num}个任务解锁`);
} else {
if (mainId == MainTaskIdEnum.MainTask_1903) {
PrefabManage.loadPrefabByType(GameType.JianLouBox, null, (prefab) => {
prefab.getComponent(JianLouBox).initView(5, true, () => {
let baDaCaiXiUnlockStatus = User.getBaDaCaiXiUnlockStatus()
baDaCaiXiUnlockStatus.WangLuo = true
User.setBaDaCaiXiUnlockStatus(baDaCaiXiUnlockStatus)
EventMgr.emitEvent_custom(ryw_Event.refreshJianZaoXinXi);
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_1903)
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_1904, false)
CccGame.playAnimation2(this.node.getChildByName("开业大吉").getChildByName("剪彩"), "剪彩", false, null, (spineNode) => {
spineNode.active = false;
Common5.playEffectCustom('XianCheng', 'sound/烟花');
CccGame.playAnimation2(this.node.getChildByName("开业大吉").getChildByName("烟花"), "烟花", false, null, (spineNode) => {
spineNode.active = false;
cc.tween(this.node.getChildByName("开业大吉").getChildByName("开业大吉"))
.set({ active: true, scale: 0 })
.to(0.5, { scale: 1 })
.delay(1)
.to(0.5, { opacity: 0 })
.set({ opacity: 255, active: false })
.call(() => {
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_1904)
})
.start();
});
});
})
})
} else {
PrefabManage.loadPrefabByType(GameType.ZhongCanTing, null, (prefabNode) => {
prefabNode.getComponent(ZhongCanTing).initView(CaiXiEnum.DianZi)
})
}
}
}
clickShiPingChang() {
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
let config = TaskManager.getTaskConfigById(MainTaskIdEnum.MainTask_505);
let num = config.subtitle - User.getCurTaskIndex();
if (num > 0) {
PrefabManage.showTextTips(`还差${num}个任务解锁`);
} else {
if (mainId == MainTaskIdEnum.MainTask_505) {
PrefabManage.loadPrefabByType(GameType.JianLouBox, null, (prefab) => {
prefab.getComponent(JianLouBox).initView(1, true, () => {
let baDaCaiXiUnlockStatus = User.getBaDaCaiXiUnlockStatus()
baDaCaiXiUnlockStatus.ShiPingChang = true
User.setBaDaCaiXiUnlockStatus(baDaCaiXiUnlockStatus)
EventMgr.emitEvent_custom(ryw_Event.refreshJianZaoXinXi);
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_505)
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_506, false)
CccGame.playAnimation2(this.node.getChildByName("开业大吉").getChildByName("剪彩"), "剪彩", false, null, (spineNode) => {
spineNode.active = false;
Common5.playEffectCustom('XianCheng', 'sound/烟花');
CccGame.playAnimation2(this.node.getChildByName("开业大吉").getChildByName("烟花"), "烟花", false, null, (spineNode) => {
spineNode.active = false;
cc.tween(this.node.getChildByName("开业大吉").getChildByName("开业大吉"))
.set({ active: true, scale: 0 })
.to(0.5, { scale: 1 })
.delay(1)
.to(0.5, { opacity: 0 })
.set({ opacity: 255, active: false })
.call(() => {
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_506)
})
.start();
});
});
})
})
} else {
PrefabManage.loadPrefabByType(GameType.ZhongCanTing, null, (prefabNode) => {
prefabNode.getComponent(ZhongCanTing).initView(CaiXiEnum.ShiPingChang)
})
}
}
// PrefabManage.loadPrefabByType(GameType.ChoushuiFirst)
}
clickYiYao() {
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
let config = TaskManager.getTaskConfigById(MainTaskIdEnum.MainTask_805);
let num = config.subtitle - User.getCurTaskIndex();
if (num > 0) {
PrefabManage.showTextTips(`还差${num}个任务解锁`);
} else {
if (mainId == MainTaskIdEnum.MainTask_805) {
PrefabManage.loadPrefabByType(GameType.JianLouBox, null, (prefab) => {
prefab.getComponent(JianLouBox).initView(2, true, () => {
let baDaCaiXiUnlockStatus = User.getBaDaCaiXiUnlockStatus()
baDaCaiXiUnlockStatus.YiYao = true
User.setBaDaCaiXiUnlockStatus(baDaCaiXiUnlockStatus)
EventMgr.emitEvent_custom(ryw_Event.refreshJianZaoXinXi);
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_805)
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_806, false)
CccGame.playAnimation2(this.node.getChildByName("开业大吉").getChildByName("剪彩"), "剪彩", false, null, (spineNode) => {
spineNode.active = false;
Common5.playEffectCustom('XianCheng', 'sound/烟花');
CccGame.playAnimation2(this.node.getChildByName("开业大吉").getChildByName("烟花"), "烟花", false, null, (spineNode) => {
spineNode.active = false;
cc.tween(this.node.getChildByName("开业大吉").getChildByName("开业大吉"))
.set({ active: true, scale: 0 })
.to(0.5, { scale: 1 })
.delay(1)
.to(0.5, { opacity: 0 })
.set({ opacity: 255, active: false })
.call(() => {
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_806)
})
.start();
});
});
})
})
} else if (mainId == MainTaskIdEnum.MainTask_1502 || mainId == MainTaskIdEnum.MainTask_1505) {
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_22, parentNode)
})
} else {
PrefabManage.loadPrefabByType(GameType.ZhongCanTing, null, (prefabNode) => {
prefabNode.getComponent(ZhongCanTing).initView(CaiXiEnum.YiYao)
})
}
}
}
clickWenYu() {
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
let config = TaskManager.getTaskConfigById(MainTaskIdEnum.MainTask_1005);
let num = config.subtitle - User.getCurTaskIndex();
if (num > 0) {
PrefabManage.showTextTips(`还差${num}个任务解锁`);
} else {
if (mainId == MainTaskIdEnum.MainTask_1005) {
PrefabManage.loadPrefabByType(GameType.JianLouBox, null, (prefab) => {
prefab.getComponent(JianLouBox).initView(3, true, () => {
let baDaCaiXiUnlockStatus = User.getBaDaCaiXiUnlockStatus()
baDaCaiXiUnlockStatus.WenYu = true
User.setBaDaCaiXiUnlockStatus(baDaCaiXiUnlockStatus)
EventMgr.emitEvent_custom(ryw_Event.refreshJianZaoXinXi);
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_1005)
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_1006, false)
CccGame.playAnimation2(this.node.getChildByName("开业大吉").getChildByName("剪彩"), "剪彩", false, null, (spineNode) => {
spineNode.active = false;
Common5.playEffectCustom('XianCheng', 'sound/烟花');
CccGame.playAnimation2(this.node.getChildByName("开业大吉").getChildByName("烟花"), "烟花", false, null, (spineNode) => {
spineNode.active = false;
cc.tween(this.node.getChildByName("开业大吉").getChildByName("开业大吉"))
.set({ active: true, scale: 0 })
.to(0.5, { scale: 1 })
.delay(1)
.to(0.5, { opacity: 0 })
.set({ opacity: 255, active: false })
.call(() => {
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_1006)
})
.start();
});
});
})
})
} else {
PrefabManage.loadPrefabByType(GameType.ZhongCanTing, null, (prefabNode) => {
prefabNode.getComponent(ZhongCanTing).initView(CaiXiEnum.WenYu)
})
}
}
}
clickYaoShan() {
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
if (mainId == MainTaskIdEnum.MainTask_508 || mainId == MainTaskIdEnum.MainTask_510) {
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_6, parentNode)
})
} else if (mainId == MainTaskIdEnum.MainTask_902 || mainId == MainTaskIdEnum.MainTask_904) {
PrefabManage.loadPrefabByType(GameType.RoomCommon, null, (prefab) => {
let parentNode = prefab.getComponent(RoomCommon).getMainNode()
PrefabManage.loadPrefabByType(GameType.DH_14, parentNode)
})
} else {
PrefabManage.loadPrefabByType(GameType.ZhongCanTing, null, (prefabNode) => {
prefabNode.getComponent(ZhongCanTing).initView(CaiXiEnum.YaoShan)
})
}
}
clickHuiGu() {
GameMgr.getInstance_custom().onLoadToSelectScene_custom();
}
onStartTask1806() {
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
if (mainId == MainTaskIdEnum.MainTask_1804 || mainId == MainTaskIdEnum.MainTask_1805) {
PrefabManage.loadPrefabByType(GameType.JianLouBox, null, (prefab) => {
prefab.getComponent(JianLouBox).initView(10, false, () => {
})
})
} else if (mainId == MainTaskIdEnum.MainTask_1806) {
PrefabManage.loadPrefabByType(GameType.JianLouBox, null, (prefab) => {
prefab.getComponent(JianLouBox).initView(10, true, () => {
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_1806)
JuQingManager.unLockNewJuQing('WX_1802')
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_1807)
})
})
}
}
onStartTask2002() {
PrefabManage.loadPrefabByType(GameType.JianLouBox, null, (prefab) => {
prefab.getComponent(JianLouBox).initView(9, true, () => {
let baDaCaiXiUnlockStatus = User.getBaDaCaiXiUnlockStatus()
baDaCaiXiUnlockStatus.ShiPinHuiShouZhan = true
User.setBaDaCaiXiUnlockStatus(baDaCaiXiUnlockStatus)
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_2002)
JuQingManager.unLockNewJuQing('WX_2001')
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_2003)
})
})
}
onStartTask2103() {
PrefabManage.loadPrefabByType(GameType.JianLouBox, null, (prefab) => {
prefab.getComponent(JianLouBox).initView(6, true, () => {
let baDaCaiXiUnlockStatus = User.getBaDaCaiXiUnlockStatus()
baDaCaiXiUnlockStatus.YueCai = true
User.setBaDaCaiXiUnlockStatus(baDaCaiXiUnlockStatus)
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_2103)
JuQingManager.unLockNewJuQing('WX_2101')
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_2104)
})
})
}
onStartTask2303() {
PrefabManage.loadPrefabByType(GameType.JianLouBox, null, (prefab) => {
prefab.getComponent(JianLouBox).initView(7, true, () => {
let baDaCaiXiUnlockStatus = User.getBaDaCaiXiUnlockStatus()
baDaCaiXiUnlockStatus.LuCai = true
User.setBaDaCaiXiUnlockStatus(baDaCaiXiUnlockStatus)
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_2303)
JuQingManager.unLockNewJuQing('WX_2301')
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_2304)
})
})
}
onStartTask2406() {
PrefabManage.loadPrefabByType(GameType.JianLouBox, null, (prefab) => {
prefab.getComponent(JianLouBox).initView(8, true, () => {
let baDaCaiXiUnlockStatus = User.getBaDaCaiXiUnlockStatus()
baDaCaiXiUnlockStatus.ManHanQuanXi = true
User.setBaDaCaiXiUnlockStatus(baDaCaiXiUnlockStatus)
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_2406)
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_2407)
ZhongCanTingManager.checkTask()
})
})
}
clickHuiFu() {
if (User.getMoney() >= 200000000000) {
UserManager.subMoney(200000000000)
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_2702)
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_2703)
}
}
}