我智商爆棚
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

3865 lines
191 KiB

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 FMSkeletonExtend from "../../../FrameWork/Component/FMSkeletonExtend";
import ZhaoChaConfig from "./ZhaoChaConfig";
import Common from "../../../FrameWork/Util/Common";
import DaDianScript from "../../../FrameWork/Base/DaDianScript";
const {ccclass, property} = cc._decorator;
//找茬类型(老版/新版)
enum ZhaoChaType{
Type1,//老版-答案只显示文字
Type2,//新版-答案掉落图片并显示文字
Type3,//新版-答案掉落图片并显示文字(微恐)
Type4,//新版-答案掉落图片并显示文字(12个)
Type5,//新版-答案掉落图片并显示文字(微恐12个)
Type6,//新版-答案掉落图片并显示文字(微恐12个)
}
@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//已找出个数
// maxTimes:number = 8
mapNode: cc.Node = null; //map图片
curMapName:string = ""//当前map名称
mapNodeFixedScale:number = 0.6//固定缩放(图片太大了)
touchStartTime:number = 0//触摸开始时间
timerCallback = null//计时器回调
tm = null;
_dt = 0;
isStartTimer:boolean = false;
curZIndex:number = 0;
geCiLabel = null
isCanTouchChaDian:boolean = true;
@property(cc.Node)
timeNode:cc.Node = null;
@property(cc.Node)
iconNode: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;
@property(cc.Node)
answerNodeType3: cc.Node = null;
@property(cc.Node)
answerNodeType4: cc.Node = null;
@property(cc.Node)
answerNodeType5: 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.getInstance().getHideGoodsInfo(this.gameId)
console.log("this.gameInfo==",this.gameInfo)
EventMgr.onEvent_custom(ryw_Event.timeOut, (tab) => {
if(this.gameId == 558){
cc.tween(this.node)
.delay(1.5)
.call(()=>{
Game.ins.showFail();
})
.start()
}else{
Game.ins.showFail();
}
}, this);
EventMgr.onEvent_custom(ryw_Event.DirectTouchMoveCheck, (data_) => {
this.directTouchMoveCallback(data_.targetNode);
}, this);
DaDianScript.userEnterDaDian()
}
start(){
cc.macro.ENABLE_MULTI_TOUCH = true;
this.init_line()
this.initMapNodeTouchEvent()
this.initComponent();
this.specialInit();
}
//初始化组件
initComponent() {
// let lab = this.node.getChildByName("标题").getChildByName("lab");
// lab.getComponent(cc.Label).string = Common5.gameConfig.zmGameConfig[Common5.selectGameNum].title2
this.scheduleOnce(this.setTimeNode, 0);
}
update(dt: number){
//找茬19中有一个歌词播报功能
if(this.gameId == 519 && this.isStartTimer){
this._dt += dt
this.geCiLabel.x = 601 - this._dt*350
}
if(this.gameId == 554){
this.update_554(dt);
}
}
specialInit(){
if (this.gameId == 561){
Common5.getSpriteFrameFromBundle(this.subBundle,"texture/wukong",this.iconNode.getComponent(cc.Sprite),()=>{
this.iconNode.active = true;
})
}
}
private tick_554 = 0;
private tick_554_1 = 0;
update_554(dt: number){
if(this.mapNode && this.mapNode.getChildByName('dxdaojishi').active && !this.mapNode.getChildByName('bg2').active){
this.tick_554 += dt;
if(this.tick_554 >= 6.0){
this.tick_554 = 0;
cc.tween(this.mapNode.getChildByName('dxdaojishi'))
.delay(1.0)
.call(()=>{
this.mapNode.getChildByName('dxqiaomensheng').active = true;
Common5.playEffectCustom("WordGame","fkwz123/ZhaoCha/map54/sound/敲门声")
})
.delay(1.0)
.call(()=>{
this.mapNode.getChildByName('dxqiaomensheng').active = false;
})
.start()
}
}
if(this.mapNode && this.mapNode.getChildByName('bg2').active && !this.mapNode.getChildByName('maoyao').active){
this.tick_554_1 += dt;
if(this.tick_554_1 > 6.0){
this.tick_554_1 = 0;
Common5.playEffectCustom("WordGame","fkwz123/ZhaoCha/map54/sound/猫叫")
}
}
}
setTimeNode(){
let worldPos = this.timeNode.getPosition()
Game.ins.setTimePos(worldPos.x,worldPos.y)
Game.ins.setTimeScale(0.7)
}
init_line(){
if(this.gameInfo.PrefabInfo.zhaoChaType == ZhaoChaType.Type1){
this.answerNodeType1.active = true
this.answerNodeType2.active = false
this.answerNodeType3.active = false
this.answerNodeType4.active = false
this.answerNodeType5.active = false
for(var i=0;i<this.gameInfo.PrefabInfo.num;i++){
this.answerNodeType1.getChildByName("xhx_"+i).active = true
}
}else if(this.gameInfo.PrefabInfo.zhaoChaType == ZhaoChaType.Type2){
this.answerNodeType1.active = false
this.answerNodeType2.active = true
this.answerNodeType3.active = false
this.answerNodeType4.active = false
this.answerNodeType5.active = false
for(var i=0;i<this.gameInfo.PrefabInfo.num;i++){
this.answerNodeType2.getChildByName("xhx_"+i).active = true
}
}else if(this.gameInfo.PrefabInfo.zhaoChaType == ZhaoChaType.Type3){
this.answerNodeType1.active = false
this.answerNodeType2.active = false
this.answerNodeType3.active = true
this.answerNodeType4.active = false
this.answerNodeType5.active = false
for(var i=0;i<this.gameInfo.PrefabInfo.num;i++){
this.answerNodeType3.getChildByName("xhx_"+i).active = true
}
}else if(this.gameInfo.PrefabInfo.zhaoChaType == ZhaoChaType.Type4){
this.answerNodeType1.active = false
this.answerNodeType2.active = false
this.answerNodeType3.active = false
this.answerNodeType4.active = true
this.answerNodeType5.active = false
for(var i=0;i<this.gameInfo.PrefabInfo.num;i++){
this.answerNodeType4.getChildByName("xhx_"+i).active = true
}
}else if(this.gameInfo.PrefabInfo.zhaoChaType == ZhaoChaType.Type5){
this.answerNodeType1.active = false
this.answerNodeType2.active = false
this.answerNodeType3.active = false
this.answerNodeType4.active = false
this.answerNodeType5.active = true
for(var i=0;i<this.gameInfo.PrefabInfo.num;i++){
this.answerNodeType5.getChildByName("xhx_"+i).active = true
}
}else if(this.gameInfo.PrefabInfo.zhaoChaType == ZhaoChaType.Type6){
this.answerNodeType1.active = false
this.answerNodeType2.active = true
this.answerNodeType3.active = false
this.answerNodeType4.active = false
this.answerNodeType5.active = false
for(var i=0;i<this.gameInfo.PrefabInfo.num;i++){
this.answerNodeType5.getChildByName("xhx_"+i).active = true
}
}
}
//初始化触摸监听
initMapNodeTouchEvent(){
Common5.getPrefabFromBundle(this.subBundle,this.subUrl,this.maskNode,(prefabNode)=>{
this.mapNode = prefabNode
this.initMouseEvent();
this.mapNode.on(cc.Node.EventType.TOUCH_START, this.touchStart_mapNode,this)
this.mapNode.on(cc.Node.EventType.TOUCH_MOVE, this.touchMove_mapNode,this)
this.mapNode.on(cc.Node.EventType.TOUCH_CANCEL, this.touchEnd_mapNode,this)
this.mapNode.on(cc.Node.EventType.TOUCH_END, this.touchEnd_mapNode,this)
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<prefabHeight){
this.mapNodeFixedScale = widthScale
}else{
this.mapNodeFixedScale = heightScale
}
this.mapNode.scale = this.mapNodeFixedScale
this.curScale = this.mapNodeFixedScale
this.lastScale = this.mapNodeFixedScale
this.specialNodeTouchEvent()
});
}
touchStart_mapNode(event){
Common5.playEffect("click")
if(this.touchId1 < 0){
this.touchId1 = event.touch.getID()
}else if(this.touchId2 < 0){
this.touchId2 = event.touch.getID()
}
if(this.touchId1 >= 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
this.goToBoundary();
}else if(touches.length == 1){ //拖动
let delta = event.getDelta()
this.mapNode.x += delta.x
this.mapNode.y += delta.y
// console.log(this.mapNode.scale,this.mapNode.x,this.mapNode.y);
this.goToBoundary()
}
}
touchEnd_mapNode(event){
let dateNow = Date.now()
if(dateNow - this.touchStartTime > 0.2 * 1000){
//补丁,长按两秒
if(dateNow - this.touchStartTime > 1 * 1000){
if(this.gameId == 515){
let ShiMenTouchNode = this.mapNode.getChildByName("feiChaDianNode").getChildByName('ShiMenTouchNode')
let rect = ShiMenTouchNode.getBoundingBoxToWorld()
if(ShiMenTouchNode.active && rect.contains(event.getLocation())){
ShiMenTouchNode.active = false
Common5.playEffectCustom(this.subBundle,"sound/shitou1000")
let shiMenSpineNode= this.mapNode.getChildByName("feiChaDianNode").getChildByName("ShiMenSpine")
shiMenSpineNode.getComponent(sp.Skeleton).setAnimation(0,"shimen",false)
shiMenSpineNode.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{
this.gameInfo.ChaNode["ZhuBaJie"].isCanTouch = true
Common5.playEffectCustom(this.subBundle,"sound/zhu2000")
})
}
}
}
}else{
this.isFind = false;
let touchPos = event.getLocation();
if(this.gameInfo.PrefabInfo.zhaoChaType == ZhaoChaType.Type1){
this.checkIsInAreaOrdVersion(touchPos)
}else if(this.gameInfo.PrefabInfo.zhaoChaType == ZhaoChaType.Type2 || this.gameInfo.PrefabInfo.zhaoChaType == ZhaoChaType.Type3 ||this.gameInfo.PrefabInfo.zhaoChaType == ZhaoChaType.Type4 || this.gameInfo.PrefabInfo.zhaoChaType == ZhaoChaType.Type5|| this.gameInfo.PrefabInfo.zhaoChaType == ZhaoChaType.Type6){
this.checkIsInAreaNewVersion(touchPos)
}
if(!this.isFind && this.gameInfo.PrefabInfo.AddTime){
//let pos = event.target.convertToWorldSpaceAR(touchPos);
let pos = Common5.getPosInWorld_custom(this.timeNode);
pos.x = pos.x + 80;
//let pos = cc.find("Canvas").convertToNodeSpaceAR(touchPos);
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
// this.goToBoundary()
}
}
//距离
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
}
}
initMouseEvent(){
this.mapNode.on(cc.Node.EventType.MOUSE_WHEEL,function(event){//监听名称+事件参数
console.log(event);
let tmpscale = this.mapNode.scale;
if (event._scrollY > 0){
if (this.mapNode.scale < 3){
tmpscale+=0.2;
this.mapNode.scale = tmpscale
this.curScale = tmpscale
this.lastScale = tmpscale
}
}
else {
if (this.mapNode.scale > this.mapNodeFixedScale){
tmpscale-=0.2;
this.mapNode.scale = tmpscale
this.curScale = tmpscale
this.lastScale = tmpscale
}
}
// console.log(this.mapNode.scale,this.mapNode.x,this.mapNode.y);
this.goToBoundary();
},this);
}
//找到一个茬点
findOnChaDian(curNode,type?:number){
let markParent = curNode
Common5.playEffect("success2")
let mark = cc.instantiate(this.markSp)
mark.active = true
markParent.addChild(mark)
let parentNode = null
if(this.gameInfo.PrefabInfo.zhaoChaType == ZhaoChaType.Type2){
parentNode = this.answerNodeType2
}else if(this.gameInfo.PrefabInfo.zhaoChaType == ZhaoChaType.Type3){
parentNode = this.answerNodeType3
}else if(this.gameInfo.PrefabInfo.zhaoChaType == ZhaoChaType.Type4){
parentNode = this.answerNodeType4
}else if(this.gameInfo.PrefabInfo.zhaoChaType == ZhaoChaType.Type5){
parentNode = this.answerNodeType5
}else if(this.gameInfo.PrefabInfo.zhaoChaType == ZhaoChaType.Type6){
parentNode = this.answerNodeType2
}
let childNode = parentNode.getChildByName("xhx_"+this.findTimes)
let answerIcon = cc.instantiate(curNode.getChildByName("childIcon"));
answerIcon.active = true;
console.log(type)
//if (type == 1){
if (this.gameId == 556){
answerIcon.parent = this.node;
curNode.active = false;
this.findTimes += 1
this.scheduleOnce(()=>{
this.mapNode.getChildByName("other").getChildByName("guang").active = true;
Common5.playEffectCustom("WordGame",this.gameInfo.PrefabInfo.soundurl+this.gameInfo.ChaNode[curNode.name].sound);
this.mapNode.getChildByName("other").getChildByName("baozupo").getComponent(sp.Skeleton).animation = "2daiji2";
this.scheduleOnce(()=>{
this.mapNode.getChildByName("other").getChildByName("baozupo").getComponent(sp.Skeleton).animation = "2daiji";
},1.5)
this.gameInfo.fangzu -= this.gameInfo.ChaNode[curNode.name].money;
this.node.getChildByName("msg").getChildByName("fangzu").getComponent(cc.Label).string = this.gameInfo.fangzu;
let toolTipnode = this.node.getChildByName("msg").getChildByName("tishi");
toolTipnode.getComponent(cc.Label).string = "-"+this.gameInfo.ChaNode[curNode.name].money;
toolTipnode.active = true;
cc.tween(toolTipnode).to(1,{y:100}).call(()=>{
toolTipnode.active = false;
toolTipnode.y = 0;
}).start();
},0.4)
cc.tween(answerIcon)
.to(0.4,{x:0,y:150,scale:3})
.delay(2)
.call(()=>{
if (this.gameInfo.ChaNode[curNode.name].say != ""){
this.mapNode.getChildByName("xiaojiejie").getChildByName("dialog").getChildByName("label").getComponent(cc.Label).string = this.gameInfo.ChaNode[curNode.name].say;
this.mapNode.getChildByName("xiaojiejie").getChildByName("dialog").active = true;
this.scheduleOnce(()=>{
this.mapNode.getChildByName("xiaojiejie").getChildByName("dialog").active = false;
},2)
}
this.mapNode.getChildByName("other").getChildByName("guang").active = false;
answerIcon.parent = childNode
Common5.setNodeToTargetPos(answerIcon,curNode.getChildByName("childIcon"))
cc.tween(answerIcon)
.to(0.4,{x:0,y:0,scale:1})
.call(()=>{
curNode.active = false;
childNode.getChildByName("desc").active = true
childNode.getChildByName("desc").getComponent(cc.Label).string = this.gameInfo.ChaNode[curNode.name].desc
answerIcon.getChildByName("label").active = true;
answerIcon.getChildByName("label").getComponent(cc.Label).string = this.gameInfo.ChaNode[curNode.name].money;
console.log("已完成个数==",this.findTimes)
this.findSpecialChaDianNums()
if(this.findTimes >= this.gameInfo.PrefabInfo.num){
if (this.gameInfo.fangzu <=0){
console.log("完成任务===")
//补丁,map19需要延迟结算
let timeNum = 0.1
if(this.gameId == 519){
timeNum = 6
}
this.scheduleOnce(()=>{
this.endGameView(1)
},timeNum)
}
else {
let timeNum = 0.1
this.scheduleOnce(()=>{
this.endGameView(0)
},timeNum)
}
return
}
})
.start()
}).start();
}
else if(this.gameId == 558){
answerIcon.parent = childNode
Common5.setNodeToTargetPos(answerIcon,curNode.getChildByName("childIcon"))
this.findOnChaDian558(answerIcon, curNode, childNode)
}
else if(this.gameId == 560){
this.findOnChaDian560(answerIcon, curNode, childNode)
}
else {
answerIcon.parent = childNode
Common5.setNodeToTargetPos(answerIcon,curNode.getChildByName("childIcon"))
this.findTimes += 1
//这里针对新的类型进行一个特殊处理:茬点找到后,播放语音。
if(this.gameId == 557){
this.findOnChaDian557(curNode);
}
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)
this.findSpecialChaDianNums()
if(this.findTimes >= this.gameInfo.PrefabInfo.num){
console.log("完成任务===")
//补丁,map19需要延迟结算
let timeNum = 0.1
if(this.gameId == 519){
timeNum = 6
}
if(this.gameId == 557){
timeNum = 5;
}
this.scheduleOnce(()=>{
this.endGameView(1)
},timeNum)
return
}
})
.start()
}
if (this.gameId == 561){
curNode.getChildByName("cd").active = true;
}
}
findOnChaDian558(answerIcon:cc.Node, curNode:cc.Node, childNode:cc.Node){
//answerIcon.parent = this.node;
if(curNode.name == 'siwa'){
curNode.active = false;
this.mapNode.getChildByName('shoucanggui2').getChildByName('siwa').active = false;
}else if(curNode.name == 'shanyu1' || curNode.name == 'shanyu2'){
curNode.active = false;
this.mapNode.getChildByName('shanyu1').active = false;
this.mapNode.getChildByName('shanyu2').active = false;
let chouwazi = this.mapNode.getChildByName('chouwazi')
this.closeTouchEvent(chouwazi)
}else if(curNode.name == 'xizhuang'){
curNode.active = false;
this.mapNode.getChildByName('dxnan1').active = true
this.mapNode.getChildByName('dxnan2').active = false
this.mapNode.getChildByName('chouwazi').getChildByName('wa2').active = true
this.mapNode.getChildByName('chouwazi').getChildByName('wa1').active = false
}else if(curNode.name == 'sanshiliuji'){
curNode.active = false;
this.mapNode.getChildByName('san6ji').active = false;
}else if(curNode.name == 'chuang'){
curNode.active = false;
this.mapNode.getChildByName('chuang').active = false;
}else if(curNode.name == 'meinvyifu'){
curNode.active = false;
//this.mapNode.getChildByName('chuang').active = false;
}else if(curNode.name == 'hongjiu'){
curNode.active = false;
this.mapNode.getChildByName('hongjiu').active = false;
}else if(curNode.name == 'mingjiashufa'){
curNode.active = false;
this.mapNode.getChildByName('mingjiashufa').active = false;
}
else{
curNode.active = false;
}
this.findTimes += 1
this.scheduleOnce(()=>{
//光环
//this.mapNode.getChildByName("other").getChildByName("guang").active = true;
//播放声音
Common5.playEffectCustom("WordGame",this.gameInfo.PrefabInfo.soundurl+this.gameInfo.ChaNode[curNode.name].sound);
this.mapNode.getChildByName('dxdasao').getComponent(FMSkeletonExtend).animation = 'shuohua'
cc.tween(this.mapNode.getChildByName('dxdasao'))
.delay(this.gameInfo.ChaNode[curNode.name].time)
.call(()=>{
this.mapNode.getChildByName('dxdasao').getComponent(FMSkeletonExtend).animation = 'daiji'
})
.start()
//包租婆的状态设置
// this.mapNode.getChildByName("other").getChildByName("baozupo").getComponent(sp.Skeleton).animation = "2daiji2";
// this.scheduleOnce(()=>{
// this.mapNode.getChildByName("other").getChildByName("baozupo").getComponent(sp.Skeleton).animation = "2daiji";
// },1.5)
//计算剩余房租
this.gameInfo.fangzu -= this.gameInfo.ChaNode[curNode.name].money;
this.node.getChildByName("msg").getChildByName("fangzu").getComponent(cc.Label).string = this.gameInfo.fangzu;
//数字减少的提示
let toolTipnode = this.node.getChildByName("msg").getChildByName("tishi");
toolTipnode.getComponent(cc.Label).string = "-"+this.gameInfo.ChaNode[curNode.name].money;
toolTipnode.active = true;
cc.tween(toolTipnode).to(1,{y:100}).call(()=>{
toolTipnode.active = false;
toolTipnode.y = 0;
}).start();
},0.4)
cc.tween(answerIcon)
//.to(0.4,{x:0,y:150,scale:3})
//.delay(2)
.delay(0.1)
.call(()=>{
// if (this.gameInfo.ChaNode[curNode.name].say != ""){
// this.mapNode.getChildByName("xiaojiejie").getChildByName("dialog").getChildByName("label").getComponent(cc.Label).string = this.gameInfo.ChaNode[curNode.name].say;
// this.mapNode.getChildByName("xiaojiejie").getChildByName("dialog").active = true;
// this.scheduleOnce(()=>{
// this.mapNode.getChildByName("xiaojiejie").getChildByName("dialog").active = false;
// },2)
// }
this.mapNode.getChildByName("other").getChildByName("guang").active = false;
//answerIcon.parent = childNode
Common5.setNodeToTargetPos(answerIcon,curNode.getChildByName("childIcon"))
cc.tween(answerIcon)
.to(0.4,{x:0,y:0,scale:1})
.call(()=>{
curNode.active = false;
childNode.getChildByName("desc").active = true
childNode.getChildByName("desc").getComponent(cc.Label).string = this.gameInfo.ChaNode[curNode.name].desc
answerIcon.getChildByName("label").active = true;
answerIcon.getChildByName("label").getComponent(cc.Label).string = this.gameInfo.ChaNode[curNode.name].money;
console.log("已完成个数==",this.findTimes)
this.findSpecialChaDianNums()
if(this.findTimes >= this.gameInfo.PrefabInfo.num){
if (this.gameInfo.fangzu <=0){
console.log("完成任务===")
//补丁,map19需要延迟结算
let timeNum = 5.0
if(this.gameId == 519){
timeNum = 6
}
this.scheduleOnce(()=>{
this.endGameView(1)
},timeNum)
}
else {
let timeNum = 0.1
this.scheduleOnce(()=>{
this.endGameView(0)
},timeNum)
}
return
}
})
.start()
}).start();
}
findOnChaDian557(chaDian:cc.Node){
let cd = this.gameInfo.ChaNode[chaDian.name];
if(cd.sound && cd.sound != ''){
this.scheduleOnce(()=>{
if(chaDian.name == 'yingwu' ){
}else if(chaDian.name == 'butiao'){
this.mapNode.getChildByName('dxgz').getComponent(FMSkeletonExtend).animation = 'animation';
}
else{
this.mapNode.getChildByName('dxdl').getComponent(FMSkeletonExtend).animation = 'shuohua1'
}
//这里播放语音
Common5.playEffectCustom("WordGame",this.gameInfo.PrefabInfo.soundurl + cd.sound);
cc.tween(chaDian)
.delay(cd.time)
.call(()=>{
this.mapNode.getChildByName('dxdl').getComponent(FMSkeletonExtend).animation = 'daiji'
if(cd.sound1 && cd.sound1 != ''){
if(chaDian.name == 'yingwu' ){
this.mapNode.getChildByName('dxdl').getComponent(FMSkeletonExtend).animation = 'shuohua1'
}
Common5.playEffectCustom("WordGame",this.gameInfo.PrefabInfo.soundurl + cd.sound1);
cc.tween(chaDian)
.delay(cd.time1)
.call(()=>{
//声音播放完了。
if(chaDian.name == 'yingwu' ){
this.mapNode.getChildByName('dxdl').getComponent(FMSkeletonExtend).animation = 'daiji'
}
})
.start()
}
})
.start()
},0.5)
}
}
findOnChaDian560(answerIcon, curNode, childNode){
let mark = cc.instantiate(this.markSp)
mark.active = true
if(curNode.parent.name == 'chaDianNode'){
let curNodeCopy = this.mapNode.getChildByName('chaDianCopyNode').getChildByName(curNode.name)
curNodeCopy.addChild(mark);
}else{
let curNodeCopy = this.mapNode.getChildByName('chaDianNode').getChildByName(curNode.name)
curNodeCopy.addChild(mark);
}
answerIcon.parent = childNode
Common5.setNodeToTargetPos(answerIcon,curNode.getChildByName("childIcon"))
this.findTimes += 1
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)
this.findSpecialChaDianNums()
if(this.findTimes >= this.gameInfo.PrefabInfo.num){
console.log("完成任务===")
//补丁,map19需要延迟结算
let timeNum = 0.1
this.scheduleOnce(()=>{
this.endGameView(1)
},timeNum)
return
}
})
.start()
}
//补丁-找到特定数量的茬点逻辑
findSpecialChaDianNums(){
if(this.gameId == 526 && this.findTimes == 9){
Common5.playEffectCustom(this.subBundle,"sound/niangzi")
this.scheduleOnce(()=>{
Common5.playEffectCustom(this.subBundle,"sound/kaimen1")
this.mapNode.scale = this.mapNodeFixedScale
this.mapNode.setPosition(cc.v2(0,0))
let spine_nvren= this.mapNode.getChildByName("spine_nvren")
spine_nvren.opacity = 220
spine_nvren.getComponent(sp.Skeleton).setAnimation(0,"nvguichumen",false)
spine_nvren.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{
})
let callFunc = ()=>{
let xiangzi_he = this.mapNode.getChildByName("xiangzi_he")
xiangzi_he.active = false
let xiangzi_kai = this.mapNode.getChildByName("xiangzi_kai")
xiangzi_kai.active = true
}
let yaoShiStart = this.mapNode.getChildByName("yaoshi")
yaoShiStart.active = true
let yaoShiTouchArea = this.mapNode.getChildByName("xiangzi_he")
let attrs = {
startPos:yaoShiStart.getPosition(),
touchArea:yaoShiTouchArea,
bindChaNodeInfo:this.gameInfo.ChaNode["JiaZhuang"],
callFunction:callFunc
}
this.openTouchEvent(yaoShiStart,attrs)
},3)
}
}
//检测node是否进入target区域(老版)
checkIsInAreaOrdVersion(pos){
let childrens = this.mapNode.children
for(var i =0;i<childrens.length;i++){
let rect = childrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
if(this.gameInfo.ChaNode[childrens[i].name].isFindOut){
return
}else{
let markParent = childrens[i]
//map6-闹钟特殊处理(补丁)
if(this.gameInfo.ChaNode[childrens[i].name].isSpecialType){
let times = this.gameInfo.ChaNode[childrens[i].name].touchTimes
if(times == 0){
this.gameInfo.ChaNode[childrens[i].name].touchTimes += 1
childrens[i].getComponent(FMSkeletonExtend).animation = 'animation2';
Common5.playEffect("word/jijiao")
return
}else if(times == 1 && childrens[i].getChildByName("specialTouchArea").getBoundingBoxToWorld().contains(pos)){
markParent = childrens[i].getChildByName("specialTouchArea")
}else{
return
}
}
Common5.playEffect("success2")
this.gameInfo.ChaNode[childrens[i].name].isFindOut = true
let mark = cc.instantiate(this.markSp)
mark.active = true
markParent.addChild(mark)
let childNode = this.answerNodeType1.getChildByName("xhx_"+this.findTimes)
childNode.getChildByName("txt").active = true
childNode.getChildByName("txt").getComponent(cc.Label).string = this.gameInfo.ChaNode[childrens[i].name].desc
childNode.getChildByName("gou").active = true
this.findTimes += 1
this.isFind = true;
console.log("已完成个数==",this.findTimes)
if(this.findTimes >= this.gameInfo.PrefabInfo.num){
console.log("完成任务===")
this.scheduleOnce(()=>{
this.endGameView(1)
},3.0)
return
}
}
return true
}else{
}
}
}
private isFind = false;
//检测node是否进入target区域(新版)
checkIsInAreaNewVersion(pos){
//补丁(map19在动效未播完前不能触发其他茬点)
if(!this.isCanTouchChaDian){
return
}
//茬点触碰逻辑
let childrens = this.mapNode.getChildByName("chaDianNode").children
for(var i =0;i<childrens.length;i++){
let rect = childrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
if(this.gameInfo.ChaNode[childrens[i].name].isFindOut){
continue
}else{
//暂不可点击
if(!this.gameInfo.ChaNode[childrens[i].name].isCanTouch){
continue
}
this.gameInfo.ChaNode[childrens[i].name].isFindOut = true
if (this.gameInfo.PrefabInfo.zhaoChaType == ZhaoChaType.Type6){
this.findOnChaDian(childrens[i],this.gameId)
}
else {
this.findOnChaDian(childrens[i])
}
this.isFind = true
}
break
}else{
//点错这里需要减5s
}
}
if(this.gameId == 560){
this.checkIsInAreaNewVersion560(pos);
}
if (this.gameId == 561){
if (!this.isFind){
Common5.playEffectCustom(this.subBundle,this.gameInfo.PrefabInfo.soundurl+"miss");
}
}
this.handSpecialGameLogic(pos)
}
checkIsInAreaNewVersion560(pos){
let childrens = this.mapNode.getChildByName("chaDianCopyNode").children
for(var i =0;i<childrens.length;i++){
let rect = childrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
if(this.gameInfo.ChaNode[childrens[i].name].isFindOut){
continue
}else{
//暂不可点击
if(!this.gameInfo.ChaNode[childrens[i].name].isCanTouch){
continue
}
this.gameInfo.ChaNode[childrens[i].name].isFindOut = true
if (this.gameInfo.PrefabInfo.zhaoChaType == ZhaoChaType.Type6){
this.findOnChaDian(childrens[i],this.gameId)
}
else {
this.findOnChaDian(childrens[i])
}
this.isFind = true
}
break
}else{
//点错这里需要减5s
}
}
}
//特殊节点的点击事件(主要处理节点可以移动的问题)
specialNodeTouchEvent(){
if(this.gameId == 522){
let congStart = this.mapNode.getChildByName("feiChaDianNode").getChildByName("cong_start")
let congEnd = this.mapNode.getChildByName("feiChaDianNode").getChildByName("cong_end")
let congTouchArea = this.mapNode.getChildByName("feiChaDianNode").getChildByName("congTouchArea")
let attrs = {
startPos:congStart.getPosition(),
endNode:congEnd,
touchArea:congTouchArea,
bindChaNodeInfo:this.gameInfo.ChaNode["ZhuangXiang"]
}
this.openTouchEvent(congStart,attrs)
}else if(this.gameId == 538){
let yanLiaoHe = this.mapNode.getChildByName("yanLiaoHe")
let baJie = this.mapNode.getChildByName("baJie")
let baJieHuaLian = this.mapNode.getChildByName("baJieHuaLian")
let attrs = {
startPos:yanLiaoHe.getPosition(),
endNode:baJieHuaLian,
touchArea:baJie,
bindChaNodeInfo:this.gameInfo.ChaNode["HuaZhuDaChe"]
}
this.openTouchEvent(yanLiaoHe,attrs)
let ranLiaoPing = this.mapNode.getChildByName("ranLiaoPing")
let gongJi = this.mapNode.getChildByName("gongJi")
let gongJiLanBo = this.mapNode.getChildByName("gongJiLanBo")
let attrs2 = {
startPos:ranLiaoPing.getPosition(),
endNode:gongJiLanBo,
touchArea:gongJi,
bindChaNodeInfo:this.gameInfo.ChaNode["LanBoJiNi"]
}
this.openTouchEvent(ranLiaoPing,attrs2)
}else if(this.gameId == 539){
let xiGua = this.mapNode.getChildByName("xiGua")
let huangGua = this.mapNode.getChildByName("huangGua")
let fixedArea_xiGua = this.mapNode.getChildByName("fixedArea_xiGua")
let attrs = {
startPos:xiGua.getPosition(),
endNode:huangGua,
touchArea:fixedArea_xiGua,
bindChaNodeInfo:this.gameInfo.ChaNode["ZhongGuaDeGua"]
}
this.openTouchEvent(xiGua,attrs)
}else if(this.gameId == 548){
let huocai = this.mapNode.getChildByName("huocai")
let huoyan = this.mapNode.getChildByName("huoyan")
let huoyan_area = this.mapNode.getChildByName("huoyan_area")
let attrs = {
startPos:huocai.getPosition(),
endNode:huoyan,
touchArea:huoyan_area,
bindChaNodeInfo:this.gameInfo.ChaNode["LvYan"]
}
this.openTouchEvent(huocai,attrs)
}else if(this.gameId == 549){
let yumi:any = this.mapNode.getChildByName("yumi")
let dxbmhj = this.mapNode.getChildByName("dxbmhj")
let yumi_area = dxbmhj.getChildByName("yumi_area")
let callFunc = ()=>{
yumi.isFeed = true;
console.log('cb549 yumi.isFeed',yumi.isFeed)
yumi.setPosition(yumi.startPos);
}
let attrs = {
startPos:yumi.getPosition(),
//endNode:huoyan,
touchArea:yumi_area,
//bindChaNodeInfo:this.gameInfo.ChaNode["LvYan"]
callFunction: callFunc
}
this.openTouchEvent(yumi,attrs)
}else if(this.gameId == 551){
let liubei:any = this.mapNode.getChildByName('liubei')
let liubeiTouchArea = this.mapNode.getChildByName('liubeiTouchArea')
let dxMen = this.mapNode.getChildByName('dxMen')
let zhugeliang1 = this.mapNode.getChildByName('zhugeliang1')
let zhugeliang2 = this.mapNode.getChildByName('zhugeliang2')
let liubeiqiaomen = this.mapNode.getChildByName('liubeiqiaomen')
this.curZIndex = cc.macro.MAX_ZINDEX;
this.mapNode.children.forEach((p, index)=>{
p.zIndex = index;
})
console.log('liubeiTouchArea', liubeiTouchArea)
let callFunc = ()=>{
// liubei.active = true;
liubei.zIndex = liubei.oldZindex;
if(liubei.touchTimes >= 3){
liubei.setPosition(liubei.startPos)
return;
}
liubeiqiaomen.active = true;
liubeiqiaomen.getComponent(FMSkeletonExtend).animation = 'qiaomen'
Common5.playEffectCustom("WordGame",'fkwz123/ZhaoCha/map51/sound/qms')
cc.tween(liubeiqiaomen)
.delay(1.5)
.call(()=>{
liubei.touchTimes += 1
if(liubei.touchTimes >= 3){
dxMen.getComponent(FMSkeletonExtend).animation = 'kaimen'
Common5.playEffectCustom("WordGame",'fkwz123/ZhaoCha/map51/sound/zgl')
cc.tween(zhugeliang1)
.to(2.5, {opacity:0})
.call(()=>{
zhugeliang2.active =true;
//HuaShanZi
this.gameInfo.ChaNode["HuaShanZi"].isCanTouch = true
})
.start()
}
liubei.active = true;
liubei.setPosition(liubei.startPos)
let attrs = {
closeTouch:false,
startPos:liubei.getPosition(),
touchArea:liubeiTouchArea,
callFunction: callFunc
}
this.openTouchEvent(liubei,attrs)
liubeiqiaomen.active = false;
})
.start()
}
let attrs = {
closeTouch:false,
oldZindex: liubei.zIndex,
touchTimes: 0,
startPos:liubei.getPosition(),
touchArea:liubeiTouchArea,
callFunction: callFunc
}
this.openTouchEvent(liubei,attrs)
}else if(this.gameId == 552){
let shizi:any = this.mapNode.getChildByName('shizi')
shizi.active = true;
let callFunc = ()=>{
console.log('callback')
shizi.setPosition(shizi.startPos)
cc.tween(shizi)
.to(0.5,{x:shizi.startPos.x+300})
.call(()=>{
this.gameInfo.ChaNode["SheYingJi"].isCanTouch = true
})
.start()
}
let attrs = {
startPos:shizi.getPosition(),
notTouchArea:shizi,
distance:20,
callFunction: callFunc
}
this.openTouchEvent(shizi,attrs)
}else if(this.gameId == 554){
let xiaoshou:any = this.mapNode.getChildByName('bg1').getChildByName('xiaoshou').getChildByName('touchArea')
let dxxiaoshou = this.mapNode.getChildByName('dxxiaoshou')
let dahuoji:any = this.mapNode.getChildByName('dahuoji')
let callFunc = ()=>{
xiaoshou.setPosition(xiaoshou.startPos)
xiaoshou.parent.active = false;
dxxiaoshou.active = true;
dxxiaoshou.getComponent(FMSkeletonExtend).loop = false;
dxxiaoshou.getComponent(FMSkeletonExtend).animation = '1chuxian'
this.gameInfo.ChaNode["xiaoshou"].isCanTouch = true
console.log('this.gameInfo',this.gameInfo)
let callFunc_dahuoji = ()=>{
dahuoji.setPosition(dahuoji.startPos)
dahuoji.active = true;
dxxiaoshou.getComponent(FMSkeletonExtend).loop = false;
dxxiaoshou.getComponent(FMSkeletonExtend).animation = '3dianhuo'
cc.tween(dxxiaoshou)
.delay(2.0)
.call(()=>{
dxxiaoshou.getComponent(FMSkeletonExtend).loop = true;
dxxiaoshou.getComponent(FMSkeletonExtend).animation = '4ranshao'
this.gameInfo.ChaNode["shaozhiqian"].isCanTouch = true
})
.delay(1.0)
.call(()=>{
this.mapNode.getChildByName('dxdaojishi').active = true;
this.mapNode.getChildByName('dxdaojishi').getComponent(FMSkeletonExtend).loop = false;
this.mapNode.getChildByName('dxdaojishi').getComponent(FMSkeletonExtend).animation = 'daojishi'
Common5.playEffectCustom("WordGame","fkwz123/ZhaoCha/map54/sound/倒计时")
})
.delay(1.0)
.call(()=>{
Common5.playEffectCustom("WordGame","fkwz123/ZhaoCha/map54/sound/倒计时")
})
.delay(1.0)
.call(()=>{
Common5.playEffectCustom("WordGame","fkwz123/ZhaoCha/map54/sound/倒计时")
})
.delay(1.0)
.call(()=>{
Common5.playEffectCustom("WordGame","fkwz123/ZhaoCha/map54/sound/倒计时")
})
.delay(1.0)
.call(()=>{
Common5.playEffectCustom("WordGame","fkwz123/ZhaoCha/map54/sound/倒计时")
})
.delay(1.0)
.call(()=>{
Common5.playEffectCustom("WordGame","fkwz123/ZhaoCha/map54/sound/倒计时")
this.gameInfo.ChaNode["daojishi"].isCanTouch = true
})
.delay(1.0)
.call(()=>{
//敲门声
//this.mapNode.getChildByName('dxqiaomensheng').active = true;
//Common5.playEffectCustom("WordGame","fkwz123/ZhaoCha/map54/sound/敲门声")
})
.delay(1.0)
.call(()=>{
//敲门声
//Common5.playEffectCustom("WordGame","fkwz123/ZhaoCha/map54/sound/敲门声")
//this.mapNode.getChildByName('dxqiaomensheng').active = false;
this.gameInfo.FeiChanDian['menbashou'].isCanTouch = true;
})
.start()
}
let attrs_dahuoji = {
startPos:dahuoji.getPosition(),
touchArea:dxxiaoshou.getChildByName('touchArea'),
callFunction: callFunc_dahuoji
}
this.openTouchEvent(dahuoji, attrs_dahuoji);
}
let attrs = {
startPos:xiaoshou.getPosition(),
notTouchArea:dahuoji,
distance:20,
callFunction: callFunc
}
this.openTouchEvent(xiaoshou,attrs)
// let jiandaoArea = this.mapNode.getChildByName('jiandaoArea')
// let callFunc_jiandaoArea = ()=>{
// this.mapNode.getChildByName('bg1').getChildByName('jiandao').active = true;
// this.mapNode.getChildByName('bg2').getChildByName('jiandao').active = true;
// this.gameInfo.ChaNode["jiandao"].isCanTouch = true
// }
// let attr_jiandaoArea = {
// startPos:jiandaoArea.getPosition(),
// notTouchArea:jiandaoArea,
// distance:20,
// callFunction: callFunc_jiandaoArea
// }
// this.openTouchEvent(jiandaoArea,attr_jiandaoArea)
}
else if (this.gameId == 556){
Common5.playEffectCustom("WordGame","fkwz123/ZhaoCha/map56/sounds/nlgpll");
this.node.getChildByName("msg").active = true;
let beiziNode = this.mapNode.getChildByName("feiChaDianNode").getChildByName("beizi");
let callFunc = ()=>{
beiziNode.active = false;
}
let attrs = {
startPos:beiziNode.getPosition(),
touchArea:this.node,
callFunction: callFunc
}
this.openTouchEvent(beiziNode,attrs)
// let siwaNode = this.mapNode.getChildByName("feiChaDianNode").getChildByName("siwa");
// let callFuncSiwa = ()=>{
// if (this.mapNode.getChildByName("chaDianNode").getChildByName("laotansuancai").active){
// this.mapNode.getChildByName("xiaojiejie").getComponent(sp.Skeleton).animation = "1daiji";
// this.mapNode.getChildByName("chaDianNode").getChildByName("laotansuancaiwazi").active = true;
// this.mapNode.getChildByName("chaDianNode").getChildByName("laotansuancai").active = false;
// siwaNode.active = false;
// this.gameInfo.FeiChanDian[siwaNode.name].isCanTouch = false;
// this.gameInfo.ChaNode["laotansuancai"].isCanTouch = false;
// this.gameInfo.ChaNode["laotansuancaiwazi"].isCanTouch = true;
// }
// else {
// siwaNode.setPosition(siwaNode["startPos"])
// siwaNode.active = true;
// }
// }
// siwaNode["startPos"] = siwaNode.getPosition();
// let attrsSiwa = {
// startPos:siwaNode.getPosition(),
// touchArea:this.mapNode.getChildByName("chaDianNode").getChildByName("laotansuancai"),
// callFunction: callFuncSiwa
// }
// this.openTouchEvent(siwaNode,attrsSiwa)
let niaoshiNode = this.mapNode.getChildByName("feiChaDianNode").getChildByName("niaoshi");
let callFuncNiaoshi = ()=>{
if (this.mapNode.getChildByName("chaDianNode").getChildByName("yingwu").active){
niaoshiNode.active = false;
this.gameInfo.ChaNode["yingwushuohua"].isCanTouch = true;
this.gameInfo.ChaNode["yingwu"].isCanTouch = false;
Common5.playEffectCustom("WordGame","fkwz123/ZhaoCha/map56/sounds/nzpl");
this.mapNode.getChildByName("chaDianNode").getChildByName("yingwu").active = false;
this.mapNode.getChildByName("chaDianNode").getChildByName("yingwushuohua").active = true;
}
else {
niaoshiNode.setPosition(niaoshiNode["startPos"])
niaoshiNode.active = true;
}
}
niaoshiNode["startPos"] = niaoshiNode.getPosition();
let attrsNiaoshi = {
startPos:niaoshiNode.getPosition(),
touchArea:this.mapNode.getChildByName("chaDianNode").getChildByName("yingwushuohua"),
callFunction: callFuncNiaoshi
}
this.openTouchEvent(niaoshiNode,attrsNiaoshi)
this.node.getChildByName("msg").getChildByName("fangzu").getComponent(cc.Label).string = this.gameInfo.fangzu;
}else if(this.gameId == 557){
// cc.tween(this.node)
// .delay(0.5)
// .call(()=>{
// Common5.playEffectCustom("WordGame","fkwz123/ZhaoCha/map57/sound/夫人我卖完烧饼回来了(0)")
// })
// .start();
this.mapNode.children.forEach((p, index)=>{
p.zIndex = index;
})
// let dianziTouch = this.mapNode.getChildByName('dianzi').getChildByName('dianziTouch')
// let callFunc = ()=>{
// this.mapNode.getChildByName('dianzi').active = false;
// this.mapNode.getChildByName('dianzi2').active = true;
// this.gameInfo.ChaNode["didao"].isCanTouch = true;
// }
// let attrs = {
// startPos:dianziTouch.getPosition(),
// notTouchArea:dianziTouch,
// distance:20,
// callFunction: callFunc
// }
// this.openTouchEvent(dianziTouch,attrs)
}else if(this.gameId == 558){
this.mapNode.children.forEach((p, index)=>{
p.zIndex = index;
})
this.curZIndex = this.mapNode.children.length;
this.node.getChildByName("msg").active = true; //title
this.node.getChildByName("msg").getChildByName('tishi').active = false;
this.node.getChildByName("msg").getChildByName("fangzu").getComponent(cc.Label).string = this.gameInfo.fangzu;
this.node.getChildByName("msg").getChildByName("title").getComponent(cc.Label).string = '欠医药费:';
cc.tween(this.node)
.delay(0.5)
.call(()=>{
Common5.playEffectCustom("WordGame",this.gameInfo.PrefabInfo.soundurl+'你打了我家老高,赶紧陪我医疗费!(0)');
})
.start();
//
let yugang = this.mapNode.getChildByName('yugang')
let chouwazi = this.mapNode.getChildByName('chouwazi');
let callFunc = ()=>{
this.mapNode.getChildByName('shanyu1').active = false;
this.mapNode.getChildByName('shanyu2').active = true;
this.mapNode.getChildByName('chaDianNode').getChildByName('shanyu1').active = false;
this.mapNode.getChildByName('chaDianNode').getChildByName('shanyu2').active = true;
this.gameInfo.ChaNode["shanyu2"].isCanTouch = true;
this.gameInfo.ChaNode["shanyu1"].isCanTouch = false;
}
let attrs = {
startPos:chouwazi.getPosition(),
touchArea:yugang,
oldIndex: chouwazi.zIndex,
callFunction: callFunc
}
this.openTouchEvent(chouwazi,attrs)
let guiziR:any = this.mapNode.getChildByName('guiziR').getChildByName('area');
let callFunc1 = () =>{
let pos2 = guiziR.getPosition();
let pos1 = guiziR.startPos
let pos = guiziR.parent.getPosition();
if(pos2.x > pos1.x){
guiziR.setPosition(pos1);
this.mapNode.getChildByName('chuang').active = true;
this.mapNode.getChildByName('san6ji').active = true;
cc.tween(guiziR.parent)
.to(1.0,{x: pos.x+585})
.call(()=>{
this.gameInfo.ChaNode["sanshiliuji"].isCanTouch = true;
this.gameInfo.ChaNode["chuang"].isCanTouch = true;
})
.start();
}else{
guiziR.setPosition(pos1);
}
}
let attrs1 = {
startPos:guiziR.getPosition(),
notTouchArea:guiziR,
distance:10,
oldIndex: guiziR.zIndex,
callFunction: callFunc1
}
this.openTouchEvent(guiziR,attrs1)
let guiziR1:any = this.mapNode.getChildByName('guiziR').getChildByName('area1');
let callFunc3 = () =>{
let pos2 = guiziR1.getPosition();
let pos1 = guiziR1.startPos
let pos = guiziR1.parent.getPosition();
if(pos2.x > pos1.x){
guiziR1.setPosition(pos1);
this.mapNode.getChildByName('chuang').active = true;
this.mapNode.getChildByName('san6ji').active = true;
cc.tween(guiziR1.parent)
.to(1.0,{x: pos.x+585})
.call(()=>{
this.gameInfo.ChaNode["sanshiliuji"].isCanTouch = true;
this.gameInfo.ChaNode["chuang"].isCanTouch = true;
})
.start();
}else{
guiziR1.setPosition(pos1);
}
}
let attrs3 = {
startPos:guiziR1.getPosition(),
notTouchArea:guiziR1,
distance:10,
oldIndex: guiziR1.zIndex,
callFunction: callFunc3
}
this.openTouchEvent(guiziR1,attrs3)
}else if(this.gameId == 559){
let w = '5天前,一女孩跳楼,从此,公司接连发生诡异事件。';
this.mapNode.getChildByName('mengban').active = true;
this.mapNode.getChildByName('mengban').getChildByName('w').getComponent(cc.Label).string = ''
let index = 0;
this.schedule(()=>{
if(index == w.length){
cc.tween(this.mapNode.getChildByName('mengban'))
.to(0.5,{opacity:0})
.call(()=>{
this.mapNode.getChildByName('mengban').active = false;
})
.start();
cc.tween(this.node)
.delay(0.8)
.call(()=>{
Common5.playEffectCustom("WordGame",this.gameInfo.PrefabInfo.soundurl+'1有点想念小丽在身边的日子');
})
.delay(3.0)
.call(()=>{
Common5.playEffectCustom("WordGame",this.gameInfo.PrefabInfo.soundurl+'2放心他一定在看着你呢');
})
.start()
}else{
this.mapNode.getChildByName('mengban').getChildByName('w').getComponent(cc.Label).string += w[index++];
}
},0.2, w.length)
//guizhang
let guizhang = this.mapNode.getChildByName('guizhang')
let guahua = this.mapNode.getChildByName('guahua')
let callFunc3 = () =>{
guizhang.active = false;
guahua.active = true;
Common5.playEffectCustom("WordGame",this.gameInfo.PrefabInfo.soundurl+'5别挡我视线');
//DianRanGuaBan
this.gameInfo.ChaNode["DianRanGuaBan"].isCanTouch = true;
}
let attrs3 = {
startPos:guizhang.getPosition(),
touchArea:guahua,
callFunction: callFunc3
}
this.openTouchEvent(guizhang,attrs3)
//guahua
}
else if(this.gameId == 561){
this.curScale = 1.227
this.lastScale = 1.227
this.mapNode.scale = 1.227;
this.mapNode.x = 100;
this.mapNode.y = -504;
}else if(this.gameId == 10054){
let hongshu:any = this.mapNode.getChildByName('hongshu')
let gaoqiqiang = this.mapNode.getChildByName('gaoqiqiang')
let area = gaoqiqiang.getChildByName('area');
let callFunc = ()=>{
gaoqiqiang.getComponent(FMSkeletonExtend).animation = 'chihongshu'
Common5.playEffectCustom(this.subBundle,'sound/吃东西0.2')
cc.tween(gaoqiqiang)
.delay(0.3)
.call(()=>{
Common5.playEffectCustom(this.subBundle,'sound/吃东西0.2')
})
.delay(0.3)
.call(()=>{
Common5.playEffectCustom(this.subBundle,'sound/吃东西0.2')
})
.delay(0.3)
.call(()=>{
gaoqiqiang.getComponent(FMSkeletonExtend).animation = 'fangpi'
Common5.playEffectCustom(this.subBundle,'sound/放屁声1.1')
})
.delay(1.5)
.call(()=>{
this.gameInfo.ChaNode["anqi"].isCanTouch = true
})
.start();
}
let attrs = {
startPos:hongshu.getPosition(),
touchArea:area,
callFunction: callFunc
}
this.openTouchEvent(hongshu,attrs)
}
}
openTouchEvent(node,attrs){
console.log('node', node.name);
node.attr(attrs)
node.on(cc.Node.EventType.TOUCH_START,this.touchStartSpecicalNode,this)
node.on(cc.Node.EventType.TOUCH_MOVE,this.touchMoveSpecicalNode,this)
node.on(cc.Node.EventType.TOUCH_CANCEL,this.touchEndSpecicalNode,this)
node.on(cc.Node.EventType.TOUCH_END,this.touchEndSpecicalNode,this)
}
closeTouchEvent(node){
node.off(cc.Node.EventType.TOUCH_START,this.touchStartSpecicalNode,this)
node.off(cc.Node.EventType.TOUCH_MOVE,this.touchMoveSpecicalNode,this)
node.off(cc.Node.EventType.TOUCH_CANCEL,this.touchEndSpecicalNode,this)
node.off(cc.Node.EventType.TOUCH_END,this.touchEndSpecicalNode,this)
}
private specialTouchTime = Date.now();
touchStartSpecicalNode(event){
Common5.playEffect("click")
this.specialTouchTime = Date.now();
if(this.gameId != 557){
event.target.zIndex = this.curZIndex++;
}
if (this.gameId == 556){
if (event.target.name == "siwa"){
event.target.getChildByName("siwa").active = true;
this.mapNode.getChildByName("xiaojiejie").getComponent(sp.Skeleton).animation = "1daiji";
}
}
}
touchMoveSpecicalNode(event){
let nodeLoc = event.getLocation()
let nodePos = event.target.parent.convertToNodeSpaceAR(nodeLoc)
event.target.setPosition(nodePos)
}
touchEndSpecicalNode(event){
if(this.gameId != 557){
event.target.zIndex = 0
}
if(this.gameId == 558){
event.target.zIndex = event.target.oldIndex;
}
let d = cc.Vec2.distance(event.target.startPos, event.target.getPosition())
//如果点击时间太短
if(Date.now() - this.specialTouchTime <= 0.2 * 1000){
if(this.gameId == 558){
}
}
if (this.gameId == 556){
if (event.target.name == "siwa"){
event.target.getChildByName("siwa").active = false;
this.mapNode.getChildByName("xiaojiejie").getComponent(sp.Skeleton).animation = "2daiji";
}
}
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 if(event.target.notTouchArea && d >= event.target.distance){
//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{
if(this.gameId == 558){
//
if(event.target.name == 'chouwazi'){
Common5.playEffectCustom("WordGame",this.gameInfo.PrefabInfo.soundurl+'真是臭男人!(0)');
}
}
if(this.gameId == 559){
if(event.target.name == 'hongbu' && Common5.checkContainsNode(this.mapNode.getChildByName('langtou'), event.target)){
Common5.playEffectCustom("WordGame",this.gameInfo.PrefabInfo.soundurl+'8你不认识我了吗');
}
}
event.target.setPosition(event.target.startPos)
}
}
//特殊关卡处理
handSpecialGameLogic(pos){
//非茬点触碰逻辑
if(!this.mapNode.getChildByName("feiChaDianNode")){
return
}
if(this.gameId == 515){
this.specialMap15(pos)
}else if(this.gameId == 516){
this.specialMap16(pos)
}else if(this.gameId == 518){
this.specialMap18(pos)
}else if(this.gameId == 519){
this.specialMap19(pos)
}else if(this.gameId == 522){
this.specialMap22(pos)
}else if(this.gameId == 523){
this.specialMap23(pos)
}else if(this.gameId == 525){
this.specialMap25(pos)
}else if(this.gameId == 526){
this.specialMap26(pos)
}else if(this.gameId == 527){
this.specialMap27(pos)
}else if(this.gameId == 529){
this.specialMap29(pos)
}else if(this.gameId == 531){
this.specialMap31(pos)
}else if(this.gameId == 533){
this.specialMap33(pos)
}else if(this.gameId == 536){
this.specialMap36(pos)
}else if(this.gameId == 537){
this.specialMap37(pos)
}else if(this.gameId == 539){
this.specialMap39(pos)
}else if(this.gameId == 540){
this.specialMap40(pos)
}else if(this.gameId == 542){
this.specialMap42(pos)
}else if(this.gameId == 546){
this.specialMap46(pos)
}else if(this.gameId == 547){
this.specialMap47(pos)
}else if(this.gameId == 548){
this.specialMap48(pos)
}else if(this.gameId == 549){
this.specialMap49(pos)
}else if(this.gameId == 550){
this.specialMap50(pos)
}else if(this.gameId == 551){
this.specialMap51(pos)
}else if(this.gameId == 552){
this.specialMap52(pos)
}else if(this.gameId == 553){
this.specialMap53(pos)
}else if(this.gameId == 554){
this.specialMap54(pos)
}else if(this.gameId == 555){
this.specialMap55(pos)
}else if(this.gameId == 556){
this.specialMap56(pos)
}else if(this.gameId == 557){
this.specialMap57(pos)
}else if(this.gameId == 558){
this.specialMap58(pos)
}else if(this.gameId == 559){
this.specialMap59(pos)
}else if(this.gameId == 560){
this.specialMap60(pos)
}else if(this.gameId == 10053){
this.specialMap10053(pos)
}else if(this.gameId == 10054){
this.specialMap10054(pos)
}
}
//map_15
specialMap15(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//石门打开
if(feiChaDianChildrens[i].name == "ShiMenTouchNode"){
// Common5.playEffectCustom(this.subBundle,"sound/shitou1000")
// let shiMenSpineNode= this.mapNode.getChildByName("feiChaDianNode").getChildByName("ShiMenSpine")
// shiMenSpineNode.getComponent(sp.Skeleton).setAnimation(0,"shimen",false)
// shiMenSpineNode.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{
// this.gameInfo.ChaNode["ZhuBaJie"].isCanTouch = true
// Common5.playEffectCustom(this.subBundle,"sound/zhu2000")
// })
//桌布掀开
}else if(feiChaDianChildrens[i].name == "ZhuoBuTouchNode"){
// let zhuoBuSpineNode= this.mapNode.getChildByName("feiChaDianNode").getChildByName("ZhuoBuSpine")
// zhuoBuSpineNode.getComponent(sp.Skeleton).setAnimation(0,"zhuobu",false)
// zhuoBuSpineNode.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{
// this.gameInfo.ChaNode["HongHaiEr"].isCanTouch = true
// })
//镜子竖起
}else if(feiChaDianChildrens[i].name == "JingZiTouchNode"){
let jingZiHengNode= this.mapNode.getChildByName("feiChaDianNode").getChildByName("Jingzi_heng")
let jingZiShuNode= this.mapNode.getChildByName("feiChaDianNode").getChildByName("Jingzi_shu")
jingZiHengNode.active = false
jingZiShuNode.active = true
this.gameInfo.ChaNode["LiuErMiHou"].isCanTouch = true
//小钻风出现
}else if(feiChaDianChildrens[i].name == "ShouYinJiTouchNode"){
Common5.playEffectCustom(this.subBundle,"sound/xunshan3800")
this.scheduleOnce(()=>{
Common5.playEffectCustom(this.subBundle,"sound/come1300")
let xiaoZuanFengSpineNode= this.mapNode.getChildByName("feiChaDianNode").getChildByName("XiaoZuanFengSpine")
xiaoZuanFengSpineNode.getComponent(sp.Skeleton).setAnimation(0,"tantou",false)
xiaoZuanFengSpineNode.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{
this.gameInfo.ChaNode["XiaoZuanFeng"].isCanTouch = true
})
},4)
}
}
}
}
}
//map_16
specialMap16(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.isFind = true
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//假发
if(feiChaDianChildrens[i].name == "Shasengjiafa"){
let Shasengjiafa= this.mapNode.getChildByName("feiChaDianNode").getChildByName("Shasengjiafa")
Shasengjiafa.active = false
}
}
}
}
}
//map_18
specialMap18(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.isFind = true
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//紫葫芦
if(feiChaDianChildrens[i].name == "ziHuLuTouchArea"){
Common5.playEffectCustom(this.subBundle,"sound/zijinhulu")
let laoqianSpineNode= this.mapNode.getChildByName("feiChaDianNode").getChildByName("laoqianSpine")
let shouhoumajiang= this.mapNode.getChildByName("feiChaDianNode").getChildByName("shouhoumajiang")
laoqianSpineNode.getComponent(sp.Skeleton).setAnimation(0,"hulu",false)
laoqianSpineNode.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{
laoqianSpineNode.getComponent(sp.Skeleton).clearTracks();
laoqianSpineNode.getComponent(sp.Skeleton).setToSetupPose();
shouhoumajiang.active = true
})
//聚宝盆
}else if(feiChaDianChildrens[i].name == "juBaoPenTouchArea"){
Common5.playEffectCustom(this.subBundle,"sound/jubaopen")
let yuanbaoSpineNode= this.mapNode.getChildByName("feiChaDianNode").getChildByName("yuanbaoSpine")
yuanbaoSpineNode.getComponent(sp.Skeleton).setAnimation(0,"yuanbao",false)
yuanbaoSpineNode.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{
})
//九齿钉耙
}else if(feiChaDianChildrens[i].name == "jiuChiDinPaTouchArea"){
Common5.playEffectCustom(this.subBundle,"sound/zhubajiejisuan")
let laoqianSpineNode= this.mapNode.getChildByName("feiChaDianNode").getChildByName("laoqianSpine")
laoqianSpineNode.getComponent(sp.Skeleton).setAnimation(0,"zhunaoguozai",false)
laoqianSpineNode.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{
laoqianSpineNode.getComponent(sp.Skeleton).clearTracks();
laoqianSpineNode.getComponent(sp.Skeleton).setToSetupPose();
})
//悟空搓牌
}else if(feiChaDianChildrens[i].name == "cuoPaiTouchArea"){
let laoqianSpineNode= this.mapNode.getChildByName("feiChaDianNode").getChildByName("laoqianSpine")
let liuwanSp= this.mapNode.getChildByName("feiChaDianNode").getChildByName("liuwanSp")
laoqianSpineNode.getComponent(sp.Skeleton).setAnimation(0,"suncuomajiang",false)
laoqianSpineNode.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{
laoqianSpineNode.getComponent(sp.Skeleton).clearTracks();
laoqianSpineNode.getComponent(sp.Skeleton).setToSetupPose();
liuwanSp.active = true
})
//桌布
}else if(feiChaDianChildrens[i].name == "zhuoBuTouchArea"){
let zhuobuSpineNode= this.mapNode.getChildByName("feiChaDianNode").getChildByName("zhuobuSpine")
zhuobuSpineNode.getComponent(sp.Skeleton).setAnimation(0,"zhuobu",false)
zhuobuSpineNode.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{
this.gameInfo.ChaNode["FuChen"].isCanTouch = true
})
//赌神
}else if(feiChaDianChildrens[i].name == "duShenTouchArea"){
Common5.playEffectCustom(this.subBundle,"sound/dushen5600")
}
}
}
}
}
//map_19
specialMap19(pos){
let SpineNodeTab = {
ZhuBaJie:{ spineNode:this.mapNode.getChildByName("feiChaDianNode").getChildByName("zhubajieSpine"),
dengGuangNode:this.mapNode.getChildByName("feiChaDianNode").getChildByName("dengGuang_BaJie")},
TangSeng:{ spineNode:this.mapNode.getChildByName("feiChaDianNode").getChildByName("tangsengSpine"),
dengGuangNode:this.mapNode.getChildByName("feiChaDianNode").getChildByName("dengGuang_TangSeng")},
SunWuKong:{ spineNode:this.mapNode.getChildByName("feiChaDianNode").getChildByName("sunwukongSpine"),
dengGuangNode:this.mapNode.getChildByName("feiChaDianNode").getChildByName("dengGuang_WuKong")},
ShaSeng:{ spineNode:this.mapNode.getChildByName("feiChaDianNode").getChildByName("shaheshangSpine"),
dengGuangNode:this.mapNode.getChildByName("feiChaDianNode").getChildByName("dengGuang_ShaSeng")},
MengBan:this.mapNode.getChildByName("feiChaDianNode").getChildByName("mengBan")
}
let AnimationNameTab = {
ZhuBaJie:{
Chong:"chong",
DaiJi:"daiji",
HeiTaoA:"hetaoa",
WuHuan:"wuhuan",
YunNan:"yunnan",
},
TangSeng:{
CaiSeChiBang:"caisechibang",
DaiJi:"daiji",
KaFei1:"kafei1",
XiaoPingGuo:"xiaopingguo"
},
SunWuKong:{
Chong:"chong",
DaiJi:"daiji",
SanLiangSan:"sanliangsan",
WuKong:"wukong"
},
ShaSeng:{
Chong:"chong",
DaiJi:"daiji",
MiaoZhen:"miaozhen",
YiJianMei:"yijianmei"
},
}
let AudioEffectTab = {
KaFei1:{EffectPath:"sound/1kafei2100",SongWord:"咖啡你冲不冲 冲冲冲冲冲"},
KaFei2:{EffectPath:"sound/2kafei1800",SongWord:"冲冲冲冲冲"},
HeiTaoA:{EffectPath:"sound/heitaoa7100",SongWord:"嘿诶诶你是我的宝贝,想你的滋味隐隐作祟"},
MiaoZhen:{EffectPath:"sound/miaozhen7200",SongWord:"雨一夜深深,这沉默的秒针,冥冥中给我轻轻感应这共振"},
SanLiangSan:{EffectPath:"sound/sanliangsan7800",SongWord:"我把我的梦想就卖了三两三,换来了灶台上的一日三餐"},
TieBang:{EffectPath:"sound/tiebang6000",SongWord:"我要这铁棒有何用"},
WuHuan:{EffectPath:"sound/wuhuan7000",SongWord:"啊五环,你比四环多一环"},
XiaoPingGuo:{EffectPath:"sound/xiaopingguo7000",SongWord:"你是我的小呀小苹果,怎么爱你都不嫌多"},
YiJianMei:{EffectPath:"sound/yijianmei6800",SongWord:"雪花飘飘北风萧萧"},
YunNan:{EffectPath:"sound/yunnan7800",SongWord:"我是云南的,云南怒江的,怒江泸水市,泸水市六库"},
ZaoGao:{EffectPath:"sound/zaogao4000",SongWord:"糟糕糟糕omg,魔法怎么失灵啦"}
}
let closeAllDengGuang = ()=>{
SpineNodeTab.ZhuBaJie.dengGuangNode.active = false
SpineNodeTab.TangSeng.dengGuangNode.active = false
SpineNodeTab.SunWuKong.dengGuangNode.active = false
SpineNodeTab.ShaSeng.dengGuangNode.active = false
SpineNodeTab.MengBan.active = false
}
let playSpineAndSounds = (nodeTab,aniName,audioInfo)=>{
Common5.playEffectCustom(this.subBundle,audioInfo.EffectPath)
this.isCanTouchChaDian = false
this.geCiLabel.getComponent(cc.Label).string = audioInfo.SongWord
this.geCiLabel.x = 601
this.isStartTimer = true
this._dt = 0
SpineNodeTab.MengBan.active = true
SpineNodeTab.MengBan.zIndex = this.curZIndex++
let dengGuangNode = nodeTab.dengGuangNode
dengGuangNode.active = true
dengGuangNode.zIndex = this.curZIndex++
let spineNode = nodeTab.spineNode
spineNode.zIndex = this.curZIndex++
spineNode.getComponent(sp.Skeleton).setAnimation(0,aniName,false)
spineNode.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{
spineNode.getComponent(sp.Skeleton).clearTracks();
spineNode.getComponent(sp.Skeleton).setToSetupPose();
closeAllDengGuang()
this.isCanTouchChaDian = true
})
}
//此情况 唐僧唱前半句,徒弟唱后半句
let playKaFeiSpineAndSounds = ()=>{
Common5.playEffectCustom(this.subBundle,AudioEffectTab.KaFei1.EffectPath)
this.isCanTouchChaDian = false
this.geCiLabel.getComponent(cc.Label).string = AudioEffectTab.KaFei1.SongWord
this.geCiLabel.x = 601
this.isStartTimer = true
this._dt = 0
SpineNodeTab.MengBan.active = true
SpineNodeTab.MengBan.zIndex = this.curZIndex++
SpineNodeTab.TangSeng.dengGuangNode.active = true
SpineNodeTab.TangSeng.dengGuangNode.zIndex = this.curZIndex++
SpineNodeTab.TangSeng.spineNode.zIndex = this.curZIndex++
SpineNodeTab.TangSeng.spineNode.getComponent(sp.Skeleton).setAnimation(0,AnimationNameTab.TangSeng.KaFei1,false)
SpineNodeTab.ZhuBaJie.spineNode.zIndex = this.curZIndex++
SpineNodeTab.ZhuBaJie.spineNode.getComponent(sp.Skeleton).setAnimation(0,AnimationNameTab.ZhuBaJie.Chong,false)
SpineNodeTab.ZhuBaJie.spineNode.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{
SpineNodeTab.ZhuBaJie.spineNode.getComponent(sp.Skeleton).clearTracks();
SpineNodeTab.ZhuBaJie.spineNode.getComponent(sp.Skeleton).setToSetupPose();
})
SpineNodeTab.SunWuKong.spineNode.zIndex = this.curZIndex++
SpineNodeTab.SunWuKong.spineNode.getComponent(sp.Skeleton).setAnimation(0,AnimationNameTab.SunWuKong.Chong,false)
SpineNodeTab.SunWuKong.spineNode.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{
SpineNodeTab.SunWuKong.spineNode.getComponent(sp.Skeleton).clearTracks();
SpineNodeTab.SunWuKong.spineNode.getComponent(sp.Skeleton).setToSetupPose();
})
SpineNodeTab.ShaSeng.spineNode.zIndex = this.curZIndex++
SpineNodeTab.ShaSeng.spineNode.getComponent(sp.Skeleton).setAnimation(0,AnimationNameTab.ShaSeng.Chong,false)
SpineNodeTab.ShaSeng.spineNode.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{
SpineNodeTab.ShaSeng.spineNode.getComponent(sp.Skeleton).clearTracks();
SpineNodeTab.ShaSeng.spineNode.getComponent(sp.Skeleton).setToSetupPose();
closeAllDengGuang()
this.isCanTouchChaDian = true
})
cc.tween(this.node)
.delay(2.2)
.call(()=>{
Common5.playEffectCustom(this.subBundle,AudioEffectTab.KaFei2.EffectPath)
SpineNodeTab.ZhuBaJie.dengGuangNode.active = true
SpineNodeTab.ZhuBaJie.dengGuangNode.zIndex = this.curZIndex-3
SpineNodeTab.SunWuKong.dengGuangNode.active = true
SpineNodeTab.SunWuKong.dengGuangNode.zIndex = this.curZIndex-3
SpineNodeTab.ShaSeng.dengGuangNode.active = true
SpineNodeTab.ShaSeng.dengGuangNode.zIndex = this.curZIndex-3
})
.start()
}
this.geCiLabel = this.mapNode.getChildByName("geCiNode").getChildByName("geCiStr")
this.geCiLabel.getComponent(cc.Label).string = ""
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.mapNode.scale = this.mapNodeFixedScale
this.mapNode.setPosition(cc.v2(0,0))
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//小苹果
if(feiChaDianChildrens[i].name == "TouchArea_PingGuo"){
playSpineAndSounds(SpineNodeTab.TangSeng,AnimationNameTab.TangSeng.XiaoPingGuo,AudioEffectTab.XiaoPingGuo)
//彩色翅膀
}else if(feiChaDianChildrens[i].name == "TouchArea_ZaoGao"){
playSpineAndSounds(SpineNodeTab.TangSeng,AnimationNameTab.TangSeng.CaiSeChiBang,AudioEffectTab.ZaoGao)
//咖啡冲不冲
}else if(feiChaDianChildrens[i].name == "TouchArea_KaFei"){
playKaFeiSpineAndSounds()
//五环之歌
}else if(feiChaDianChildrens[i].name == "TouchArea_WuHuan"){
playSpineAndSounds(SpineNodeTab.ZhuBaJie,AnimationNameTab.ZhuBaJie.WuHuan,AudioEffectTab.WuHuan)
//秒针
}else if(feiChaDianChildrens[i].name == "TouchArea_ShouBiao"){
playSpineAndSounds(SpineNodeTab.ShaSeng,AnimationNameTab.ShaSeng.MiaoZhen,AudioEffectTab.MiaoZhen)
//一剪梅
}else if(feiChaDianChildrens[i].name == "TouchArea_MeiHua"){
playSpineAndSounds(SpineNodeTab.ShaSeng,AnimationNameTab.ShaSeng.YiJianMei,AudioEffectTab.YiJianMei)
//悟空
}else if(feiChaDianChildrens[i].name == "TouchArea_WuKong"){
playSpineAndSounds(SpineNodeTab.SunWuKong,AnimationNameTab.SunWuKong.WuKong,AudioEffectTab.TieBang)
//我是云南的
}else if(feiChaDianChildrens[i].name == "TouchArea_LuoShiFen"){
playSpineAndSounds(SpineNodeTab.ZhuBaJie,AnimationNameTab.ZhuBaJie.YunNan,AudioEffectTab.YunNan)
//黑桃A
}else if(feiChaDianChildrens[i].name == "TouchArea_HeiTaoA"){
playSpineAndSounds(SpineNodeTab.ZhuBaJie,AnimationNameTab.ZhuBaJie.HeiTaoA,AudioEffectTab.HeiTaoA)
//三两三
}else if(feiChaDianChildrens[i].name == "TouchArea_SanErSan"){
playSpineAndSounds(SpineNodeTab.SunWuKong,AnimationNameTab.SunWuKong.SanLiangSan,AudioEffectTab.SanLiangSan)
}
}
}
}
}
//map_22
specialMap22(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.isFind = true
//猪八戒头
if(feiChaDianChildrens[i].name == "zhuBaJieTouchArea"){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
Common5.playEffectCustom(this.subBundle,"sound/laozhu")
break
//猪鼻子插葱
}else if(feiChaDianChildrens[i].name == "congTouchArea" && this.gameInfo.ChaNode["ZhuangXiang"].isCanTouch){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
Common5.playEffectCustom(this.subBundle,"sound/zhuangxiang")
break
//腋毛
}else if(feiChaDianChildrens[i].name == "yeMaoTouchArea"){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
Common5.playEffectCustom(this.subBundle,"sound/yemao")
break
}
}
}
}
}
//map_23
specialMap23(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//新娘
if(feiChaDianChildrens[i].name == "xinNiangTouchArea"){
let xinNiangSpine= this.mapNode.getChildByName("xinNiangSpine")
xinNiangSpine.getComponent(sp.Skeleton).setAnimation(0,"xiangaitou",false)
xinNiangSpine.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{
this.gameInfo.ChaNode["LaoTaiTaiLian"].isCanTouch = true
})
//抽屉
}else if(feiChaDianChildrens[i].name == "chouTiTouchArea"){
let chouTiSpine= this.mapNode.getChildByName("chouTiSpine")
chouTiSpine.active = true
chouTiSpine.getComponent(sp.Skeleton).setAnimation(0,"chouti",false)
chouTiSpine.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{
this.gameInfo.ChaNode["MianJu"].isCanTouch = true
})
}
}
}
}
}
//map_25
specialMap25(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//新娘
if(feiChaDianChildrens[i].name == "zuolamen"){
let zuolamenNode= this.mapNode.getChildByName("feiChaDianNode").getChildByName("zuolamen")
cc.tween(zuolamenNode)
.to(0.5,{x:0})
.call(()=>{
this.gameInfo.ChaNode["BaGuaLu"].isCanTouch = true
})
.start()
}
}
}
}
}
//map_26
specialMap26(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//抽屉-书信
if(feiChaDianChildrens[i].name == "touchArea_chouTi"){
let chouTiSpine= this.mapNode.getChildByName("spine_chouti")
chouTiSpine.getComponent(sp.Skeleton).setAnimation(0,"chouti",false)
chouTiSpine.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{
this.gameInfo.ChaNode["ShuXin"].isCanTouch = true
})
//衣柜-长袍
}else if(feiChaDianChildrens[i].name == "touchArea_yiGui"){
let yiGuiSpine= this.mapNode.getChildByName("spine_yigui")
yiGuiSpine.getComponent(sp.Skeleton).setAnimation(0,"yiguidakai",false)
yiGuiSpine.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{
this.gameInfo.ChaNode["ChangPao"].isCanTouch = true
})
//枕头-曲谱
}else if(feiChaDianChildrens[i].name == "touchArea_zhenTou"){
let zhenTou= this.mapNode.getChildByName("zhentou")
cc.tween(zhenTou)
.to(0.5,{x:525,y:200})
.call(()=>{
this.gameInfo.ChaNode["QuPu"].isCanTouch = true
})
.start()
}
}
}
}
}
//map_27
specialMap27(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//头发
if(feiChaDianChildrens[i].name == "touchArea_touFa"){
let spine_jiaFa= this.mapNode.getChildByName("spine_jiaFa")
spine_jiaFa.getComponent(sp.Skeleton).setAnimation(0,"jiafa",false)
spine_jiaFa.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{
this.gameInfo.ChaNode["JiaFa"].isCanTouch = true
})
//红酒
}else if(feiChaDianChildrens[i].name == "touchArea_jiu"){
let spine_hongJiuBiao= this.mapNode.getChildByName("spine_hongJiuBiao")
spine_hongJiuBiao.getComponent(sp.Skeleton).setAnimation(0,"hongjiubiao",false)
spine_hongJiuBiao.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{
this.gameInfo.ChaNode["JiaJiu"].isCanTouch = true
})
//假项链
}else if(feiChaDianChildrens[i].name == "xianglian_jia"){
let jiaXiangLian = this.mapNode.getChildByName("feiChaDianNode").getChildByName("xianglian_jia").getChildByName("spFrame")
jiaXiangLian.active = true
//假蜡烛
}else if(feiChaDianChildrens[i].name == "touchArea_laZhu"){
let zhuguang = this.mapNode.getChildByName("zhuguang")
zhuguang.active = false
this.gameInfo.ChaNode["JiaZhuGuang"].isCanTouch = true
//假钥匙
}else if(feiChaDianChildrens[i].name == "touchArea_yaoShi"){
let yaoshi_1 = this.mapNode.getChildByName("yaoshi_1")
let yaoshi_2 = this.mapNode.getChildByName("yaoshi_2")
yaoshi_1.active = false
yaoshi_2.active = true
//纸盒
}else if(feiChaDianChildrens[i].name == "touchArea_zhiHe"){
let zhizhang = this.mapNode.getChildByName("zhizhang")
zhizhang.active = true
let huazhuanglian = this.mapNode.getChildByName("huazhuanglian")
let callFunc = ()=>{
huazhuanglian.active = false
let spine_caLian= this.mapNode.getChildByName("spine_caLian")
spine_caLian.getComponent(sp.Skeleton).setAnimation(0,"dianjiyanwu",false)
}
let attrs = {
startPos:zhizhang.getPosition(),
touchArea:huazhuanglian,
bindChaNodeInfo:this.gameInfo.ChaNode["HuaZhuangShu"],
callFunction:callFunc
}
this.openTouchEvent(zhizhang,attrs)
}
}
}
}
}
//map_29
specialMap29(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
let baJieZhengMian= this.mapNode.getChildByName("baJie").getChildByName("baJieZhengMian")
let baJieBeiMian= this.mapNode.getChildByName("baJie").getChildByName("baJieBeiMian")
let wuKongZhengMian= this.mapNode.getChildByName("wuKong").getChildByName("wuKongZhengMian")
let wuKongBeiMian= this.mapNode.getChildByName("wuKong").getChildByName("wuKongBeiMian")
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
// this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//八戒-
if(feiChaDianChildrens[i].name == "touchArea_baJieTou"){
baJieZhengMian.active = !baJieZhengMian.active
baJieBeiMian.active = !baJieBeiMian.active
//悟空-
}else if(feiChaDianChildrens[i].name == "touchArea_wuKongTou"){
wuKongZhengMian.active = !wuKongZhengMian.active
wuKongBeiMian.active = !wuKongBeiMian.active
if(wuKongBeiMian.active){
this.gameInfo.ChaNode["PanChan"].isCanTouch = true
}else{
this.gameInfo.ChaNode["PanChan"].isCanTouch = false
}
//八戒-左腿
}else if(feiChaDianChildrens[i].name == "touchArea_baJieZuoTui" && baJieBeiMian.active){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
let baJieZuoTui = baJieBeiMian.getChildByName("baJieZuoTui")
baJieZuoTui.active = false
let muYu = this.mapNode.getChildByName("muYu")
muYu.active = true
this.gameInfo.ChaNode["MuYu"].isCanTouch = true
//八戒-右腿
}else if(feiChaDianChildrens[i].name == "touchArea_baJieYouTui" && baJieBeiMian.active){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
let baJieYouTui = baJieBeiMian.getChildByName("baJieYouTui")
baJieYouTui.active = false
let fanWan = this.mapNode.getChildByName("fanWan")
fanWan.active = true
this.gameInfo.ChaNode["ZiJinBoYu"].isCanTouch = true
//悟空-肚子
}else if(feiChaDianChildrens[i].name == "touchArea_wuKongDuZi" && wuKongZhengMian.active){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
let wuKongDuZi = wuKongZhengMian.getChildByName("wuKongDuZi")
wuKongDuZi.active = false
let maoZi = this.mapNode.getChildByName("maoZi")
maoZi.active = true
this.gameInfo.ChaNode["PiLuMao"].isCanTouch = true
//悟空-后背
}else if(feiChaDianChildrens[i].name == "touchArea_wuKongHouBei" && wuKongBeiMian.active){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
let wuKongHouBei = wuKongBeiMian.getChildByName("wuKongHouBei")
wuKongHouBei.active = false
let shouZhang = this.mapNode.getChildByName("shouZhang")
shouZhang.active = true
this.gameInfo.ChaNode["JiuHuanXiZhang"].isCanTouch = true
//白龙马-
}else if(feiChaDianChildrens[i].name == "touchArea_baiLongMaZui"){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
let spine_baiLongMa = this.mapNode.getChildByName("spine_baiLongMa")
spine_baiLongMa.getComponent(sp.Skeleton).setAnimation(0,"zhangzuima",false)
this.gameInfo.ChaNode["JingShu"].isCanTouch = true
//白龙马-尾巴
}else if(feiChaDianChildrens[i].name == "touchArea_baiLongWeiBa"){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
let spine_maWei = this.mapNode.getChildByName("spine_maWei")
spine_maWei.getComponent(sp.Skeleton).setAnimation(0,"mawei",false)
this.gameInfo.ChaNode["TongGuanWenDie"].isCanTouch = true
//八戒-肚子
}else if(feiChaDianChildrens[i].name == "touchArea_baJieDuZi" && baJieZhengMian.active){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
let baJieJiaSha = baJieZhengMian.getChildByName("baJieJiaSha")
baJieJiaSha.active = true
this.gameInfo.ChaNode["JinLanJiaSha"].isCanTouch = true
}
}
}
}
}
//map_31
specialMap31(pos){
let spi_shouJi= this.mapNode.getChildByName("spi_shouJi")
let touchArea_bg = this.mapNode.getChildByName("feiChaDianNode").getChildByName("touchArea_bg")
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
//手机
if(feiChaDianChildrens[i].name == "touchArea_shouJi" && spi_shouJi["bindAni"] != "liangpingshouji"){
console.log("手机==")
spi_shouJi.getComponent(sp.Skeleton).setAnimation(0,"liangpingshouji",false)
spi_shouJi["bindAni"] = "liangpingshouji"
touchArea_bg.active = true
break
//手机-音量
}else if(feiChaDianChildrens[i].name == "touchArea_yinLiang" && spi_shouJi["bindAni"] == "liangpingshouji"){
console.log("手机音量==")
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
spi_shouJi.getComponent(sp.Skeleton).setAnimation(0,"yingliang",false)
spi_shouJi["bindAni"] = "yingliang"
touchArea_bg.active = true
// spi_shouJi.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{
// spi_shouJi.getComponent(sp.Skeleton).setAnimation(0,"heipingshouji",false)
// spi_shouJi["bindAni"] = "heipingshouji"
// })
let spi_shaSeng= this.mapNode.getChildByName("spi_shaSeng")
spi_shaSeng.getComponent(sp.Skeleton).setAnimation(0,"shasengdiaoerji",false)
this.gameInfo.ChaNode["TingGe"].isCanTouch = true
break
//空白区域
}else if(touchArea_bg.active && feiChaDianChildrens[i].name == "touchArea_bg" && (spi_shouJi["bindAni"] == "liangpingshouji" || spi_shouJi["bindAni"] == "yingliang")){
console.log("空白区域==")
spi_shouJi.getComponent(sp.Skeleton).setAnimation(0,"heipingshouji",false)
spi_shouJi["bindAni"] = "heipingshouji"
touchArea_bg.active = false
break
//翻页
}else if(feiChaDianChildrens[i].name == "touchArea_nextPage"){
let ppt_1 = this.mapNode.getChildByName("ppt_1")
ppt_1.active = !ppt_1.active
let ppt_2 = this.mapNode.getChildByName("ppt_2")
ppt_2.active = !ppt_2.active
if(ppt_1.active){
this.gameInfo.ChaNode["CuoZi"].isCanTouch = true
this.gameInfo.ChaNode["JianDuanPPT"].isCanTouch = false
}else if(ppt_2.active){
this.gameInfo.ChaNode["CuoZi"].isCanTouch = false
this.gameInfo.ChaNode["JianDuanPPT"].isCanTouch = true
}
//书本
}else if(feiChaDianChildrens[i].name == "touchArea_shuBen"){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
let shuBen = this.mapNode.getChildByName("feiChaDianNode").getChildByName("touchArea_shuBen").getChildByName("shuBen")
cc.tween(shuBen)
.by(0.3,{y:-150})
.call(()=>{
this.gameInfo.ChaNode["MeiNvShiPin"].isCanTouch = true
})
.start()
}
}
}
}
}
//map_33
specialMap33(pos){
let guiMen_1= this.mapNode.getChildByName("feiChaDianNode").getChildByName("guiMen_1")
let guiMen_2= this.mapNode.getChildByName("feiChaDianNode").getChildByName("guiMen_2")
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//柜门
if(feiChaDianChildrens[i].name == "guiMen_1"){
guiMen_1.active = false
guiMen_2.active = true
this.gameInfo.ChaNode["ShouYinJi"].isCanTouch = true
//电视机
}else if(feiChaDianChildrens[i].name == "touchArea_dianShiJi"){
let huaMian= this.mapNode.getChildByName("huaMian")
huaMian.active = true
this.gameInfo.ChaNode["ShouMenYuan"].isCanTouch = true
}
}
}
}
}
//map_36
specialMap36(pos){
let zuoQuan = this.mapNode.getChildByName("maBaoGuoNode").getChildByName("zuoQuan")
let ZuoQuanKai = this.mapNode.getChildByName("maBaoGuoNode").getChildByName("ZuoQuanKai")
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
//口袋支票
if(feiChaDianChildrens[i].name == "touchArea_kouDai"){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
let zhiPiao = this.mapNode.getChildByName("zhiPiao")
cc.tween(zhiPiao)
.by(0.5,{y:40})
.start()
this.gameInfo.ChaNode["ShouMaiCaiPan"].isCanTouch = true
//拳刺手套
}else if(feiChaDianChildrens[i].name == "touchArea_quanCi"){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
let zuoShouQuanCi = this.mapNode.getChildByName("zuoShouQuanCi")
zuoShouQuanCi.active = true
this.gameInfo.ChaNode["QuanCi"].isCanTouch = true
//马大师左拳
}else if(feiChaDianChildrens[i].name == "touchArea_zuoQuan"){
zuoQuan.active = false
ZuoQuanKai.active = true
this.gameInfo.ChaNode["LaJiaoPenWu"].isCanTouch = true
//马大师身体
}else if(feiChaDianChildrens[i].name == "touchArea_shenTi"){
let maBaoGuoNode = this.mapNode.getChildByName("maBaoGuoNode")
maBaoGuoNode.active = false
this.gameInfo.ChaNode["LaJiaoPenWu"].isCanTouch = false
let spi_maDaShi = this.mapNode.getChildByName("spi_maDaShi")
spi_maDaShi.active = true
spi_maDaShi.getComponent(sp.Skeleton).setAnimation(0,"chuquan",false)
spi_maDaShi.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{
spi_maDaShi.active = false
maBaoGuoNode.active = true
zuoQuan.active = true
ZuoQuanKai.active = false
})
let spi_gangGuan = this.mapNode.getChildByName("spi_gangGuan")
spi_gangGuan.getComponent(sp.Skeleton).setAnimation(0,"gangguan",false)
spi_gangGuan.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{
this.gameInfo.ChaNode["GangGuan"].isCanTouch = true
})
//马大师裤腿
}else if(feiChaDianChildrens[i].name == "touchArea_zuoKuTui"){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
let zuoKuTui = this.mapNode.getChildByName("maBaoGuoNode").getChildByName("zuoKuTui")
let zuoKuTuiJuanQi = this.mapNode.getChildByName("maBaoGuoNode").getChildByName("zuoKuTuiJuanQi")
zuoKuTui.active = false
zuoKuTuiJuanQi.active = true
this.gameInfo.ChaNode["GangBanHuTui"].isCanTouch = true
//激光手电
}else if(feiChaDianChildrens[i].name == "touchArea_shouDian"){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
let jiGuang = this.mapNode.getChildByName("jiGuang")
jiGuang.active = true
//口气
}else if(feiChaDianChildrens[i].name == "touchArea_kouQi"){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
let spi_tou = this.mapNode.getChildByName("spi_tou")
spi_tou.getComponent(sp.Skeleton).setAnimation(0,"haqi",false)
spi_tou.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{
this.gameInfo.ChaNode["KouQiXiJi"].isCanTouch = true
})
}
}
}
}
}
//map_37
specialMap37(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//西装
if(feiChaDianChildrens[i].name == "touchArea_xiZhuang"){
let xiZhuang= this.mapNode.getChildByName("xiZhuang")
xiZhuang.active = false
this.gameInfo.ChaNode["YangMaoShan"].isCanTouch = true
//
}else if(feiChaDianChildrens[i].name == "touchArea_shu"){
let shu= this.mapNode.getChildByName("shu")
cc.tween(shu)
.by(0.5,{x:140})
.call(()=>{
this.gameInfo.ChaNode["LaoShuDong"].isCanTouch = true
})
.start()
}
}
}
}
}
//map_39
specialMap39(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//蓝色妖姬-
if(feiChaDianChildrens[i].name == "touchArea_lanSe"){
Common5.playEffectCustom(this.subBundle,"sounds/jingTianDaGua")
let ls_zuiXing1= this.mapNode.getChildByName("ls_zuiXing1")
let ls_zuiXing2= this.mapNode.getChildByName("ls_zuiXing2")
let ls_shuoHua= this.mapNode.getChildByName("ls_shuoHua")
let ls_baoQuan= this.mapNode.getChildByName("ls_baoQuan")
let ls_kanBaoZhi= this.mapNode.getChildByName("ls_kanBaoZhi")
ls_zuiXing1.active = false
ls_zuiXing2.active = true
ls_shuoHua.active = true
ls_baoQuan.active = false
ls_kanBaoZhi.active = true
this.gameInfo.ChaNode["JingTianDaGua"].isCanTouch = true
//红色风暴-
}else if(feiChaDianChildrens[i].name == "touchArea_hongSe"){
Common5.playEffectCustom(this.subBundle,"sounds/jiDiuLe")
let hs_zuiXing1= this.mapNode.getChildByName("hs_zuiXing1")
let hs_zuiXing2= this.mapNode.getChildByName("hs_zuiXing2")
let hs_shuoHua= this.mapNode.getChildByName("hs_shuoHua")
hs_zuiXing1.active = false
hs_zuiXing2.active = true
hs_shuoHua.active = true
this.gameInfo.ChaNode["BaGua"].isCanTouch = true
//黑色人头
}else if(feiChaDianChildrens[i].name == "touchArea_heiSe"){
let tou_zhengChang= this.mapNode.getChildByName("tou_zhengChang")
let tou_waiZui= this.mapNode.getChildByName("tou_waiZui")
tou_zhengChang.active = false
tou_waiZui.active = true
this.gameInfo.ChaNode["WaiGuaLieZao"].isCanTouch = true
//上衣口袋
}else if(feiChaDianChildrens[i].name == "touchArea_kouDai"){
let guaGuaLe= this.mapNode.getChildByName("guaGuaLe")
cc.tween(guaGuaLe)
.by(0.5,{x:-12,y:50})
.call(()=>{
this.gameInfo.ChaNode["GuaGuaLe"].isCanTouch = true
})
.start()
//裤子口袋
}else if(feiChaDianChildrens[i].name == "touchArea_kuZiKouDai"){
let diGua= this.mapNode.getChildByName("diGua")
let kuZiKouDai= this.mapNode.getChildByName("kuZiKouDai")
kuZiKouDai.active = false
cc.tween(diGua)
.by(0.5,{x:-85})
.call(()=>{
this.gameInfo.ChaNode["DiGua"].isCanTouch = true
})
.start()
}
}
}
}
}
//map_40
specialMap40(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//苹果
if(feiChaDianChildrens[i].name == "apple"){
let apple= this.mapNode.getChildByName("feiChaDianNode").getChildByName("apple")
let gaoXiaoJie1= this.mapNode.getChildByName("gaoXiaoJie1")
let gaoXiaoJie2= this.mapNode.getChildByName("gaoXiaoJie2")
apple.getComponent(cc.Animation).play()
cc.tween(this.node)
.delay(0.2)
.call(()=>{
this.gameInfo.ChaNode["ZuanJie"].isCanTouch = true
gaoXiaoJie1.active = false
gaoXiaoJie2.active = true
})
.start()
}
}
}
}
}
//map_42
specialMap42(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//录音机 xuwenqiang
if(feiChaDianChildrens[i].name == "KaiGuan"){
let xuwenqiang = feiChaDianChildrens[i].getChildByName('xuwenqiang');
xuwenqiang.active = true;
xuwenqiang.opacity = 0;
cc.tween(xuwenqiang)
.to(0.2, {opacity:255})
.call(()=>{
this.gameInfo.ChaNode["WenQiang"].isCanTouch = true
})
.start()
//录音机 Luyinji
}else if(feiChaDianChildrens[i].name == "Luyinji"){
feiChaDianChildrens[i].getChildByName('aizhenaishangaiqiang').active = true;
feiChaDianChildrens[i].getChildByName('sound').active = true;
Common5.playEffectCustom("WordGame", 'fkwz123/ZhaoCha/map42/sounds/aqiang');
cc.tween(feiChaDianChildrens[i])
.to(0.05,{angle:30})
.to(0.05,{angle:0})
.to(0.05,{angle:-30})
.to(0.05,{angle:0})
.call(()=>{
this.gameInfo.ChaNode["AQiang"].isCanTouch = true
})
.start()
}
}
}
}
}
//map_46
specialMap46(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//maozi
if(feiChaDianChildrens[i].name == "maozi"){
let maozi = this.mapNode.getChildByName("feiChaDianNode").getChildByName("maozi")
cc.tween(maozi)
.to(0.05,{x:maozi.x-40})
.to(0.3,{y:maozi.y-100})
.call(()=>{
this.gameInfo.ChaNode["RanFa"].isCanTouch = true
maozi.active = false;
})
.start()
}
//fangyingji
if(feiChaDianChildrens[i].name == "fangyingji"){
let dianying = this.mapNode.getChildByName('dianying');
dianying.active = true;
dianying.opacity = 0;
cc.tween(dianying)
.to(1.0,{opacity:255})
.call(()=>{
this.gameInfo.ChaNode["DaHuaXiYou"].isCanTouch = true
})
.start();
}
}
}
}
}
//map_47
specialMap47(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//guimen
if(feiChaDianChildrens[i].name == "guimen"){
let guimendakai = this.mapNode.getChildByName('guimendakai');
guimendakai.active = true;
this.gameInfo.ChaNode["DaoCaoRen"].isCanTouch = true
}
//jingziqiwu
if(feiChaDianChildrens[i].name == "jingziqiwu"){
let jingziqiwu = this.mapNode.getChildByName('feiChaDianNode').getChildByName('jingziqiwu');
cc.tween(jingziqiwu)
.to(1.0,{opacity:0})
.call(()=>{
this.gameInfo.ChaNode["JingZhongRen"].isCanTouch = true
jingziqiwu.active = false;
})
.start()
}
//putongtou
if(feiChaDianChildrens[i].name == "putongtou"){
let putongtou = this.mapNode.getChildByName('feiChaDianNode').getChildByName('putongtou');
let zhuantouxiao = this.mapNode.getChildByName('zhuantouxiao');
putongtou.active = false;
zhuantouxiao.active = true;
this.gameInfo.ChaNode["GuiYiMianKong"].isCanTouch = true
}
//wenzhang
if(feiChaDianChildrens[i].name == "wenzhang"){
let wenzhangguanbi = this.mapNode.getChildByName('wenzhangguanbi');
let wenzhangdakai = this.mapNode.getChildByName('wenzhangdakai');
wenzhangguanbi.active = false;
wenzhangdakai.active = true;
this.gameInfo.ChaNode["HeiMao"].isCanTouch = true
}
//rijiben
if(feiChaDianChildrens[i].name == "rijiben"){
let rijidakai = this.mapNode.getChildByName('rijidakai');
rijidakai.active = true;
this.gameInfo.ChaNode["GuiYiRiJi"].isCanTouch = true
}
//shouji
if(feiChaDianChildrens[i].name == "shouji"){
let liaotianjiemian = this.mapNode.getChildByName('liaotianjiemian');
liaotianjiemian.active = true;
liaotianjiemian.on(cc.Node.EventType.TOUCH_START, ()=>{
this.mapNode.getChildByName('liaotianjiemian').active = false;
})
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = false
}
}
}
}
}
//map_48
specialMap48(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//shizhong
if(feiChaDianChildrens[i].name == "shizhong"){
let shizhong = this.mapNode.getChildByName('shizhong');
shizhong.getComponent(FMSkeletonExtend).animation = '12'
cc.tween(shizhong)
.delay(2.0)
.call(()=>{
Common5.playEffectCustom("WordGame",'fkwz123/ZhaoCha/map48/sound/zs')
let wawa = this.mapNode.getChildByName('wawa');
wawa.active = true;
wawa.opacity = 0;
cc.tween(wawa)
.to(1.5, {opacity:255})
.call(()=>{
this.gameInfo.ChaNode["WaWa"].isCanTouch = true
})
.start()
let ren = this.mapNode.getChildByName('ren');
ren.active = true;
ren.opacity = 0;
cc.tween(ren)
.to(1.5, {opacity:255})
.call(()=>{
this.gameInfo.ChaNode["HongYiNvZi"].isCanTouch = true
})
.start()
let yizi = this.mapNode.getChildByName('yizi')
let yizi_sound = this.mapNode.getChildByName('yizi_sound');
yizi.getComponent(FMSkeletonExtend).animation = 'yizi'
yizi_sound.active = true;
cc.tween(yizi)
.delay(0.5)
.call(()=>{
this.gameInfo.ChaNode["YaoBaiYiZi"].isCanTouch = true
})
.start()
})
.start()
}
//shuilongtou
if(feiChaDianChildrens[i].name == "shuilongtou"){
let liushui = this.mapNode.getChildByName('liushui')
liushui.active = true;
liushui.opacity = 0;
cc.tween(liushui)
.to(0.5,{opacity:255})
.call(()=>{
this.gameInfo.ChaNode["HongSeShui"].isCanTouch = true
})
.start()
}
//huocai
if(feiChaDianChildrens[i].name == "huocai"){
let huocai = this.mapNode.getChildByName('feiChaDianNode').getChildByName('liushui')
let oldPos = huocai.getPosition();
huocai.on(cc.Node.EventType.TOUCH_MOVE,(event)=>{
let dropNode = event.target as cc.Node;
let nodeLoc = event.getLocation()
let nodePos = event.target.parent.convertToNodeSpaceAR(nodeLoc)
dropNode.setPosition(nodePos);
})
huocai.on(cc.Node.EventType.TOUCH_END,(event)=>{
let dropNode = event.target as cc.Node;
let huoyan = this.mapNode.getChildByName('huoyan');
let d = Common5.makeNodeDistance_custom(dropNode, huoyan)
if(d < 50){
huoyan.active = true;
huoyan.opacity = 0
cc.tween(huoyan)
.to(0.5,{opacity:255})
.call(()=>{
this.gameInfo.ChaNode["LvYan"].isCanTouch = true
})
.start()
}
dropNode.setPosition(oldPos);
})
}
//chuanglian
if(feiChaDianChildrens[i].name == "chuanglian"){
let chuanglian = this.mapNode.getChildByName('chuanglian')
chuanglian.getComponent(FMSkeletonExtend).animation = 'lakai'
cc.tween(chuanglian)
.delay(1.0)
.call(()=>{
this.gameInfo.ChaNode["ShengZi"].isCanTouch = true
})
.start()
}
}
}
}
}
//map_49
specialMap49(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//honghaier
if(feiChaDianChildrens[i].name == "honghaier"){
let yumi:any = this.mapNode.getChildByName('yumi')
let dxbmhj = this.mapNode.getChildByName('dxbmhj')//
let dxph:any = this.mapNode.getChildByName('dxph')
dxph.getComponent(FMSkeletonExtend).animation = 'penhuo'
cc.tween(dxph)
.delay(1.0)
.call(()=>{
if(yumi.isFeed){
dxbmhj.getComponent(FMSkeletonExtend).animation = 'youyumi'
cc.tween(dxbmhj)
.delay(1.0)
.call(()=>{
this.gameInfo.ChaNode["BaoMiHua"].isCanTouch = true
})
.start()
}else{
dxbmhj.getComponent(FMSkeletonExtend).animation = 'wuyumi'
this.gameInfo.FeiChanDian["honghaier"].isTouchOff = false
}
})
.start()
}
//zuiba
if(feiChaDianChildrens[i].name == "zuiba"){
let zuiba = this.mapNode.getChildByName('zuiba')
let dxppt = this.mapNode.getChildByName('dxppt')
dxppt.active = true;
zuiba.active = false;
this.gameInfo.ChaNode["PaoPaoTang"].isCanTouch = true
}
}
}
}
}
//map_50
specialMap50(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//zuanjiehezi
if(feiChaDianChildrens[i].name == "zuanjiehezi"){
let nanren = this.mapNode.getChildByName('nanren')
let nvren = this.mapNode.getChildByName('nvren')
nanren.getChildByName('jiezhihezikai').active = true;
nanren.getChildByName('jiezhiheziguan').active = false;
//nanren.getChildByName('gaoxing').active = true;
//nanren.getChildByName('putong').active = false;
nvren.getChildByName('gaoxing').active = true
//GeDanZuanJie
this.gameInfo.ChaNode["GeDanZuanJie"].isCanTouch = true
}
//cheyaosi
if(feiChaDianChildrens[i].name == "cheyaosi"){
let haoche = this.mapNode.getChildByName('00qiche').getChildByName('00qiche')
let pos = haoche.getPosition();
let posNew = new cc.Vec2(pos.x - haoche.width - 100, pos.y);
haoche.active = true;
haoche.setPosition(posNew);
Common5.playEffectCustom("WordGame",'fkwz123/ZhaoCha/map50/sound/qclb')
cc.tween(haoche)
.to(1.0, {x:pos.x})
.call(()=>{
//PaoChe
this.gameInfo.ChaNode["PaoChe"].isCanTouch = true
})
.start()
}
//dalaba
if(feiChaDianChildrens[i].name == "dalaba"){
Common5.playEffectCustom("WordGame",'fkwz123/ZhaoCha/map50/sound/dalaba')
let dabala123 = this.mapNode.getChildByName('dabala123')
dabala123.active = true;
cc.tween(dabala123)
.to(0.2,{scale:0.9})
.to(0.2,{scale:1.0})
.to(0.2,{scale:1.1})
.to(0.2,{scale:1.0})
.to(0.2,{scale:0.9})
.to(0.2,{scale:1.0})
.to(0.2,{scale:1.1})
.to(0.2,{scale:1.0})
.to(0.2,{scale:0.9})
.to(0.2,{scale:1.0})
.to(0.2,{scale:1.1})
.to(0.2,{scale:1.0})
.call(()=>{
dabala123.active = false;
})
.start()
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = false
}
//nanrenzui
if(feiChaDianChildrens[i].name == "nanrenzui"){
let nanren = this.mapNode.getChildByName('nanren')
nanren.getChildByName('gaoxing').active = true;
nanren.getChildByName('putong').active = false;
this.gameInfo.ChaNode["DaJinYa"].isCanTouch = true
}
//lajitong1
if(feiChaDianChildrens[i].name == "lajitong1"){
let lajitong1 = this.mapNode.getChildByName('feiChaDianNode').getChildByName('lajitong1');
let qiqiu = this.mapNode.getChildByName('1qiqiu');
let xinfeng = this.mapNode.getChildByName('2xinfeng');
let zhijin = this.mapNode.getChildByName('3zhijin');
if(!qiqiu.active){
let pos1 = Common5.getRelativePosition(lajitong1.getChildByName('top'), qiqiu.parent);
let pos2 = qiqiu.getPosition();
let posNew = Common5.getRelativePosition(lajitong1.getChildByName('top1'), qiqiu.parent);
qiqiu.active = true;
qiqiu.scale = 0.2;
qiqiu.setPosition(posNew)
cc.tween(qiqiu)
.to(0.5, {x:pos1.x, y:pos1.y, scale:0.6})
.to(0.5,{x:pos2.x, y:pos2.y, scale: 1.0})
.call(()=>{
this.gameInfo.FeiChanDian["qiqiu"].isTouchOff = false
})
.start()
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = false
}else if(!xinfeng.active){
//信封
let pos1 = Common5.getRelativePosition(lajitong1.getChildByName('top'), xinfeng.parent);
let pos2 = xinfeng.getPosition();
let posNew = Common5.getRelativePosition(lajitong1.getChildByName('top1'), xinfeng.parent);
xinfeng.active = true;
xinfeng.scale = 0.2;
xinfeng.setPosition(posNew)
cc.tween(xinfeng)
.to(0.5, {x:pos1.x, y:pos1.y, scale:0.6})
.to(0.5,{x:pos2.x, y:pos2.y, scale: 1.0})
.call(()=>{
this.gameInfo.FeiChanDian["xinfeng"].isTouchOff = false
})
.start()
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = false
}else if(!zhijin.active){
//纸巾
let pos1 = Common5.getRelativePosition(lajitong1.getChildByName('top'), zhijin.parent);
let pos2 = zhijin.getPosition();
let posNew = Common5.getRelativePosition(lajitong1.getChildByName('top1'), zhijin.parent);
zhijin.active = true;
zhijin.scale = 0.2;
zhijin.setPosition(posNew)
cc.tween(zhijin)
.to(0.5, {x:pos1.x, y:pos1.y, scale:0.6})
.to(0.5,{x:pos2.x, y:pos2.y, scale: 1.0})
.start()
}
}
//qiqiu
if(feiChaDianChildrens[i].name == "qiqiu"){
let qiqiu = this.mapNode.getChildByName('1qiqiu');
qiqiu.getComponent(FMSkeletonExtend).animation = 'jiezhi'
cc.tween(qiqiu)
.delay(0.1)
.call(()=>{
this.gameInfo.ChaNode["JinJieZhi"].isCanTouch = true
})
.start()
}
//xinfeng
if(feiChaDianChildrens[i].name == "xinfeng"){
let zhipiao = this.mapNode.getChildByName('2zhipiao');
zhipiao.active = true;
this.gameInfo.ChaNode["ZhiPiao"].isCanTouch = true
}
//lajitong2
if(feiChaDianChildrens[i].name == "lajitong2"){
let lajitong1 = this.mapNode.getChildByName('feiChaDianNode').getChildByName('lajitong2');
let xianhua = this.mapNode.getChildByName('4xianhua');
let lvmaozi = this.mapNode.getChildByName('6lvmaozi');
let qiaokelihe = this.mapNode.getChildByName('5qiaokelihe');
if(!xianhua.active){
let pos1 = Common5.getRelativePosition(lajitong1.getChildByName('top'), xianhua.parent);
let pos2 = xianhua.getPosition();
let posNew = Common5.getRelativePosition(lajitong1.getChildByName('top1'), xianhua.parent);
xianhua.active = true;
xianhua.scale = 0.2;
xianhua.setPosition(posNew)
cc.tween(xianhua)
.to(0.5, {x:pos1.x, y:pos1.y, scale:0.6})
.to(0.5,{x:pos2.x, y:pos2.y, scale: 1.0})
.call(()=>{
this.gameInfo.FeiChanDian["xianhua"].isTouchOff = false
})
.start()
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = false
}else if(!lvmaozi.active){
let pos1 = Common5.getRelativePosition(lajitong1.getChildByName('top'), lvmaozi.parent);
let pos2 = lvmaozi.getPosition();
let posNew = Common5.getRelativePosition(lajitong1.getChildByName('top1'), lvmaozi.parent);
lvmaozi.active = true;
lvmaozi.scale = 0.2;
lvmaozi.setPosition(posNew)
cc.tween(lvmaozi)
.to(0.5, {x:pos1.x, y:pos1.y, scale:0.6})
.to(0.5,{x:pos2.x, y:pos2.y, scale: 1.0})
.call(()=>{
//LvBaoShi
this.gameInfo.ChaNode["LvBaoShi"].isCanTouch = true
})
.start()
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = false
}else if(!qiaokelihe.active){
let pos1 = Common5.getRelativePosition(lajitong1.getChildByName('top'), qiaokelihe.parent);
let pos2 = qiaokelihe.getPosition();
let posNew = Common5.getRelativePosition(lajitong1.getChildByName('top1'), qiaokelihe.parent);
qiaokelihe.active = true;
qiaokelihe.scale = 0.2;
qiaokelihe.setPosition(posNew)
cc.tween(qiaokelihe)
.to(0.5, {x:pos1.x, y:pos1.y, scale:0.6})
.to(0.5,{x:pos2.x, y:pos2.y, scale: 1.0})
.call(()=>{
this.gameInfo.FeiChanDian["qiaokelihe"].isTouchOff = false
})
.start()
}
}
//xianhua
if(feiChaDianChildrens[i].name == "xianhua"){
let shoujihe = this.mapNode.getChildByName('4shoujihe');
shoujihe.active = true;
this.gameInfo.ChaNode["GaoDuanShouJi"].isCanTouch = true
}
//qiaokelihe
if(feiChaDianChildrens[i].name == "qiaokelihe"){
this.mapNode.getChildByName('5qiaokelihe').active = false;
let fangchanzheng = this.mapNode.getChildByName('5fangchanzheng');
fangchanzheng.active = true;
this.gameInfo.ChaNode["FangChanZheng"].isCanTouch = true
}
}
}
}
}
//map_51
specialMap51(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//chuanglian
if(feiChaDianChildrens[i].name == "chuanglian"){
let dxChuangLian = this.mapNode.getChildByName('dxChuangLian')
dxChuangLian.getComponent(FMSkeletonExtend).animation = 'chuanglian'
cc.tween(dxChuangLian)
.delay(0.5)
.call(()=>{
//WuRenJi
this.gameInfo.ChaNode["WuRenJi"].isCanTouch = true
})
.start()
}
}
}
}
}
//map_52
specialMap52(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//zhugeliang
if(feiChaDianChildrens[i].name == "zhugeliang"){
console.log('feiChaDianChildrens[i].name',feiChaDianChildrens[i].name)
let dxZhuGeLiang = this.mapNode.getChildByName('dxZhuGeLiang')
dxZhuGeLiang.getComponent(FMSkeletonExtend).animation = 'zhugeliang'
Common5.playEffectCustom(this.subBundle,'sound/jt')
cc.tween(dxZhuGeLiang)
.delay(12.0)
.call(()=>{
this.gameInfo.FeiChanDian['zhugeliang'].isTouchOff = false
dxZhuGeLiang.getComponent(FMSkeletonExtend).clearTracks();
})
.start()
}
//yuncheng
if(feiChaDianChildrens[i].name == "yuncheng"){
let yun = this.mapNode.getChildByName('yun').getChildByName('yun')
let x = yun.getPosition().x - 1000;
cc.tween(yun)
.to(2.0, {opacity: 0, x: x})
.call(()=>{
//FeiDie
this.gameInfo.ChaNode["FeiDie"].isCanTouch = true
})
.start()
}
//chengmen
if(feiChaDianChildrens[i].name == "chengmen"){
let menclose = this.mapNode.getChildByName('menclose')
menclose.active = false;
//XiChenQi
this.gameInfo.ChaNode["XiChenQi"].isCanTouch = true
}
}
}
}
}
//map_53
specialMap53(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//chuanglian
if(feiChaDianChildrens[i].name == "chuanglian"){
let chuanglian = this.mapNode.getChildByName('chuanglian')
chuanglian.active = false;
this.gameInfo.ChaNode["wurenji"].isCanTouch = true
}
//chouti
if(feiChaDianChildrens[i].name == "chouti"){
let choutikai = this.mapNode.getChildByName('choutikai')
choutikai.active = true;
this.gameInfo.ChaNode["bingdundun"].isCanTouch = true
}
}
}
}
}
//map_54
specialMap54(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.isFind = true
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//chuanglian
if(feiChaDianChildrens[i].name == "menbashou"){
this.mapNode.getChildByName('dxqiaomensheng').active = false;
this.mapNode.getChildByName('bg2').active = true
this.mapNode.getChildByName('bg2').opacity = 0;
cc.tween(this.mapNode.getChildByName('bg2'))
.to(0.7,{opacity:255})
.call(()=>{
this.mapNode.getChildByName('bg1').active = false;
this.mapNode.getChildByName('dxlinghun').active = true;
//siwangbiji
this.gameInfo.ChaNode["heiwuchang"].isCanTouch = true
this.gameInfo.ChaNode["baiwuchang"].isCanTouch = true
this.gameInfo.ChaNode["guiyidexiao"].isCanTouch = true
this.gameInfo.ChaNode["siwangbiji"].isCanTouch = true
this.gameInfo.ChaNode["linghun"].isCanTouch = true
})
.delay(2.0)
.call(()=>{
//Common5.playEffectCustom("WordGame",'fkwz123/ZhaoCha/map54/sound/猫叫')
})
.delay(1.0)
.call(()=>{
this.gameInfo.FeiChanDian['guimen'].isCanTouch = true
})
.start();
}
//chuanglian
if(feiChaDianChildrens[i].name == "guizi"){
this.mapNode.getChildByName('bg2').getChildByName('tongzhishu').active = true;
this.mapNode.getChildByName('bg1').getChildByName('tongzhishu').active = true;
this.gameInfo.ChaNode["tongzhishu"].isCanTouch = true
}
//guimen
if(feiChaDianChildrens[i].name == "guimen"){
this.mapNode.getChildByName('bg2').getChildByName('kaimen').active = true;
this.mapNode.getChildByName('maoyao').active = true;
cc.tween(this.mapNode.getChildByName('maoyao'))
.delay(0.5)
.call(()=>{
this.gameInfo.ChaNode["heimao"].isCanTouch = true
})
.start()
}
//jiandao
if(feiChaDianChildrens[i].name == "jiandao"){
this.mapNode.getChildByName('bg1').getChildByName('jiandao').active = true;
this.mapNode.getChildByName('bg2').getChildByName('jiandao').active = true;
this.gameInfo.ChaNode["jiandao"].isCanTouch = true
}
}
}
}
}
//map_55
specialMap55(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.isFind = true
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//meinv
if(feiChaDianChildrens[i].name == "meinv"){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = false
this.mapNode.getChildByName('zhuozi').getChildByName('meinv').getComponent(FMSkeletonExtend).animation = '3chi'
cc.tween(this.mapNode.getChildByName('zhuozi').getChildByName('meinv'))
.delay(2.0)
.call(()=>{
Common5.playEffectCustom("WordGame",'fkwz123/ZhaoCha/map55/sound/怎么吃也吃不饱')
this.mapNode.getChildByName('zhuozi').getChildByName('meinv').getComponent(FMSkeletonExtend).animation = '1daiji'
})
.start()
}
//bangyi
if(feiChaDianChildrens[i].name == "bangyi"){
this.mapNode.getChildByName('yonghubucunzai').active = true;
this.gameInfo.ChaNode["yonghubucunzai"].isCanTouch = true
}
//liwu
if(feiChaDianChildrens[i].name == "liwu"){
this.mapNode.getChildByName('guancailiwu').active = true;
cc.tween(this.mapNode.getChildByName('guancailiwu'))
.delay(3.0)
.call(()=>{
this.mapNode.getChildByName('tips0').active = true;
this.gameInfo.ChaNode["guancai"].isCanTouch = true
})
.start()
}
//gouwuche
if(feiChaDianChildrens[i].name == "gouwuche"){
this.mapNode.getChildByName('mengpotang').active = true;
this.gameInfo.ChaNode["mengpotang"].isCanTouch = true
}
//tips1
if(feiChaDianChildrens[i].name == "tips1"){
this.mapNode.getChildByName('tips1').active = true;
this.gameInfo.FeiChanDian["tips2"].isCanTouch = true
}
//tips2
if(feiChaDianChildrens[i].name == "tips2"){
this.mapNode.getChildByName('tips1').y += 45;
this.mapNode.getChildByName('tips2').active = true;
this.gameInfo.FeiChanDian["tips3"].isCanTouch = true
}
//tips3
if(feiChaDianChildrens[i].name == "tips3"){
this.mapNode.getChildByName('tips1').y += 45;
this.mapNode.getChildByName('tips2').y += 45;
this.mapNode.getChildByName('tips3').active = true;
this.gameInfo.FeiChanDian["tips4"].isCanTouch = true //
this.mapNode.getChildByName('zhuozi').getChildByName('meinv').getComponent(FMSkeletonExtend).animation = '2daiji'
cc.tween(this.mapNode.getChildByName('zhuozi').getChildByName('meinv'))
.delay(2.0)
.call(()=>{
//guiyiwawa
this.gameInfo.ChaNode["guiyiwawa"].isCanTouch = true
this.mapNode.getChildByName('buwawa').getComponent(FMSkeletonExtend).animation = '2dong';
this.mapNode.getChildByName('zhuozi').getChildByName('meinv').getComponent(FMSkeletonExtend).animation = '1daiji'
Common5.playEffectCustom("WordGame",'fkwz123/ZhaoCha/map55/sound/吓人家干嘛')
})
.start();
}
//tips4
if(feiChaDianChildrens[i].name == "tips4"){
this.mapNode.getChildByName('tips1').y += 45;
this.mapNode.getChildByName('tips2').y += 45;
this.mapNode.getChildByName('tips3').y += 45;
this.mapNode.getChildByName('tips4').active = true;
this.gameInfo.ChaNode["heiwuchang"].isCanTouch = true
}
//shouji
if(feiChaDianChildrens[i].name == "shouji"){
this.mapNode.getChildByName('shafa').getChildByName('shouji1').active = true;
this.gameInfo.ChaNode["dafenwaimai"].isCanTouch = true
Common5.playEffectCustom("WordGame",'fkwz123/ZhaoCha/map55/sound/外卖')
}
//guizi
if(feiChaDianChildrens[i].name == "guizi"){
this.mapNode.getChildByName('dakaideguizi').active = true;
this.mapNode.getChildByName('chuizi').active = true;
let chuizi:any = this.mapNode.getChildByName('chuizi')
let jingzi = this.mapNode.getChildByName('jingzi')
let callFunc = ()=>{
jingzi.getComponent(FMSkeletonExtend).animation = '2jingzi+cuizi'
cc.tween(jingzi)
.delay(1.0)
.call(()=>{
Common5.playEffectCustom("WordGame",'fkwz123/ZhaoCha/map55/sound/砸镜子')
//打开镜子的茬点
this.gameInfo.ChaNode["toukui"].isCanTouch = true
})
.start()
}
let attrs = {
startPos:chuizi.getPosition(),
touchArea:jingzi,
callFunction: callFunc
}
this.openTouchEvent(chuizi,attrs)
}
//kaiguan
if(feiChaDianChildrens[i].name == "kaiguan"){
this.mapNode.getChildByName('open1').active = true;
this.mapNode.getChildByName('open2').active = true;
this.mapNode.getChildByName('qiangshangzi').active = true;
this.gameInfo.FeiChanDian['meinv'].isTouchOff = true
this.mapNode.getChildByName('guiyixiaohai').active = true;
this.mapNode.getChildByName('guiyixiaohai').getComponent(FMSkeletonExtend).animation = '2chuxian';
Common5.playEffectCustom("WordGame",'fkwz123/ZhaoCha/map55/sound/诡异的笑')
cc.tween(this.mapNode.getChildByName('guiyixiaohai'))
.delay(2.0)
.call(()=>{
this.mapNode.getChildByName('guiyixiaohai').getComponent(FMSkeletonExtend).animation = '3chi';
this.gameInfo.ChaNode["guiyixiaohai"].isCanTouch = true
Common5.playEffectCustom("WordGame",'fkwz123/ZhaoCha/map55/sound/没想到被你们看穿了')
})
.start()
//meidian
this.mapNode.getChildByName('zhuozi').getChildByName('meidian').active = true;
this.gameInfo.ChaNode["meiban"].isCanTouch = true
this.gameInfo.ChaNode["qiangshangzi"].isCanTouch = true
}
}
}
}
}
//map_53
specialMap56(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
// this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//beizi
if(feiChaDianChildrens[i].name == "siwa"){
Common5.playEffectCustom("WordGame",'fkwz123/ZhaoCha/map56/sounds/pswlnby')
}
else if(feiChaDianChildrens[i].name == "yingwu"){
Common5.playEffectCustom("WordGame",'fkwz123/ZhaoCha/map56/sounds/zdq')
}
else if(feiChaDianChildrens[i].name == "laotansuancai"){
Common5.playEffectCustom("WordGame",'fkwz123/ZhaoCha/map56/sounds/jxhzltdwd')
}
else if (feiChaDianChildrens[i].name == "bingxiangguan"){
this.gameInfo.ChaNode["bingxiang"].isCanTouch = true;
this.gameInfo.FeiChanDian["bingxiangguan"].isCanTouch = false;
this.mapNode.getChildByName("chaDianNode").getChildByName("bingxiang").active = true;
this.mapNode.getChildByName("feiChaDianNode").getChildByName("bingxiangguan").active = false;
}
}
}
}
}
//map_57
specialMap57(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//beizi
if(feiChaDianChildrens[i].name == "beizi"){
this.mapNode.getChildByName('beizi').y += 200;
//皮鞭茬点可用 xiaopibian
this.gameInfo.ChaNode["shaobing"].isCanTouch = true;
}
//chuanglian1
if(feiChaDianChildrens[i].name == "chuanglian"){
this.mapNode.getChildByName('chuanglian1').active = false;
this.mapNode.getChildByName('chuanglian2').active = true;
this.gameInfo.ChaNode["xizichuangtie"].isCanTouch = true;
}
//guizi
if(feiChaDianChildrens[i].name == "guizi"){
this.mapNode.getChildByName('guizi1').active = false;
this.mapNode.getChildByName('guizi2').active = true;
this.mapNode.getChildByName('guizi3').active = true;
this.mapNode.getChildByName('guizi4').active = true;
this.gameInfo.ChaNode["tongzhuang"].isCanTouch = true;
}
//qianbao
if(feiChaDianChildrens[i].name == "qianbao"){
if(this.mapNode.getChildByName('qianbao1').active){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = false
this.mapNode.getChildByName('qianbao1').active = false;
this.mapNode.getChildByName('qianbao2').active = true;
}else{
this.mapNode.getChildByName('zhaopian').active = true;
this.gameInfo.ChaNode["dalangzhaopian"].isCanTouch = true;
}
}
//zhentou
if(feiChaDianChildrens[i].name == "zhentou"){
this.mapNode.getChildByName('zhentou').y += 200;
this.gameInfo.ChaNode["jiehunzheng"].isCanTouch = true;
}
}
}
}
}
//map_58
specialMap58(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
//console.log('11113========',feiChaDianChildrens)
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//guizi
if(feiChaDianChildrens[i].name == "guizi"){
this.mapNode.getChildByName('shoucanggui1').active = false
this.mapNode.getChildByName('shoucanggui2').active = true;
//siwa
this.gameInfo.ChaNode["siwa"].isCanTouch = true;
}
if(feiChaDianChildrens[i].name == "nvmishu"){
//console.log('1111========')
if(this.mapNode.getChildByName('dxnv').getComponent(FMSkeletonExtend).animation == 'nv2'){
//console.log('1111')
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = false
Common5.playEffectCustom("WordGame",this.gameInfo.PrefabInfo.soundurl+'我是正经人不能脱(0)');
}
}
}
}
}
}
//map_59
specialMap59(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//console.log('11113========')
//xiangzi
if(feiChaDianChildrens[i].name == "xiangzi"){
console.log('11114========')
this.mapNode.getChildByName('xiangzi_1').active = false;
this.mapNode.getChildByName('xiangzi_20').active = true;
this.mapNode.getChildByName('xiangzi_21').active = true;
this.mapNode.getChildByName('xiangzi_22').active = true;
let xiangzi_22 = this.mapNode.getChildByName("xiangzi_22");
let callFunc1 = ()=>{
this.mapNode.getChildByName("langtou").getComponent(FMSkeletonExtend).animation = '2qiaoji'
cc.tween(this.mapNode.getChildByName("langtou"))
.delay(2.0)
.call(()=>{
Common5.playEffectCustom("WordGame",this.gameInfo.PrefabInfo.soundurl+'6有点冷啊可以盖上吗');
//GuHui
this.gameInfo.ChaNode["GuHui"].isCanTouch = true;
this.mapNode.getChildByName('zheban1').active = true;
this.mapNode.getChildByName('zheban2').active = true;
//hongbu
let hongbu = this.mapNode.getChildByName('hongbu')
let honggaitou = this.mapNode.getChildByName('honggaitou')
let callFunc4 = () =>{
hongbu.active = false;
honggaitou.active = true;
Common5.playEffectCustom("WordGame",this.gameInfo.PrefabInfo.soundurl+'7以后我就是她');
//HongGaiTou
this.gameInfo.ChaNode["HongGaiTou"].isCanTouch = true;
}
let attrs4 = {
startPos:hongbu.getPosition(),
touchArea:honggaitou,
callFunction: callFunc4
}
this.openTouchEvent(hongbu,attrs4)
})
.start();
}
let attrs1 = {
startPos:xiangzi_22.getPosition(),
touchArea:this.mapNode.getChildByName("langtou"),
callFunction: callFunc1
}
this.openTouchEvent(xiangzi_22, attrs1)
}
//koudai
if(feiChaDianChildrens[i].name == "koudai"){
this.mapNode.getChildByName('fuzou').active = true;
this.gameInfo.ChaNode["FuZhi"].isCanTouch = true;
}
//chuanghu
if(feiChaDianChildrens[i].name == "chuanghu"){
if(this.mapNode.getChildByName('chuanghu').getComponent(FMSkeletonExtend).animation == '1jingzhi'){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = false
this.mapNode.getChildByName('chuanghu').getComponent(FMSkeletonExtend).animation = '1jingzhi2'
cc.tween(this.mapNode.getChildByName('chuanghu'))
.delay(2.0)
.call(()=>{
this.mapNode.getChildByName('chuanghu').getComponent(FMSkeletonExtend).loop = true
this.mapNode.getChildByName('chuanghu').getComponent(FMSkeletonExtend).animation = '3chuifeng'
Common5.playEffectCustom("WordGame",this.gameInfo.PrefabInfo.soundurl+'4有点冷');
})
.start();
}else{
this.mapNode.getChildByName('chuanghu').getComponent(FMSkeletonExtend).loop = false
this.mapNode.getChildByName('chuanghu').getComponent(FMSkeletonExtend).animation = '1jingzhi'
this.mapNode.getChildByName('guiying').active = true;
//ChuangWaiRenYing
this.gameInfo.ChaNode["ChuangWaiRenYing"].isCanTouch = true;
}
}
//dayinji
if(feiChaDianChildrens[i].name == "dayinji"){
this.mapNode.getChildByName('dayinji').getComponent(FMSkeletonExtend).animation = '2daying'
cc.tween(this.mapNode.getChildByName('dayinji'))
.delay(2.0)
.call(()=>{
Common5.playEffectCustom("WordGame",this.gameInfo.PrefabInfo.soundurl+'3你瞒不住的');
this.gameInfo.ChaNode["GuiYiZhaoPian"].isCanTouch = true;
})
.start();
}
//benzi
if(feiChaDianChildrens[i].name == "benzi"){
this.mapNode.getChildByName('benzi1').active = false;
this.mapNode.getChildByName('benzi2').active = true;
this.gameInfo.ChaNode["GuiYiRiJi"].isCanTouch = true;
}
//shizhong
if(feiChaDianChildrens[i].name == "shizhong"){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = false
Common5.playEffectCustom("WordGame",this.gameInfo.PrefabInfo.soundurl+'9好想回到五天前');
}
}
}
}
}
//map_60
private specialMap60_touchTimes = 0;
specialMap60Callback(name){
this.specialMap60_touchTimes += 1
let curNode:cc.Node = null;
if(name == 'xigua1'){
curNode = this.mapNode.getChildByName('xigua1');
}else{
curNode = this.mapNode.getChildByName('xigua2');
}
if(this.specialMap60_touchTimes <= 1){
this.mapNode.getChildByName('biaoqing').active = true;
this.gameInfo.ChaNode["biaoqing"].isCanTouch = true;
Common5.playEffectCustom("WordGame", this.gameInfo.PrefabInfo.soundurl + '谁懂啊')
curNode.getComponent(FMSkeletonExtend).animation = '3';
cc.tween(curNode)
.delay(1.0)
.call(()=>{
curNode.getComponent(FMSkeletonExtend).animation = '2';
})
.start()
}
if(this.specialMap60_touchTimes >= 2 && this.specialMap60_touchTimes <= 4){
Common5.playEffectCustom("WordGame", this.gameInfo.PrefabInfo.soundurl + '老六')
curNode.getComponent(FMSkeletonExtend).animation = '3';
cc.tween(curNode)
.delay(1.0)
.call(()=>{
curNode.getComponent(FMSkeletonExtend).animation = '2';
})
.start()
}
if(this.specialMap60_touchTimes == 5){
Common5.playEffectCustom("WordGame", this.gameInfo.PrefabInfo.soundurl + '救命啊')
this.gameInfo.ChaNode["xigua"].isCanTouch = true;
curNode.getComponent(FMSkeletonExtend).animation = '4';
cc.tween(curNode)
.delay(1.0)
.call(()=>{
curNode.getComponent(FMSkeletonExtend).animation = '1';
})
.start()
}
if(this.specialMap60_touchTimes > 5){
if(curNode.getComponent(FMSkeletonExtend).animation == '4' || curNode.getComponent(FMSkeletonExtend).animation == '1'){
Common5.playEffectCustom("WordGame", this.gameInfo.PrefabInfo.soundurl + '救命啊')
curNode.getComponent(FMSkeletonExtend).animation = '4';
cc.tween(curNode)
.delay(1.0)
.call(()=>{
curNode.getComponent(FMSkeletonExtend).animation = '1';
})
.start()
}
if(curNode.getComponent(FMSkeletonExtend).animation == '2' || curNode.getComponent(FMSkeletonExtend).animation == '3'){
Common5.playEffectCustom("WordGame", this.gameInfo.PrefabInfo.soundurl + '救命啊')
curNode.getComponent(FMSkeletonExtend).animation = '3';
cc.tween(curNode)
.delay(1.0)
.call(()=>{
curNode.getComponent(FMSkeletonExtend).animation = '2';
})
.start()
}
}
this.gameInfo.FeiChanDian[name].isTouchOff = false
}
specialMap60(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
console.log('==================qingshu')
//qingshu
if(feiChaDianChildrens[i].name == "qingshu"){
this.mapNode.getChildByName('qingshu').active = true;
this.gameInfo.ChaNode["qingshu"].isCanTouch = true;
}
if(feiChaDianChildrens[i].name == "xigua1" || feiChaDianChildrens[i].name == "xigua2"){
this.specialMap60Callback(feiChaDianChildrens[i].name);
}
}
}
}
}
//map_10053
specialMap10053(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//shouji
if(feiChaDianChildrens[i].name == "shouji"){
let shoujida = this.mapNode.getChildByName('shoujida')
shoujida.active = true;
this.gameInfo.FeiChanDian['quhao'].isTouchOff = false
this.gameInfo.ChaNode["quhao"].isCanTouch = true
}
//shuohua
if(feiChaDianChildrens[i].name == "shuohua"){
let dialogTianJin = this.mapNode.getChildByName('dialogTianJin')
let dialogHunan = this.mapNode.getChildByName('dialogHunan')
dialogHunan.active = true;
Common5.playEffectCustom(this.subBundle,'sound/csh')
cc.tween(dialogHunan)
.delay(2.5)
.call(()=>{
this.gameInfo.ChaNode["fangyan"].isCanTouch = true
dialogTianJin.active = true;
Common5.playEffectCustom(this.subBundle,'sound/tjh')
})
.start()
}
//quhao
if(feiChaDianChildrens[i].name == "quhao"){
let shoujida = this.mapNode.getChildByName('shoujida')
shoujida.active = false;
}
}
}
}
}
//map_10054
specialMap10054(pos){
let feiChaDianChildrens = this.mapNode.getChildByName("feiChaDianNode").children
for(var i =0;i<feiChaDianChildrens.length;i++){
//可以触摸且未触发过
if(this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name] && this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isCanTouch && !this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff){
let rect = feiChaDianChildrens[i].getBoundingBoxToWorld()
if(rect.contains(pos)){
this.gameInfo.FeiChanDian[feiChaDianChildrens[i].name].isTouchOff = true
//kouqi
if(feiChaDianChildrens[i].name == "kouqi"){
let xujiang = this.mapNode.getChildByName('xujiang')
xujiang.getComponent(FMSkeletonExtend).animation = 'kouchou'
Common5.playEffectCustom(this.subBundle,'sound/吐气1.1')
cc.tween(xujiang)
.delay(1.0)
.call(()=>{
this.gameInfo.ChaNode["kouqi"].isCanTouch = true
})
.start();
}
}
}
}
}
directTouchMoveCallback(targetNode: any){
console.log("targetNodeName+++++++++++++++++++++>" + targetNode.name);
if(this.gameId == 515){
if(targetNode.name == 'shuYeTouchArea'){
this.gameInfo.ChaNode["MangSheJing"].isCanTouch = true
let shuYe = this.mapNode.getChildByName('feiChaDianNode').getChildByName('shuYe')
let x = shuYe.x + 150
cc.tween(shuYe)
.to(0.2,{x:x})
.start()
}else if(targetNode.name == 'ZhuoBuTouchNode'){
let zhuoBuSpineNode= this.mapNode.getChildByName("feiChaDianNode").getChildByName("ZhuoBuSpine")
zhuoBuSpineNode.getComponent(sp.Skeleton).setAnimation(0,"zhuobu",false)
zhuoBuSpineNode.getComponent(sp.Skeleton).setCompleteListener((trackEntry,loopCount)=>{
this.gameInfo.ChaNode["HongHaiEr"].isCanTouch = true
})
}
}
}
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);
}
}
/////////////////
}