import EventMgr from "../../../FrameWork/Event/EventMgr"; import { ryw_Event } from "../../../FrameWork/Event/EventEnum"; import Common5 from "../../../Platform/th/Common5"; import Game from "../../../Scripts/Game"; import ZhaoChaConfig_v2 from "./ZhaoChaConfig_v2"; import Common from "../../../FrameWork/Util/Common"; import DaDianScript from "../../../FrameWork/Base/DaDianScript"; const {ccclass, property} = cc._decorator; @ccclass export default class ZhaoCha extends cc.Component{ gameId:number = 0; gameInfo = null originalTouchDistance:number = 0 //起始双指触摸间距 lastScale:number = 1//上次缩放值 curScale:number = 1//当前缩放值 touchId1:number = -1 touchId2:number = -2 findTimes:number = 0//已找出个数 mapNode: cc.Node = null; //map图片 mapNodeFixedScale:number = 0.6//固定缩放(图片太大了) touchStartTime:number = 0//触摸开始时间 isFind = false; curZIndex:number = 100; allMoneyNum_ = 0 @property(cc.Node) timeNode:cc.Node = null; @property(cc.Node) maskNode:cc.Node = null; @property(cc.Node) markSp: cc.Node = null; @property(cc.Node) answerNodeType1: cc.Node = null; @property(cc.Node) answerNodeType2: cc.Node = null; subBundle = null subUrl = null isFailShow=false; isSuccessShow=false; onLoad(){ Common.Type = 2; Common.subLevel = 0; Common.GameSubTipConfigs=[Common5.gameConfig.zmGameConfig[Common5.selectGameNum].toolTip] this.subBundle = Common5.gameConfig.zmGameConfig[Common5.selectGameNum].subbundle this.subUrl = Common5.gameConfig.zmGameConfig[Common5.selectGameNum].suburl this.gameId = Common5.gameConfig.zmGameConfig[Common5.selectGameNum].gameId this.gameInfo = ZhaoChaConfig_v2.getInstance().getHideGoodsInfo(this.gameId) EventMgr.onEvent_custom(ryw_Event.timeOut, (tab) => { Game.ins.showFail();; }, this); DaDianScript.userEnterDaDian() } start(){ cc.macro.ENABLE_MULTI_TOUCH = true; this.init_line() this.initMapNodeTouchEvent() this.setTimeNode() } setTimeNode(){ let worldPos = this.timeNode.getPosition() Game.ins.setTimePos(worldPos.x,worldPos.y) Game.ins.setTimeScale(0.7) } init_line(){ let answerNode = null if(this.gameInfo.PrefabInfo.zhaoChaType == ZhaoChaConfig_v2.getInstance().getZhaoChaType().Type1){ answerNode = this.answerNodeType1 }else if(this.gameInfo.PrefabInfo.zhaoChaType == ZhaoChaConfig_v2.getInstance().getZhaoChaType().Type2){ answerNode = this.answerNodeType2 } answerNode.active = true for(var i=0;i{ this.mapNode = prefabNode this.openMapTouch() let prefabWidth = this.mapNode.width let prefabHeight = this.mapNode.height let maskWidth = this.maskNode.width let maskHeight = this.maskNode.height let widthScale = maskWidth/prefabWidth let heightScale = maskHeight/prefabHeight if(prefabWidth= 0 && this.touchId2 >= 0){ // console.log("邵阳1—双点触摸开始") } this.touchStartTime = Date.now() } touchMove_mapNode(event){ let touches = event.getTouches() if(touches.length == 2){ //缩放 if(this.originalTouchDistance == 0){ this.originalTouchDistance = this.getDistance(touches[0].getLocation(),touches[1].getLocation()) } //获取双指移动数据 let curDistance = this.getDistance(touches[0].getLocation(),touches[1].getLocation()) let tempScale = curDistance/this.originalTouchDistance let y = 0.5*tempScale + 0.5 let scale = y * this.lastScale if(scale < this.mapNodeFixedScale){ scale = this.mapNodeFixedScale }else if(scale > 3){ scale = 3 }else{ } this.mapNode.scale = scale this.curScale = scale }else if(touches.length == 1){ //拖动 let delta = event.getDelta() this.mapNode.x += delta.x this.mapNode.y += delta.y this.goToBoundary() } } touchEnd_mapNode(event){ if(Date.now() - this.touchStartTime > 0.2 * 1000){ }else{ this.isFind = false; let touchPos = event.getLocation(); this.checkIsInAreaNewVersion(touchPos) if(!this.isFind && this.gameInfo.PrefabInfo.AddTime){ let pos = Common5.getPosInWorld_custom(this.timeNode); pos.x = pos.x + 80; Common5.showTips_customTimeNew(this.gameInfo.PrefabInfo.AddTime.toString(), 0.3, pos); Game.ins.addTick(this.gameInfo.PrefabInfo.AddTime); } } if(event.touch.getID() == this.touchId1){ this.touchId1 = -1 }else if(event.touch.getID() == this.touchId2){ this.touchId2 = -2 } if(this.touchId1 < 0 && this.touchId2 < 0){ this.originalTouchDistance = 0 this.lastScale = this.curScale } } //距离 getDistance(startPos,endPos){ var pos = cc.v2(startPos.x - endPos.x,startPos.y - endPos.y) var dis = Math.sqrt(pos.x * pos.x + pos.y * pos.y) return dis } //检测边界 goToBoundary(){ let widthMask = this.maskNode.width let heightMask = this.maskNode.height let widthMap = this.mapNode.width*this.curScale let heightMap = this.mapNode.height*this.curScale //右边界 if(this.mapNode.x + widthMap/2 <= widthMask/2){ this.mapNode.x = widthMask/2 - widthMap/2 //左边界 }else if(this.mapNode.x - widthMap/2>= -widthMask/2){ this.mapNode.x = -widthMask/2 + widthMap/2 } //上边界 if(this.mapNode.y + heightMap/2 <= heightMask/2){ this.mapNode.y = heightMask/2 - heightMap/2 //下边界 }else if(this.mapNode.y - heightMap/2 >= -heightMask/2){ this.mapNode.y = -heightMask/2 + heightMap/2 } } //找到一个茬点 findOnChaDian(curNode){ let parentNode = null if(this.gameInfo.PrefabInfo.zhaoChaType == ZhaoChaConfig_v2.getInstance().getZhaoChaType().Type1){ parentNode = this.answerNodeType1 }else if(this.gameInfo.PrefabInfo.zhaoChaType == ZhaoChaConfig_v2.getInstance().getZhaoChaType().Type2){ parentNode = this.answerNodeType2 } let childNode = parentNode.getChildByName("xhx_"+this.findTimes) if(!childNode){ return } Common5.playEffect("success2") let answerIcon = cc.instantiate(curNode.getChildByName("childIcon")); answerIcon.active = true; answerIcon.parent = childNode Common5.setNodeToTargetPos(answerIcon,curNode.getChildByName("childIcon")) if(this.gameInfo.PrefabInfo.isShowMark){ let mark = cc.instantiate(this.markSp) mark.active = true curNode.addChild(mark) } this.findTimes += 1 // answerIcon.scale = 0 cc.tween(answerIcon) .to(0.4,{x:0,y:0}) .call(()=>{ childNode.getChildByName("desc").active = true childNode.getChildByName("desc").getComponent(cc.Label).string = this.gameInfo.ChaNode[curNode.name].desc console.log("已完成个数==",this.findTimes) if(this.findTimes >= this.gameInfo.PrefabInfo.num){ console.log("完成所有茬点个数===") let timeNum = this.gameInfo.PrefabInfo.overTime || 0.1 if(this.gameInfo.PrefabInfo.startMoney || this.gameInfo.PrefabInfo.targetMoney){ if(this.node["allMoney"] != this.gameInfo.PrefabInfo.targetMoney){ //大嫂求情小于0也算成功(补丁) if(this.gameId == 1208 && this.node["allMoney"] <= 0){ }else{ this.scheduleOnce(()=>{ this.endGameView(0) },timeNum) return } } } this.scheduleOnce(()=>{ this.endGameView(1) },timeNum) return } }) .start() this.findChaDianSpecialLogic(curNode,answerIcon) } //检测node是否进入target区域(新版) checkIsInAreaNewVersion(pos){ //茬点触碰逻辑 let childrens = this.mapNode.getChildByName("chaDianNode").children for(var i =0;i{ this.closeTouchEvent(event.target) Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"锤子砸东西音效(0)"); let chuiziSpine = event.target.getChildByName("chuiziSpine") chuiziSpine.getComponent(sp.Skeleton).setAnimation(0,"chuizi",false) chuiziSpine.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{ chuiziSpine.getComponent(sp.Skeleton).clearTracks(); chuiziSpine.getComponent(sp.Skeleton).setToSetupPose(); event.target.setPosition(event.target.startPos) this.openTouchEvent1(event.target) callFu() }) } if(Common5.checkContainsNode(event.target.touchArea1,event.target) && !event.target.isArea1Finish){ event.target.isArea1Finish = true callFunc(event.target.callFunction1) return }else if(Common5.checkContainsNode(event.target.touchArea2,event.target) && !event.target.isArea2Finish){ event.target.isArea2Finish = true callFunc(event.target.callFunction2) return } }else if(event.target.name == "hanBao"){ if(event.target.touchArea.active && Common5.checkContainsNode(event.target.touchArea,event.target)){ this.closeTouchEvent(event.target) event.target.active = false event.target.callFunction && event.target.callFunction() }else{ event.target.setPosition(event.target.startPos) } return } }else if(this.gameId == 1205){ if(event.target.name == "chanZi"){ if(Common5.checkContainsNode(event.target.touchArea1,event.target) && !event.target.isArea1Finish){ event.target.isArea1Finish = true event.target.callFunction1() return }else if(Common5.checkContainsNode(event.target.touchArea2,event.target) && !event.target.isArea2Finish){ event.target.isArea2Finish = true event.target.callFunction2() return }else if(Common5.checkContainsNode(event.target.touchArea3,event.target) && !event.target.isArea3Finish){ event.target.isArea3Finish = true event.target.callFunction3() return }else if(Common5.checkContainsNode(event.target.touchArea4,event.target) && !event.target.isArea4Finish){ event.target.isArea4Finish = true event.target.callFunction4() return }else if(Common5.checkContainsNode(event.target.touchArea5,event.target)){ event.target.callFunction5() return }else{ let liyoutianSpine = this.mapNode.getChildByName('liyoutianSpine'); liyoutianSpine.getComponent(sp.Skeleton).setAnimation(0,"daichanzi",true) event.target.setPosition(event.target.startPos) event.target.opacity = 0 return } }else if(event.target.name == "beiZi"){ if(event.target.touchArea.active && Common5.checkContainsNode(event.target.touchArea,event.target)){ event.target.active = false event.target.callFunction() return }else{ event.target.opacity = 0 event.target.setPosition(event.target.startPos) let dasaoSpine = this.mapNode.getChildByName('dasaoSpine'); if(this.node["isChuangHuPoSui"]){ dasaoSpine.getComponent(sp.Skeleton).setAnimation(0,"nabeizifadou",true) }else{ dasaoSpine.getComponent(sp.Skeleton).setAnimation(0,"nabeizi",true) } return } } }else if(this.gameId == 1206){ //距离小判定为点击,大判定为拖动 if(event.target.name == "yiXiang"){ let dis = Common5.makeDistance(event.target.getPosition(),event.target.startPos) if(dis <= 5){ let chaNode = this.mapNode.getChildByName('chaDianNode').getChildByName('TaiShuYiXiang') this.findOnChaDian(chaNode) }else{ if(event.target.touchArea.active && Common5.checkContainsNode(event.target.touchArea,event.target)){ event.target.active = false event.target.callFunction() return }else{ event.target.setPosition(event.target.startPos) } } return }else if(event.target.name == "baDou"){ let dis = Common5.makeDistance(event.target.getPosition(),event.target.startPos) if(dis <= 5){ // let chaNode = this.mapNode.getChildByName('chaDianNode').getChildByName('BaDou') // this.findOnChaDian(chaNode) }else{ if(event.target.touchArea.active && Common5.checkContainsNode(event.target.touchArea,event.target)){ event.target.active = false event.target.callFunction() return }else{ event.target.setPosition(event.target.startPos) } } return } }else if(this.gameId == 1207){ if(event.target.name == "guaizhangSpine"){ if(Common5.checkContainsNode(event.target.touchArea1,event.target)){ event.target.callFunction1() return }else if(Common5.checkContainsNode(event.target.touchArea2,event.target)){ event.target.callFunction2() return }else if(Common5.checkContainsNode(event.target.touchArea3,event.target) && !event.target.isArea3Finish){ event.target.isArea3Finish = true event.target.callFunction3() return }else{ let laorenSpine = this.mapNode.getChildByName('laorenSpine'); laorenSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) event.target.setPosition(event.target.startPos) event.target.opacity = 0 return } } }else if(this.gameId == 1208){ if(event.target.name == "gaoGenXieNode"){ if(event.target.touchArea1 && Common5.checkContainsNode(event.target.touchArea1,event.target) && !event.target.isArea1Finish){ event.target.isArea1Finish = true event.target.callFunction1() return }else if(Common5.checkContainsNode(event.target.touchArea2,event.target) && !event.target.isArea2Finish){ event.target.isArea2Finish = true event.target.callFunction2() return }else{ let taishuSpine = this.mapNode.getChildByName('taishuSpine'); taishuSpine.getComponent(sp.Skeleton).setAnimation(0,"1daiji",true) event.target.setPosition(event.target.startPos) event.target.opacity = 0 return } }else if(event.target.name == "caiPiaoTouchArea"){ return }else{ if(event.target.touchArea.active && Common5.checkContainsNode(event.target.touchArea,event.target)){ event.target.active = false event.target.callFunction() return }else{ event.target.setPosition(event.target.startPos) } } }else if(this.gameId == 1210){ if(event.target.name == "hongZao" || event.target.name == "guaZi" || event.target.name == "guiYuan" || event.target.name == "huaSheng"){ let isFindArea = false for(var i=0;i<4;i++){ let guoPanArea = this.mapNode.getChildByName('guoPanArea'+i); if(Common5.checkContainsNode(guoPanArea,event.target)){ this.closeTouchEvent(event.target) event.target.setPosition(guoPanArea.getPosition()) event.target["posArea"] = i+1 isFindArea = true break } } if(!isFindArea){ event.target.setPosition(event.target.startPos) return } let hongZao = this.mapNode.getChildByName('hongZao'); let guaZi = this.mapNode.getChildByName('guaZi'); let guiYuan = this.mapNode.getChildByName('guiYuan'); let huaSheng = this.mapNode.getChildByName('huaSheng'); if(hongZao["posArea"] && huaSheng["posArea"] && guiYuan["posArea"] && guaZi["posArea"]){ if(hongZao["posArea"] == 1 && huaSheng["posArea"] == 2 && guiYuan["posArea"] == 3 && guaZi["posArea"] == 4){ this.gameInfo.ChaNode["ZaoShengGuiZi"].isCanTouch = true }else{ this.gameInfo.ChaNode["TuTeChan"].isCanTouch = true } } event.target.callFunction() return }else if(event.target.name == "zhengDuanShu" || event.target.name == "qianBaoNode"){ event.target.callFunction() return }else if(event.target.name == "shuaTong" || event.target.name == "jiaoDai" || event.target.name == "baiJiu"){ let nanShengSpine = this.mapNode.getChildByName('nanShengSpine'); if(nanShengSpine["spineStatus"] == "daiji"){ this.closeTouchEvent(event.target) event.target.active = false event.target.callFunction() }else{ event.target.setPosition(event.target.startPos) } return }else if(event.target.name == "shouJi"){ if(Common5.checkContainsNode(event.target.touchArea,event.target)) { this.closeTouchEvent(event.target) event.target.callFunction() }else{ event.target.setPosition(event.target.startPos) } return }else if(event.target.name == "suLiaoDai"){ let zhuangcaiSpine = this.mapNode.getChildByName('zhuangcaiSpine'); if(!zhuangcaiSpine["isRouCaiMiss"] && Common5.checkContainsNode(event.target.touchArea,event.target)) { event.target.active = false this.closeTouchEvent(event.target) event.target.callFunction() }else{ event.target.setPosition(event.target.startPos) } return } }else if(this.gameId == 1211){ if(event.target.name == "hongYiNv"){ let scene1 = this.mapNode.getChildByName('scene1'); let cheSpine = scene1.getChildByName('cheSpine'); if(cheSpine["clickTimes"] && cheSpine["clickTimes"] >= 5 && scene1.active && Common5.checkContainsNode(event.target.touchArea,event.target) ){ this.closeTouchEvent(event.target) event.target.active = false cheSpine.getComponent(sp.Skeleton).setAnimation(0,"ku",true) event.target.callFunction() this.gameInfo.ChaNode["FuJiaShiKuQi"].isCanTouch = true this.gameInfo.ChaNode["FuJiaShiKuQi"].bSwitch = true }else{ event.target.setPosition(event.target.startPos) } return } }else if(this.gameId == 1212){ if(event.target.name == "yehuSpine"){ if(Common5.checkContainsNode(event.target.touchArea,event.target) ){ this.closeTouchEvent(event.target) event.target.setPosition(event.target.touchArea) event.target.callFunction() }else{ event.target.setPosition(event.target.startPos) } return } }else if(this.gameId == 1213){ if(event.target.name == "saoZhou"){ if(Common5.checkContainsNode(event.target.touchArea1,event.target)){ event.target.callFunction1() return }else if(Common5.checkContainsNode(event.target.touchArea2,event.target)){ event.target.callFunction2() return }else if(Common5.checkContainsNode(event.target.touchArea3,event.target)){ event.target.callFunction3() return }else{ event.target.setPosition(event.target.startPos) return } }else if(event.target.name == "yiFu"){ if(Common5.checkContainsNode(event.target.touchArea1,event.target)){ event.target.callFunction1() return }else if(Common5.checkContainsNode(event.target.touchArea2,event.target)){ event.target.callFunction2() return }else{ event.target.setPosition(event.target.startPos) return } } }else if(this.gameId == 1302){ if(event.target.name == "红布"){ if(event.target.touchArea.active && !Common5.checkIntersectsBox(event.target.touchArea,event.target)){ this.closeTouchEvent(event.target) event.target.active = false event.target.callFunction && event.target.callFunction() }else{ event.target.setPosition(event.target.startPos) } return }else if(event.target.name == "chuziNode"){ let callFunc = (callFu, spineName)=>{ this.closeTouchEvent(event.target) //Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"锤子砸东西音效(0)"); let chuiziSpine = this.mapNode.getChildByName(spineName); chuiziSpine.getComponent(sp.Skeleton).setAnimation(0,"qiao2",false) if(spineName =='chuziSpine3'){ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"锤墙"); } this.scheduleOnce(()=>{ event.target.active = true event.target.setPosition(event.target.startPos) this.openTouchEvent1(event.target) callFu() },1.5) } if(Common5.checkContainsNode(event.target.touchArea1,event.target) && !event.target.isArea1Finish){ event.target.active = false event.target.isArea1Finish = true callFunc(event.target.callFunction1,'chuziSpine1') return }else if(Common5.checkContainsNode(event.target.touchArea2,event.target) && !event.target.isArea2Finish){ event.target.isArea2Finish = true event.target.active = false callFunc(event.target.callFunction2,'chuziSpine2') return }else if(Common5.checkContainsNode(event.target.touchArea3,event.target) && !event.target.isArea3Finish){ event.target.isArea3Finish = true event.target.active = false callFunc(event.target.callFunction3,'chuziSpine3') return }else if(Common5.checkContainsNode(event.target.touchArea4,event.target) && !event.target.isArea4Finish){ event.target.isArea4Finish = true event.target.active = false callFunc(event.target.callFunction4,'chuziSpine3') return } } } if(event.target.touchArea && Common5.checkContainsNode(event.target.touchArea,event.target)){ this.closeTouchEvent(event.target) event.target.active = false event.target.endNode && (event.target.endNode.active = true) event.target.bindChaNodeInfo && (event.target.bindChaNodeInfo.isCanTouch = true) event.target.callFunction && event.target.callFunction() }else{ event.target.setPosition(event.target.startPos) } } findChaDianSpecialLogic(curNode,answerIcon){ if(this.gameId == 1201){ this.node["allMoney"] -= this.gameInfo.ChaNode[curNode.name].money; this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"]+"亿" answerIcon.getChildByName("label").getComponent(cc.Label).string = this.gameInfo.ChaNode[curNode.name].money+"亿" let toolTipnode = cc.instantiate(this.node.getChildByName("msg").getChildByName("contentStr")) ; toolTipnode.getComponent(cc.Label).string = "-"+this.gameInfo.ChaNode[curNode.name].money + "亿"; toolTipnode.active = true; this.node.getChildByName("msg").addChild(toolTipnode) cc.tween(toolTipnode).to(1,{y:100}).call(()=>{ toolTipnode.removeFromParent() }).start(); }else if(this.gameId == 1202){ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+this.gameInfo.ChaNode[curNode.name].sound); this.node["allMoney"] -= this.gameInfo.ChaNode[curNode.name].money; this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"]+"" answerIcon.getChildByName("label").getComponent(cc.Label).string = this.gameInfo.ChaNode[curNode.name].money+"" let toolTipnode = cc.instantiate(this.node.getChildByName("msg").getChildByName("contentStr")) ; toolTipnode.getComponent(cc.Label).string = "-"+this.gameInfo.ChaNode[curNode.name].money + ""; toolTipnode.active = true; this.node.getChildByName("msg").addChild(toolTipnode) cc.tween(toolTipnode).to(1,{y:100}).call(()=>{ toolTipnode.removeFromParent() }).start(); let bindNodeName = this.gameInfo.ChaNode[curNode.name].bindNodeName if(bindNodeName){ this.mapNode.getChildByName(bindNodeName).active = false } }else if(this.gameId == 1203){ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+this.gameInfo.ChaNode[curNode.name].sound); this.node["allMoney"] += this.gameInfo.ChaNode[curNode.name].money; this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = Common5.formatNumber(this.node["allMoney"]) answerIcon.getChildByName("label").getComponent(cc.Label).string = Common5.formatNumber(this.gameInfo.ChaNode[curNode.name].money) let toolTipnode = cc.instantiate(this.node.getChildByName("msg").getChildByName("contentStr")) ; toolTipnode.getComponent(cc.Label).string = "+"+Common5.formatNumber(this.gameInfo.ChaNode[curNode.name].money) toolTipnode.active = true; this.node.getChildByName("msg").addChild(toolTipnode) cc.tween(toolTipnode).to(1,{y:100}).call(()=>{ toolTipnode.removeFromParent() }).start(); let xiazhuSpine = this.mapNode.getChildByName("xiazhuSpine") xiazhuSpine.getComponent(sp.Skeleton).setAnimation(0,"xiezi",false) this.node.stopAllActions() cc.tween(this.node) .delay(1.5) .call(()=>{ xiazhuSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) }) .start() }else if(this.gameId == 1204){ this.node["dialogFunc"](this.mapNode.getChildByName('qiPaoYou'),this.gameInfo.ChaNode[curNode.name].sound1,this.mapNode.getChildByName('qiPaoZuo'),this.gameInfo.ChaNode[curNode.name].sound2,true) this.node["allMoney"] -= this.gameInfo.ChaNode[curNode.name].money; this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"]+"h" answerIcon.getChildByName("label").getComponent(cc.Label).string = this.gameInfo.ChaNode[curNode.name].money+"h" let toolTipnode = cc.instantiate(this.node.getChildByName("msg").getChildByName("contentStr")) ; toolTipnode.getComponent(cc.Label).string = "-"+this.gameInfo.ChaNode[curNode.name].money+"h" toolTipnode.active = true; this.node.getChildByName("msg").addChild(toolTipnode) cc.tween(toolTipnode).to(1,{y:100}).call(()=>{ toolTipnode.removeFromParent() }).start(); }else if(this.gameId == 1205){ this.node["dialogFunc2"](this.mapNode.getChildByName('qiPaoZuo'),this.gameInfo.ChaNode[curNode.name].sound) this.node["allMoney"] -= this.gameInfo.ChaNode[curNode.name].money; this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"] answerIcon.getChildByName("label").getComponent(cc.Label).string = this.gameInfo.ChaNode[curNode.name].money let toolTipnode = cc.instantiate(this.node.getChildByName("msg").getChildByName("contentStr")) ; toolTipnode.getComponent(cc.Label).string = "-" + this.gameInfo.ChaNode[curNode.name].money toolTipnode.active = true; this.node.getChildByName("msg").addChild(toolTipnode) cc.tween(toolTipnode).to(1,{y:100}).call(()=>{ toolTipnode.removeFromParent() }).start(); let bindNodeName = this.gameInfo.ChaNode[curNode.name].bindNodeName if(bindNodeName){ this.mapNode.getChildByName(bindNodeName).active = false } if(curNode.name == "JinDan"){ let maTong = this.mapNode.getChildByName('maTong'); let matongSpine = maTong.getChildByName('matongSpine'); matongSpine.getComponent(sp.Skeleton).setAnimation(0,"meidan",true) } }else if(this.gameId == 1206){ this.node["dialogFunc1206"](this.gameInfo.ChaNode[curNode.name].sound1,this.gameInfo.ChaNode[curNode.name].sound2,this.gameInfo.ChaNode[curNode.name].person1,this.gameInfo.ChaNode[curNode.name].person2) this.node["allMoney"] -= this.gameInfo.ChaNode[curNode.name].money; this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"] answerIcon.getChildByName("label").getComponent(cc.Label).string = this.gameInfo.ChaNode[curNode.name].money let toolTipnode = cc.instantiate(this.node.getChildByName("msg").getChildByName("contentStr")) ; toolTipnode.getComponent(cc.Label).string = "-" + this.gameInfo.ChaNode[curNode.name].money toolTipnode.active = true; this.node.getChildByName("msg").addChild(toolTipnode) cc.tween(toolTipnode).to(1,{y:100}).call(()=>{ toolTipnode.removeFromParent() }).start(); let bindNodeName = this.gameInfo.ChaNode[curNode.name].bindNodeName if(bindNodeName){ this.mapNode.getChildByName(bindNodeName).active = false } if(curNode.name == "MuDi" || curNode.name == "ShouYi"){ let dasaoSpine = this.mapNode.getChildByName('dasaoSpine'); let gaoqiqiangSpine = this.mapNode.getChildByName('gaoqiqiangSpine'); cc.tween(this.mapNode) .delay(2.8) .call(()=>{ dasaoSpine.getComponent(sp.Skeleton).setAnimation(0,"shanbazhang",false) Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"扇巴掌"); }) .delay(0.36) .call(()=>{ gaoqiqiangSpine.getComponent(sp.Skeleton).setAnimation(0,"beishan",false) }) .delay(0.3) .call(()=>{ gaoqiqiangSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) dasaoSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) }) .start() } }else if(this.gameId == 1207){ this.node["allMoney"] += this.gameInfo.ChaNode[curNode.name].money; this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"] answerIcon.getChildByName("label").getComponent(cc.Label).string = this.gameInfo.ChaNode[curNode.name].money let toolTipnode = cc.instantiate(this.node.getChildByName("msg").getChildByName("contentStr")) ; toolTipnode.getComponent(cc.Label).string = "+" + this.gameInfo.ChaNode[curNode.name].money toolTipnode.active = true; this.node.getChildByName("msg").addChild(toolTipnode) cc.tween(toolTipnode).to(1,{y:100}).call(()=>{ toolTipnode.removeFromParent() }).start(); let bindNodeName = this.gameInfo.ChaNode[curNode.name].bindNodeName if(bindNodeName){ this.mapNode.getChildByName(bindNodeName).active = false } if(curNode.name == "SiFangQian" || curNode.name == "YouXiZhangHao"){ let nvshengSpine = this.mapNode.getChildByName('nvshengSpine'); let nanshengSpine = this.mapNode.getChildByName('nanshengSpine'); let nanshengshentiSpine = this.mapNode.getChildByName('nanshengshentiSpine'); let nanshengshouSpine = this.mapNode.getChildByName('nanshengshouSpine'); cc.tween(this.mapNode) .delay(0.3) .call(()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"扇耳光"); nvshengSpine.getComponent(sp.Skeleton).setAnimation(0,"shanbazhang",false) }) .delay(0.53) .call(()=>{ this.node["dialogFunc1207"](this.gameInfo.ChaNode[curNode.name].sound,this.gameInfo.ChaNode[curNode.name].sound2,this.gameInfo.ChaNode[curNode.name].person,this.gameInfo.ChaNode[curNode.name].person2) nanshengSpine.active = true nanshengshentiSpine.active = false nanshengshouSpine.active = false nanshengSpine.getComponent(sp.Skeleton).setAnimation(0,"beishan",false) }) .delay(0.9) .call(()=>{ nanshengSpine.active = false nanshengshentiSpine.active = true nanshengshouSpine.active = true nanshengshentiSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) nanshengshouSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) nvshengSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) }) .start() }else{ this.node["dialogFunc1207"](this.gameInfo.ChaNode[curNode.name].sound,this.gameInfo.ChaNode[curNode.name].sound2,this.gameInfo.ChaNode[curNode.name].person,this.gameInfo.ChaNode[curNode.name].person2) if(curNode.name == "DianNao"){ this.gameInfo.FeiChanDian["dnKaiGuanTouchArea"].isCanTouch = false } } }else if(this.gameId == 1208){ this.node["dialogFunc1208"](this.gameInfo.ChaNode[curNode.name].sound,this.gameInfo.ChaNode[curNode.name].sound2,this.gameInfo.ChaNode[curNode.name].person,this.gameInfo.ChaNode[curNode.name].person2) this.node["allMoney"] -= this.gameInfo.ChaNode[curNode.name].money; this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"] answerIcon.getChildByName("label").getComponent(cc.Label).string = this.gameInfo.ChaNode[curNode.name].money let toolTipnode = cc.instantiate(this.node.getChildByName("msg").getChildByName("contentStr")) ; toolTipnode.getComponent(cc.Label).string = "-" + this.gameInfo.ChaNode[curNode.name].money toolTipnode.active = true; this.node.getChildByName("msg").addChild(toolTipnode) cc.tween(toolTipnode).to(1,{y:100}).call(()=>{ toolTipnode.removeFromParent() }).start(); let bindNodeName = this.gameInfo.ChaNode[curNode.name].bindNodeName if(bindNodeName){ this.mapNode.getChildByName(bindNodeName).active = false } }else if(this.gameId == 1209){ this.node["dialogFunc1209"](this.gameInfo.ChaNode[curNode.name].sound,this.gameInfo.ChaNode[curNode.name].sound2,this.gameInfo.ChaNode[curNode.name].person,this.gameInfo.ChaNode[curNode.name].person2) this.node["allMoney"] += this.gameInfo.ChaNode[curNode.name].money; this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"]+"亿" answerIcon.getChildByName("label").getComponent(cc.Label).string = this.gameInfo.ChaNode[curNode.name].money let toolTipnode = cc.instantiate(this.node.getChildByName("msg").getChildByName("contentStr")) ; toolTipnode.getComponent(cc.Label).string = "+" + this.gameInfo.ChaNode[curNode.name].money+"亿" toolTipnode.active = true; this.node.getChildByName("msg").addChild(toolTipnode) cc.tween(toolTipnode).to(1,{y:100}).call(()=>{ toolTipnode.removeFromParent() }).start(); let bindNodeName = this.gameInfo.ChaNode[curNode.name].bindNodeName if(bindNodeName){ this.mapNode.getChildByName(bindNodeName).active = false } if(curNode.name == "ZuanShiYa"){ let nanyiSpine = this.mapNode.getChildByName("nanyiSpine") nanyiSpine.getComponent(sp.Skeleton).setAnimation(0,"ditoudaiji",true) }else if(curNode.name == "ShouGouGongSi"){ this.node["bShowGou"] = true let nanerSpine = this.mapNode.getChildByName("nanerSpine") nanerSpine.stopAllActions() cc.tween(nanerSpine) .call(()=>{ nanerSpine.getComponent(sp.Skeleton).setAnimation(0,"fennu",false) }) .delay(1.5) .call(()=>{ nanerSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) }) .start() } this.node["bChaDian"] = true let nvSpine = this.mapNode.getChildByName("nvSpine") nvSpine.stopAllActions() cc.tween(nvSpine) .call(()=>{ nvSpine.getComponent(sp.Skeleton).setAnimation(0,"aimu",false) }) .delay(1.5) .call(()=>{ nvSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) }) .start() }else if(this.gameId == 1210){ this.node["dialogFunc1210"](this.gameInfo.ChaNode[curNode.name].sound,this.gameInfo.ChaNode[curNode.name].sound2,this.gameInfo.ChaNode[curNode.name].person,this.gameInfo.ChaNode[curNode.name].person2) this.node["allMoney"] -= this.gameInfo.ChaNode[curNode.name].money; this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"] answerIcon.getChildByName("label").getComponent(cc.Label).string = this.gameInfo.ChaNode[curNode.name].money let toolTipnode = cc.instantiate(this.node.getChildByName("msg").getChildByName("contentStr")) ; if(this.gameInfo.ChaNode[curNode.name].money < 0){ toolTipnode.getComponent(cc.Label).string = "+" + (-this.gameInfo.ChaNode[curNode.name].money) }else{ toolTipnode.getComponent(cc.Label).string = "-" + this.gameInfo.ChaNode[curNode.name].money } toolTipnode.active = true; this.node.getChildByName("msg").addChild(toolTipnode) cc.tween(toolTipnode).to(1,{y:100}).call(()=>{ toolTipnode.removeFromParent() }).start(); let bindNodeName = this.gameInfo.ChaNode[curNode.name].bindNodeName if(bindNodeName){ this.mapNode.getChildByName(bindNodeName).active = false } if(curNode.name == "ChiYiGeCai"){ let zhuangcaiSpine = this.mapNode.getChildByName('zhuangcaiSpine'); zhuangcaiSpine.getComponent(sp.Skeleton).setAnimation(0,"none3",false) zhuangcaiSpine["isRouCaiMiss"] = true }else if(curNode.name == "ZiXuanYiPing" || curNode.name == "JiaoDai" || curNode.name == "ChangFenShouGe"){ let nanShengSpine = this.mapNode.getChildByName('nanShengSpine'); nanShengSpine.getComponent(sp.Skeleton).setAnimation(0,"kongshoudaiji",true) nanShengSpine["spineStatus"] = "daiji" }else if(curNode.name == "ZaoShengGuiZi" || curNode.name == "TuTeChan"){ let hongZao = this.mapNode.getChildByName('hongZao'); let guaZi = this.mapNode.getChildByName('guaZi'); let guiYuan = this.mapNode.getChildByName('guiYuan'); let huaSheng = this.mapNode.getChildByName('huaSheng'); hongZao.active = false guaZi.active = false guiYuan.active = false huaSheng.active = false } }else if(this.gameId == 1211){ this.node["dialogFunc1211"](this.gameInfo.ChaNode[curNode.name].sound,this.gameInfo.ChaNode[curNode.name].person) this.node["allMoney"] -= this.gameInfo.ChaNode[curNode.name].money; this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"]+"亿" answerIcon.getChildByName("label").getComponent(cc.Label).string = this.gameInfo.ChaNode[curNode.name].money+"亿" let toolTipnode = cc.instantiate(this.node.getChildByName("msg").getChildByName("contentStr")) ; toolTipnode.getComponent(cc.Label).string = "-" + this.gameInfo.ChaNode[curNode.name].money + "亿" toolTipnode.active = true; this.node.getChildByName("msg").addChild(toolTipnode) cc.tween(toolTipnode).to(1,{y:100}).call(()=>{ toolTipnode.removeFromParent() }).start(); let jiedaiSpine = this.mapNode.getChildByName('jiedaiSpine'); jiedaiSpine.getComponent(sp.Skeleton).setAnimation(0,"cahan",false) jiedaiSpine.stopAllActions() cc.tween(jiedaiSpine) .delay(3) .call(()=>{ jiedaiSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) }) .start() if(curNode.name == "LinShiGong"){ let zhengJianFangDa = this.mapNode.getChildByName('zhengJianFangDa'); zhengJianFangDa.active = false }else if(curNode.name == "LunGuDuanLie1" || curNode.name == "LunGuDuanLie2"){ this.gameInfo.ChaNode["LunGuDuanLie1"].isFindOut = true this.gameInfo.ChaNode["LunGuDuanLie2"].isFindOut = true }else if(curNode.name == "DiaoLuoDeCheDeng1" || curNode.name == "DiaoLuoDeCheDeng2"){ this.gameInfo.ChaNode["DiaoLuoDeCheDeng1"].isFindOut = true this.gameInfo.ChaNode["DiaoLuoDeCheDeng2"].isFindOut = true }else if(curNode.name == "FuJiaShiKuQi"){ let scene1 = this.mapNode.getChildByName('scene1'); let cheSpine = scene1.getChildByName('cheSpine'); cheSpine.getComponent(sp.Skeleton).setAnimation(0,"loushui",false) cc.tween(cheSpine) .delay(2) .call(()=>{ this.gameInfo.ChaNode["PaoShuiChe"].isCanTouch = true this.gameInfo.ChaNode["PaoShuiChe"].bSwitch = true }) .start() } }else if(this.gameId == 1212){ this.node["dialogFunc1212"](this.gameInfo.ChaNode[curNode.name].sound,this.gameInfo.ChaNode[curNode.name].sound2,this.gameInfo.ChaNode[curNode.name].person,this.gameInfo.ChaNode[curNode.name].person2) this.node["allMoney"] += this.gameInfo.ChaNode[curNode.name].money; this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"]+"%" answerIcon.getChildByName("label").getComponent(cc.Label).string = this.gameInfo.ChaNode[curNode.name].money+"%" let toolTipnode = cc.instantiate(this.node.getChildByName("msg").getChildByName("contentStr")) ; toolTipnode.getComponent(cc.Label).string = "+" + this.gameInfo.ChaNode[curNode.name].money + "%" toolTipnode.active = true; this.node.getChildByName("msg").addChild(toolTipnode) cc.tween(toolTipnode).to(1,{y:100}).call(()=>{ toolTipnode.removeFromParent() }).start(); }else if(this.gameId == 1213){ this.node["dialogFunc1213"](this.gameInfo.ChaNode[curNode.name].sound,this.gameInfo.ChaNode[curNode.name].sound2,this.gameInfo.ChaNode[curNode.name].person,this.gameInfo.ChaNode[curNode.name].person2) this.node["allMoney"] += this.gameInfo.ChaNode[curNode.name].money; this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"] answerIcon.getChildByName("label").getComponent(cc.Label).string = this.gameInfo.ChaNode[curNode.name].money let toolTipnode = cc.instantiate(this.node.getChildByName("msg").getChildByName("contentStr")) ; if(this.gameInfo.ChaNode[curNode.name].money >0){ toolTipnode.getComponent(cc.Label).string = "+" + this.gameInfo.ChaNode[curNode.name].money }else{ toolTipnode.getComponent(cc.Label).string = "" + this.gameInfo.ChaNode[curNode.name].money } toolTipnode.active = true; this.node.getChildByName("msg").addChild(toolTipnode) cc.tween(toolTipnode).to(1,{y:100}).call(()=>{ toolTipnode.removeFromParent() }).start(); }else if(this.gameId == 1302){ this.findChadian1302(curNode,answerIcon) } } specialNodeMoveEvent1201(){ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"开头语音"); this.node["allMoney"] = 50000 this.node.getChildByName("msg").active = true this.node.getChildByName("msg").getChildByName("title").getComponent(cc.Label).string = "功德币:" this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"]+"亿" let huoyanSpine = this.mapNode.getChildByName('huoyanSpine') let huoPenTouchArea = huoyanSpine.getChildByName('huoPenTouchArea'); //打火机 let daHuoJi = this.mapNode.getChildByName('daHuoJi'); //方便面 let fangBianMian = this.mapNode.getChildByName('fangBianMian'); //电脑 let dianNao = this.mapNode.getChildByName('dianNao'); //纸钱 let zhiQian = this.mapNode.getChildByName('zhiQian'); //肾宝片 let shenBao = this.mapNode.getChildByName('shenBao'); //空调 let kongTiao = this.mapNode.getChildByName('kongTiao'); //辣条 let laTiao = this.mapNode.getChildByName('laTiao'); //音效 let yinXiang = this.mapNode.getChildByName('yinXiang'); //动物世界 let dongWuShiJie = this.mapNode.getChildByName('dongWuShiJie'); //鬼差证 let guiChaiZheng = this.mapNode.getChildByName('guiChaiZheng') //胡椒 let huJiao = this.mapNode.getChildByName("huJiao") //手机 let shouJi = this.mapNode.getChildByName("shouJi") //烟 let yan = this.mapNode.getChildByName("yan") //房产证 let fangChanZheng = this.mapNode.getChildByName("fangChanZheng") //咖啡 let kaFei = this.mapNode.getChildByName("kaFei") let commonFunc = (chaNode)=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+this.gameInfo.ChaNode[chaNode.name].sound); huoyanSpine.getComponent(sp.Skeleton).setAnimation(0,"dahuo",false) this.scheduleOnce(()=>{ huoyanSpine.getComponent(sp.Skeleton).setAnimation(0,"xiaohuo",true) },1.2) } let daHuoJiAttrs = { startPos:daHuoJi.getPosition(), touchArea:huoPenTouchArea, callFunction: ()=>{ // Common5.playMusicCustom('WordGame',this.gameInfo.PrefabInfo.soundurl+"爆燃") Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"爆燃"); daHuoJi["bSwitch"] = true huoyanSpine.getComponent(sp.Skeleton).setAnimation(0,"xiaohuo",true) } } let fangBianMianAttrs = { startPos:fangBianMian.getPosition(), touchArea:huoPenTouchArea, bindNode:daHuoJi, callFunction: ()=>{ let chaNode = this.mapNode.getChildByName('chaDianNode').getChildByName('FangBianMian') commonFunc(chaNode) this.findOnChaDian(chaNode) } } let dianNaoAttrs = { startPos:dianNao.getPosition(), touchArea:huoPenTouchArea, bindNode:daHuoJi, callFunction: ()=>{ let chaNode = this.mapNode.getChildByName('chaDianNode').getChildByName('DianNao') commonFunc(chaNode) this.findOnChaDian(chaNode) } } let zhiQianAttrs = { startPos:zhiQian.getPosition(), touchArea:huoPenTouchArea, bindNode:daHuoJi, callFunction: ()=>{ let chaNode = this.mapNode.getChildByName('chaDianNode').getChildByName('ZhiQian') commonFunc(chaNode) this.findOnChaDian(chaNode) } } let shenBaoAttrs = { startPos:shenBao.getPosition(), touchArea:huoPenTouchArea, bindNode:daHuoJi, callFunction: ()=>{ let chaNode = this.mapNode.getChildByName('chaDianNode').getChildByName('ShenBaoPian') commonFunc(chaNode) this.findOnChaDian(chaNode) } } let kongTiaoAttrs = { startPos:kongTiao.getPosition(), touchArea:huoPenTouchArea, bindNode:daHuoJi, callFunction: ()=>{ let chaNode = this.mapNode.getChildByName('chaDianNode').getChildByName('KongTiao') commonFunc(chaNode) this.findOnChaDian(chaNode) } } let laTiaoAttrs = { startPos:laTiao.getPosition(), touchArea:huoPenTouchArea, bindNode:daHuoJi, callFunction: ()=>{ let chaNode = this.mapNode.getChildByName('chaDianNode').getChildByName('LaTiao') commonFunc(chaNode) this.findOnChaDian(chaNode) } } let yinXiangAttrs = { startPos:yinXiang.getPosition(), touchArea:huoPenTouchArea, bindNode:daHuoJi, callFunction: ()=>{ let chaNode = this.mapNode.getChildByName('chaDianNode').getChildByName('YinXiang') commonFunc(chaNode) this.findOnChaDian(chaNode) Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"小苹果"); this.mapNode.getChildByName('sudaqiang').getComponent(sp.Skeleton).setAnimation(0,"tiaowu1",true) this.scheduleOnce(()=>{ this.mapNode.getChildByName('sudaqiang').getComponent(sp.Skeleton).setAnimation(0,"daiji",true) },7) } } let dongWuShiJieAttrs = { startPos:dongWuShiJie.getPosition(), touchArea:this.mapNode.getChildByName('feiChaDianNode').getChildByName('chuangHuTouchArea'), bindNode:this.mapNode.getChildByName('feiChaDianNode').getChildByName('chuangHuTouchArea'), callFunction: ()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"春天到了"); Common5.setNodeToTargetPos(guiChaiZheng,this.mapNode.getChildByName('niuTou')) guiChaiZheng.active = true guiChaiZheng.scale = 0 cc.tween(guiChaiZheng) .delay(2) .call(()=>{ this.mapNode.getChildByName('niuTou').active = false }) .to(0.4,{x:190,y:-630,scale:1}) .start() } } let guiChaiZhengAttrs = { startPos:guiChaiZheng.getPosition(), touchArea:huoPenTouchArea, bindNode:daHuoJi, callFunction: ()=>{ let chaNode = this.mapNode.getChildByName('chaDianNode').getChildByName('GuiChaiZheng') commonFunc(chaNode) this.findOnChaDian(chaNode) } } let huJiaoAttrs = { startPos:huJiao.getPosition(), touchArea:huoPenTouchArea, bindNode:daHuoJi, callFunction: ()=>{ let chaNode = this.mapNode.getChildByName('chaDianNode').getChildByName('HuJiao') commonFunc(chaNode) this.findOnChaDian(chaNode) } } let shouJiAttrs = { startPos:shouJi.getPosition(), touchArea:huoPenTouchArea, bindNode:daHuoJi, callFunction: ()=>{ let chaNode = this.mapNode.getChildByName('chaDianNode').getChildByName('ShouJi') commonFunc(chaNode) this.findOnChaDian(chaNode) } } let yanAttrs = { startPos:yan.getPosition(), touchArea:huoPenTouchArea, callFunction: ()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"香烟"); } } let fangChanZhengAttrs = { startPos:fangChanZheng.getPosition(), touchArea:huoPenTouchArea, callFunction: ()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"房产证"); } } let kaFeiAttrs = { startPos:kaFei.getPosition(), touchArea:huoPenTouchArea, callFunction: ()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"咖啡"); } } this.openTouchEvent(daHuoJi,daHuoJiAttrs) this.openTouchEvent(fangBianMian,fangBianMianAttrs) this.openTouchEvent(dianNao,dianNaoAttrs) this.openTouchEvent(zhiQian,zhiQianAttrs) this.openTouchEvent(shenBao,shenBaoAttrs) this.openTouchEvent(kongTiao,kongTiaoAttrs) this.openTouchEvent(laTiao,laTiaoAttrs) this.openTouchEvent(yinXiang,yinXiangAttrs) this.openTouchEvent(dongWuShiJie,dongWuShiJieAttrs) this.openTouchEvent(guiChaiZheng,guiChaiZhengAttrs) this.openTouchEvent(huJiao,huJiaoAttrs) this.openTouchEvent(shouJi,shouJiAttrs) this.openTouchEvent(yan,yanAttrs) this.openTouchEvent(fangChanZheng,fangChanZhengAttrs) this.openTouchEvent(kaFei,kaFeiAttrs) } specialNodeMoveEvent1202(){ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"我给高老板送了这么多次鱼(0)"); this.node["allMoney"] = this.gameInfo.PrefabInfo.startMoney this.node.getChildByName("msg").active = true this.node.getChildByName("msg").getChildByName("title").getComponent(cc.Label).string = "佣金费:" this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"]+"" //人影 let renYing = this.mapNode.getChildByName('renYing'); //高启强 let gaoQiQiang = this.mapNode.getChildByName('gaoQiQiang'); //大嫂 let daSao = this.mapNode.getChildByName('daSao'); //黑蒜 let heiSuan = this.mapNode.getChildByName('heiSuan'); //佣金 let yongJin = this.mapNode.getChildByName('yongJin'); let heiSuanAttrs = { startPos:heiSuan.getPosition(), touchArea:daSao, callFunction: ()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"大嫂呕吐音效(0)"); daSao.getChildByName("dasaoSpine").getComponent(sp.Skeleton).setAnimation(0,"tu",false) this.scheduleOnce(()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"老婆,你没事吧(0)"); cc.tween(gaoQiQiang) .to(0.4,{y:400}) .start() let zuanJie = this.mapNode.getChildByName('zuanJie'); zuanJie.active = true this.gameInfo.ChaNode["ZuanJie"].isCanTouch = true daSao.getChildByName("dasaoSpine").getComponent(sp.Skeleton).setAnimation(0,"daijiku",true) let daSaoAttrs = { startPos:daSao.getPosition(), touchArea:gaoQiQiang, callFunction: ()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"等我东山再起房里的东西都归你了(0)"); gaoQiQiang.active = false renYing.active = true cc.tween(renYing) .delay(0.5) .by(2,{x:600}) .call(()=>{ yongJin.active = true yongJin.scale = 0.3 cc.tween(yongJin) .to(0.6,{x:-208,y:-575,scale:1}) .call(()=>{ this.gameInfo.ChaNode["YongJin"].isCanTouch = true }) .start() }) .start() Common5.setNodeToTargetPos(yongJin,gaoQiQiang) } } this.openTouchEvent(daSao,daSaoAttrs) },1) } } this.openTouchEvent(heiSuan,heiSuanAttrs) //床 let chuangTouchArea = this.mapNode.getChildByName('chuangTouchArea'); let qingShu = this.mapNode.getChildByName('qingShu'); let poDiBan = this.mapNode.getChildByName('poDiBan'); let chuang = this.mapNode.getChildByName('chuang'); let poChuang = this.mapNode.getChildByName('poChuang'); let dongYu = this.mapNode.getChildByName('dongYu'); //地砖 let diZhuan = this.mapNode.getChildByName('diZhuan'); //锤子 let chuiZi = this.mapNode.getChildByName('chuiZi'); let chuiZiAttrs = { startPos:chuiZi.getPosition(), touchArea1:chuangTouchArea, touchArea2:diZhuan, callFunction1: ()=>{ chuang.active = false poChuang.active = true dongYu.active = true this.gameInfo.ChaNode["DongYu"].isCanTouch = true }, callFunction2: ()=>{ diZhuan.active = false qingShu.active = true poDiBan.active = true this.gameInfo.ChaNode["QingShu"].isCanTouch = true } } this.openTouchEvent(chuiZi,chuiZiAttrs) //八音盒 let baYinHe = this.mapNode.getChildByName('baYinHe'); //汉堡 let hanBao = this.mapNode.getChildByName('hanBao'); //老八汉堡 let laBaHanBao = this.mapNode.getChildByName('laBaHanBao'); let hanBaoAttrs = { startPos:hanBao.getPosition(), touchArea:baYinHe, callFunction: ()=>{ baYinHe.active = false laBaHanBao.active = true this.gameInfo.ChaNode["MiZhiXiaoHanBao"].isCanTouch = true this.gameInfo.ChaNode["BaYinHeWanJu"].isCanTouch = false } } this.openTouchEvent(hanBao,hanBaoAttrs) } specialNodeMoveEvent1203(){ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"开头语音"); this.node["allMoney"] = this.gameInfo.PrefabInfo.startMoney this.node.getChildByName("msg").active = true this.node.getChildByName("msg").getChildByName("title").getComponent(cc.Label).string = "房价:" this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = Common5.formatNumber(this.node["allMoney"]) //黄油漆 let huangYouQi = this.mapNode.getChildByName('huangYouQi'); //马桶 let maTong = this.mapNode.getChildByName('maTong'); //金马桶 let jinMaTong = this.mapNode.getChildByName('jinMaTong'); let huangYouQiAttrs = { startPos:huangYouQi.getPosition(), touchArea:maTong, callFunction: ()=>{ maTong.active = false jinMaTong.active = true this.gameInfo.ChaNode["HuangJinMaTong"].isCanTouch = true } } this.openTouchEvent(huangYouQi,huangYouQiAttrs) //菜刀 let caiDao = this.mapNode.getChildByName('caiDao'); let daoSpine = this.mapNode.getChildByName('daoSpine'); //水管 let shuiGuan = this.mapNode.getChildByName('shuiGuan'); //破水管 let poShuiGuan = this.mapNode.getChildByName('poShuiGuan'); //房间水 let fangJianShui = this.mapNode.getChildByName('fangJianShui'); let caiDaoAttrs = { startPos:caiDao.getPosition(), touchArea:shuiGuan, callFunction: ()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"刀砍管路(0)"); daoSpine.active = true daoSpine.getComponent(sp.Skeleton).setAnimation(0,"animation",false) daoSpine.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{ this.gameInfo.ChaNode["TianRanYongChi"].isCanTouch = true shuiGuan.active = false poShuiGuan.active = true fangJianShui.active = true fangJianShui.opacity = 0 cc.tween(fangJianShui) .to(1.5,{opacity:255}) .start() daoSpine.active = false }) } } this.openTouchEvent(caiDao,caiDaoAttrs) //狗衣服 let gouYiFu = this.mapNode.getChildByName('gouYiFu'); //狗身上衣服 let gouShenShangYi = this.mapNode.getChildByName('gouShenShangYi'); //狗 let gou = this.mapNode.getChildByName('gou'); let gouYiFuAttrs = { startPos:gouYiFu.getPosition(), touchArea:gou, callFunction: ()=>{ gouShenShangYi.active = true this.gameInfo.ChaNode["AnBaoQuan"].isCanTouch = true } } this.openTouchEvent(gouYiFu,gouYiFuAttrs) //剪刀 let jianDao = this.mapNode.getChildByName('jianDao'); //盆栽 let penZai = this.mapNode.getChildByName('penZai'); let jianshuzhiSpine = penZai.getChildByName('jianshuzhiSpine'); let jianDaoAttrs = { startPos:jianDao.getPosition(), touchArea:penZai, callFunction: ()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"剪子修剪盆栽(0)"); jianshuzhiSpine.getComponent(sp.Skeleton).setAnimation(0,"jianshuzhi",false) jianshuzhiSpine.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{ this.gameInfo.ChaNode["PenZai"].isCanTouch = true }) } } this.openTouchEvent(jianDao,jianDaoAttrs) //螺丝刀 let luoSiDao = this.mapNode.getChildByName('luoSiDao'); //螺丝 let ningLuoSiSpine = this.mapNode.getChildByName('ningLuoSiSpine'); //床 let chuangSpine = this.mapNode.getChildByName('chuangSpine'); let luoSiDaoAttrs = { startPos:luoSiDao.getPosition(), touchArea:ningLuoSiSpine, callFunction: ()=>{ ningLuoSiSpine.getComponent(sp.Skeleton).setAnimation(0,"animation",false) ningLuoSiSpine.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"床摇的声音(0)"); this.gameInfo.ChaNode["YaoYaoChuang"].isCanTouch = true chuangSpine.getComponent(sp.Skeleton).setAnimation(0,"animation",true) }) } } this.openTouchEvent(luoSiDao,luoSiDaoAttrs) //砖头 let zhuanTou = this.mapNode.getChildByName('zhuanTou'); //电视机 let dianShiJi = this.mapNode.getChildByName('dianShiJi'); //电视机 let dianshijiSpine = dianShiJi.getChildByName('dianshijiSpine'); let zhuanTouAttrs = { startPos:zhuanTou.getPosition(), touchArea:dianShiJi, callFunction: ()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"板砖拍电视(0)"); dianshijiSpine.getComponent(sp.Skeleton).setAnimation(0,"paidianshi",false) dianshijiSpine.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{ this.gameInfo.ChaNode["DianShiJi"].isCanTouch = true }) } } this.openTouchEvent(zhuanTou,zhuanTouAttrs) //锤子 let chuiZi = this.mapNode.getChildByName('chuiZi'); //雕像 let diaoXiang = this.mapNode.getChildByName('diaoXiang'); //雕像 let diaoxiangSpine = diaoXiang.getChildByName('diaoxiangSpine'); let chuiZiAttrs = { startPos:chuiZi.getPosition(), touchArea:diaoXiang, callFunction: ()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"锤子砸雕塑(0)"); diaoxiangSpine.getComponent(sp.Skeleton).setAnimation(0,"animation",false) diaoxiangSpine.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{ this.gameInfo.ChaNode["DuBiDiaoXiang"].isCanTouch = true }) } } this.openTouchEvent(chuiZi,chuiZiAttrs) //葫芦 let huLuAn = this.mapNode.getChildByName('huLuAn'); let huLuLiang = this.mapNode.getChildByName('huLuLiang'); //王多鱼 let wangduoyu = this.mapNode.getChildByName('wangduoyu'); //王多鱼 let wangduoyuSpine = wangduoyu.getChildByName('wangduoyuSpine'); let huLuAttrs = { startPos:huLuAn.getPosition(), touchArea:wangduoyu, callFunction: ()=>{ wangduoyuSpine.getComponent(sp.Skeleton).setAnimation(0,"panhulu",false) this.scheduleOnce(()=>{ this.gameInfo.ChaNode["HuLu"].isCanTouch = true huLuLiang.active = true wangduoyuSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) },1.2) } } this.openTouchEvent(huLuAn,huLuAttrs) } specialNodeMoveEvent1204(){ this.node["qiPaoEffect"] = (node,soundUrl)=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl + soundUrl) node.active = true node.scale = 0 node.getChildByName("str").getComponent(cc.Label).string = soundUrl cc.tween(node) .to(0.2,{scale:1}) .delay(2.8) .to(0.2,{scale:0}) .call(()=>{ node.active = false }) .start() } this.node["dialogFunc"] = (qiPao1,soundUrl_1,qiPao2,soundUrl_2,isShowSpine)=>{ this.node.stopAllActions() this.mapNode.getChildByName('qiPaoZuo').stopAllActions() this.mapNode.getChildByName('qiPaoYou').stopAllActions() this.mapNode.getChildByName('qiPaoZuo').active = false this.mapNode.getChildByName('qiPaoYou').active = false let laobanSpine = this.mapNode.getChildByName("laobanSpine") laobanSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) cc.tween(this.node) .call(()=>{ this.node["qiPaoEffect"](qiPao1,soundUrl_1) }) .delay(3.4) .call(()=>{ if(isShowSpine){ laobanSpine.getComponent(sp.Skeleton).setAnimation(0,"ganga",true) } this.node["qiPaoEffect"](qiPao2,soundUrl_2) }) .delay(3) .call(()=>{ laobanSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) }) .start() } this.node["dialogFunc"](this.mapNode.getChildByName('qiPaoZuo'),"最近项目多,这周要做好加班准备",this.mapNode.getChildByName('qiPaoYou'),"老板,你每周都是这样讲",false) this.node["allMoney"] = this.gameInfo.PrefabInfo.startMoney this.node.getChildByName("msg").active = true this.node.getChildByName("msg").getChildByName("title").getComponent(cc.Label).string = "加班时长:" this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"]+"h" } specialNodeMoveEvent1205(){ this.node["qiPaoEffect2"] = (node,soundUrl)=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl + soundUrl) node.active = true node.scale = 0 node.getChildByName("str").getComponent(cc.Label).string = soundUrl cc.tween(node) .to(0.2,{scale:1}) .delay(2.8) .to(0.2,{scale:0}) .call(()=>{ node.active = false }) .start() } this.node["dialogFunc2"] = (qiPao,soundUrl)=>{ this.node.stopAllActions() this.mapNode.getChildByName('qiPaoZuo').stopAllActions() this.mapNode.getChildByName('qiPaoYou').stopAllActions() this.mapNode.getChildByName('qiPaoZuo').active = false this.mapNode.getChildByName('qiPaoYou').active = false this.node["qiPaoEffect2"](qiPao,soundUrl) } this.node["dialogFunc2"](this.mapNode.getChildByName('qiPaoZuo'),"房子都装修完一个月了,今天必须把工钱还给我") this.node["allMoney"] = this.gameInfo.PrefabInfo.startMoney this.node.getChildByName("msg").active = true this.node.getChildByName("msg").getChildByName("title").getComponent(cc.Label).string = "剩余欠款:" this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"] //铲子 let chanZi = this.mapNode.getChildByName('chanZi'); let chanziSpine = chanZi.getChildByName('chanziSpine'); let liyoutianSpine = this.mapNode.getChildByName('liyoutianSpine'); let lieFengTouchArea = this.mapNode.getChildByName('lieFengTouchArea'); let lanQiang = this.mapNode.getChildByName('lanQiang'); let suiQiangXie = this.mapNode.getChildByName('suiQiangXie'); let chuanghuSpine = this.mapNode.getChildByName('chuanghuSpine'); let chuangHuTouchArea = this.mapNode.getChildByName('chuangHuTouchArea'); let diTan = this.mapNode.getChildByName('diTan'); let diTanKai = this.mapNode.getChildByName('diTanKai'); let dasaoSpine = this.mapNode.getChildByName('dasaoSpine'); let daSaoTouchArea = this.mapNode.getChildByName('feiChaDianNode').getChildByName('daSaoTouchArea'); let maTong = this.mapNode.getChildByName('maTong'); let matongSpine = maTong.getChildByName('matongSpine'); let diBan = this.mapNode.getChildByName('diBan'); let lanDiBan = this.mapNode.getChildByName('lanDiBan'); let lanDiBanChaDian = this.mapNode.getChildByName('lanDiBanChaDian'); let lanDiBanTouchArea = this.mapNode.getChildByName('lanDiBanTouchArea'); let chanZiAttrs = { startPos:chanZi.getPosition(), touchArea1:lieFengTouchArea, callFunction1: ()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"拍墙、地板音效"); chanziSpine.getComponent(sp.Skeleton).setAnimation(0,"paiqiang",false) cc.tween(this.mapNode) .delay(0.5) .to(0.15,{angle:-5}) .to(0.15,{angle:5}) .to(0.15,{angle:-5}) .to(0.15,{angle:5}) .to(0.1,{angle:0}) .call(()=>{ lanQiang.active = true suiQiangXie.active = true chanZi.opacity = 0 chanZi.setPosition(chanZi["startPos"]) chanziSpine.getComponent(sp.Skeleton).setAnimation(0,"none",false) liyoutianSpine.getComponent(sp.Skeleton).setAnimation(0,"daichanzi",true) this.gameInfo.ChaNode["QiangMianCaiLiao"].isCanTouch = true }) .start() }, touchArea2:chuangHuTouchArea, callFunction2: ()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"拍玻璃碎"); chanziSpine.getComponent(sp.Skeleton).setAnimation(0,"paiboli",false) cc.tween(this.mapNode) .delay(0.7) .call(()=>{ chanZi.opacity = 0 chanZi.setPosition(chanZi["startPos"]) chanziSpine.getComponent(sp.Skeleton).setAnimation(0,"none",false) liyoutianSpine.getComponent(sp.Skeleton).setAnimation(0,"daichanzi",true) chuanghuSpine.getComponent(sp.Skeleton).setAnimation(0,"pochuanghu",true) this.gameInfo.ChaNode["ChuangHu"].isCanTouch = true this.node["isChuangHuPoSui"] = true }) .delay(1) .call(()=>{ this.node["dialogFunc2"](this.mapNode.getChildByName('qiPaoYou'),"好冷呀你想要什么我都给你") if(this.node["isBeiZiMove"]){ dasaoSpine.getComponent(sp.Skeleton).setAnimation(0,"fadou",true) }else{ dasaoSpine.getComponent(sp.Skeleton).setAnimation(0,"nabeizifadou",true) } diTan.active = false diTanKai.active = true this.gameInfo.ChaNode["HuangJin"].isCanTouch = true }) .start() }, touchArea3:maTong, callFunction3: ()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"砸马桶"); chanziSpine.getComponent(sp.Skeleton).setAnimation(0,"paimatong",false) this.gameInfo.ChaNode["MaTong"].isCanTouch = false cc.tween(this.mapNode) .delay(0.7) .call(()=>{ chanZi.opacity = 0 chanZi.setPosition(chanZi["startPos"]) chanziSpine.getComponent(sp.Skeleton).setAnimation(0,"none",false) liyoutianSpine.getComponent(sp.Skeleton).setAnimation(0,"daichanzi",true) matongSpine.getComponent(sp.Skeleton).setAnimation(0,"youdan",true) this.gameInfo.ChaNode["JinDan"].isCanTouch = true }) .start() }, touchArea4:lanDiBanTouchArea, callFunction4: ()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"拍墙、地板音效"); chanziSpine.getComponent(sp.Skeleton).setAnimation(0,"paidiban",false) cc.tween(this.mapNode) .delay(0.5) .to(0.15,{angle:-5}) .to(0.15,{angle:5}) .to(0.15,{angle:-5}) .to(0.15,{angle:5}) .to(0.1,{angle:0}) .call(()=>{ chanZi.opacity = 0 chanZi.setPosition(chanZi["startPos"]) chanziSpine.getComponent(sp.Skeleton).setAnimation(0,"none",false) liyoutianSpine.getComponent(sp.Skeleton).setAnimation(0,"daichanzi",true) diBan.active = false lanDiBan.active = false lanDiBanChaDian.active = true this.gameInfo.ChaNode["DiBanZhuan"].isCanTouch = true }) .start() }, touchArea5:daSaoTouchArea, callFunction5: ()=>{ this.node["dialogFunc2"](this.mapNode.getChildByName('qiPaoYou'),"别打我我没钱给你快滚蛋!") chanZi.opacity = 0 chanZi.setPosition(chanZi["startPos"]) chanziSpine.getComponent(sp.Skeleton).setAnimation(0,"none",false) liyoutianSpine.getComponent(sp.Skeleton).setAnimation(0,"daichanzi",true) } } this.openTouchEvent(chanZi,chanZiAttrs) //杯子 let beiZi = this.mapNode.getChildByName('beiZi'); let yuGang = this.mapNode.getChildByName('yuGang'); let niuNaiYuGang = this.mapNode.getChildByName('niuNaiYuGang'); let beiZiAttrs = { startPos:beiZi.getPosition(), touchArea:yuGang, callFunction: ()=>{ yuGang.active = false niuNaiYuGang.active = true this.node["isBeiZiMove"] = true this.gameInfo.ChaNode["YuGangNiuNai"].isCanTouch = true this.gameInfo.ChaNode["YuGangZhengChang"].isCanTouch = false } } this.openTouchEvent(beiZi,beiZiAttrs) } specialNodeMoveEvent1206(){ this.node["allMoney"] = this.gameInfo.PrefabInfo.startMoney this.node.getChildByName("msg").active = true this.node.getChildByName("msg").getChildByName("title").getComponent(cc.Label).string = "认爹礼:" this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"] this.node["qiPaoEffect1206"] = (node,soundUrl)=>{ if(!node){ return } Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl + soundUrl) node.active = true node.scale = 0 node.getChildByName("str").getComponent(cc.Label).string = soundUrl cc.tween(node) .to(0.2,{scale:1}) .delay(2.8) .to(0.2,{scale:0}) .call(()=>{ node.active = false }) .start() } this.node["dialogFunc1206"] = (soundUrl1,soundUrl2,person1,person2)=>{ let qiPao1 = null let qiPao2 = null if(person1 == "gqq"){ qiPao1 = this.mapNode.getChildByName('qiPaoGQQ') }else if(person1 == "ts"){ qiPao1 = this.mapNode.getChildByName('qiPaoTS') }else if(person1 == "ds"){ qiPao1 = this.mapNode.getChildByName('qiPaoDS') } if(person2 == "gqq"){ qiPao2 = this.mapNode.getChildByName('qiPaoGQQ') }else if(person2 == "ts"){ qiPao2 = this.mapNode.getChildByName('qiPaoTS') }else if(person2 == "ds"){ qiPao2 = this.mapNode.getChildByName('qiPaoDS') } this.node.stopAllActions() this.mapNode.getChildByName('qiPaoGQQ').stopAllActions() this.mapNode.getChildByName('qiPaoTS').stopAllActions() this.mapNode.getChildByName('qiPaoDS').stopAllActions() this.mapNode.getChildByName('qiPaoGQQ').active = false this.mapNode.getChildByName('qiPaoTS').active = false this.mapNode.getChildByName('qiPaoDS').active = false cc.tween(this.node) .call(()=>{ this.node["qiPaoEffect1206"](qiPao1,soundUrl1) }) .delay(3.4) .call(()=>{ this.node["qiPaoEffect1206"](qiPao2,soundUrl2) }) .delay(3) .call(()=>{ }) .start() } this.node["dialogFunc1206"]("想当我干儿子,准备88万的认爹礼","我用全部身家给你凑钱","ts","gqq") //遗像 let yiXiang = this.mapNode.getChildByName('yiXiang'); //楠木盒 let nanMuHe = this.mapNode.getChildByName('nanMuHe'); //老八汉堡 let guHuiHe = this.mapNode.getChildByName('guHuiHe'); let yiXiangAttrs = { startPos:yiXiang.getPosition(), touchArea:nanMuHe, callFunction: ()=>{ nanMuHe.active = false guHuiHe.active = true this.gameInfo.ChaNode["LianMingGuHuiHe"].isCanTouch = true this.gameInfo.ChaNode["NanMuHe"].isCanTouch = false } } this.openTouchEvent(yiXiang,yiXiangAttrs) //巴豆 let baDou = this.mapNode.getChildByName('baDou'); let caiHongPi = this.mapNode.getChildByName('caiHongPi'); let gaoQiQiangTouchArea = this.mapNode.getChildByName("feiChaDianNode").getChildByName('gaoQiQiangTouchArea'); let gaoqiqiangSpine = this.mapNode.getChildByName('gaoqiqiangSpine'); let baDouAttrs = { startPos:baDou.getPosition(), touchArea:gaoQiQiangTouchArea, callFunction: ()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"放屁声"); gaoqiqiangSpine.getComponent(sp.Skeleton).setAnimation(0,"fangpi",false) cc.tween(this.node) .delay(1) .call(()=>{ gaoqiqiangSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) caiHongPi.active = true this.gameInfo.ChaNode["CaiHongPi"].isCanTouch = true }) .start() } } this.openTouchEvent(baDou,baDouAttrs) } specialNodeMoveEvent1207(){ this.node["qiPaoEffect1207"] = (node,soundUrl)=>{ if(!node){ return } Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl + soundUrl) node.active = true node.scale = 0 node.getChildByName("str").getComponent(cc.Label).string = soundUrl cc.tween(node) .to(0.2,{scale:1}) .delay(2.8) .to(0.2,{scale:0}) .call(()=>{ node.active = false }) .start() } this.node["dialogFunc1207"] = (soundUrl1,soundUrl2,person1,person2)=>{ let qiPao1 = null let qiPao2 = null if(person1 == "ex"){ qiPao1 = this.mapNode.getChildByName('qiPaoEX') }else if(person1 == "ez"){ qiPao1 = this.mapNode.getChildByName('qiPaoEZ') }else if(person1 == "pp"){ qiPao1 = this.mapNode.getChildByName('qiPaoPP') } if(person2 == "ex"){ qiPao2 = this.mapNode.getChildByName('qiPaoEX') }else if(person2 == "ez"){ qiPao2 = this.mapNode.getChildByName('qiPaoEZ') }else if(person2 == "pp"){ qiPao2 = this.mapNode.getChildByName('qiPaoPP') } this.node.stopAllActions() this.mapNode.getChildByName('qiPaoEX').stopAllActions() this.mapNode.getChildByName('qiPaoEZ').stopAllActions() this.mapNode.getChildByName('qiPaoPP').stopAllActions() this.mapNode.getChildByName('qiPaoEX').active = false this.mapNode.getChildByName('qiPaoEZ').active = false this.mapNode.getChildByName('qiPaoPP').active = false cc.tween(this.node) .call(()=>{ this.node["qiPaoEffect1207"](qiPao1,soundUrl1) }) .delay(3.4) .call(()=>{ this.node["qiPaoEffect1207"](qiPao2,soundUrl2) }) .delay(3) .call(()=>{ }) .start() } // this.node["dialogFunc1207"]("想当我干儿子,准备88万的认爹礼","我用全部身家给你凑钱","ts","gqq") this.node["allMoney"] = this.gameInfo.PrefabInfo.startMoney this.node.getChildByName("msg").active = true this.node.getChildByName("msg").getChildByName("title").getComponent(cc.Label).string = "赡养费:" this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"] //拐杖 let guaizhangSpine = this.mapNode.getChildByName('guaizhangSpine'); let nvshengSpine = this.mapNode.getChildByName('nvshengSpine'); let nanshengSpine = this.mapNode.getChildByName('nanshengSpine'); let nanshengshentiSpine = this.mapNode.getChildByName('nanshengshentiSpine'); let nanshengshouSpine = this.mapNode.getChildByName('nanshengshouSpine'); let laorenSpine = this.mapNode.getChildByName('laorenSpine'); let penZai = this.mapNode.getChildByName('penZai'); let lieFeng = this.mapNode.getChildByName('lieFeng'); let siFangQian = this.mapNode.getChildByName('siFangQian'); let nvRenTouchArea = this.mapNode.getChildByName('nvRenTouchArea'); let nanRenTouchArea = this.mapNode.getChildByName('nanRenTouchArea'); let nvRenTouPos = this.mapNode.getChildByName('nvRenTouPos'); let nanRenTouPos = this.mapNode.getChildByName('nanRenTouPos'); let guaizhangSpineAttrs = { startPos:guaizhangSpine.getPosition(), touchArea1:nvRenTouchArea, touchArea2:nanRenTouchArea, touchArea3:penZai, callFunction1: ()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"被拐杖打"); guaizhangSpine.getComponent(sp.Skeleton).setAnimation(0,"qiaoren",false) guaizhangSpine.setPosition(cc.v2(nvRenTouPos.x,nvRenTouPos.y)) cc.tween(this.mapNode) .delay(0.5) .call(()=>{ this.node["dialogFunc1207"]("哎哟,怎么还动手呢",null,"ex",null) guaizhangSpine.getComponent(sp.Skeleton).setAnimation(0,"none",false) guaizhangSpine.opacity = 0 guaizhangSpine.setPosition(guaizhangSpine["startPos"]) laorenSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) nvshengSpine.getComponent(sp.Skeleton).setAnimation(0,"yun",false) }) .delay(1.2) .call(()=>{ nvshengSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) }) .start() }, callFunction2: ()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"被拐杖打"); guaizhangSpine.getComponent(sp.Skeleton).setAnimation(0,"qiaoren",false) guaizhangSpine.setPosition(cc.v2(nanRenTouPos.x,nanRenTouPos.y)) cc.tween(this.mapNode) .delay(0.5) .call(()=>{ this.node["dialogFunc1207"]("妈,我也做不了主呀",null,"ez",null) guaizhangSpine.getComponent(sp.Skeleton).setAnimation(0,"none",false) guaizhangSpine.opacity = 0 guaizhangSpine.setPosition(guaizhangSpine["startPos"]) laorenSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) nanshengSpine.active = true nanshengshentiSpine.active = false nanshengshouSpine.active = false nanshengSpine.getComponent(sp.Skeleton).setAnimation(0,"yun",false) }) .delay(1.2) .call(()=>{ nanshengSpine.active = false nanshengshentiSpine.active = true nanshengshouSpine.active = true nanshengshentiSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) nanshengshouSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) }) .start() }, callFunction3: ()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"花瓶被打碎"); guaizhangSpine.getComponent(sp.Skeleton).setAnimation(0,"qiaohuapen",false) guaizhangSpine.setPosition(cc.v2(lieFeng.x,lieFeng.y)) cc.tween(this.mapNode) .delay(0.5) .call(()=>{ guaizhangSpine.getComponent(sp.Skeleton).setAnimation(0,"none",false) guaizhangSpine.opacity = 0 guaizhangSpine.setPosition(guaizhangSpine["startPos"]) laorenSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) lieFeng.active = true siFangQian.active = true this.gameInfo.ChaNode["SiFangQian"].isCanTouch = true this.gameInfo.ChaNode["HuaPing"].isCanTouch = false }) .start() }, } this.openTouchEvent(guaizhangSpine,guaizhangSpineAttrs) } specialNodeMoveEvent1208(){ this.node["qiPaoEffect1208"] = (node,soundUrl)=>{ if(!node){ return } Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl + soundUrl) node.active = true node.scale = 0 node.getChildByName("str").getComponent(cc.Label).string = soundUrl cc.tween(node) .to(0.2,{scale:1}) .delay(2.8) .to(0.2,{scale:0}) .call(()=>{ node.active = false }) .start() } this.node["dialogFunc1208"] = (soundUrl1,soundUrl2,person1,person2)=>{ let qiPao1 = null let qiPao2 = null if(person1 == "ds"){ qiPao1 = this.mapNode.getChildByName('qiPaoDS') }else if(person1 == "ts"){ qiPao1 = this.mapNode.getChildByName('qiPaoTS') }else if(person1 == "gqq"){ qiPao1 = this.mapNode.getChildByName('qiPaoGQQ') } if(person2 == "ds"){ qiPao2 = this.mapNode.getChildByName('qiPaoDS') }else if(person2 == "ts"){ qiPao2 = this.mapNode.getChildByName('qiPaoTS') }else if(person2 == "gqq"){ qiPao2 = this.mapNode.getChildByName('qiPaoGQQ') } this.node.stopAllActions() this.mapNode.getChildByName('qiPaoDS').stopAllActions() this.mapNode.getChildByName('qiPaoTS').stopAllActions() this.mapNode.getChildByName('qiPaoGQQ').stopAllActions() this.mapNode.getChildByName('qiPaoDS').active = false this.mapNode.getChildByName('qiPaoTS').active = false this.mapNode.getChildByName('qiPaoGQQ').active = false cc.tween(this.node) .call(()=>{ this.node["qiPaoEffect1208"](qiPao1,soundUrl1) }) .delay(3.4) .call(()=>{ this.node["qiPaoEffect1208"](qiPao2,soundUrl2) }) .delay(3) .call(()=>{ }) .start() } // this.node["dialogFunc1207"]("想当我干儿子,准备88万的认爹礼","我用全部身家给你凑钱","ts","gqq") this.node["allMoney"] = this.gameInfo.PrefabInfo.startMoney this.node.getChildByName("msg").active = true this.node.getChildByName("msg").getChildByName("title").getComponent(cc.Label).string = "赔偿金:" this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"] //抹布 let maBu = this.mapNode.getChildByName('maBu'); let mabuSpine = this.mapNode.getChildByName('mabuSpine'); let maBuAttrs = { startPos:maBu.getPosition(), touchArea:mabuSpine, callFunction: ()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"抹布擦相框"); mabuSpine.getComponent(sp.Skeleton).setAnimation(0,"2mabu",false) cc.tween(this.mapNode) .delay(2) .call(()=>{ mabuSpine.getComponent(sp.Skeleton).setAnimation(0,"3daiji",false) this.gameInfo.ChaNode["ZhuMingYouHua"].isCanTouch = true this.gameInfo.ChaNode["JiaHua"].isCanTouch = false }) .start() } } this.openTouchEvent(maBu,maBuAttrs) //高跟鞋 let gaoGenXieNode = this.mapNode.getChildByName('gaoGenXieNode'); let gaogenxieSpine = gaoGenXieNode.getChildByName('gaogenxieSpine'); let taishuSpine = this.mapNode.getChildByName('taishuSpine') // let chuangHuDi = this.mapNode.getChildByName('chuangHuDi'); let baoXianGuiGuan = this.mapNode.getChildByName('baoXianGuiGuan'); let baoXIanGuiKai = this.mapNode.getChildByName('baoXIanGuiKai'); // let huangJin = this.mapNode.getChildByName('huangJin') let huangJinWa = this.mapNode.getChildByName('huangJinWa') // let chuangHu = this.mapNode.getChildByName('chuangHu'); // let qingWa = this.mapNode.getChildByName('qingWa'); // let she = this.mapNode.getChildByName('she'); // let jiu = this.mapNode.getChildByName('jiu'); // let sheJiu = this.mapNode.getChildByName('sheJiu'); let gaoGenXieAttrs = { startPos:gaoGenXieNode.getPosition(), // touchArea1:chuangHuDi, // callFunction1: ()=>{ // Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"窗户碎"); // gaogenxieSpine.getComponent(sp.Skeleton).setAnimation(0,"qiao1",false) // cc.tween(this.mapNode) // .delay(0.7) // .call(()=>{ // chuangHu.active = false // qingWa.active = true // she.active = true // gaogenxieSpine.getComponent(sp.Skeleton).setAnimation(0,"kong",false) // gaoGenXieNode.opacity = 0 // gaoGenXieNode.setPosition(gaoGenXieNode["startPos"]) // taishuSpine.getComponent(sp.Skeleton).setAnimation(0,"1daiji",true) // }) // .start() // }, touchArea2:baoXianGuiGuan, callFunction2: ()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"砸保险柜"); gaogenxieSpine.getComponent(sp.Skeleton).setAnimation(0,"qiao1",false) cc.tween(this.mapNode) .delay(0.7) .call(()=>{ baoXianGuiGuan.active = false baoXIanGuiKai.active = true // huangJin.active = true gaogenxieSpine.getComponent(sp.Skeleton).setAnimation(0,"kong",false) gaoGenXieNode.opacity = 0 gaoGenXieNode.setPosition(gaoGenXieNode["startPos"]) taishuSpine.getComponent(sp.Skeleton).setAnimation(0,"1daiji",true) // this.gameInfo.ChaNode["HuangJin"].isCanTouch = true huangJinWa.active = true this.gameInfo.ChaNode["JinChanChu"].isCanTouch = true }) .start() } } this.openTouchEvent(gaoGenXieNode,gaoGenXieAttrs) // let qingWaAttrs = { // startPos:qingWa.getPosition(), // touchArea:huangJin, // callFunction: ()=>{ // huangJin.active = false // huangJinWa.active = true // this.gameInfo.ChaNode["JinChanChu"].isCanTouch = true // this.gameInfo.ChaNode["HuangJin"].isCanTouch = false // } // } // this.openTouchEvent(qingWa,qingWaAttrs) // let sheAttrs = { // startPos:she.getPosition(), // touchArea:jiu, // callFunction: ()=>{ // jiu.active = false // sheJiu.active = true // this.gameInfo.ChaNode["SheJiu"].isCanTouch = true // this.gameInfo.ChaNode["PuTongJiu"].isCanTouch = false // } // } // this.openTouchEvent(she,sheAttrs) //榴莲 let liuLian = this.mapNode.getChildByName('liuLian'); let suiLiuLian = this.mapNode.getChildByName('suiLiuLian'); let gaoQiQiangTouchArea = this.mapNode.getChildByName("feiChaDianNode").getChildByName('gaoQiQiangTouchArea'); let qianggeSpine = this.mapNode.getChildByName('qianggeSpine'); let liuLianAttrs = { startPos:liuLian.getPosition(), touchArea:gaoQiQiangTouchArea, callFunction: ()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"磕头"); qianggeSpine.getComponent(sp.Skeleton).setAnimation(0,"2ketou",false) cc.tween(this.mapNode) .delay(1.5) .call(()=>{ let chaNode = this.mapNode.getChildByName('chaDianNode').getChildByName('KeLiuLian') this.findOnChaDian(chaNode) qianggeSpine.getComponent(sp.Skeleton).setAnimation(0,"3daiji",true) qianggeSpine["isLiuXie"] = true }) .start() } } this.openTouchEvent(liuLian,liuLianAttrs) } specialNodeMoveEvent1209(){ EventMgr.onceEvent_custom(ryw_Event.Check1209Mima, (tab) => { let baoXianGuiGuan = this.mapNode.getChildByName('baoXianGuiGuan') baoXianGuiGuan.active = false this.gameInfo.ChaNode["XianJin"].isCanTouch = true }, this); this.node["qiPaoEffect1209"] = (node,soundUrl)=>{ if(!node){ return } Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl + soundUrl) node.active = true node.scale = 0 node.getChildByName("str").getComponent(cc.Label).string = soundUrl cc.tween(node) .to(0.2,{scale:1}) .delay(2.8) .to(0.2,{scale:0}) .call(()=>{ node.active = false }) .start() } this.node["dialogFunc1209"] = (soundUrl1,soundUrl2,person1,person2)=>{ let qiPao1 = null let qiPao2 = null if(person1 == "ds"){ qiPao1 = this.mapNode.getChildByName('qiPaoDS') }else if(person1 == "sj"){ qiPao1 = this.mapNode.getChildByName('qiPaoSJ') }else if(person1 == "htf"){ qiPao1 = this.mapNode.getChildByName('qiPaoHTF') }else if(person1 == "fh"){ qiPao1 = this.mapNode.getChildByName('qiPaoFH') }else if(person1 == "mv"){ qiPao1 = this.mapNode.getChildByName('qiPaoMV') } if(person2 == "ds"){ qiPao2 = this.mapNode.getChildByName('qiPaoDS') }else if(person2 == "sj"){ qiPao2 = this.mapNode.getChildByName('qiPaoSJ') }else if(person2 == "htf"){ qiPao2 = this.mapNode.getChildByName('qiPaoHTF') }else if(person2 == "fh"){ qiPao2 = this.mapNode.getChildByName('qiPaoFH') }else if(person2 == "mv"){ qiPao2 = this.mapNode.getChildByName('qiPaoMV') } this.node.stopAllActions() this.mapNode.getChildByName('qiPaoDS').stopAllActions() this.mapNode.getChildByName('qiPaoSJ').stopAllActions() this.mapNode.getChildByName('qiPaoHTF').stopAllActions() this.mapNode.getChildByName('qiPaoFH').stopAllActions() this.mapNode.getChildByName('qiPaoMV').stopAllActions() this.mapNode.getChildByName('qiPaoDS').active = false this.mapNode.getChildByName('qiPaoSJ').active = false this.mapNode.getChildByName('qiPaoHTF').active = false this.mapNode.getChildByName('qiPaoFH').active = false this.mapNode.getChildByName('qiPaoMV').active = false cc.tween(this.node) .call(()=>{ this.node["qiPaoEffect1209"](qiPao1,soundUrl1) }) .delay(3.4) .call(()=>{ this.node["qiPaoEffect1209"](qiPao2,soundUrl2) }) .delay(3) .call(()=>{ }) .start() } this.node["dialogFunc1209"]("瞧你这德性,怎么可能配得上我",null,"mv",) this.node["allMoney"] = this.gameInfo.PrefabInfo.startMoney this.node.getChildByName("msg").active = true this.node.getChildByName("msg").getChildByName("title").getComponent(cc.Label).string = "身价:" this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"] } specialNodeMoveEvent1210(){ this.node["qiPaoEffect1210"] = (node,soundUrl)=>{ if(!node){ return } Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl + soundUrl) node.active = true node.scale = 0 node.getChildByName("str").getComponent(cc.Label).string = soundUrl cc.tween(node) .to(0.2,{scale:1}) .delay(2.8) .to(0.2,{scale:0}) .call(()=>{ node.active = false }) .start() } this.node["dialogFunc1210"] = (soundUrl1,soundUrl2,person1,person2)=>{ let qiPao1 = null let qiPao2 = null if(person1 == "nr"){ qiPao1 = this.mapNode.getChildByName('qiPaoNR') }else if(person1 == "xl"){ qiPao1 = this.mapNode.getChildByName('qiPaoXL') } if(person2 == "nr"){ qiPao2 = this.mapNode.getChildByName('qiPaoNR') }else if(person2 == "xl"){ qiPao2 = this.mapNode.getChildByName('qiPaoXL') } this.node.stopAllActions() this.mapNode.getChildByName('qiPaoNR').stopAllActions() this.mapNode.getChildByName('qiPaoXL').stopAllActions() this.mapNode.getChildByName('qiPaoNR').active = false this.mapNode.getChildByName('qiPaoXL').active = false cc.tween(this.node) .call(()=>{ this.node["qiPaoEffect1210"](qiPao1,soundUrl1) }) .delay(3.4) .call(()=>{ this.node["qiPaoEffect1210"](qiPao2,soundUrl2) }) .delay(3) .call(()=>{ }) .start() } // this.node["dialogFunc1210"]("瞧你这德性,怎么可能配得上我",null,"mv",) this.node["allMoney"] = this.gameInfo.PrefabInfo.startMoney this.node.getChildByName("msg").active = true this.node.getChildByName("msg").getChildByName("title").getComponent(cc.Label).string = "随礼:" this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"] //早生贵子 let hongZao = this.mapNode.getChildByName('hongZao'); let guaZi = this.mapNode.getChildByName('guaZi'); let guiYuan = this.mapNode.getChildByName('guiYuan'); let huaSheng = this.mapNode.getChildByName('huaSheng'); let hongZaoAttrs = { startPos:hongZao.getPosition(), callFunction: ()=>{ hongZao.getComponent(cc.BlockInputEvents).enabled = false } } this.openTouchEvent(hongZao,hongZaoAttrs) let guaZiAttrs = { startPos:guaZi.getPosition(), callFunction: ()=>{ guaZi.getComponent(cc.BlockInputEvents).enabled = false } } this.openTouchEvent(guaZi,guaZiAttrs) let guiYuanAttrs = { startPos:guiYuan.getPosition(), callFunction: ()=>{ guiYuan.getComponent(cc.BlockInputEvents).enabled = false } } this.openTouchEvent(guiYuan,guiYuanAttrs) let huaShengAttrs = { startPos:huaSheng.getPosition(), callFunction: ()=>{ huaSheng.getComponent(cc.BlockInputEvents).enabled = false } } this.openTouchEvent(huaSheng,huaShengAttrs) //症断书 let zhengDuanShuBlockInput = this.mapNode.getChildByName('zhengDuanShuBlockInput'); let zhengDuanShu = zhengDuanShuBlockInput.getChildByName('zhengDuanShu'); let zhengDuanShuAttrs = { startPos:zhengDuanShu.getPosition(), callFunction: ()=>{ zhengDuanShuBlockInput.active = false let chaNode = this.mapNode.getChildByName('chaDianNode').getChildByName('ZhenDuanShu') this.findOnChaDian(chaNode) } } this.openTouchEvent(zhengDuanShu,zhengDuanShuAttrs) //钱包 let qianBaoBlockInput = this.mapNode.getChildByName('qianBaoBlockInput'); let qianBaoNode = qianBaoBlockInput.getChildByName('qianBaoNode'); let qianBaoNodeAttrs = { startPos:qianBaoNode.getPosition(), callFunction: ()=>{ qianBaoBlockInput.active = false let chaNode = this.mapNode.getChildByName('chaDianNode').getChildByName('QianNvYou') this.findOnChaDian(chaNode) } } this.openTouchEvent(qianBaoNode,qianBaoNodeAttrs) //话筒 let shuaTong = this.mapNode.getChildByName('shuaTong'); let nanShengTouchArea = this.mapNode.getChildByName('nanShengTouchArea'); let shuaTongAttrs = { startPos:shuaTong.getPosition(), touchArea:nanShengTouchArea, callFunction: ()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"分手快乐歌曲"); let nanShengSpine = this.mapNode.getChildByName('nanShengSpine'); nanShengSpine.getComponent(sp.Skeleton).setAnimation(0,"changge",true) nanShengSpine["spineStatus"] = "huatong" this.gameInfo.ChaNode["ChangFenShouGe"].isCanTouch = true } } this.openTouchEvent(shuaTong,shuaTongAttrs) //胶带 let jiaoDai = this.mapNode.getChildByName('jiaoDai'); let jiaoDaiAttrs = { startPos:jiaoDai.getPosition(), touchArea:nanShengTouchArea, callFunction: ()=>{ let nanShengSpine = this.mapNode.getChildByName('nanShengSpine'); nanShengSpine.getComponent(sp.Skeleton).setAnimation(0,"rengjiaodai",true) nanShengSpine["spineStatus"] = "jiaodai" this.gameInfo.ChaNode["JiaoDai"].isCanTouch = true } } this.openTouchEvent(jiaoDai,jiaoDaiAttrs) //白酒 let baiJiu = this.mapNode.getChildByName('baiJiu'); let baiJiuAttrs = { startPos:baiJiu.getPosition(), touchArea:nanShengTouchArea, callFunction: ()=>{ this.node["dialogFunc1210"]("来晚了,我自炫一瓶",null,"nr",null) let nanShengSpine = this.mapNode.getChildByName('nanShengSpine'); nanShengSpine.getComponent(sp.Skeleton).setAnimation(0,"shuohua",false) nanShengSpine["spineStatus"] = "baijiu" cc.tween(nanShengSpine) .delay(2) .call(()=>{ let nanShengSpine = this.mapNode.getChildByName('nanShengSpine'); nanShengSpine.getComponent(sp.Skeleton).setAnimation(0,"xuanjiu",true) this.gameInfo.ChaNode["ZiXuanYiPing"].isCanTouch = true }) .start() } } this.openTouchEvent(baiJiu,baiJiuAttrs) //手机 let shouJi = this.mapNode.getChildByName('shouJi'); let shouJiTouchArea = this.mapNode.getChildByName('shouJiTouchArea'); let shouJiAttrs = { startPos:shouJi.getPosition(), touchArea:shouJiTouchArea, callFunction: ()=>{ this.node["dialogFunc1210"]("今天随礼,全场狂降500元!",null,"xl",null) shouJi.getComponent(cc.BlockInputEvents).enabled = false shouJi.setPosition(shouJiTouchArea.getPosition()) this.gameInfo.ChaNode["HunLiZhiBo"].isCanTouch = true } } this.openTouchEvent(shouJi,shouJiAttrs) //塑料袋 let suLiaoDai = this.mapNode.getChildByName('suLiaoDai'); let fanCaiTouchArea = this.mapNode.getChildByName('fanCaiTouchArea'); let suLiaoDaiAttrs = { startPos:suLiaoDai.getPosition(), touchArea:fanCaiTouchArea, callFunction: ()=>{ this.gameInfo.ChaNode["ChiYiGeCai"].isCanTouch = false let zhuangcaiSpine = this.mapNode.getChildByName('zhuangcaiSpine'); zhuangcaiSpine.getComponent(sp.Skeleton).setAnimation(0,"zhuangcai",false) cc.tween(zhuangcaiSpine) .delay(2) .call(()=>{ zhuangcaiSpine.getComponent(sp.Skeleton).setAnimation(0,"none2",false) this.gameInfo.ChaNode["JiuXiDaBao"].isCanTouch = true }) .start() } } this.openTouchEvent(suLiaoDai,suLiaoDaiAttrs) } specialNodeMoveEvent1211(){ this.node["qiPaoEffect1211"] = (node,soundUrl)=>{ if(!node){ return } Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl + soundUrl) node.active = true node.scale = 0 node.getChildByName("str").getComponent(cc.Label).string = soundUrl cc.tween(node) .to(0.2,{scale:1}) .delay(2.8) .to(0.2,{scale:0}) .call(()=>{ node.active = false }) .start() } this.node["dialogFunc1211"] = (soundUrl1,person1)=>{ let qiPao1 = null if(person1 == "xjj"){ qiPao1 = this.mapNode.getChildByName('qiPaoXJJ') } this.node.stopAllActions() this.mapNode.getChildByName('qiPaoXJJ').stopAllActions() this.mapNode.getChildByName('qiPaoXJJ').active = false cc.tween(this.node) .call(()=>{ this.node["qiPaoEffect1211"](qiPao1,soundUrl1) }) .start() } // this.node["dialogFunc1211"]("瞧你这德性,怎么可能配得上我",null,"mv",) this.node["allMoney"] = this.gameInfo.PrefabInfo.startMoney this.node.getChildByName("msg").active = true this.node.getChildByName("msg").getChildByName("title").getComponent(cc.Label).string = "市值:" this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"]+"亿" let hongYiNv = this.mapNode.getChildByName('hongYiNv') let cheZiTouchArea = this.mapNode.getChildByName('cheZiTouchArea'); let hongYiNvAttrs = { startPos:hongYiNv.getPosition(), touchArea:cheZiTouchArea, callFunction: ()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"女生哭"); this.gameInfo.ChaNode["FuJiaShiKuQi"].isCanTouch = true this.gameInfo.ChaNode["FuJiaShiKuQi"].bSwitch = true } } this.openTouchEvent(hongYiNv,hongYiNvAttrs) } specialNodeMoveEvent1212(){ this.node["qiPaoEffect1212"] = (node,soundUrl,personName)=>{ if(!node){ return } let nanSpine = this.mapNode.getChildByName('nanSpine'); Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl + soundUrl) node.active = true node.scale = 0 node.getChildByName("str").getComponent(cc.Label).string = soundUrl cc.tween(node) .call(()=>{ if(personName == "lg"){ nanSpine.getComponent(sp.Skeleton).setAnimation(0,"ma",false) } }) .to(0.2,{scale:1}) .delay(1.5) .call(()=>{ if(personName == "lg"){ nanSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) } }) .delay(1.3) .to(0.2,{scale:0}) .call(()=>{ node.active = false }) .start() } this.node["dialogFunc1212"] = (soundUrl1,soundUrl2,person1,person2)=>{ let qiPao1 = null let qiPao2 = null if(person1 == "lp"){ qiPao1 = this.mapNode.getChildByName('qiPaoLP') }else if(person1 == "lg"){ qiPao1 = this.mapNode.getChildByName('qiPaoLG') } if(person2 == "lp"){ qiPao2 = this.mapNode.getChildByName('qiPaoLP') }else if(person2 == "lg"){ qiPao2 = this.mapNode.getChildByName('qiPaoLG') } this.node.stopAllActions() this.mapNode.getChildByName('qiPaoLP').stopAllActions() this.mapNode.getChildByName('qiPaoLG').stopAllActions() this.mapNode.getChildByName('qiPaoLP').active = false this.mapNode.getChildByName('qiPaoLG').active = false cc.tween(this.node) .call(()=>{ this.node["qiPaoEffect1212"](qiPao1,soundUrl1,person1) }) .delay(2) .call(()=>{ this.node["qiPaoEffect1212"](qiPao2,soundUrl2,person2) }) .start() } this.node["dialogFunc1212"]("求求你让我可怜的老公站起来",null,"lp",) this.node["allMoney"] = this.gameInfo.PrefabInfo.startMoney this.node.getChildByName("msg").active = true this.node.getChildByName("msg").getChildByName("title").getComponent(cc.Label).string = "康复值:" this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"]+"%" let yehuSpine = this.mapNode.getChildByName('yehuSpine') let shuibeiSpine = this.mapNode.getChildByName('shuibeiSpine') let shuiBeiTouchArea = this.mapNode.getChildByName('shuiBeiTouchArea'); let yehuSpineAttrs = { startPos:yehuSpine.getPosition(), touchArea:shuiBeiTouchArea, callFunction: ()=>{ yehuSpine.getComponent(sp.Skeleton).setAnimation(0,"daoshui",false) shuibeiSpine.getComponent(sp.Skeleton).setAnimation(0,"daoshui",false) cc.tween(this.mapNode) .delay(2.5) .call(()=>{ yehuSpine.setPosition(yehuSpine["startPos"]) yehuSpine.getComponent(sp.Skeleton).setAnimation(0,"chushi",false) this.gameInfo.ChaNode["Cha"].isCanTouch = true }) .start() } } this.openTouchEvent(yehuSpine,yehuSpineAttrs) let nanRenShouJiNode = this.mapNode.getChildByName("nanRenShouJiNode") let shouJi1 = nanRenShouJiNode.getChildByName('shouJi1') this.openTouchEvent(shouJi1,{}) let nvRenShouJiNode = this.mapNode.getChildByName("nvRenShouJiNode") let shouJi2 = nvRenShouJiNode.getChildByName('shouJi2') this.openTouchEvent(shouJi2,{}) let diQiuYiNode = this.mapNode.getChildByName("diQiuYiNode") let diQiuYi = diQiuYiNode.getChildByName('diQiuYi') this.openTouchEvent(diQiuYi,{}) let dianNaoNode = this.mapNode.getChildByName("dianNaoNode") let dianNao = dianNaoNode.getChildByName('dianNao') this.openTouchEvent(dianNao,{}) let huiYuanKaNode = this.mapNode.getChildByName("huiYuanKaNode") let huiYuanKa = huiYuanKaNode.getChildByName('huiYuanKa') this.openTouchEvent(huiYuanKa,{}) } specialNodeMoveEvent1213(){ this.node["qiPaoEffect1213"] = (node,soundUrl)=>{ if(!node){ return } Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl + soundUrl) node.active = true node.scale = 0 node.getChildByName("str").getComponent(cc.Label).string = soundUrl cc.tween(node) .to(0.2,{scale:1}) .delay(2.8) .to(0.2,{scale:0}) .call(()=>{ node.active = false }) .start() } this.node["dialogFunc1213"] = (soundUrl1,soundUrl2,person1,person2)=>{ let qiPao1 = null let qiPao2 = null if(person1 == "lp"){ qiPao1 = this.mapNode.getChildByName('qiPaoLP') }else if(person1 == "pp"){ qiPao1 = this.mapNode.getChildByName('qiPaoPP') } if(person2 == "lp"){ qiPao2 = this.mapNode.getChildByName('qiPaoLP') }else if(person2 == "pp"){ qiPao2 = this.mapNode.getChildByName('qiPaoPP') } this.node.stopAllActions() this.mapNode.getChildByName('qiPaoLP').stopAllActions() this.mapNode.getChildByName('qiPaoPP').stopAllActions() this.mapNode.getChildByName('qiPaoLP').active = false this.mapNode.getChildByName('qiPaoPP').active = false cc.tween(this.node) .call(()=>{ this.node["qiPaoEffect1213"](qiPao1,soundUrl1) }) .delay(3.4) .call(()=>{ this.node["qiPaoEffect1213"](qiPao2,soundUrl2) }) .delay(3) .call(()=>{ }) .start() } // this.node["dialogFunc1210"]("瞧你这德性,怎么可能配得上我",null,"mv",) this.node["allMoney"] = this.gameInfo.PrefabInfo.startMoney this.node.getChildByName("msg").active = true this.node.getChildByName("msg").getChildByName("title").getComponent(cc.Label).string = "和睦值:" this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"] let nanrenSpine = this.mapNode.getChildByName('nanrenSpine'); let nvrenSpine = this.mapNode.getChildByName('nvrenSpine'); let popoSpine = this.mapNode.getChildByName('popoSpine'); //婴儿 let yingEr = this.mapNode.getChildByName('yingEr'); let nanRenTouchArea = this.mapNode.getChildByName('nanRenTouchArea'); let yingErAttrs = { startPos:yingEr.getPosition(), touchArea:nanRenTouchArea, callFunction: ()=>{ nanrenSpine.getComponent(sp.Skeleton).setAnimation(0,"baoxiaohaidaiji",true) cc.tween(this.mapNode) .delay(1.5) .call(()=>{ let chaNode = this.mapNode.getChildByName('chaDianNode').getChildByName('HongXiaoHai') this.findOnChaDian(chaNode) nanrenSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) }) .start() } } this.openTouchEvent(yingEr,yingErAttrs) //炒南瓜 let chaoNanGua = this.mapNode.getChildByName('chaoNanGua'); let nvRenTouchArea = this.mapNode.getChildByName('nvRenTouchArea'); let chaoNanGuaAttrs = { startPos:chaoNanGua.getPosition(), touchArea:nvRenTouchArea, callFunction: ()=>{ let chaNode = this.mapNode.getChildByName('chaDianNode').getChildByName('ChiNanGua') this.findOnChaDian(chaNode) popoSpine.getComponent(sp.Skeleton).setAnimation(0,"ku",false) cc.tween(this.mapNode) .delay(2) .call(()=>{ popoSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) }) .start() } } this.openTouchEvent(chaoNanGua,chaoNanGuaAttrs) //鸡汤 let jiTang = this.mapNode.getChildByName('jiTang'); let jiTangAttrs = { startPos:jiTang.getPosition(), touchArea:nvRenTouchArea, callFunction: ()=>{ let chaNode = this.mapNode.getChildByName('chaDianNode').getChildByName('HeJiTang') this.findOnChaDian(chaNode) } } this.openTouchEvent(jiTang,jiTangAttrs) //酒 let jiuPing = this.mapNode.getChildByName('jiuPing'); let jiuPingAttrs = { startPos:jiuPing.getPosition(), touchArea:nanRenTouchArea, callFunction: ()=>{ nanrenSpine.getComponent(sp.Skeleton).setAnimation(0,"hejiu",false) cc.tween(this.mapNode) .delay(1) .call(()=>{ nanrenSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) }) .delay(0.1) .call(()=>{ nvrenSpine.getComponent(sp.Skeleton).setAnimation(0,"daren",false) nanrenSpine.getComponent(sp.Skeleton).setAnimation(0,"beida",false) popoSpine.getComponent(sp.Skeleton).setAnimation(0,"daren",false) }) .delay(0.5) .call(()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"扇耳光"); }) .delay(0.5) .call(()=>{ let chaNode = this.mapNode.getChildByName('chaDianNode').getChildByName('JinZhiHeJiu') this.findOnChaDian(chaNode) }) .delay(0.5) .call(()=>{ nvrenSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) nanrenSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) popoSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) }) .start() } } this.openTouchEvent(jiuPing,jiuPingAttrs) //扫帚 let saoZhou = this.mapNode.getChildByName('saoZhou'); let poPoTouchArea = this.mapNode.getChildByName('poPoTouchArea'); let saoZhouAttrs = { startPos:saoZhou.getPosition(), touchArea1:nanRenTouchArea, touchArea2:nvRenTouchArea, touchArea3:poPoTouchArea, callFunction1: ()=>{ saoZhou.active = false this.closeTouchEvent(saoZhou) let chaNode = this.mapNode.getChildByName('chaDianNode').getChildByName('ErZiSaoDi') this.findOnChaDian(chaNode) }, callFunction2: ()=>{ saoZhou.setPosition(saoZhou["startPos"]) Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"扇耳光"); this.node["dialogFunc1213"]("不知道我在坐月子吗",null,"lp",) nvrenSpine.getComponent(sp.Skeleton).setAnimation(0,"daren",false) nanrenSpine.getComponent(sp.Skeleton).setAnimation(0,"beida",false) cc.tween(this.mapNode) .delay(1.5) .call(()=>{ nvrenSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) nanrenSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) }) .start() }, callFunction3: ()=>{ saoZhou.setPosition(saoZhou["startPos"]) Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"扇耳光"); this.node["dialogFunc1213"]("我是你家保姆吗",null,"pp",) popoSpine.getComponent(sp.Skeleton).setAnimation(0,"daren",false) nanrenSpine.getComponent(sp.Skeleton).setAnimation(0,"beida",false) cc.tween(this.mapNode) .delay(1.5) .call(()=>{ popoSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) nanrenSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) }) .start() } } this.openTouchEvent(saoZhou,saoZhouAttrs) //购物车 let gouWuCheNode = this.mapNode.getChildByName('gouWuCheNode'); let btn_mai = gouWuCheNode.getChildByName('btn_mai') this.openTouchEvent(btn_mai,{}) let btn_shanchu = gouWuCheNode.getChildByName('btn_shanchu') this.openTouchEvent(btn_shanchu,{}) //病例 let bingLiBenNode = this.mapNode.getChildByName("bingLiBenNode") let bingLi = bingLiBenNode.getChildByName("bingLi") this.openTouchEvent(bingLi,{}) //房产证 let fangChanZheng = this.mapNode.getChildByName('fangChanZheng'); let fangChanZhengAttrs = { startPos:fangChanZheng.getPosition(), touchArea:nvRenTouchArea, callFunction: ()=>{ let chaNode = this.mapNode.getChildByName('chaDianNode').getChildByName('FangChanZheng') this.findOnChaDian(chaNode) } } this.openTouchEvent(fangChanZheng,fangChanZhengAttrs) //衣服 let yiFu = this.mapNode.getChildByName('yiFu'); let yiFuAttrs = { startPos:yiFu.getPosition(), touchArea1:nvRenTouchArea, touchArea2:poPoTouchArea, callFunction1: ()=>{ yiFu.active = false this.closeTouchEvent(yiFu) let chaNode = this.mapNode.getChildByName('chaDianNode').getChildByName('YiFuGeiXiFu') this.findOnChaDian(chaNode) Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"扇耳光"); popoSpine.getComponent(sp.Skeleton).setAnimation(0,"daren",false) nanrenSpine.getComponent(sp.Skeleton).setAnimation(0,"beida",false) cc.tween(this.mapNode) .delay(1.5) .call(()=>{ popoSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) nanrenSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) }) .start() }, callFunction2: ()=>{ yiFu.active = false this.closeTouchEvent(yiFu) let chaNode = this.mapNode.getChildByName('chaDianNode').getChildByName('YiFuGeiPoPo') this.findOnChaDian(chaNode) } } this.openTouchEvent(yiFu,yiFuAttrs) } specialNodeMoveEvent1302(){ this.node["allMoney"] = this.gameInfo.PrefabInfo.startMoney this.node.getChildByName("msg").active = true this.node.getChildByName("msg").getChildByName("title").getComponent(cc.Label).string = "当前售价:" this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = (this.node["allMoney"]) this.node["qiPaoEffect"] = (node,soundUrl)=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl + soundUrl) node.active = true node.scale = 0 node.getChildByName("str").getComponent(cc.Label).string = soundUrl cc.tween(node) .to(0.2,{scale:1}) .delay(2.0) .to(0.2,{scale:0}) .call(()=>{ node.active = false }) .start() } this.node["dialogFunc"] = (qiPao1,qiPao2,soundUrl_1,soundUrl_2,nanPeople,nvPeople)=>{ this.node.stopAllActions() this.mapNode.getChildByName('qiPaoZuo').stopAllActions() this.mapNode.getChildByName('qiPaoYou').stopAllActions() this.mapNode.getChildByName('qiPaoZuo').active = false this.mapNode.getChildByName('qiPaoYou').active = false let xujiangSpine = this.mapNode.getChildByName("xujiangSpine") let dasaoSpine = this.mapNode.getChildByName("dasaoSpine") //console.log(nanPeople,nvPeople) cc.tween(this.node) .call(()=>{ this.node["qiPaoEffect"](qiPao1,soundUrl_1) //Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl + soundUrl_1) if(nvPeople== 'hot'){ dasaoSpine.getComponent(sp.Skeleton).setAnimation(0,"2han+shuohua",true) }else if(nvPeople== 'veryhot'){ dasaoSpine.getComponent(sp.Skeleton).setAnimation(0,"3dahan+shuohua",true) }else if(nvPeople== 'shengqi'){ dasaoSpine.getComponent(sp.Skeleton).setAnimation(0,"4shengqi",true) } }) .delay(1.8) .call(()=>{ this.node["qiPaoEffect"](qiPao2,soundUrl_2) //Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl + soundUrl_2) if(nanPeople== 'hot'){ xujiangSpine.getComponent(sp.Skeleton).setAnimation(0,"2han+shuohua",true) }else if(nanPeople== 'veryhot'){ xujiangSpine.getComponent(sp.Skeleton).setAnimation(0,"3dahan+shuohua",true) }else if(nanPeople== 'haipa'){ xujiangSpine.getComponent(sp.Skeleton).setAnimation(0,"4xinxu",true) }else if(nanPeople== 'zhengchang'){ xujiangSpine.getComponent(sp.Skeleton).setAnimation(0,"1daiji+shuohua",true) } }) .delay(2.8) .call(()=>{ dasaoSpine.getComponent(sp.Skeleton).setAnimation(0,"1daiji",true) xujiangSpine.getComponent(sp.Skeleton).setAnimation(0,"1daiji",true) }) .start() } let dasaoSpine = this.mapNode.getChildByName('dasaoSpine'); let chuangArea = this.mapNode.getChildByName('床完整'); let chuangPo = this.mapNode.getChildByName('床破损'); let dasaoAttrs = { startPos:dasaoSpine.getPosition(), touchArea:chuangArea, callFunction: ()=>{ chuangArea.active = false chuangPo.active = true this.gameInfo.ChaNode["poChuang"].isCanTouch = true dasaoSpine.setPosition(dasaoSpine['startPos']) dasaoSpine.active = true } } this.openTouchEvent(dasaoSpine,dasaoAttrs) let guziguan = this.mapNode.getChildByName('柜子关'); let suohao = guziguan.getChildByName('锁完好'); let suowai = guziguan.getChildByName('锁外'); let posui = guziguan.getChildByName('锁破损'); let suoArea = this.mapNode.getChildByName('suoArea'); let hongbuNode = this.mapNode.getChildByName('红布'); let hongbuArea = this.mapNode.getChildByName('hongbuArea'); let matongArea = this.mapNode.getChildByName('matongArea'); let liefengArea = this.mapNode.getChildByName('liefengArea'); let matongSpine = this.mapNode.getChildByName('matongSpine'); let baoxianSpine = this.mapNode.getChildByName('baoxianSpine'); let hongbuAttrs = { startPos:hongbuNode.getPosition(), touchArea:hongbuArea, callFunction: ()=>{ hongbuNode.active = false this.gameInfo.ChaNode["zhuoZi"].isCanTouch = true // 注册锤子 let chuziNode = this.mapNode.getChildByName('chuziNode'); let chuiziAttrs = { startPos:chuziNode.getPosition(), touchArea1:suoArea, touchArea2:matongArea, touchArea3:liefengArea, touchArea4:liefengArea, // 柜子锁 callFunction1: ()=>{ suohao.active = false suowai.active = false posui.active = true this.gameInfo.FeiChanDian["guiziArea"].isCanTouch = true }, // 马桶 callFunction2: ()=>{ matongSpine.getComponent(sp.Skeleton).setAnimation(0,"2poshun",false) Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"马桶碎了"); matongSpine.getComponent(sp.Skeleton).setCompleteListener(()=>{ this.gameInfo.ChaNode["zaMaTong"].isCanTouch = true }) }, // 裂缝 callFunction3: ()=>{ this.gameInfo.ChaNode["qiangBiLieFeng"].isCanTouch = false baoxianSpine.getComponent(sp.Skeleton).setAnimation(0,"2liefen",false) this.gameInfo.ChaNode["chuiziChuiQiang1"].isCanTouch = true }, callFunction4: ()=>{ // 宝箱可以触摸 this.gameInfo.ChaNode["chuiziChuiQiang1"].isCanTouch = false baoxianSpine.getComponent(sp.Skeleton).setAnimation(0,"3baoxiangui",false) this.gameInfo.FeiChanDian["baoxianguiArea"].isCanTouch = true } } this.openTouchEvent(chuziNode,chuiziAttrs) } } this.openTouchEvent(hongbuNode,hongbuAttrs) } //map_1201 feiChaDianEvent1201(pos){ let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children for(var i =0;i{ let guanjiaSpine = this.mapNode.getChildByName("guanjiaSpine") guanjiaSpine.getComponent(sp.Skeleton).setAnimation(0,"wanyao",true) Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"得嘞"); },4.5) } } } } } //map_1204 feiChaDianEvent1204(pos){ let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children for(var i =0;i{ yuangongSpine.getComponent(sp.Skeleton).setAnimation(0,"meimaozidaiji",true) this.gameInfo.ChaNode["DiZhongHai"].isCanTouch = true },1) } } } } } //map_1205 feiChaDianEvent1205(pos){ let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children for(var i =0;i{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"下跪地板碎"); taishuSpine.getComponent(sp.Skeleton).setAnimation(0,"tangxia",false) }) .delay(1) .call(()=>{ this.mapNode.getChildByName('qiPaoTS').y = 210 taishuSpine.getComponent(sp.Skeleton).setAnimation(0,"tangxia2",true) this.node["dialogFunc1206"]("这事你得负责,不加50万摆不平",null,"ts",null) }) .delay(1) .call(()=>{ gaoqiqiangSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) lieFeng.active = true this.node["allMoney"] += 500000 this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"] let toolTipnode = cc.instantiate(this.node.getChildByName("msg").getChildByName("contentStr")) ; toolTipnode.getComponent(cc.Label).string = "+" + 500000 toolTipnode.active = true; this.node.getChildByName("msg").addChild(toolTipnode) cc.tween(toolTipnode).to(1,{y:100}).call(()=>{ toolTipnode.removeFromParent() }).start(); }) .start() } } } } } //map_1207 feiChaDianEvent1207(pos){ let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children for(var i =0;i{ this.gameInfo.ChaNode["YinHangKa"].isCanTouch = true }) .start() //点击电脑开关 }else if(feiChaDianChildrens[i].name == "dnKaiGuanTouchArea"){ let dianNao = this.mapNode.getChildByName("dianNao") let dianNaoKaiJi = this.mapNode.getChildByName("dianNaoKaiJi") dianNao.active = false dianNaoKaiJi.active = true this.gameInfo.ChaNode["DianNao"].isCanTouch = false this.gameInfo.ChaNode["YouXiZhangHao"].isCanTouch = true //点击老人 }else if(feiChaDianChildrens[i].name == "laoRenTouchArea"){ let diBanXia = this.mapNode.getChildByName('diBanXia'); let yuZhuo = this.mapNode.getChildByName('yuZhuo'); let suiDiBan = this.mapNode.getChildByName('suiDiBan'); let laorenSpine = this.mapNode.getChildByName('laorenSpine'); laorenSpine.getComponent(sp.Skeleton).setAnimation(0,"chuodiban",false) Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"地板碎"); cc.tween(this.mapNode) .delay(1.1) .call(()=>{ // Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"地板碎"); }) .to(0.1,{angle:-5}) .to(0.1,{angle:5}) .to(0.1,{angle:-5}) .to(0.1,{angle:5}) .to(0.1,{angle:0}) .call(()=>{ this.node["dialogFunc1207"]("你这个不孝子",null,"pp",null) laorenSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) diBanXia.active = true yuZhuo.active = true suiDiBan.active = true this.gameInfo.ChaNode["YuZhuoZi"].isCanTouch = true }) .start() } } } } } //map_1208 feiChaDianEvent1208(pos){ let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children for(var i =0;i{ this.gameInfo.FeiChanDian["caiPiaoTouchArea"].isCanTouch = true }) .start() //启强 }else if(feiChaDianChildrens[i].name == "gaoQiQiangTouchArea"){ if(!this.node["qiqiangketou"]){ this.node["qiqiangketou"] = 0 } if(this.node["qiqiangketou"] >= 20){ return } Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"磕头"); this.node["qiqiangketou"] += 1 this.node.stopAllActions() let qianggeSpine = this.mapNode.getChildByName("qianggeSpine") if(qianggeSpine["isLiuXie"]){ qianggeSpine.getComponent(sp.Skeleton).setAnimation(0,"4ketou",false) }else{ qianggeSpine.getComponent(sp.Skeleton).setAnimation(0,"7ketou",false) } this.node["allMoney"] -= 100 this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"]+"" let toolTipnode = cc.instantiate(this.node.getChildByName("msg").getChildByName("contentStr")) ; toolTipnode.getComponent(cc.Label).string = "-100" toolTipnode.active = true; this.node.getChildByName("msg").addChild(toolTipnode) cc.tween(toolTipnode).to(1,{y:100}).call(()=>{ toolTipnode.removeFromParent() }).start(); cc.tween(this.node) .delay(0.5) .call(()=>{ if(this.node["qiqiangketou"] >= 20){ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"磕死后音效"); qianggeSpine.getComponent(sp.Skeleton).setAnimation(0,"5ketou+yun",false) this.scheduleOnce(()=>{ this.endGameView(0) },3.3) }else{ if(qianggeSpine["isLiuXie"]){ qianggeSpine.getComponent(sp.Skeleton).setAnimation(0,"3daiji",true) }else{ qianggeSpine.getComponent(sp.Skeleton).setAnimation(0,"1daiji",true) } } }) .start() //大嫂 }else if(feiChaDianChildrens[i].name == "daSaoTouchArea"){ this.node["dialogFunc1208"]("求你原谅强哥吧",null,"ds",null) //泰叔 }else if(feiChaDianChildrens[i].name == "taiShuTouchArea"){ this.node["dialogFunc1208"]("今天必须拿出点诚意",null,"ts",null) } } } } } //map_1209 feiChaDianEvent1209(pos){ let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children for(var i =0;i{ this.gameInfo.FeiChanDian["miMaXiangTouchArea"].isCanTouch = true }) .start() //密码箱 }else if(feiChaDianChildrens[i].name == "miMaXiangTouchArea"){ this.mapNode.setPosition(cc.v2(0,0)) let mimasuoLayer = this.mapNode.getChildByName("mimasuoLayer") mimasuoLayer.active = true mimasuoLayer.getComponent('BaoxianGui').setMimaData(true, this.gameInfo) //键盘 }else if(feiChaDianChildrens[i].name == "jianPanTouchArea"){ this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true let xianShiQiYouXi = this.mapNode.getChildByName("xianShiQiYouXi") let xianShiQiGuPiao = this.mapNode.getChildByName("xianShiQiGuPiao") xianShiQiYouXi.active = false xianShiQiGuPiao.active = true this.gameInfo.ChaNode["YouXiBanZhuan"].isCanTouch = false this.gameInfo.ChaNode["GuShiZiChan"].isCanTouch = true //手机 }else if(feiChaDianChildrens[i].name == "shouJiTouchArea"){ this.node["dialogFunc1209"]("儿子,赶紧滚回来继承500个小目标",null,"sj",null) this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true let shouJiGuan = this.mapNode.getChildByName("shouJiGuan") let shouJiKai = this.mapNode.getChildByName("shouJiKai") shouJiGuan.active = false shouJiKai.active = true this.gameInfo.ChaNode["JiChengJiaChan"].isCanTouch = true //窗帘 }else if(feiChaDianChildrens[i].name == "chuangLianTouchArea"){ this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true let chuangLianKai = this.mapNode.getChildByName("chuangLianKai") let chuangLianGuan = this.mapNode.getChildByName("chuangLianGuan") chuangLianGuan.active = false chuangLianKai.active = true this.gameInfo.ChaNode["ZhiShengJi"].isCanTouch = true //水池 }else if(feiChaDianChildrens[i].name == "shuiChiTouchArea"){ this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true let shuiChiGuan = this.mapNode.getChildByName("shuiChiGuan") let jiu = shuiChiGuan.getChildByName("jiu") jiu.active = true this.gameInfo.ChaNode["MaoTaiYuanJiang"].isCanTouch = true //电视 }else if(feiChaDianChildrens[i].name == "dianShiTouchArea"){ this.node["dialogFunc1209"]("今日新闻,王二蛋先生以100亿元收购暴雷公司",null,"ds",null) this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true let dianShiGuan = this.mapNode.getChildByName("dianShiGuan") let dianShiKai = this.mapNode.getChildByName("dianShiKai") dianShiGuan.active = false dianShiKai.active = true this.gameInfo.ChaNode["ShouGouGongSi"].isCanTouch = true //吊灯 }else if(feiChaDianChildrens[i].name == "dengTouchArea"){ this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true let dengSpine = this.mapNode.getChildByName("dengSpine") let nanerSpine = this.mapNode.getChildByName("nanerSpine") dengSpine.getComponent(sp.Skeleton).setAnimation(0,"beizha",false) cc.tween(this.mapNode) .delay(0.2) .call(()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"被砸"); nanerSpine.getComponent(sp.Skeleton).setAnimation(0,"beizha",false) }) .delay(1.3) .call(()=>{ dengSpine.getComponent(sp.Skeleton).setAnimation(0,"none2",false) nanerSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) this.gameInfo.ChaNode["YeMingZhu"].isCanTouch = true }) .start() //牙齿 }else if(feiChaDianChildrens[i].name == "yaChiTouchArea"){ this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true let nanyiSpine = this.mapNode.getChildByName("nanyiSpine") nanyiSpine.getComponent(sp.Skeleton).setAnimation(0,"zhuanshiyadaiji",true) this.gameInfo.ChaNode["ZuanShiYa"].isCanTouch = true //房产证 }else if(feiChaDianChildrens[i].name == "fangChanZhengTouchArea"){ if(!this.node["fangChanZhengNum"]){ this.node["fangChanZhengNum"] = 1 }else{ this.node["fangChanZhengNum"] += 1 } if(this.gameInfo.ChaNode["FangChanZheng"].isFindOut && this.node["fangChanZhengNum"]>1 && this.node["fangChanZhengNum"] <= 10){ this.node["allMoney"] += 5; this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"]+"亿" let toolTipnode = cc.instantiate(this.node.getChildByName("msg").getChildByName("contentStr")) ; toolTipnode.getComponent(cc.Label).string = "+5亿" toolTipnode.active = true; this.node.getChildByName("msg").addChild(toolTipnode) cc.tween(toolTipnode).to(1,{y:100}).call(()=>{ toolTipnode.removeFromParent() }).start(); let fangChanZheng2 = this.mapNode.getChildByName("fangChanZhengElse").getChildByName("fangChanZheng"+this.node["fangChanZhengNum"]) fangChanZheng2 && (fangChanZheng2.active = false) let plusNode = cc.instantiate(this.mapNode.getChildByName("fangChanPlusStr")) ; plusNode.getComponent(cc.Label).string = "+5亿" plusNode.active = true; this.mapNode.addChild(plusNode) cc.tween(plusNode).by(1,{y:100}).call(()=>{ plusNode.removeFromParent() }).start(); }else{ } //女人 }else if(feiChaDianChildrens[i].name == "nvRenTouchArea"){ if(this.node["bChaDian"]){ this.node["dialogFunc1209"]("蛋哥,原谅我吧",null,"mv",) }else{ this.node["dialogFunc1209"]("瞧你那穷酸样",null,"mv",) } //黄毛 }else if(feiChaDianChildrens[i].name == "huangMaoTouchArea"){ if(this.node["bShowGou"]){ this.node["dialogFunc1209"]("我爸啥也不是",null,"htf",) let nanerSpine = this.mapNode.getChildByName("nanerSpine") nanerSpine.stopAllActions() cc.tween(nanerSpine) .call(()=>{ nanerSpine.getComponent(sp.Skeleton).setAnimation(0,"chuitousangqi",false) }) .delay(1.5) .call(()=>{ nanerSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) }) .start() }else{ this.node["dialogFunc1209"]("我爸是暴雷老总",null,"htf",) } } } } } } //map_1210 feiChaDianEvent1210(pos){ let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children for(var i =0;i{ this.gameInfo.ChaNode["JieHunBianLiHun"].isCanTouch = true sizhiSpine.active = false }) .start() //症断书 }else if(feiChaDianChildrens[i].name == "zhenDuanShuTouchArea"){ this.mapNode.setPosition(cc.v2(0,0)) let zhengDuanShuBlockInput = this.mapNode.getChildByName('zhengDuanShuBlockInput'); zhengDuanShuBlockInput.active = true let nanShengSpine = this.mapNode.getChildByName('nanShengSpine'); nanShengSpine.getComponent(sp.Skeleton).setAnimation(0,"kongshoudaiji",true) nanShengSpine["spineStatus"] = "daiji" zhengDuanShuBlockInput.zIndex = 1000 //钱包 }else if(feiChaDianChildrens[i].name == "qianBaoTouchArea"){ this.mapNode.setPosition(cc.v2(0,0)) let qianBao = this.mapNode.getChildByName('qianBao'); qianBao.active = false let qianBaoBlockInput = this.mapNode.getChildByName('qianBaoBlockInput'); qianBaoBlockInput.active = true qianBaoBlockInput.zIndex = 1000 } } } } } //map_1211 feiChaDianEvent1211(pos){ let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children for(var i =0;i{ this.gameInfo.ChaNode["ZhengQiangBingQiLin"].bSwitch = true this.gameInfo.ChaNode["ZhengQiangBingQiLin"].isCanTouch = true }) //点击小证件 }else if(feiChaDianChildrens[i].name == "zhengJianTouchArea1" ){ let zhengJianFangDa = this.mapNode.getChildByName('zhengJianFangDa'); zhengJianFangDa.active = true this.gameInfo.FeiChanDian["zhengJianTouchArea2"].isCanTouch = true break //点击大证件 }else if(feiChaDianChildrens[i].name == "zhengJianTouchArea2"){ let zhengJianFangDa = this.mapNode.getChildByName('zhengJianFangDa'); let gongZuoZheng = zhengJianFangDa.getChildByName('gongZuoZheng'); let linShiGong = zhengJianFangDa.getChildByName('linShiGong'); if(zhengJianFangDa.active){ gongZuoZheng.active = false linShiGong.active = true this.gameInfo.FeiChanDian["zhengJianTouchArea1"].isTouchOff = true this.gameInfo.FeiChanDian["zhengJianTouchArea2"].isTouchOff = true this.gameInfo.ChaNode["LinShiGong"].isCanTouch = true this.gameInfo.ChaNode["LinShiGong"].bSwitch = true } break //点击车前盖 }else if(feiChaDianChildrens[i].name == "cheQianGaiTouchArea" && scene1.active){ let cheSpine = scene1.getChildByName('cheSpine'); if(!cheSpine["clickTimes"]){ cheSpine["clickTimes"] = 1 }else{ cheSpine["clickTimes"]++ } if(cheSpine["clickTimes"] >= 5){ this.gameInfo.FeiChanDian["cheQianGaiTouchArea"].isTouchOff = true cheSpine.getComponent(sp.Skeleton).setAnimation(0,"huangdong",false) cc.tween(this.mapNode) .delay(0.7) .call(()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"车轮毂断裂"); }) .delay(1.3) .call(()=>{ cheSpine.getComponent(sp.Skeleton).setAnimation(0,"huangdong2",true) this.gameInfo.ChaNode["LunGuDuanLie1"].isCanTouch = true this.gameInfo.ChaNode["LunGuDuanLie1"].bSwitch = true this.gameInfo.ChaNode["LunGuDuanLie2"].isCanTouch = true this.gameInfo.ChaNode["LunGuDuanLie2"].bSwitch = true this.gameInfo.ChaNode["DiaoLuoDeCheDeng1"].isCanTouch = true this.gameInfo.ChaNode["DiaoLuoDeCheDeng1"].bSwitch = true this.gameInfo.ChaNode["DiaoLuoDeCheDeng2"].isCanTouch = true this.gameInfo.ChaNode["DiaoLuoDeCheDeng2"].bSwitch = true }) .start() }else{ cheSpine.getComponent(sp.Skeleton).setAnimation(0,"qiao",false) } //点击导购 }else if(feiChaDianChildrens[i].name == "meiNvTouchArea"){ this.node["dialogFunc1211"]("冰淇淋已经发完了","xjj") } } } } } //map_1212 feiChaDianEvent1212(pos){ let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children for(var i =0;i= 5){ nanSpine.getComponent(sp.Skeleton).setAnimation(0,"beidaduan",false) }else{ nanSpine.getComponent(sp.Skeleton).setAnimation(0,"beida",false) } cc.tween(this.mapNode) .delay(0.3) .call(()=>{ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"击打"); }) .delay(0.3) .call(()=>{ if(nvSpine["daCiShu"] >= 5){ this.gameInfo.FeiChanDian["nvRenTouchArea"].isTouchOff = true this.scheduleOnce(()=>{ this.endGameView(0) },0.5) }else{ this.gameInfo.FeiChanDian["nvRenTouchArea"].isTouchOff = false nanSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) } nvSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) if(nvSpine["daCiShu"] == 1){ let chaNode = this.mapNode.getChildByName('chaDianNode').getChildByName('XiTiaoFanYing') this.findOnChaDian(chaNode) } }) .start() //点击男人手机 }else if(feiChaDianChildrens[i].name == "nanShouJiTouchArea"){ let nanRenShouJiNode = this.mapNode.getChildByName("nanRenShouJiNode") nanRenShouJiNode.active = true //点击女人手机 }else if(feiChaDianChildrens[i].name == "nvShouJiTouchArea"){ let nvRenShouJiNode = this.mapNode.getChildByName("nvRenShouJiNode") nvRenShouJiNode.active = true //点击电脑 }else if(feiChaDianChildrens[i].name == "dianNaoTouchArea"){ let dianNaoNode = this.mapNode.getChildByName("dianNaoNode") dianNaoNode.active = true //点击地球仪 }else if(feiChaDianChildrens[i].name == "diQiuYiTouchArea"){ let diQiuYiNode = this.mapNode.getChildByName("diQiuYiNode") diQiuYiNode.active = true //点击会员卡 }else if(feiChaDianChildrens[i].name == "huiYuanKaTouchArea"){ let huiYuanKaNode = this.mapNode.getChildByName("huiYuanKaNode") huiYuanKaNode.active = true } } } } } //map_1213 feiChaDianEvent1213(pos){ let kongTiaoKai = this.mapNode.getChildByName("kongTiaoKai") let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children for(var i =0;i{ toolTipnode.removeFromParent() }).start(); let popoSpine = this.mapNode.getChildByName('popoSpine'); popoSpine.getComponent(sp.Skeleton).setAnimation(0,"shengqi",false) cc.tween(this.mapNode) .delay(2) .call(()=>{ popoSpine.getComponent(sp.Skeleton).setAnimation(0,"daiji",true) }) .start() //点击插头 }else if(feiChaDianChildrens[i].name == "chaTouTouchArea"){ let kongTiaoGuan = this.mapNode.getChildByName("kongTiaoGuan") kongTiaoGuan.active = false kongTiaoKai.active = true let chaNode = this.mapNode.getChildByName('chaDianNode').getChildByName('KaiKongTiao') this.findOnChaDian(chaNode) //点击电视 }else if(feiChaDianChildrens[i].name == "dianShiTouchArea"){ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"本市某小区,一男性因家庭婆媳矛盾跳楼"); cc.tween(this.mapNode) .delay(4) .call(()=>{ let chaNode = this.mapNode.getChildByName('chaDianNode').getChildByName('DianShiXinWen') this.findOnChaDian(chaNode) }) .start() //点击纸团 }else if(feiChaDianChildrens[i].name == "zhiTuanTouchArea"){ let zhiTuan = this.mapNode.getChildByName("zhiTuan") zhiTuan.active = false let bingLiBenNode = this.mapNode.getChildByName("bingLiBenNode") bingLiBenNode.active = true //点击手机 }else if(feiChaDianChildrens[i].name == "shouJiTouchArea"){ let gouWuCheNode = this.mapNode.getChildByName('gouWuCheNode'); gouWuCheNode.active = true //点击柜门 }else if(feiChaDianChildrens[i].name == "guiMenTouchArea"){ let guiMenGuan = this.mapNode.getChildByName('guiMenGuan'); let guiMenKai = this.mapNode.getChildByName('guiMenKai'); guiMenGuan.active = false guiMenKai.active = true let yiFu = this.mapNode.getChildByName('yiFu'); yiFu.active = true //点击抽屉 }else if(feiChaDianChildrens[i].name == "chouTiTouchArea"){ let chouTiKai = this.mapNode.getChildByName('chouTiKai'); chouTiKai.active = true let fangChanZheng = this.mapNode.getChildByName('fangChanZheng'); fangChanZheng.active = true } } } } } specialMap1302(pos){ let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children // dasaoArea:{isCanTouch:true,isTouchOff:false}, // xujiangArea:{isCanTouch:true,isTouchOff:false}, // guiziArea:{isCanTouch:false,isTouchOff:false}, // baoxianguiArea:{isCanTouch:false,isTouchOff:false}, // saiziArea:{isCanTouch:true,isTouchOff:false}, // chuanlianArea:{isCanTouch:true,isTouchOff:false}, // kongtiaoArea:{isCanTouch:true,isTouchOff:false}, // dianshiArea:{isCanTouch:true,isTouchOff:false} for(var i =0;i{ this.gameInfo.ChaNode["xiShouPan"].isCanTouch = true saiziSpine.getComponent(sp.Skeleton).setAnimation(0,"3penshui",true) },2.0) }else if(feiChaDianChildrens[i].name == "chuanlianArea"){ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"拉窗帘"); this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true let wendujiSpine = this.mapNode.getChildByName('wendujiSpine'); let dianshiSpine = this.mapNode.getChildByName('chuanglianSpine'); let reSpr = this.mapNode.getChildByName('reSpr'); let dasaoSpine = this.mapNode.getChildByName('dasaoSpine'); let xujiangSpine = this.mapNode.getChildByName('xujiangSpine'); this.gameInfo.FeiChanDian["kongtiaoArea"].isCanTouch = true wendujiSpine.getComponent(sp.Skeleton).setAnimation(0,"2shengwen50",false) dianshiSpine.getComponent(sp.Skeleton).setAnimation(0,"2dakai",false) dianshiSpine.getComponent(sp.Skeleton).setCompleteListener(()=>{ reSpr.active = true reSpr.opacity = 150 cc.tween(reSpr) .to(0.2, {opacity:30}) .to(0.2, {opacity:150}) .to(0.2, {opacity:30}) .to(0.2, {opacity:150}) .to(0.2, {opacity:30}) .to(0.2, {opacity:150}) .call(()=>{ reSpr.active = false dasaoSpine.getComponent(sp.Skeleton).setAnimation(0,"2han",true) xujiangSpine.getComponent(sp.Skeleton).setAnimation(0,"2han",true) this.gameInfo.ChaNode["chuangHu"].isCanTouch = true }) .start() }) }else if(feiChaDianChildrens[i].name == "kongtiaoArea"){ this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"空调"); let kongtiaoSpine = this.mapNode.getChildByName('kongtiaoSpine'); let wendujiSpine = this.mapNode.getChildByName('wendujiSpine'); let reSpr = this.mapNode.getChildByName('reSpr'); let dasaoSpine = this.mapNode.getChildByName('dasaoSpine'); let xujiangSpine = this.mapNode.getChildByName('xujiangSpine'); wendujiSpine.getComponent(sp.Skeleton).setAnimation(0,"4baozha100",false) kongtiaoSpine.getComponent(sp.Skeleton).setAnimation(0,"2kai",false) kongtiaoSpine.getComponent(sp.Skeleton).setCompleteListener(()=>{ reSpr.active = true reSpr.opacity = 255 cc.tween(reSpr) .to(0.2, {opacity:30}) .to(0.2, {opacity:255}) .to(0.2, {opacity:30}) .to(0.2, {opacity:255}) .to(0.2, {opacity:30}) .to(0.2, {opacity:255}) .call(()=>{ reSpr.active = false dasaoSpine.getComponent(sp.Skeleton).setAnimation(0,"3dahan",true) xujiangSpine.getComponent(sp.Skeleton).setAnimation(0,"3dahan",true) this.gameInfo.ChaNode["kongTiao"].isCanTouch = true }) .start() }) }else if(feiChaDianChildrens[i].name == "dianshiArea"){ Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"电视机"); this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true let dianshiSpine = this.mapNode.getChildByName('dianshiSpine'); dianshiSpine.getComponent(sp.Skeleton).setAnimation(0,"2kai",true) dianshiSpine.getComponent(sp.Skeleton).setCompleteListener(()=>{ this.gameInfo.ChaNode["dianShi"].isCanTouch = true }) } } } } } findChadian1302(curNode,answerIcon){ //Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+this.gameInfo.ChaNode[curNode.name].sound); this.node["dialogFunc"](this.mapNode.getChildByName('qiPaoYou'),this.mapNode.getChildByName('qiPaoZuo'),this.gameInfo.ChaNode[curNode.name].sound1,this.gameInfo.ChaNode[curNode.name].sound2,this.gameInfo.ChaNode[curNode.name].nvPeople, this.gameInfo.ChaNode[curNode.name].nanPeople) let index_ = 0 if( this.allMoneyNum_ == 0){ this.node.getChildByName("msg").stopAllActions() this.allMoneyNum_ = this.node["allMoney"] }else{ this.node.getChildByName("msg").stopAllActions() let num = this.node.getChildByName("msg")['beifenNum'] this.node["allMoney"] = num this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"]+"" this.allMoneyNum_ = this.node["allMoney"] } this.node.getChildByName("msg")['beifenNum'] = this.node["allMoney"]-this.gameInfo.ChaNode[curNode.name].money cc.tween(this.node.getChildByName("msg")) .call(()=>{ this.allMoneyNum_ -= Math.floor(this.gameInfo.ChaNode[curNode.name].money/20) ; this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.allMoneyNum_ +"" index_++ if(index_==20){ this.node["allMoney"] -= this.gameInfo.ChaNode[curNode.name].money; this.node.getChildByName("msg").getChildByName("contentStr").getComponent(cc.Label).string = this.node["allMoney"]+"" this.node.getChildByName("msg").stopAllActions() this.allMoneyNum_ = 0 } }) .delay(0.015) .union() .repeatForever() .start() if(this.gameInfo.ChaNode[curNode.name].desc == '古董宝贝'){ answerIcon.getChildByName("label").getComponent(cc.Label).string = "+50000000" }else{ answerIcon.getChildByName("label").getComponent(cc.Label).string = this.gameInfo.ChaNode[curNode.name].money+"" } let toolTipnode = cc.instantiate(this.node.getChildByName("msg").getChildByName("contentStr")) ; if(this.gameInfo.ChaNode[curNode.name].desc == '古董宝贝'){ toolTipnode.getComponent(cc.Label).string = "+50000000"; }else{ toolTipnode.getComponent(cc.Label).string = "-"+this.gameInfo.ChaNode[curNode.name].money + ""; } toolTipnode.active = true; this.node.getChildByName("msg").addChild(toolTipnode) cc.tween(toolTipnode).to(1,{y:100}).call(()=>{ toolTipnode.removeFromParent() }).start(); } endGameView(touchIndex) { Game.ins.stopTime(); if (touchIndex == 0) { if(this.isFailShow){ return } this.isFailShow = true this.scheduleOnce(() => { Game.ins.showFail(); }, 3); } else { if(this.isSuccessShow){ return } this.isSuccessShow = true this.scheduleOnce(() => { Game.ins.showSuccess(); },3); } } }