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.
783 lines
36 KiB
783 lines
36 KiB
import { ryw_Event } from "../../../FrameWork/Event/EventEnum";
|
|
import EventMgr from "../../../FrameWork/Event/EventMgr";
|
|
import User from "../../../FrameWork/User/User";
|
|
import Common5 from "../../../Platform/th/Common5";
|
|
import TouZiXieYiShu from "../../GameMethodRes/TouZiXieYiShu/TouZiXieYiShu";
|
|
import JuQingManager from "../../JuQingChat/JuQingManager";
|
|
import TaskManager, { MainTaskIdEnum } from "../../JuQingChat/TaskManager";
|
|
import JuQingQiPao from "../../JuQingGuanQia/JuQingQiPao";
|
|
import BagManager from "../../Manager/BagManager";
|
|
import UserManager from "../../Manager/UserManager";
|
|
import NewGuideScript from "../../NewGuide/NewGuideScript";
|
|
import PrefabManage, { GameType } from "../../PrefabManager/PrefabManage";
|
|
import GetAward from "../../SCommon/GetAward";
|
|
import GameBaseScript from "../GameBaseScript";
|
|
import RoomBase from "../RoomBase";
|
|
import fengyin from "../SuiPian/fengyin";
|
|
import tuyin from "../SuiPian/tuyin";
|
|
import xiangyin from "../SuiPian/xiangyin";
|
|
let needIDs = [
|
|
{
|
|
goodids: [3004, 3005, 3006],
|
|
tiaoZhuanGameType: GameType.KuaiDiZhan,
|
|
huoYuan: '盲盒站',
|
|
},
|
|
{
|
|
goodids: [3016, 3017, 3018, 3019, 3020],
|
|
tiaoZhuanGameType: GameType.CiShanChouJiang,
|
|
huoYuan: '慈善抽奖',
|
|
},
|
|
{
|
|
goodids: [3069, 3070, 3071, 3072, 3073],
|
|
tiaoZhuanGameType: GameType.ChoushuiFirst,
|
|
huoYuan: '鱼塘',
|
|
}
|
|
]
|
|
const { ccclass, property } = cc._decorator;
|
|
@ccclass
|
|
export default class Room3 extends RoomBase {
|
|
chatConfig = {
|
|
chatConfig_1: [
|
|
// { effectUrl: 'GameRoomRes/sound/Room3/小辰辰,好久不见,甚是想念啊', delayTime: 4.86, str: '小辰辰,好久不见,甚是想念啊', posi: 'qipao2' },
|
|
// { effectUrl: 'GameRoomRes/sound/Room3/受不了你,快说正事吧。', delayTime: 2.64, str: '受不了你,快说正事吧。', posi: '-1' },
|
|
// { effectUrl: 'GameRoomRes/sound/Room3/真无趣,兔印的下落有了,找回来就有投资。', delayTime: 5.1, str: '真无趣,兔印的下落有了,找回来就有投资。', posi: 'qipao2' },
|
|
{ effectUrl: 'GameRoomRes/sound/Room3/唉,兔印的下落有了,找回来就有投资!', delayTime: 3.1, str: '唉,兔印的下落有了,找回来就有投资!', posi: 'qipao2' },
|
|
],
|
|
chatConfig_2: [
|
|
{ effectUrl: 'GameRoomRes/sound/Room3/场地找好了,你去找钱总签合同吧,小心遇到老熟人哦。', delayTime: 5.3, str: '场地找好了,你去找钱总签合同吧,小心遇到老熟人哦。', posi: 'qipao2' },
|
|
// { effectUrl: 'GameRoomRes/sound/Room3/20万?还挺合适的。', delayTime: 3, str: '20万?还挺合适的。', posi: '-1' },
|
|
// { effectUrl: 'GameRoomRes/sound/Room3/去吧,那有你的老熟人,哈哈。', delayTime: 3, str: '去吧,那有你的老熟人,哈哈。', posi: 'qipao2' },
|
|
],
|
|
chatConfig_3: [
|
|
{ effectUrl: 'GameRoomRes/sound/Room3/我来了,这个人是谁!', delayTime: 1.65, str: '我来了,这个人是谁!', posi: '-1' },
|
|
{ effectUrl: 'GameRoomRes/sound/Room3/傅少,这是我男友,叶少!', delayTime: 2.72, str: '傅少,这是我男友,叶少!', posi: 'qipao4' },
|
|
{ effectUrl: 'GameRoomRes/sound/Room3/可笑!衣服吊牌都没撕,装什么大少!', delayTime: 7.4, str: '可笑!衣服吊牌都没撕,装什么大少!', posi: 'qipao3' },
|
|
{ effectUrl: 'GameRoomRes/sound/Room3/怕个屁,干!', delayTime: 2, str: '不得罪', str1: "就是干", endStr: "怕个屁,干!", posi: '-1' },
|
|
{ effectUrl: 'GameRoomRes/sound/Room3/贱人!垃圾!你们给我等着!', delayTime: 4.45, str: '贱人!垃圾!你们给我等着!', posi: 'qipao3' },
|
|
],
|
|
chatConfig_4: [
|
|
// { effectUrl: 'GameRoomRes/sound/Room5/还是有点醉,留下来陪我,给你追加投资。', delayTime: 3, str: '还是有点醉,留下来陪我,给你追加投资。', posi: 'qipao5' },
|
|
],
|
|
|
|
chatConfig_5: [
|
|
{ effectUrl: 'GameRoomRes/sound/Room3/我只能支撑你到这了。', delayTime: 2.12, str: '我只能支撑你到这了。', posi: 'qipao2' },
|
|
{ effectUrl: 'GameRoomRes/sound/Room3/足够了,以后换我帮你!', delayTime: 2.85, str: '足够了,以后换我帮你!', posi: '-1' },
|
|
{ effectUrl: 'GameRoomRes/sound/Room3/行啦,快去找凤印吧。', delayTime: 2.4, str: '行啦,快去找凤印吧。', posi: 'qipao2' },
|
|
],
|
|
|
|
chatConfig_6: [
|
|
// { effectUrl: 'GameRoomRes/sound/Room5/完成钱氏改建后,以后的路就靠你自己了。', delayTime: 3, str: '完成钱氏改建后,以后的路就靠你自己了。', posi: 'qipao2' },
|
|
// { effectUrl: 'GameRoomRes/sound/Room5/好,我不会让你失望的。', delayTime: 3, str: '好,我不会让你失望的。', posi: '-1' },
|
|
// { effectUrl: 'GameRoomRes/sound/Room5/多陪陪我,我把私房钱给你。', delayTime: 3, str: '多陪陪我,我把私房钱给你。', posi: 'qipao2' },
|
|
],
|
|
}
|
|
|
|
|
|
|
|
@property(cc.Node)
|
|
layerNode: cc.Node[] = [];
|
|
|
|
@property(cc.Node)
|
|
needLayer: cc.Node = null;
|
|
|
|
@property(cc.Node)
|
|
singleItem: cc.Node = null;
|
|
@property(cc.ScrollView)
|
|
m_ScrollView: cc.ScrollView = null;
|
|
|
|
// @property(sp.SkeletonData)
|
|
// skedata_shuijiao_1: sp.SkeletonData = null;
|
|
// @property(sp.SkeletonData)
|
|
// skedata_taiqiu: sp.SkeletonData = null;
|
|
// @property(sp.SkeletonData)
|
|
// skedata_shuijiao_2: sp.SkeletonData = null;
|
|
|
|
// finishTaskStep = 0
|
|
// maskGuideNode: cc.Node = null
|
|
|
|
curLayerIndex: number = 0;
|
|
curNeedID: number = -1;
|
|
|
|
onLoad() {
|
|
// this.finishTaskStep = 0
|
|
|
|
|
|
}
|
|
|
|
start() {
|
|
// TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_313)
|
|
// let a = User.getBaDaCaiXiUnlockStatus()
|
|
// a.YaoShan = true
|
|
// User.setBaDaCaiXiUnlockStatus(a)
|
|
|
|
GameBaseScript.preLoadRemoteAudio(this.chatConfig);
|
|
super.start();
|
|
this.refreshLayer()
|
|
|
|
this.refreshNeedLayer()
|
|
EventMgr.onEvent_custom(ryw_Event.refreshNeedLayer, () => {
|
|
this.refreshNeedLayer()
|
|
}, this)
|
|
|
|
EventMgr.onEvent_custom(ryw_Event.ZhuiJiaTouZi, () => {
|
|
// PrefabManage.showBlackGuoDu(() => {
|
|
// PrefabManage.loadPrefabByType(GameType.CityPrefab)
|
|
// this.node.destroy()
|
|
// })
|
|
}, this)
|
|
}
|
|
refreshNeedLayer() {
|
|
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
|
|
let mainId = mainTaskInfo.Id
|
|
if (mainId == MainTaskIdEnum.MainTask_303) {
|
|
this.curNeedID = 0
|
|
} else if (mainId == MainTaskIdEnum.MainTask_304) {// && BagManager.getBagGoodNums(3007) <= 0
|
|
this.curNeedID = 0
|
|
} else if (mainId == MainTaskIdEnum.MainTask_504) {
|
|
this.curNeedID = 1
|
|
} else if (mainId == MainTaskIdEnum.MainTask_505 && BagManager.getBagGoodNums(3021) <= 0) {
|
|
this.curNeedID = 1
|
|
} else if (mainId == MainTaskIdEnum.MainTask_1308 || mainId == MainTaskIdEnum.MainTask_1309) {
|
|
this.curNeedID = 2
|
|
}
|
|
if (this.curNeedID >= 0) {
|
|
this.needLayer.active = true
|
|
this.needLayer.getChildByName("huanYuanNode").getChildByName("huoYuan").getComponent(cc.Label).string = needIDs[this.curNeedID].huoYuan
|
|
this.initItemContent()
|
|
if (mainId == MainTaskIdEnum.MainTask_303) {
|
|
let node = this.needLayer.getChildByName("huanYuanNode");
|
|
this.guideView([node]);
|
|
}
|
|
} else {
|
|
this.needLayer.active = false
|
|
}
|
|
}
|
|
// 刷新场景
|
|
refreshLayer() {
|
|
for (const node of this.layerNode) {
|
|
node.active = false;
|
|
}
|
|
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
|
|
let mainId = mainTaskInfo.Id
|
|
if (mainId == MainTaskIdEnum.MainTask_302) {
|
|
this.curLayerIndex = 0
|
|
this["continueStory" + this.curLayerIndex]();
|
|
this.node.getChildByName("nameplate_1").active = true
|
|
} else if (mainId == MainTaskIdEnum.MainTask_314) {
|
|
this.curLayerIndex = 2
|
|
this["continueStory" + this.curLayerIndex]();
|
|
this.node.getChildByName("nameplate_2").active = true
|
|
} else if (mainId == MainTaskIdEnum.MainTask_1307) {
|
|
this.curLayerIndex = 4
|
|
this["continueStory" + this.curLayerIndex]();
|
|
} else if (mainId == MainTaskIdEnum.MainTask_1309 || mainId == MainTaskIdEnum.MainTask_1310) {
|
|
this.curLayerIndex = 4
|
|
this["continueStory" + this.curLayerIndex]();
|
|
} else if (mainId >= MainTaskIdEnum.MainTask_505 && mainId < MainTaskIdEnum.MainTask_805) {
|
|
this.curLayerIndex = 3
|
|
} else {
|
|
|
|
}
|
|
this.layerNode[this.curLayerIndex].active = true;
|
|
|
|
//Common5.playMusicCustom('GameRes', 'GameStory10/sound/背景bgm');
|
|
|
|
|
|
}
|
|
// 继续剧情
|
|
continueStory0() {
|
|
let touziren = this.layerNode[this.curLayerIndex].getChildByName("投资人站立")
|
|
let touzirenSpine = touziren.getComponent(sp.Skeleton)
|
|
touzirenSpine.setAnimation(0, "待机", true)
|
|
|
|
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
|
|
let mainId = mainTaskInfo.Id
|
|
if (mainId == MainTaskIdEnum.MainTask_301 || mainId == MainTaskIdEnum.MainTask_303) {
|
|
// this.onDoTask201()
|
|
return
|
|
}
|
|
|
|
const dialogEvents = [
|
|
// (func) => {
|
|
// this.showQiPao(this.chatConfig.chatConfig_1[this.dialogIndex++], func, () => {
|
|
// touzirenSpine.setAnimation(0, "说话", true)
|
|
// });
|
|
// },
|
|
// (func) => {
|
|
// touzirenSpine.setAnimation(0, "待机", true)
|
|
// let node = this.node.getChildByName("对话框");
|
|
// this.guideView([node]);
|
|
// this.showClickDialog(this.chatConfig.chatConfig_1[this.dialogIndex++], func);
|
|
// },
|
|
(func) => {
|
|
this.showQiPao(this.chatConfig.chatConfig_1[this.dialogIndex++], func, () => {
|
|
touzirenSpine.setAnimation(0, "说话", true)
|
|
});
|
|
},
|
|
(func) => {
|
|
touzirenSpine.setAnimation(0, "待机", true)
|
|
func()
|
|
},
|
|
]
|
|
const dialogCallFunc = (logEvents: any[]) => {
|
|
logEvents.shift()(() => {
|
|
if (logEvents.length > 0) {
|
|
dialogCallFunc(logEvents);
|
|
} else {
|
|
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_302)
|
|
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_303)
|
|
|
|
this.refreshNeedLayer()
|
|
// this.onDoTask201()
|
|
// EventMgr.emitEvent_custom(ryw_Event.EnterNextGame);
|
|
// this.node.destroy()
|
|
}
|
|
});
|
|
}
|
|
dialogCallFunc(dialogEvents);
|
|
}
|
|
|
|
// 继续剧情
|
|
continueStory1() {
|
|
let touziren = this.layerNode[this.curLayerIndex].getChildByName("投资人站立")
|
|
let touzirenSpine = touziren.getComponent(sp.Skeleton)
|
|
touzirenSpine.setAnimation(0, "待机", true)
|
|
|
|
// let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
|
|
// let mainId = mainTaskInfo.Id
|
|
// if (mainId == MainTaskIdEnum.MainTask_301 || mainId == MainTaskIdEnum.MainTask_303) {
|
|
// // this.onDoTask201()
|
|
// return
|
|
// }
|
|
console.log("continueStory1-----------")
|
|
|
|
const dialogEvents = [
|
|
(func) => {
|
|
this.showQiPao(this.chatConfig.chatConfig_2[this.dialogIndex++], func, () => {
|
|
touzirenSpine.setAnimation(0, "说话", true)
|
|
});
|
|
},
|
|
// (func) => {
|
|
// touzirenSpine.setAnimation(0, "待机", true)
|
|
// this.showClickDialog(this.chatConfig.chatConfig_2[this.dialogIndex++], func);
|
|
// },
|
|
// (func) => {
|
|
// this.showQiPao(this.chatConfig.chatConfig_2[this.dialogIndex++], func, () => {
|
|
// touzirenSpine.setAnimation(0, "说话", true)
|
|
// });
|
|
// },
|
|
(func) => {
|
|
touzirenSpine.setAnimation(0, "待机", true)
|
|
func()
|
|
},
|
|
]
|
|
const dialogCallFunc = (logEvents: any[]) => {
|
|
logEvents.shift()(() => {
|
|
if (logEvents.length > 0) {
|
|
dialogCallFunc(logEvents);
|
|
} else {
|
|
// TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_304)
|
|
// this.scheduleOnce(() => {
|
|
// TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_305)
|
|
// })
|
|
// User.setRoomBtnIndex(3)
|
|
// this.curNeedID = -1
|
|
// this.refreshNeedLayer()
|
|
|
|
// this.onDoTask201()
|
|
// EventMgr.emitEvent_custom(ryw_Event.EnterNextGame);
|
|
// this.node.destroy()
|
|
}
|
|
});
|
|
}
|
|
dialogCallFunc(dialogEvents);
|
|
}
|
|
|
|
// 继续剧情
|
|
continueStory2() {
|
|
let touziren = this.layerNode[this.curLayerIndex].getChildByName("投资人")
|
|
let touzirenSpine = touziren.getComponent(sp.Skeleton)
|
|
touzirenSpine.setAnimation(0, "反派抓投资人", true)
|
|
|
|
let nanzhu = this.layerNode[this.curLayerIndex].getChildByName("男主")
|
|
let nanzhuSpine = nanzhu.getComponent(sp.Skeleton)
|
|
nanzhuSpine.setAnimation(0, "男主进场", false)
|
|
|
|
let fanpai = this.layerNode[this.curLayerIndex].getChildByName("反派")
|
|
fanpai.active = false
|
|
let fanpaiSpine = fanpai.getComponent(sp.Skeleton)
|
|
// fanpaiSpine.setAnimation(0, "入场", false)
|
|
|
|
const dialogEvents = [
|
|
(func) => {
|
|
this.showClickDialog(this.chatConfig.chatConfig_3[this.dialogIndex++], func, () => {
|
|
nanzhuSpine.setAnimation(0, "男主说话", true)
|
|
});
|
|
},
|
|
(func) => {
|
|
nanzhuSpine.setAnimation(0, "男主待机", true)
|
|
touzirenSpine.setAnimation(0, "投资人挣脱", false)
|
|
touzirenSpine.setCompleteListener(() => {
|
|
touzirenSpine.setCompleteListener(null)
|
|
touzirenSpine.setAnimation(0, "投资人待机", true)
|
|
fanpai.active = true
|
|
fanpaiSpine.setAnimation(0, "反派待机", true)
|
|
func()
|
|
})
|
|
},
|
|
(func) => {
|
|
this.showQiPao(this.chatConfig.chatConfig_3[this.dialogIndex++], func, () => {
|
|
touzirenSpine.setAnimation(0, "投资人说话", true)
|
|
});
|
|
},
|
|
(func) => {
|
|
touzirenSpine.setAnimation(0, "投资人待机", true)
|
|
nanzhu.active = false
|
|
this.showQiPao(this.chatConfig.chatConfig_3[this.dialogIndex++], func, () => {
|
|
fanpaiSpine.setAnimation(0, "反派泼酒", false)
|
|
Common5.playRemoteAudioEffect("action_effect/泼酒");
|
|
fanpaiSpine.setCompleteListener(() => {
|
|
fanpaiSpine.setCompleteListener(null)
|
|
fanpaiSpine.setAnimation(0, "反派待机说话", true)
|
|
nanzhu.active = true
|
|
nanzhuSpine.setAnimation(0, "男主有污渍待机", true)
|
|
})
|
|
});
|
|
},
|
|
(func) => {
|
|
fanpaiSpine.setAnimation(0, "反派待机", true)
|
|
this.showClickDialog(this.chatConfig.chatConfig_3[this.dialogIndex++], func, () => {
|
|
nanzhuSpine.setAnimation(0, "男主说话", true)
|
|
});
|
|
},
|
|
(func) => {
|
|
fanpai.active = false
|
|
nanzhuSpine.setAnimation(0, "男主打人", false)
|
|
Common5.playRemoteAudioEffect("action_effect/扇踢");
|
|
nanzhuSpine.setCompleteListener(() => {
|
|
nanzhuSpine.setCompleteListener(null)
|
|
nanzhuSpine.setAnimation(0, "男主有污渍待机", true)
|
|
fanpai.active = true
|
|
fanpaiSpine.setAnimation(0, "反派被打待机", true)
|
|
func()
|
|
})
|
|
},
|
|
(func) => {
|
|
this.showQiPao(this.chatConfig.chatConfig_3[this.dialogIndex++], func, () => {
|
|
fanpaiSpine.setAnimation(0, "反派被打说话", true)
|
|
});
|
|
},
|
|
(func) => {
|
|
fanpaiSpine.setAnimation(0, "反派离开", false)
|
|
func()
|
|
},
|
|
]
|
|
const dialogCallFunc = (logEvents: any[]) => {
|
|
logEvents.shift()(() => {
|
|
if (logEvents.length > 0) {
|
|
dialogCallFunc(logEvents);
|
|
} else {
|
|
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_314)
|
|
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_401)
|
|
|
|
// this.onDoTask201()
|
|
// EventMgr.emitEvent_custom(ryw_Event.EnterNextGame);
|
|
// this.node.destroy()
|
|
}
|
|
});
|
|
}
|
|
dialogCallFunc(dialogEvents);
|
|
}
|
|
|
|
// 继续剧情
|
|
continueStory3() {
|
|
let touziren = this.layerNode[this.curLayerIndex].getChildByName("投资人")
|
|
let touzirenSpine = touziren.getComponent(sp.Skeleton)
|
|
touzirenSpine.setAnimation(0, "扶男主待机", true)
|
|
|
|
const dialogEvents = [
|
|
// (func) => {
|
|
// this.showQiPao(this.chatConfig.chatConfig_4[this.dialogIndex++], func, () => {
|
|
// touzirenSpine.setAnimation(0, "扶男主不笑说话", true)
|
|
// });
|
|
// },
|
|
(func) => {
|
|
touzirenSpine.setAnimation(0, "扶男主待机", true)
|
|
func()
|
|
},
|
|
]
|
|
const dialogCallFunc = (logEvents: any[]) => {
|
|
logEvents.shift()(() => {
|
|
if (logEvents.length > 0) {
|
|
dialogCallFunc(logEvents);
|
|
} else {
|
|
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_504)
|
|
this.scheduleOnce(() => {
|
|
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_505)
|
|
})
|
|
this.curNeedID = -1
|
|
this.refreshNeedLayer()
|
|
// PrefabManage.loadPrefabByType(GameType.CityPrefab)
|
|
// this.node.destroy()
|
|
// this.onDoTask201()
|
|
// EventMgr.emitEvent_custom(ryw_Event.EnterNextGame);
|
|
// this.node.destroy()
|
|
}
|
|
});
|
|
}
|
|
dialogCallFunc(dialogEvents);
|
|
}
|
|
|
|
// 继续剧情
|
|
continueStory4() {
|
|
let touziren = this.layerNode[this.curLayerIndex].getChildByName("投资人站立")
|
|
let touzirenSpine = touziren.getComponent(sp.Skeleton)
|
|
touzirenSpine.setAnimation(0, "待机", true)
|
|
|
|
|
|
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
|
|
let mainId = mainTaskInfo.Id
|
|
if (mainId == MainTaskIdEnum.MainTask_1309 || mainId == MainTaskIdEnum.MainTask_1310) {
|
|
// this.onDoTask201()
|
|
return
|
|
}
|
|
|
|
const dialogEvents = [
|
|
(func) => {
|
|
this.showQiPao(this.chatConfig.chatConfig_5[this.dialogIndex++], func, () => {
|
|
touzirenSpine.setAnimation(0, "说话", true)
|
|
});
|
|
},
|
|
(func) => {
|
|
touzirenSpine.setAnimation(0, "待机", true)
|
|
this.showClickDialog(this.chatConfig.chatConfig_5[this.dialogIndex++], func);
|
|
},
|
|
(func) => {
|
|
this.showQiPao(this.chatConfig.chatConfig_5[this.dialogIndex++], func, () => {
|
|
touzirenSpine.setAnimation(0, "说话", true)
|
|
});
|
|
},
|
|
]
|
|
const dialogCallFunc = (logEvents: any[]) => {
|
|
logEvents.shift()(() => {
|
|
if (logEvents.length > 0) {
|
|
dialogCallFunc(logEvents);
|
|
} else {
|
|
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_1307)
|
|
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_1308)
|
|
this.refreshNeedLayer()
|
|
}
|
|
});
|
|
}
|
|
dialogCallFunc(dialogEvents);
|
|
}
|
|
|
|
// 继续剧情
|
|
continueStory5() {
|
|
let touziren = this.layerNode[this.curLayerIndex].getChildByName("投资人站立")
|
|
let touzirenSpine = touziren.getComponent(sp.Skeleton)
|
|
touzirenSpine.setAnimation(0, "待机", true)
|
|
|
|
|
|
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
|
|
let mainId = mainTaskInfo.Id
|
|
|
|
const dialogEvents = [
|
|
// (func) => {
|
|
// this.showQiPao(this.chatConfig.chatConfig_6[this.dialogIndex++], func, () => {
|
|
// touzirenSpine.setAnimation(0, "说话", true)
|
|
// });
|
|
// },
|
|
// (func) => {
|
|
// touzirenSpine.setAnimation(0, "待机", true)
|
|
// this.showClickDialog(this.chatConfig.chatConfig_6[this.dialogIndex++], func);
|
|
// },
|
|
// (func) => {
|
|
// this.showQiPao(this.chatConfig.chatConfig_6[this.dialogIndex++], func, () => {
|
|
// touzirenSpine.setAnimation(0, "说话", true)
|
|
// });
|
|
// },
|
|
(func) => {
|
|
touzirenSpine.setAnimation(0, "待机", true)
|
|
func()
|
|
},
|
|
]
|
|
const dialogCallFunc = (logEvents: any[]) => {
|
|
logEvents.shift()(() => {
|
|
if (logEvents.length > 0) {
|
|
dialogCallFunc(logEvents);
|
|
} else {
|
|
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_1309)
|
|
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_1310, false)
|
|
Common5.playRemoteAudioEffect("ZhuiJiaTouZi/多陪陪我,我把私房钱给你。");
|
|
this.scheduleOnce(() => {
|
|
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_1310)
|
|
}, 3)
|
|
}
|
|
});
|
|
}
|
|
dialogCallFunc(dialogEvents);
|
|
}
|
|
|
|
initItemContent() {
|
|
this.m_ScrollView.content.removeAllChildren()
|
|
let isAllFind = true
|
|
let propIdArr = needIDs[this.curNeedID].goodids
|
|
this.needLayer.getChildByName("huanYuanNode").getChildByName("huoYuan").getComponent(cc.Label).string = needIDs[this.curNeedID].huoYuan
|
|
for (let i = 0; i < propIdArr.length; i++) {
|
|
let item = cc.instantiate(this.singleItem)
|
|
item.active = true
|
|
item.parent = this.m_ScrollView.content
|
|
|
|
let spFrame_hui = item.getChildByName('spFrame_hui')
|
|
let spFrame_liang = item.getChildByName('spFrame_liang')
|
|
Common5.setRemoteSpriteFrame(spFrame_hui.getComponent(cc.Sprite), 'GoodIcon/' + propIdArr[i])
|
|
Common5.setRemoteSpriteFrame(spFrame_liang.getComponent(cc.Sprite), 'GoodIcon/' + propIdArr[i])
|
|
let _pro = BagManager.getGoodsProperty(propIdArr[i])
|
|
item.getChildByName('nameStr').getComponent(cc.Label).string = _pro.goodName
|
|
|
|
if (BagManager.getBagGoodNums(propIdArr[i]) > 0) {
|
|
spFrame_liang.active = true
|
|
spFrame_hui.active = false
|
|
} else {
|
|
isAllFind = false
|
|
spFrame_liang.active = false
|
|
spFrame_hui.active = true
|
|
}
|
|
}
|
|
|
|
if (isAllFind) {
|
|
this.needLayer.getChildByName("按钮").active = true
|
|
this.needLayer.getChildByName("huanYuanNode").active = false
|
|
|
|
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
|
|
let mainId = mainTaskInfo.Id
|
|
if (mainId == MainTaskIdEnum.MainTask_304) {
|
|
let node = this.needLayer.getChildByName("按钮");
|
|
node.getComponent(cc.Widget).updateAlignment()
|
|
this.guideView([node]);
|
|
}
|
|
}
|
|
}
|
|
|
|
onTouchSubmit() {
|
|
//碎片合并
|
|
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
|
|
let mainId = mainTaskInfo.Id
|
|
let goodArray = []
|
|
if (mainId == MainTaskIdEnum.MainTask_304) {//兔印
|
|
goodArray = [{ goodId: 3007, goodNum: 1 }]
|
|
} else if (mainId == MainTaskIdEnum.MainTask_504) {//象印
|
|
goodArray = [{ goodId: 3021, goodNum: 1 }]
|
|
} else if (mainId == MainTaskIdEnum.MainTask_1309) {//凤印
|
|
goodArray = [{ goodId: 3074, goodNum: 1 }]
|
|
}
|
|
this.needLayer.active = false
|
|
if (mainId == MainTaskIdEnum.MainTask_304) {
|
|
//播放合成动画
|
|
PrefabManage.loadPrefabByType(GameType.tuyin, this.node, (node) => {
|
|
node.getComponent(tuyin).run(this.m_ScrollView.content.children, () => {
|
|
this.scheduleOnce(() => {
|
|
PrefabManage.loadPrefabByType(GameType.GetAward, null, (prefabNode) => {
|
|
prefabNode.getComponent('GetAward').initView(goodArray, () => {
|
|
//播放完再显示投资协议书
|
|
PrefabManage.loadPrefabByType(GameType.TouZiXieYiShu, null, (prefab) => {
|
|
let money = 500000
|
|
prefab.getComponent(TouZiXieYiShu).initView("叶氏药膳", money, () => {
|
|
UserManager.addMoney(money)
|
|
PrefabManage.showTextTips(`恭喜获得投资${Common5.getNumberChangeHanzi(money, '1')}`)
|
|
|
|
this.curLayerIndex = 1
|
|
this.dialogIndex = 0
|
|
for (const layer of this.layerNode) {
|
|
layer.active = false
|
|
}
|
|
this.layerNode[this.curLayerIndex].active = true;
|
|
this["continueStory" + this.curLayerIndex]();
|
|
|
|
|
|
TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_304)
|
|
this.scheduleOnce(() => {
|
|
TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_305)
|
|
})
|
|
User.setRoomBtnIndex(3)
|
|
this.curNeedID = -1
|
|
this.refreshNeedLayer()
|
|
})
|
|
})
|
|
});
|
|
})
|
|
}, 1)
|
|
})
|
|
})
|
|
} else if (mainId == MainTaskIdEnum.MainTask_504) {
|
|
//播放合成动画
|
|
PrefabManage.loadPrefabByType(GameType.xiangyin, this.node, (node) => {
|
|
node.getComponent(xiangyin).run(this.m_ScrollView.content.children, () => {
|
|
this.scheduleOnce(() => {
|
|
PrefabManage.loadPrefabByType(GameType.GetAward, null, (prefabNode) => {
|
|
prefabNode.getComponent('GetAward').initView(goodArray, () => {
|
|
//播放完再显示投资协议书
|
|
PrefabManage.loadPrefabByType(GameType.TouZiXieYiShu, null, (prefab) => {
|
|
let money = 700000
|
|
prefab.getComponent(TouZiXieYiShu).initView("叶氏食品厂", money, () => {
|
|
UserManager.addMoney(money)
|
|
PrefabManage.showTextTips(`恭喜获得投资${Common5.getNumberChangeHanzi(money, '1')}`)
|
|
|
|
this.curLayerIndex = 3
|
|
this.dialogIndex = 0
|
|
for (const layer of this.layerNode) {
|
|
layer.active = false
|
|
}
|
|
this.layerNode[this.curLayerIndex].active = true;
|
|
this["continueStory" + this.curLayerIndex]();
|
|
})
|
|
})
|
|
});
|
|
})
|
|
}, 1)
|
|
})
|
|
})
|
|
} else if (mainId == MainTaskIdEnum.MainTask_1309) {
|
|
//播放合成动画
|
|
PrefabManage.loadPrefabByType(GameType.fengyin, this.node, (node) => {
|
|
node.getComponent(fengyin).run(this.m_ScrollView.content.children, () => {
|
|
this.scheduleOnce(() => {
|
|
PrefabManage.loadPrefabByType(GameType.GetAward, null, (prefabNode) => {
|
|
prefabNode.getComponent('GetAward').initView(goodArray, () => {
|
|
//播放完再显示投资协议书
|
|
PrefabManage.loadPrefabByType(GameType.TouZiXieYiShu, null, (prefab) => {
|
|
let money = 60000000
|
|
prefab.getComponent(TouZiXieYiShu).initView("叶氏电子", money, () => {
|
|
UserManager.addMoney(money)
|
|
PrefabManage.showTextTips(`恭喜获得投资${Common5.getNumberChangeHanzi(money, '1')}`)
|
|
|
|
this.curLayerIndex = 5
|
|
this.dialogIndex = 0
|
|
for (const layer of this.layerNode) {
|
|
layer.active = false
|
|
}
|
|
this.layerNode[this.curLayerIndex].active = true;
|
|
this["continueStory" + this.curLayerIndex]();
|
|
})
|
|
})
|
|
});
|
|
})
|
|
}, 1)
|
|
})
|
|
})
|
|
}
|
|
// PrefabManage.loadPrefabByType(GameType.GetAward, null, (prefabNode) => {
|
|
// prefabNode.getComponent('GetAward').initView(goodArray, () => {
|
|
// if (mainId == MainTaskIdEnum.MainTask_304) {
|
|
// //播放合成动画
|
|
// PrefabManage.loadPrefabByType(GameType.tuyin, null, (node) => {
|
|
// node.getComponent(tuyin).run(this.m_ScrollView.content.children, () => {
|
|
// //播放完再显示投资协议书
|
|
// this.needLayer.active = false
|
|
// PrefabManage.loadPrefabByType(GameType.TouZiXieYiShu, null, (prefab) => {
|
|
// let money = 500000
|
|
// prefab.getComponent(TouZiXieYiShu).initView("叶氏药膳", money, () => {
|
|
// UserManager.addMoney(money)
|
|
// PrefabManage.showTextTips(`恭喜获得投资${Common5.getNumberChangeHanzi(money, '1')}`)
|
|
|
|
// this.curLayerIndex = 1
|
|
// this.dialogIndex = 0
|
|
// for (const layer of this.layerNode) {
|
|
// layer.active = false
|
|
// }
|
|
// this.layerNode[this.curLayerIndex].active = true;
|
|
// this["continueStory" + this.curLayerIndex]();
|
|
// })
|
|
// })
|
|
// })
|
|
// })
|
|
// } else if (mainId == MainTaskIdEnum.MainTask_504) {
|
|
// //播放合成动画
|
|
// //播放完再显示投资协议书
|
|
// this.needLayer.active = false
|
|
// PrefabManage.loadPrefabByType(GameType.TouZiXieYiShu, null, (prefab) => {
|
|
// let money = 500000
|
|
// prefab.getComponent(TouZiXieYiShu).initView("叶氏食品厂", money, () => {
|
|
// UserManager.addMoney(money)
|
|
// PrefabManage.showTextTips(`恭喜获得投资${Common5.getNumberChangeHanzi(money, '1')}`)
|
|
|
|
// this.curLayerIndex = 3
|
|
// this.dialogIndex = 0
|
|
// for (const layer of this.layerNode) {
|
|
// layer.active = false
|
|
// }
|
|
// this.layerNode[this.curLayerIndex].active = true;
|
|
// this["continueStory" + this.curLayerIndex]();
|
|
// })
|
|
// })
|
|
// } else if (mainId == MainTaskIdEnum.MainTask_1309) {
|
|
// //播放合成动画
|
|
// //播放完再显示投资协议书
|
|
// this.needLayer.active = false
|
|
// PrefabManage.loadPrefabByType(GameType.TouZiXieYiShu, null, (prefab) => {
|
|
// let money = 500000
|
|
// prefab.getComponent(TouZiXieYiShu).initView("叶氏电子", money, () => {
|
|
// UserManager.addMoney(money)
|
|
// PrefabManage.showTextTips(`恭喜获得投资${Common5.getNumberChangeHanzi(money, '1')}`)
|
|
|
|
// this.curLayerIndex = 5
|
|
// this.dialogIndex = 0
|
|
// for (const layer of this.layerNode) {
|
|
// layer.active = false
|
|
// }
|
|
// this.layerNode[this.curLayerIndex].active = true;
|
|
// this["continueStory" + this.curLayerIndex]();
|
|
// })
|
|
// })
|
|
// }
|
|
// });
|
|
// })
|
|
}
|
|
|
|
onBtnHuoYuanTiaoZhuan() {
|
|
// this.node.removeFromParent()
|
|
// this.node.destroy()
|
|
PrefabManage.loadPrefabByType(needIDs[this.curNeedID].tiaoZhuanGameType)
|
|
}
|
|
|
|
// onDoTask201() {
|
|
// this.dialogIndex = 0
|
|
// //查看爷爷的信
|
|
// this.layerNode[this.curLayerIndex].getChildByName("信封").active = true
|
|
// }
|
|
// onTouchXinFeng() {
|
|
// this.layerNode[this.curLayerIndex].getChildByName("信封").active = false
|
|
// this.layerNode[this.curLayerIndex].getChildByName("信").active = true
|
|
// }
|
|
// onTouchXin() {
|
|
// this.layerNode[this.curLayerIndex].getChildByName("信").active = false
|
|
// this.showClickDialog(this.chatConfig.chatConfig_201[this.dialogIndex++], () => {
|
|
// TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_202)
|
|
// });
|
|
// }
|
|
onTouchChuMen() {
|
|
PrefabManage.loadPrefabByType(GameType.CityPrefab)
|
|
this.node.removeFromParent()
|
|
this.node.destroy()
|
|
}
|
|
|
|
// getSpine() {
|
|
// let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
|
|
// let mainId = mainTaskInfo.Id
|
|
// if (mainId == MainTaskIdEnum.MainTask_304 || mainId == MainTaskIdEnum.MainTask_305) {
|
|
// return this.skedata_shuijiao_1
|
|
// } else if (mainId == MainTaskIdEnum.MainTask_504 || mainId == MainTaskIdEnum.MainTask_505) {
|
|
// return this.skedata_taiqiu
|
|
// } else if (mainId == MainTaskIdEnum.MainTask_1309 || mainId == MainTaskIdEnum.MainTask_1310) {
|
|
// return this.skedata_shuijiao_2
|
|
// }
|
|
// }
|
|
guideView(nodeArray) {
|
|
PrefabManage.loadPrefabByType(GameType.GuideMskNode, this.node, (prefab) => {
|
|
let guideNodeArray = nodeArray
|
|
let firstNode = guideNodeArray.shift()
|
|
prefab.getComponent(NewGuideScript).setBindNode(firstNode, guideNodeArray)
|
|
})
|
|
}
|
|
}
|
|
|